code: def decode_key(encoded_key: bytes) -> types.FPLKeyType:
      """Decode an encoded dictionary key encoded with encode_key.
  
      Args:
        encoded_key: Dictionary key, encoded with encode_key.
  
      Returns:
        Decoded dictionary key.
  
      Raises:
        ValueError: We couldn't decode the encoded key.
      """
      if encoded_key.startswith(_TUPLE_KEY_PREFIX):
          parts = encoded_key[len(_TUPLE_KEY_PREFIX) :].split(b"$", 1)
          if len(parts) != 2:
              raise ValueError("invalid encoding: %s" % encoded_key)
          elem_count = int(parts[0])
          parts = parts[1].split(b"$", elem_count)
          if len(parts) != elem_count + 1:
              raise ValueError("invalid encoding: %s" % encoded_key)
          lengths = map(int, parts[:elem_count])
          parts = parts[elem_count]
          elems = []
          for length in lengths:
              elems.append(parts[:length].decode("utf8"))
              parts = parts[length + 1 :]  # Add one for the $ delimiter
          return tuple(elems)
      elif encoded_key.startswith(_BYTES_KEY_PREFIX):
          return encoded_key[len(_BYTES_KEY_PREFIX) :].decode("utf8")
      else:
          raise ValueError("invalid encoding: %s" % encoded_key)
  
file_path: model-analysis/tensorflow_model_analysis/eval_saved_model/encoding.py
imports: import tensorflow
  from tensorflow_model_analysis.api import types
  from google.protobuf import any_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: decode_key(encoded_key) and returns: tuple, encoded_key