def is_instance(arg, types, allow_none=False):
    """
    >>> is_instance(1, int)
    True
    >>> is_instance(3.5, float)
    True
    >>> is_instance('hello', str)
    True
    >>> is_instance([1, 2, 3], list)
    True

    >>> is_instance(1, (int, float))
    True
    >>> is_instance(3.5, (int, float))
    True
    >>> is_instance('hello', (str, list))
    True
    >>> is_instance([1, 2, 3], (str, list))
    True

    >>> is_instance(1, float)
    False
    >>> is_instance(3.5, int)
    False
    >>> is_instance('hello', list)
    False
    >>> is_instance([1, 2, 3], str)
    False

    >>> is_instance(1, (list, str))
    False
    >>> is_instance(3.5, (list, str))
    False
    >>> is_instance('hello', (int, float))
    False
    >>> is_instance([1, 2, 3], (int, float))
    False

    >>> is_instance(None, int)
    False
    >>> is_instance(None, float)
    False
    >>> is_instance(None, str)
    False
    >>> is_instance(None, list)
    False

    >>> is_instance(None, (int, float))
    False
    >>> is_instance(None, (int, float))
    False
    >>> is_instance(None, (str, list))
    False
    >>> is_instance(None, (str, list))
    False

    >>> is_instance(1, int, allow_none=True)
    True
    >>> is_instance(3.5, float, allow_none=True)
    True
    >>> is_instance('hello', str, allow_none=True)
    True
    >>> is_instance([1, 2, 3], list, allow_none=True)
    True

    >>> is_instance(1, (int, float), allow_none=True)
    True
    >>> is_instance(3.5, (int, float), allow_none=True)
    True
    >>> is_instance('hello', (str, list), allow_none=True)
    True
    >>> is_instance([1, 2, 3], (str, list), allow_none=True)
    True

    >>> is_instance(1, float, allow_none=True)
    False
    >>> is_instance(3.5, int, allow_none=True)
    False
    >>> is_instance('hello', list, allow_none=True)
    False
    >>> is_instance([1, 2, 3], str, allow_none=True)
    False

    >>> is_instance(1, (list, str), allow_none=True)
    False
    >>> is_instance(3.5, (list, str), allow_none=True)
    False
    >>> is_instance('hello', (int, float), allow_none=True)
    False
    >>> is_instance([1, 2, 3], (int, float), allow_none=True)
    False

    >>> is_instance(None, int, allow_none=True)
    True
    >>> is_instance(None, float, allow_none=True)
    True
    >>> is_instance(None, str, allow_none=True)
    True
    >>> is_instance(None, list, allow_none=True)
    True

    >>> is_instance(None, (int, float), allow_none=True)
    True
    >>> is_instance(None, (int, float), allow_none=True)
    True
    >>> is_instance(None, (str, list), allow_none=True)
    True
    >>> is_instance(None, (str, list), allow_none=True)
    True
    """
    return (allow_none and arg is None) or isinstance(arg, types)