At the time of arraignment for a violation of a Class 2 misdemeanor or a violation of an ordinance or at the time of the hearing for a petty offense, the circuit court judge or magistrate may conclude and state on the record, in the defendant's presence, that the defendant will not be deprived of his liberty if he is convicted. The circuit court judge's or magistrate's statement that the defendant will not be deprived of his liberty if he is convicted shall be made before the defendant enters his plea. If the defendant is not in custody and if the court has concluded that he will not be deprived of his liberty if he is convicted, an indigent defendant charged with violating a Class 2 misdemeanor, an ordinance not having a penalty greater than a Class 2 misdemeanor or a petty offense, is not entitled to court assigned counsel.
SDCL 23A-40-6.1