Whenever any person is convicted in municipal court for violation of a municipal ordinance, the court may order the defendant to a term of community service or remedial action in lieu of fine or in conjunction with imprisonment. If the defendant fails to perform the required community service or if the conditions of community service are violated, the judge may impose a sentence of imprisonment, not to exceed the maximum sentence allowable for the violation for which the defendant was convicted.
Okla. Stat. tit. 11, § 27-122.2