class_docstr: Generic Metadata writer.
  
  Example usage:
  
  For an example model which requires two inputs: image and general feature
  inputs, and generates one output: classification.
  
  with open(model_path, 'rb') as f:
    writer = MetadataWriter.create(f.read())
    model_content, metadata_json_content = writer
        .add_genernal_info('model_name', 'model description')
        .add_image_input()
        .add_feature_input()
        .add_classification_output(Labels().add(['A', 'B']))
        .populate()
class_docstr_tok: ["Generic","Metadata","writer",".","Example","usage",":","For","an","example","model","which","requires","two","inputs",":","image","and","general","feature","inputs",",","and","generates","one","output",":","classification",".","with","open","(","model_path",",","'rb","'",")","as","f",":","writer","=","MetadataWriter.create","(","f.read","(",")",")","model_content",",","metadata_json_content","=","writer",".add_genernal_info","(","'model_name","'",",","'model","description","'",")",".add_image_input","(",")",".add_feature_input","(",")",".add_classification_output","(","Labels","(",")",".add","(","[","'","A","'",",","'","B","'","]",")",")",".populate","(",")"]
docstr: Stores calibration parameters in a csv file.
code: def _export_calibration_file(
      self, filename: str, calibrations: List[CalibrationParameter]
  ) -> str:
      """Stores calibration parameters in a csv file."""
      filepath = os.path.join(self._temp_folder.name, filename)
      with open(filepath, "w") as f:
          for item in calibrations:
              if item:
                  if (
                      item.scale is None
                      or item.slope is None
                      or item.offset is None
                  ):
                      raise ValueError(
                          "scale, slope and offset values can not be set to "
                          "None."
                      )
                  elif item.min_score is not None:
                      f.write(
                          f"{item.scale},{item.slope},{item.offset},{item.min_score}"
                      )
                  else:
                      f.write(
                          f"{item.scale},{item.slope},{item.offset}"
                      )
              f.write("\n")
  
      self._associated_files.append(filepath)
      return filepath
  
imports: import collections
  import csv
  import dataclasses
  import os
  import tempfile
  from typing import List, Optional, Tuple, Union
  import flatbuffers
  from mediapipe.tasks.metadata import metadata_schema_py_generated
  from mediapipe.tasks.python.metadata import metadata
  from mediapipe.tasks.python.metadata.metadata_writers import metadata_info
  from mediapipe.tasks.python.metadata.metadata_writers import writer_utils
label_desc: Use image node_id 19 for calling the MetadataWriter obj's underlying member method code with example usage: obj._export_calibration_file(filename, calibrations) and returns: filepath