code: def _sanitize_value(x):
      """
      Performs cleaning steps on the data so various type comparisons can
      be performed correctly.
      """
      if isinstance(
          x, _six.string_types + _six.integer_types + (float,)
      ):
          return x
      elif _HAS_SKLEARN and _sp.issparse(x):
          return x.todense()
      elif isinstance(x, _np.ndarray):
          return x
      elif isinstance(x, tuple):
          return (_sanitize_value(v) for v in x)
      elif isinstance(x, list):
          return [_sanitize_value(v) for v in x]
      elif isinstance(x, dict):
          return dict(
              (_sanitize_value(k), _sanitize_value(v))
              for k, v in x.items()
          )
      else:
          assert False, str(x)
  
imports: import math
  import numpy
  import os
  import six
  import warnings
  import sys
  from coremltools.proto import Model_pb2
  from coremltools.models._deprecation import deprecated
  from .._deps import _HAS_SKLEARN
label_desc: Use image node_id 17 for calling a global function with example usage: _sanitize_value(x) and returns: x, x, x, unknown, unknown, dict