This title 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 any power conferred by law upon any public body, tribunal or officer, to impose or inflict punishment for a contempt.