code: def _hashed_slicing_details(
      slicing_details: Iterable[validation_result_pb2.SlicingDetails],
  ) -> Dict[
      Union[slicer.SingleSliceSpec, slicer.CrossSliceSpec],
      validation_result_pb2.SlicingDetails,
  ]:
      """Returns hash table of slicing details keyed by serialized slice spec."""
      hashed_details = {}
      for details in slicing_details:
          hashable_slice_spec = slicer.deserialize_slice_spec(
              details.slicing_spec
          )
          if hashable_slice_spec not in hashed_details:
              hashed_details[hashable_slice_spec] = details
      return hashed_details
  
file_path: model-analysis/tensorflow_model_analysis/evaluators/metrics_validator.py
imports: import math
  from typing import Any, Dict, Iterable, List, Tuple, Union
  import numpy
  from tensorflow_model_analysis.metrics import metric_specs
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.proto import validation_result_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
  from tensorflow_model_analysis.utils import model_util
label_desc: Use image node_id 2 for calling a global function with example usage: _hashed_slicing_details(slicing_details) and returns: hashed_details