code: def _is_numeric_value(arr, var):
      """
      Checks a variable against non-numeric types such as types, slices,
      empty arrays, and None, that need not be checked for NaN and Inf values.
  
      Parameters
      ----------
      arr : the data of that correspond to any PyTensor Variable
      var : The corresponding PyTensor variable
  
      Returns
      -------
      is_non_numeric : bool
          `True` the value is non-numeric.
  
      """
      from pytensor.link.c.type import _cdata_type
      from pytensor.tensor.random.type import RandomType
  
      if isinstance(arr, _cdata_type):
          return False
      elif isinstance(
          arr, (np.random.mtrand.RandomState, np.random.Generator)
      ):
          return False
      elif var and isinstance(var.type, RandomType):
          return False
      elif isinstance(arr, slice):
          return False
      elif arr is None:
          return False
      elif arr.size == 0:
          return False
      return True
  
file_path: pytensor/pytensor/compile/nanguardmode.py
imports: import logging
  from collections.abc import ValuesView
  from io import StringIO
  import numpy
  import pytensor
  from pytensor.compile.mode import Mode
  from pytensor.configdefaults import config
  from pytensor.tensor.type import discrete_dtypes
label_desc: Use image node_id 1 for calling a global function with example usage: _is_numeric_value(arr, var) and returns: True, False, False, False, False, False, False