code: def drive_run(args):
      """Invoke runner module with command line arguments
  
      Parameters
      ----------
      args: argparse.Namespace
          Arguments from command line parser.
      """
  
      path = pathlib.Path(args.PATH)
      options = None
      project_dir = None
      if args.device == "micro":
          # If it's a micro device, then grab the model.tar path from Project API instead.
          # args.PATH will be used too since it points to the project directory. N.B.: there is no
          # way to determine the model.tar path from the project dir or vice-verse (each platform
          # is free to put model.tar whereever it's convenient).
          project_dir = path
          path = pathlib.Path(args.mlf_path)
  
          # Check for options unavailable for micro targets.
  
          if args.rpc_key or args.rpc_tracker:
              raise TVMCException(
                  "--rpc-key and/or --rpc-tracker can't be specified for micro targets."
              )
  
          if args.device != "micro":
              raise TVMCException(
                  f"Device '{args.device}' not supported. "
                  "Only device 'micro' is supported to run a model in MLF, "
                  "i.e. when '--device micro'."
              )
  
          if args.profile:
              raise TVMCException(
                  "--profile is not currently supported for micro devices."
              )
  
          if args.print_time:
              raise TVMCException(
                  "--print-time is not currently supported for micro devices."
              )
  
          # Get and check options for micro targets.
          options = get_and_check_options(
              args.project_option, args.valid_options
          )
  
      else:
          # Check for options only availabe for micro targets.
  
          if args.list_options:
              raise TVMCException(
                  "--list-options is only availabe on micro targets, i.e. when '--device micro'."
              )
  
      try:
          tvmc_package = TVMCPackage(
              package_path=path, project_dir=project_dir
          )
      except IsADirectoryError:
          raise TVMCException(
              f"File {path} must be an archive, not a directory."
          )
      except FileNotFoundError:
          raise TVMCException(f"File {path} does not exist.")
      except ReadError:
          raise TVMCException(
              f"Could not read model from archive {path}!"
          )
  
      rpc_hostname, rpc_port = tracker_host_port_from_cli(
          args.rpc_tracker
      )
  
      try:
          inputs = np.load(args.inputs) if args.inputs else {}
      except IOError as ex:
          raise TVMCException("Error loading inputs file: %s" % ex)
  
      result = run_module(
          tvmc_package,
          args.device,
          hostname=rpc_hostname,
          port=rpc_port,
          rpc_key=args.rpc_key,
          inputs=inputs,
          fill_mode=args.fill_mode,
          benchmark=args.print_time,
          repeat=args.repeat,
          number=args.number,
          profile=args.profile,
          end_to_end=args.end_to_end,
          options=options,
      )
  
      if args.print_time:
          stat_table = result.format_times()
          # print here is intentional
          print(stat_table)
  
      if args.print_top:
          top_results = get_top_results(result, args.print_top)
          # print here is intentional
          print(top_results)
  
      if args.outputs:
          # Save the outputs
          result.save(args.outputs)
  
imports: from contextlib import ExitStack
  import logging
  import pathlib
  from typing import Dict, Optional, Union
  from tarfile import ReadError
  import argparse
  import sys
  import json
  import numpy
  import tvm
  from tvm import rpc
  from tvm.runtime import vm
  from tvm.autotvm.measure import request_remote
  from tvm.contrib import graph_executor
  from tvm.contrib.debugger import debug_executor
  from tvm.runtime import profiler_vm
  from tvm.relay.param_dict import load_param_dict
  from .None import TVMCException
  from .arguments import TVMCSuppressedArgumentParser
  from .project import get_project_options, get_and_check_options, get_project_dir
  from .main import register_parser
  from .model import TVMCPackage, TVMCResult
  from .result_utils import get_top_results
  from .tracker import tracker_host_port_from_cli
label_desc: Use image node_id 2 for calling a global function with example usage: drive_run(args) without return types