code: def _validate_conversion_arguments(
      model,
      exact_source,
      exact_target,
      inputs,
      outputs,
      classifier_config,
      compute_precision,
      convert_to,
      minimum_deployment_target,
  ):
      """
      Validate and process model, inputs, classifier_config based on
      `exact_source` (which cannot be `auto`) and `exact_target`.
      """
  
      def raise_if_duplicated(input_list):
          # Detect duplicated inputs
          input_names = [
              t.name for t in input_list if t.name is not None
          ]
          dups = [
              item
              for item, count in collections.Counter(
                  input_names
              ).items()
              if count > 1
          ]
          if len(dups) > 0:
              raise ValueError("Duplicated inputs: {}".format(dups))
  
      def _flatten_list(_inputs):
          ret = []
          for _input in _inputs:
              if isinstance(_input, (list, tuple)):
                  ret.extend(_flatten_list(_input))
              elif isinstance(_input, InputType):
                  ret.append(_input)
              else:
                  raise ValueError(
                      "Unknown type {} for flattening into InputType.".format(
                          type(_input)
                      )
                  )
          return ret
  
      flat_inputs = None
      if inputs is not None:
          if not isinstance(inputs, list):
              raise ValueError("`inputs` must be of type list")
  
          # get flattened inputs
          flat_inputs = _flatten_list(inputs)
          for flat_input in flat_inputs:
              if not isinstance(flat_input, InputType):
                  raise ValueError(
                      "inputs must be a list of type ct.TensorType or ct.ImageType"
                  )
              if flat_input.dtype == types.fp16:
                  if not (
                      minimum_deployment_target is not None
                      and minimum_deployment_target
                      >= AvailableTarget.iOS16
                  ):
                      raise TypeError(
                          "float16 dtype for inputs is only supported for deployment "
                          "target >= iOS16/macOS13/watchOS9/tvOS16"
                      )
  
      if exact_target == "mlprogram":
          err_msg_infinite_bound = (
              "For mlprogram, inputs with infinite upper_bound is not allowed. Please set upper_bound"
              ' to a positive value in "RangeDim()" for the "inputs" param in ct.convert().'
          )
          if inputs is not None:
              for flat_input in _flatten_list(inputs):
                  tensor_shapes: List[Optional[Shape]] = (
                      flat_input.shape.shapes
                      if isinstance(flat_input.shape, EnumeratedShapes)
                      else [flat_input.shape]
                  )
                  for tensor_shape in tensor_shapes:
                      if tensor_shape is not None:
                          for shape in tensor_shape.shape:
                              if (
                                  isinstance(shape, RangeDim)
                                  and shape.upper_bound < 0
                              ):
                                  raise ValueError(
                                      err_msg_infinite_bound
                                  )
  
      if outputs is not None:
          for t in outputs:
              if t.dtype == types.fp16:
                  if not (
                      minimum_deployment_target is not None
                      and minimum_deployment_target
                      >= AvailableTarget.iOS16
                  ):
                      raise TypeError(
                          "float16 dtype for outputs is only supported for deployment "
                          "target >= iOS16/macOS13/watchOS9/tvOS16"
                      )
  
      if classifier_config is not None:
          if not isinstance(classifier_config, ClassifierConfig):
              raise ValueError(
                  "`classifier_config` must be of type ClassifierConfig"
              )
  
      if (
          convert_to.lower() == "neuralnetwork"
          and compute_precision is not None
      ):
          raise ValueError(
              "compute_precision is only supported for mlprogram target and must be "
              "None if target=='neuralnetwork'. Note that target may be implicitly set "
              "depending on the minimum_deployment_target. See "
              "minimum_deployment_target for more details."
          )
  
      if compute_precision is not None:
          if compute_precision not in [
              precision.FLOAT32,
              precision.FLOAT16,
          ]:
              if not isinstance(
                  compute_precision, FP16ComputePrecision
              ):
                  raise ValueError(
                      "'compute_precision' must be either coremltools.precision.FLOAT32 "
                      "or coremltools.precision.FLOAT16 or of type "
                      "coremltools.transform.FP16ComputePrecision()"
                  )
  
      if exact_source in {"tensorflow", "tensorflow2"}:
          if exact_source == "tensorflow" and not _HAS_TF_1:
              raise ValueError(
                  'Converter was called with source="tensorflow", but missing '
                  "tensorflow package"
              )
  
          if inputs is not None:
              raise_if_duplicated(inputs)
  
          if inputs is not None and not all(
              [isinstance(_input, InputType) for _input in inputs]
          ):
              raise ValueError(
                  "Input should be a list of TensorType or ImageType"
              )
  
      elif exact_source == "pytorch":
          if _HAS_TORCH_EXPORT_API and isinstance(
              model, ExportedProgram
          ):
              if model.dialect != "EDGE":
                  raise NotImplementedError(
                      f"Conversion for models with only EDGE dialect is supported/tested. Provided Dialect: {model.dialect}"
                  )
  
              # TODO: rdar://115845792 ([Executorch] Handle user provided inputs/outputs in the convert API)
              if inputs is not None:
                  raise AssertionError(
                      "'inputs' argument should be None for ExportedProgram"
                  )
  
              if outputs is not None:
                  raise AssertionError(
                      "'outputs' argument should be None for ExportedProgram"
                  )
  
          else:
              is_torch_load_successful = False
              try:
                  try_load_torchscript(model)
                  is_torch_load_successful = True
              except:
                  pass
              if is_torch_load_successful:
                  if inputs is None:
                      raise ValueError(
                          'Expected argument "inputs" for TorchScript models not provided'
                      )
  
                  raise_if_duplicated(flat_inputs)
                  if inputs is not None and not all(
                      [
                          isinstance(_input, InputType)
                          for _input in flat_inputs
                      ]
                  ):
                      raise ValueError(
                          "Input should be a list/tuple (or nested lists/tuples) of TensorType or ImageType"
                      )
              else:
                  raise TypeError(
                      "@model must either be a TorchScript object (or .pt or .pth file) or an ExportedProgram object (if using torch.export based API), received: {}".format(
                          type(model)
                      )
                  )
  
      elif exact_source == "milinternal":
          if not isinstance(model, Program):
              raise ValueError(
                  "Converter was asked to convert MIL input, but input is not a MIL "
                  "program!"
              )
  
imports: import collections
  import gc
  import os
  from typing import List, Optional, Text, Union
  from coremltools import _LOWEST_ALLOWED_SPECIFICATION_VERSION_FOR_MILPROGRAM, _LOWEST_ALLOWED_SPECIFICATION_VERSION_FOR_NEURALNETWORK
  from coremltools import ComputeUnit
  from coremltools import __version__
  from coremltools import _logger
  from coremltools._deps import _HAS_TF_1, _HAS_TF_2, _HAS_TORCH, _HAS_TORCH_EXPORT_API
  from coremltools.converters._profile_utils import _profile
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget, check_deployment_compatibility
  from coremltools.converters.mil.converter import mil_convert
  from coremltools.converters.mil.input_types import ClassifierConfig, EnumeratedShapes, ImageType, InputType, RangeDim, Shape, TensorType
  from coremltools.converters.mil.mil import Program, types
  from coremltools.converters.mil.mil.passes.defs.quantization import ComputePrecision
  from coremltools.converters.mil.mil.passes.defs.quantization import FP16ComputePrecision
  from coremltools.converters.mil.mil.passes.graph_pass import PassOption
  from coremltools.converters.mil.mil.passes.pass_pipeline import PassPipeline
  from coremltools.models import _METADATA_SOURCE, _METADATA_SOURCE_DIALECT, _METADATA_VERSION
  from coremltools.models.utils import _MLPACKAGE_EXTENSION
label_desc: Use image node_id 6 for calling a global function with example usage: _validate_conversion_arguments(model, exact_source, exact_target, inputs, outputs, classifier_config, compute_precision, convert_to, minimum_deployment_target) and returns: ret