code: def is_type_factory(_type: type[Any]) -> Callable[[Any], None]:
      """
  
      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) -> None:
          if type(x) != _type:
              raise ValueError(f"Value must have type '{_type}'")
  
      return inner
  
imports: from __future__ import annotations
  from contextlib import ContextDecorator, contextmanager
  import re
  from typing import TYPE_CHECKING, Any, Callable, Generic, NamedTuple, cast
  import warnings
  from pandas._typing import F, T
  from pandas.util._exceptions import find_stack_level
label_desc: Use image node_id 19 for calling a global function with example usage: is_type_factory(_type) and returns: inner