code: def _quantize_converter(model, func, calibration_gen, debug=True):
      """Returns a converter appropriate for the function and debug configs."""
      converter = lite.TFLiteConverterV2.from_concrete_functions(
          [func], model
      )
      converter.target_spec.supported_ops = [
          lite.OpsSet.TFLITE_BUILTINS_INT8
      ]
      converter.representative_dataset = calibration_gen
  
      # TODO(b/191205988): Explicitly disable saved model lowering in conversion.
      converter.experimental_lower_to_saved_model = False
  
      # Create a TFLite model with new quantizer and numeric verify ops.
      converter.optimizations = [lite.Optimize.DEFAULT]
      converter.experimental_new_quantizer = True
      if debug:
          converter._experimental_calibrate_only = True
      return converter
  
imports: import csv
  import io
  import re
  from unittest import mock
  from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow.lite.python import convert
  from tensorflow.lite.python import lite
  from tensorflow.lite.python.metrics import metrics
  from tensorflow.lite.tools.optimize.debugging.python import debugger
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import test
  from tensorflow.python.trackable import autotrackable
label_desc: Use image node_id 4 for calling a global function with example usage: _quantize_converter(model, func, calibration_gen, debug) and returns: converter