def get_level_value(level):
    """Returns the logging value associated with a particular level name.  The
    argument must be present in LEVELS_DICT or be an integer constant.
    Otherwise None will be returned."""
    try:
        # integral constants also work: they are the level value
        return int(level)
    except __HOLE__:
        try:
            return LEVELS_DICT[level.upper()]
        except KeyError:
            logging.warning("level '%s' cannot be translated to a level value (not present in LEVELS_DICT)" % level)
            return None
dataset/ETHPy150Open neovim/python-client/scripts/logging_statement_modifier.py/get_level_value