When the imprisonment is pursuant to the judgment of any court, police court, or police magistrate of an incorporated city or town for the violation of any ordinance, bylaw, or other regulation, the marshal shall superintend the performance of the labor herein contemplated, and shall furnish the tools and materials, if necessary at the expense of the city or town requiring the labor, and such city or town shall be entitled to the earnings of its convicts.
Okla. Stat. tit. 57, § 7