code: def _export_graph_model_library_format(
      mods: typing.List[executor_factory.ExecutorFactoryModule],
      tempdir: pathlib.Path,
  ):
      """Export a tvm.relay.build artifact in Model Library Format.
  
      Parameters
      ----------
      mods : List[tvm.relay.backend.executor_factory.ExecutorFactoryModule]
          A list of the return value of tvm.relay.build,
          which will be exported into Model Library Format.
      tempdir : pathlib.Path
          Temporary directory to populate with Model Library Format contents.
      """
  
      assert _is_module_names_unique(
          mods
      ), "Multiple modules should have unique names."
  
      metadata = {
          "version": _GENERATED_VERSION,
      }
      metadata["modules"] = {}
      for mod in mods:
          is_aot = isinstance(
              mod, executor_factory.AOTExecutorFactoryModule
          )
          executor = ["aot"] if is_aot else ["graph"]
          module_name = mod.libmod_name
          metadata["modules"][module_name] = {
              "model_name": module_name,
              "export_datetime": datetime.datetime.now().strftime(
                  "%Y-%m-%d %H:%M:%SZ"
              ),
              "memory": _build_memory_map(mod),
              "target": [str(t) for t in mod.target],
              "executors": executor,
              "style": "full-model",
          }
  
          if is_aot and (str(mod.runtime) == "crt"):
              standalone_crt = {
                  "short_name": "tvm_standalone_crt",
                  "url": f"{STANDALONE_CRT_URL}",
                  "url_type": "mlf_path",
                  "version_spec": f"{tvm.__version__}",
              }
              external_dependencies = [standalone_crt]
              metadata["modules"][module_name][
                  "external_dependencies"
              ] = external_dependencies
  
      with open(tempdir / METADATA_FILE, "w") as json_f:
          json.dump(metadata, json_f, indent=2, sort_keys=True)
  
      codegen_dir = tempdir / "codegen"
      codegen_dir.mkdir()
      _populate_codegen_dir(mods, codegen_dir)
  
      parameters_dir = tempdir / "parameters"
      parameters_dir.mkdir()
      src_dir = tempdir / "src"
      src_dir.mkdir()
      graph_config_dir = tempdir / "executor-config" / "graph"
      for mod in mods:
          if _should_generate_interface_header(mod):
              include_path = codegen_dir / "host" / "include"
              if not include_path.exists():
                  include_path.mkdir()
  
              devices = mod.get_devices()
              pools = _get_pools_from_module(mod)
              io_pool_allocations = _get_io_pool_allocation_from_module(
                  mod
              )
              main_func = metadata["modules"][mod.libmod_name][
                  "memory"
              ]["functions"]["main"][0]
              workspace_size = int(main_func["workspace_size_bytes"])
              inputs = main_func["inputs"]
              outputs = main_func["outputs"]
              inputs_sizes = {
                  name: property_map["size"]
                  for name, property_map in inputs.items()
              }
              output_sizes = {
                  name: property_map["size"]
                  for name, property_map in outputs.items()
              }
              input_names = list(inputs.keys())
              output_names = list(outputs.keys())
  
              generate_c_interface_header(
                  mod.libmod_name,
                  input_names,
                  output_names,
                  pools,
                  io_pool_allocations,
                  devices,
                  workspace_size,
                  include_path,
                  inputs_sizes,
                  output_sizes,
              )
  
          is_aot = isinstance(
              mod, executor_factory.AOTExecutorFactoryModule
          )
          param_filename = parameters_dir / f"{mod.libmod_name}.params"
          with open(param_filename, "wb") as f:
              f.write(param_dict.save_param_dict(mod.params))
  
          with open(src_dir / f"{mod.libmod_name}.relay", "w") as f:
              f.write(str(mod.ir_mod))
  
          if not is_aot:
              if not graph_config_dir.exists():
                  graph_config_dir.mkdir(parents=True)
              with open(
                  graph_config_dir / f"{mod.libmod_name}.graph", "w"
              ) as f:
                  f.write(mod.get_executor_config())
  
imports: import datetime
  import json
  import os
  import pathlib
  import re
  import tarfile
  import typing
  import tvm
  from tvm.micro import get_standalone_crt_dir, get_microtvm_template_projects
  from .._ffi import get_global_func
  from ..contrib import utils
  from ..driver import build_module
  from ..relay import param_dict
  from ..relay.backend import executor_factory
  from ..relay.backend.name_transforms import prefix_generated_name, to_c_variable_style
  from ..tir import expr
label_desc: Use image node_id 14 for calling a global function with example usage: _export_graph_model_library_format(mods, tempdir) without return types