def mlevel(level):
 if (level and (not isinstance(level, numbers.Integral))):
  return LOG_LEVELS[level.upper()]
 return level

def mlevel ( level ) : if ( level and ( not isinstance ( level , numbers . Integral ) ) ) : return LOG_LEVELS [ level . upper ( ) ] return level
convert level name/int to log level .