def METHOD_NAME(value, default=None):
    if value is None:
        return default
    try:
        return int(value)
    except ValueError:
        logger.warning("Couldn't convert to int: %s. Returning %s", value, default)
        return default