The court shall have the power and jurisdiction to send processes and other mandates in any matter of which it has jurisdiction into any part of the county or any adjoining county, for service or execution, as provided by the criminal procedure law; and particularly to compel the attendance of witnesses, to order the conditional examination of witnesses within or without the state, to inquire into the sanity of a defendant and to dismiss the prosecution of an action conformably to the provisions of the criminal procedure law, and to punish for criminal contempt a person guilty thereof in the manner and subject to the limitations prescribed for courts of record by the judiciary law.
N.Y. Uniform Justice Court § 2005