code: def first_arg_to_level_name(arg):
      
      try:
          return int(arg)
      except ValueError:
          arg = arg.upper()
          for level in LEVELS:
              if level in arg:
                  return level
          return None
docs: Decide what level the argument specifies and return it.  The argument
      must contain (case-insensitive) one of the values in LEVELS or be an integer
      constant.  Otherwise None will be returned.