Did the Pirates, during the "Golden Age of Piracy", actually have a "Pirate Code" which they all adhered to?

by lelimaboy

If yes, what were they? who enforced those rules? were there any trials? who presided over these trials, the captain, the first mate, or did it alternate? What were the punishments, was it always death, or did they jail people?

Mr_Kiwi

Here's a similar post that was answered a while back.