code: def _create_dummy_model_metadata_with_tensor(
      tensor_metadata: _metadata_fb.TensorMetadataT,
  ) -> bytes:
      # Create a dummy model using the tensor metadata.
      subgraph_metadata = _metadata_fb.SubGraphMetadataT()
      subgraph_metadata.inputTensorMetadata = [tensor_metadata]
      model_metadata = _metadata_fb.ModelMetadataT()
      model_metadata.subgraphMetadata = [subgraph_metadata]
  
      # Create the Flatbuffers object and convert it to the json format.
      builder = flatbuffers.Builder(0)
      builder.Finish(
          model_metadata.Pack(builder),
          _metadata.MetadataPopulator.METADATA_FILE_IDENTIFIER,
      )
      return bytes(builder.Output())
  
imports: import os
  import tempfile
  from absl.testing import absltest
  from absl.testing import parameterized
  import flatbuffers
  from mediapipe.tasks.metadata import metadata_schema_py_generated
  from mediapipe.tasks.metadata import schema_py_generated
  from mediapipe.tasks.python.metadata import metadata
  from mediapipe.tasks.python.metadata.metadata_writers import metadata_info
  from mediapipe.tasks.python.test import test_utils
label_desc: Use image node_id 1 for calling a global function with example usage: _create_dummy_model_metadata_with_tensor(tensor_metadata) and returns: bytes