code: def generate_packer_config(file_path, providers):
      builders = []
      provisioners = []
      for provider_name in providers:
          builders.append(
              {
                  "name": f"{provider_name}",
                  "type": "vagrant",
                  "box_name": f"microtvm-base-{provider_name}",
                  "output_dir": f"output-packer-{provider_name}",
                  "communicator": "ssh",
                  "source_path": "generic/ubuntu1804",
                  "provider": provider_name,
                  "template": "Vagrantfile.packer-template",
              }
          )
  
      repo_root = subprocess.check_output(
          ["git", "rev-parse", "--show-toplevel"], encoding="utf-8"
      ).strip()
  
      scripts_to_copy = EXTRA_SCRIPTS
      for script in scripts_to_copy:
          script_path = os.path.join(repo_root, script)
          filename = os.path.basename(script_path)
          provisioners.append(
              {
                  "type": "file",
                  "source": script_path,
                  "destination": f"~/{filename}",
              }
          )
  
      provisioners.append(
          {
              "type": "shell",
              "script": "base_box_setup.sh",
          }
      )
      provisioners.append(
          {
              "type": "shell",
              "script": "base_box_provision.sh",
          }
      )
  
      with open(file_path, "w") as f:
          json.dump(
              {
                  "builders": builders,
                  "provisioners": provisioners,
              },
              f,
              sort_keys=True,
              indent=2,
          )
  
imports: import argparse
  import copy
  import json
  import logging
  import pathlib
  import os
  import re
  import shlex
  import shutil
  import subprocess
  import sys
  import pathlib
label_desc: Use image node_id 6 for calling a global function with example usage: generate_packer_config(file_path, providers) without return types