If the accused person pleads guilty, the municipal judge may hear evidence touching on the nature of the case, or otherwise ascertain the facts thereof, and after such hearing, may refuse to accept the plea or may accept the plea, assess the punishment and enter the proper judgment.
K.S.A. 12-4407