A person who in the presence of a court or magistrate assaults or threatens to assault another, or to commit an offense against another's person or property, or who contends with another with angry words, may be ordered by the court or magistrate to give security, as is provided in section 29-02-11, or if that person refuses to do so that person may be committed as is provided in section 29-02-12.
N.D.C.C. § 29-02-14