human
Complete the below
def is_instance_factory(_type):

    ''''Parameters
    `_type` - the type to be checked against
    Returns
    validator - a function of a single argument x , which raises
    ValueError if x is not an instance of `_type`'
    '''

=====
Give me a the Python code you requested?
assistant
#Here is the Python code you requested.
    if isinstance(_type, (tuple, list)):
        _type = tuple(_type)
        from pandas.io.formats.printing import pprint_thing
        type_repr = '|'.join(map(pprint_thing, _type))
    else:
        type_repr = ("'%s'" % _type)
    def inner(x):
        if (not isinstance(x, _type)):
            raise ValueError(('Value    must    be    an    instance    of    %s' % type_repr))
    return inner