code: def get_subgraph(model_buffer: bytearray) -> _schema_fb.SubGraph:
      """Gets the subgraph of the model.
  
      TFLite does not support multi-subgraph. A model should have exactly one
      subgraph.
  
      Args:
        model_buffer: valid buffer of the model file.
  
      Returns:
        The subgraph of the model.
  
      Raises:
        ValueError: if the model has more than one subgraph or has no subgraph.
      """
  
      model = _schema_fb.Model.GetRootAsModel(model_buffer, 0)
  
      # Use the first subgraph as default. TFLite Interpreter doesn't support
      # multiple subgraphs yet, but models with mini-benchmark may have multiple
      # subgraphs for acceleration evaluation purpose.
      return model.Subgraphs(0)
  
file_path: mediapipe/mediapipe/tasks/python/metadata/metadata_writers/writer_utils.py
imports: from typing import List
  from mediapipe.tasks.metadata import schema_py_generated
label_desc: Use image node_id 6 for calling a global function with example usage: get_subgraph(model_buffer) and returns: model