import warnings


def _log_level(verbosity):
    """Return log level for specified verbosity level. """
    message = 'Verbosity should be between -2 and 9'
    if verbosity > 9:
        warnings.warn(message, RuntimeWarning)
        verbosity = 9
    elif verbosity < -1:
        warnings.warn(message, RuntimeWarning)
        verbosity = -1
    level = 29 - verbosity
    return level