This code does not affect any power conferred by law upon any court-martial, or other military authority or officer, to impose or inflict punishment upon offenders; nor, except as provided in Section 19.2 of this code, any power conferred by law upon any public body, tribunal, or officer, to impose or inflict punishment for a contempt.