class_docstr: Simple container holding classification labels of a particular tensor.
  
  Example usage:
    # The first added label list can be used as category names as needed.
    labels = Labels()
      .add(['/m/011l78', '/m/031d23'])
      .add(['cat', 'dog], 'en')
      .add(['chat', 'chien], 'fr')
class_docstr_tok: ["Simple","container","holding","classification","labels","of","a","particular","tensor",".","Example","usage",":","#","The","first","added","label","list","can","be","used","as","category","names","as","needed",".","labels","=","Labels","(",")",".add","(","[","'\/m\/011l78","'",",","'\/m\/031d23","'","]",")",".add","(","[","'cat","'",",","'dog","]",",","'en","'",")",".add","(","[","'chat","'",",","'chien","]",",","'fr","'",")"]
docstr: Adds labels in the container.
  
  Args:
    labels: A list of label names, e.g. ['apple', 'pear', 'banana'].
    locale: The specified locale for labels.
    exported_filename: The file name to export the labels. If not set,
      filename defaults to 'labels.txt'.
  
  Returns:
    The Labels instance, can be used for chained operation.
code: def add(
      self,
      labels: List[str],
      locale: Optional[str] = None,
      exported_filename: Optional[str] = None,
  ) -> "Labels":
      """Adds labels in the container.
  
      Args:
        labels: A list of label names, e.g. ['apple', 'pear', 'banana'].
        locale: The specified locale for labels.
        exported_filename: The file name to export the labels. If not set,
          filename defaults to 'labels.txt'.
  
      Returns:
        The Labels instance, can be used for chained operation.
      """
      if not labels:
          raise ValueError("The list of labels is empty.")
  
      # Prepare the new item to be inserted
      if not exported_filename:
          exported_filename = "labels"
          if locale:
              exported_filename += f"_{locale}"
          exported_filename += ".txt"
      item = LabelItem(
          filename=exported_filename, names=labels, locale=locale
      )
  
      # Insert the new element at the end of the list
      self._labels.append(item)
      return self
  
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 3 for calling the Labels obj's underlying member method code with example usage: obj.add(labels, locale, exported_filename) and returns: self