<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def loglevel(level):
 """ Convert any representation of `level` to an int appropriately. :type level: int or str :rtype: int True 10 Traceback (most recent call last):
 ValueError: None is not a proper log level. """

    if isinstance(level, str):
        level = getattr(logging, level.upper())
    elif isinstance(level, int):
        pass
    else:
        raise ValueError('{0!r} is not a proper log level.'.format(level))
    return level