code: def drive_tune(args):
      """Invoke auto-tuning with command line arguments
  
      Parameters
      ----------
      args: argparse.Namespace
          Arguments from command line parser.
      """
      if not os.path.isfile(args.FILE):
          raise TVMCException(
              f"Input file '{args.FILE}' doesn't exist, is a broken symbolic link, or a directory."
          )
  
      tvmc_model = frontends.load_model(
          args.FILE, args.model_format, shape_dict=args.input_shapes
      )
  
      # Specify hardware parameters, although they'll only be used if autoscheduling.
      hardware_params = auto_scheduler.HardwareParams(
          num_cores=args.num_cores,
          vector_unit_bytes=args.vector_unit_bytes,
          cache_line_bytes=args.cache_line_bytes,
          max_shared_memory_per_block=args.max_shared_memory_per_block,
          max_local_memory_per_block=args.max_local_memory_per_block,
          max_threads_per_block=args.max_threads_per_block,
          max_vthread_extent=args.max_vthread_extent,
          warp_size=args.warp_size,
          target=args.target,
          target_host=args.target_host,
      )
  
      if args.rpc_tracker:
          parsed_url = urlparse("//%s" % args.rpc_tracker)
          rpc_hostname = parsed_url.hostname
          rpc_port = parsed_url.port or 9090
          logger.info("RPC tracker hostname: %s", rpc_hostname)
          logger.info("RPC tracker port: %s", rpc_port)
  
          if not args.rpc_key:
              raise TVMCException(
                  "need to provide an RPC tracker key (--rpc-key) for remote tuning"
              )
      else:
          rpc_hostname = None
          rpc_port = None
  
      transform_args = parse_graph_transform_args(args)
  
      tune_model(
          tvmc_model,
          args.target,
          tuning_records=args.output,
          prior_records=args.tuning_records,
          enable_autoscheduler=args.enable_autoscheduler,
          rpc_key=args.rpc_key,
          hostname=rpc_hostname,
          port=rpc_port,
          trials=args.trials,
          target_host=args.target_host,
          tuner=args.tuner,
          min_repeat_ms=args.min_repeat_ms,
          early_stopping=args.early_stopping,
          timeout=args.timeout,
          repeat=args.repeat,
          number=args.number,
          parallel=args.parallel,
          hardware_params=hardware_params,
          include_simple_tasks=args.include_simple_tasks,
          log_estimated_latency=args.log_estimated_latency,
          additional_target_options=reconstruct_target_args(args),
          tasks_filter=args.tasks,
          **transform_args,
      )
  
imports: import os.path
  import logging
  import time
  from copy import deepcopy
  from typing import Any, Optional, Dict, List, Union
  from urllib.parse import urlparse
  import tvm
  from tvm import autotvm, auto_scheduler
  from tvm.auto_scheduler.search_task import HardwareParams
  from tvm.autotvm.tuner import GATuner
  from tvm.autotvm.tuner import GridSearchTuner
  from tvm.autotvm.tuner import RandomTuner
  from tvm.autotvm.tuner import XGBTuner
  from tvm.target import Target
  from .None import TVMCException, composite_target, frontends
  from .main import register_parser
  from .model import TVMCModel
  from .target import target_from_cli, generate_target_args, reconstruct_target_args
  from .shape_parser import parse_shape_string
  from .transform import generate_transform_args, parse_graph_transform_args, apply_graph_transforms
label_desc: Use image node_id 2 for calling a global function with example usage: drive_tune(args) without return types