code: def _populate_unitwise_quantization_specs(
      quantization_options: _QuantizationOptions,
  ) -> None:
      """Verifies and pupulates unitwise quantization specs."""
      if not quantization_options.unit_wise_quantization_specs:
          return
  
      sorted_top_level_component_specs = sorted(
          quantization_options.quantization_method.quantization_component_specs,
          key=lambda x: x.quantization_component,
      )
  
      for (
          unitwise_spec
      ) in quantization_options.unit_wise_quantization_specs:
          if not unitwise_spec.unit:
              raise ValueError(
                  "UnitWiseQuantizationSpec must contain at least one unit."
              )
  
          for unit in unitwise_spec.unit:
              if not unit.op_type and not unit.node_name:
                  raise ValueError(
                      "Either `op_type` or `node_name` must be specified."
                  )
  
          _populate_quantization_component_spec(
              unitwise_spec.quantization_method
          )
  
          component_specs = (
              unitwise_spec.quantization_method.quantization_component_specs
          )
          if component_specs and (
              sorted_top_level_component_specs
              != sorted(
                  component_specs,
                  key=lambda x: x.quantization_component,
              )
          ):
              raise ValueError(
                  "Currently unit-wise quantization spec only supports NO_QUANTIZE and"
                  " same quantization method as the top-level `quantization_method`"
              )
  
imports: import tempfile
  from typing import Mapping, Optional
  from absl import logging
  from tensorflow.compiler.mlir.quantization.tensorflow import quantization_options_pb2
  from tensorflow.compiler.mlir.quantization.tensorflow.python import py_function_lib
  from tensorflow.compiler.mlir.quantization.tensorflow.python import pywrap_quantize_model
  from tensorflow.compiler.mlir.quantization.tensorflow.python import representative_dataset
  from tensorflow.compiler.mlir.quantization.tensorflow.python import save_model
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.saved_model import load
  from tensorflow.python.saved_model import loader_impl
  from tensorflow.python.saved_model import signature_constants
  from tensorflow.python.saved_model import tag_constants
  from tensorflow.python.trackable import autotrackable
  from tensorflow.python.util import tf_export
label_desc: Use image node_id 10 for calling a global function with example usage: _populate_unitwise_quantization_specs(quantization_options) without return types