Any court, justice of the peace, police court or police magistrate, in cases where such courts have jurisdiction under the laws of this state, or as provided by the ordinances or charter of any incorporated town or city in the state, shall have full power and authority to sentence such convict to hard labor as provided in this article.
Okla. Stat. tit. 57, § 6