code: def _sanitize_value(x):
      """
      Performs cleaning steps on the data so various type comparisons can
      be performed correctly.
      """
      if isinstance(
          x,
          (
              str,
              int,
              float,
          ),
      ):
          return x
      elif _HAS_SCIPY 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: from collections.abc import Iterable
  from functools import lru_cache
  import math
  import os
  import shutil
  import subprocess
  import sys
  import tempfile
  from typing import Optional, Union
  import warnings
  import numpy
  import coremltools
  from coremltools import ComputeUnit
  from coremltools.converters.mil.mil.passes.defs.preprocess import NameSanitizer
  from coremltools.proto import Model_pb2
  import coremltools.proto.MIL_pb2
  from .._deps import _HAS_SCIPY
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