When sitting as a court, the municipal court judge, shall have the power to punish for contempt by fine not exceeding five hundred dollars ($500.00), by imprisonment in the manner prescribed aforesaid not exceeding one hundred eighty (180) days, or by one or both, or any part thereof, in the discretion of the presiding officer.