def int_or_none(value):
    """Convert value into int, or return None if not valid. Note that this
    receives input from internet. Python 3 has no issues with long ints."""
    result = None
    try:
        result = int(value)
    except TypeError:
        result = None
    except ValueError:
        result = None
    return result