code: def is_type_factory(_type):
      """
  
      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`
  
      """
  
      def inner(x):
          if type(x) != _type:
              msg = "Value must have type '{typ!s}'"
              raise ValueError(msg.format(typ=_type))
  
      return inner
  
imports: from collections import namedtuple
  from contextlib import contextmanager
  import re
  import warnings
  import pandas.compat
  from pandas.compat import lmap, map, u
label_desc: Use image node_id 19 for calling a global function with example usage: is_type_factory(_type) and returns: inner