def is_type_factory(_type):
def inner(x):<EOL><INDENT>if type(x) != _type:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg.format(typ=_type))<EOL><DEDENT><DEDENT>return inner<EOL>
Parameters
----------
`_type` - a type to be compared against (e.g. type(x) == `_type`)

Returns
-------
validator - a function of a single argument x , which raises
            ValueError if type(x) is not equal to `_type`