code: def _assert_valid_categorical_missing_value(value):
      """
      Check that value is a valid categorical missing_value.
  
      Raises a TypeError if the value is cannot be used as the missing_value for
      a categorical_dtype Term.
      """
      label_types = LabelArray.SUPPORTED_SCALAR_TYPES
      if not isinstance(value, label_types):
          raise TypeError(
              "Categorical terms must have missing values of type "
              "{types}.".format(
                  types=" or ".join([t.__name__ for t in label_types]),
              )
          )
  
imports: from abc import ABCMeta, abstractproperty
  from bisect import insort
  from collections import Mapping
  from weakref import WeakValueDictionary
  from numpy import array, dtype, ndarray, searchsorted
  from six import with_metaclass
  from catalyst.assets import Asset
  from catalyst.errors import DTypeNotSpecified, InvalidOutputName, NonExistentAssetInTimeFrame, NonSliceableTerm, NonWindowSafeInput, NotDType, TermInputsNotSpecified, TermOutputsEmpty, UnsupportedDType, WindowLengthNotSpecified
  from catalyst.lib.adjusted_array import can_represent_dtype
  from catalyst.lib.labelarray import LabelArray
  from catalyst.utils.input_validation import expect_types
  from catalyst.utils.memoize import lazyval
  from catalyst.utils.numpy_utils import bool_dtype, categorical_dtype, datetime64ns_dtype, default_missing_value_for_dtype
  from catalyst.utils.sharedoc import templated_docstring, PIPELINE_ALIAS_NAME_DOC, PIPELINE_DOWNSAMPLING_FREQUENCY_DOC
  from .downsample_helpers import expect_downsample_frequency
  from .sentinels import NotSpecified
label_desc: Use image node_id 2 for calling a global function with example usage: _assert_valid_categorical_missing_value(value) without return types