code: def _deprecate_as_int(x, desc):
      """
      Like `operator.index`, but emits a deprecation warning when passed a float
  
      Parameters
      ----------
      x : int-like, or float with integral value
          Value to interpret as an integer
      desc : str
          description to include in any error message
  
      Raises
      ------
      TypeError : if x is a non-integral float or non-numeric
      DeprecationWarning : if x is an integral float
      """
      try:
          return operator.index(x)
      except TypeError as e:
          # Numpy 1.17.0, 2019-03-11
          try:
              ix = int(x)
          except TypeError:
              pass
          else:
              if ix == x:
                  warnings.warn(
                      f"In future, this will raise TypeError, as {desc} will "
                      "need to be an integer not just an integral float.",
                      DeprecationWarning,
                      stacklevel=3,
                  )
                  return ix
  
          raise TypeError(f"{desc} must be an integer") from e
  
imports: import operator
  import functools
  import warnings
  import numpy
  from numpy.core.multiarray import dragon4_positional, dragon4_scientific
  from numpy.core.umath import absolute
label_desc: Use image node_id 18 for calling a global function with example usage: _deprecate_as_int(x, desc) and returns: operator, ix