code: def get_signature_defs(tflite_model):
      """Get SignatureDef dict from the Metadata of a TfLite flatbuffer buffer.
  
      Args:
        tflite_model: TFLite model buffer to get the signature_def.
  
      Returns:
        dict containing serving names to SignatureDefs if exists, otherwise, empty
          dict.
  
      Raises:
        ValueError:
          tflite_model buffer does not contain a valid TFLite model.
        DecodeError:
          SignatureDef cannot be parsed from TfLite SignatureDef metadata.
      """
      model = tflite_model
      if not isinstance(tflite_model, bytearray):
          model = bytearray(tflite_model)
      serialized_signature_def_map = (
          signature_def_util.GetSignatureDefMap(model)
      )
  
      def _deserialize(serialized):
          signature_def = meta_graph_pb2.SignatureDef()
          signature_def.ParseFromString(serialized)
          return signature_def
  
      return {
          k: _deserialize(v)
          for k, v in serialized_signature_def_map.items()
      }
  
imports: from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.lite.tools.signature import _pywrap_signature_def_util_wrapper
label_desc: Use image node_id 2 for calling a global function with example usage: get_signature_defs(tflite_model) and returns: unknown, signature_def