code: def _get_slice_value(
      slice_key: metrics_for_slice_pb2.SingleSliceKey,
  ) -> Union[float, bytes, int]:
      """Determines the primitive value stored by the slice."""
      value_type = slice_key.WhichOneof("kind")
      if value_type == "float_value":
          return slice_key.float_value
      elif value_type == "bytes_value":
          return slice_key.bytes_value
      elif value_type == "int64_value":
          return slice_key.int64_value
      else:
          raise NotImplementedError(
              f"{value_type} in {slice_key} is not supported."
          )
  
imports: import collections
  import dataclasses
  import itertools
  from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Union
  import numpy
  import pandas
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
  from google.protobuf import wrappers_pb2
  from google.protobuf import descriptor
  from google.protobuf import message
label_desc: Use image node_id 2 for calling a global function with example usage: _get_slice_value(slice_key) and returns: slice_key, slice_key, slice_key