In all prosecutions for misdemeanors where the punishment prescribed is a fine or imprisonment, or both, the discretion as to the punishment shall be in the court unless otherwise provided.