code: def pack(
      files: Dict[str, Union[str, Path]],
      yaml_files: Dict[str, Union[str, Path]],
      outpath: Union[str, Path],
      option: Iterable[Union[str, Path]] = (),
  ):
      for v in (
          list(files.values())
          + list(yaml_files.values())
          + list(option)
      ):
          if not Path(v).exists():
              raise FileNotFoundError(f"No such file or directory: {v}")
  
      files = {k: _to_relative_or_resolve(v) for k, v in files.items()}
      yaml_files = {
          k: _to_relative_or_resolve(v) for k, v in yaml_files.items()
      }
      option = [_to_relative_or_resolve(v) for v in option]
  
      meta_objs = dict(
          files=files,
          yaml_files=yaml_files,
          timestamp=datetime.now().timestamp(),
          python=sys.version,
      )
  
      try:
          import torch
  
          meta_objs.update(torch=str(torch.__version__))
      except ImportError:
          pass
      try:
          import espnet
  
          meta_objs.update(espnet=espnet.__version__)
      except ImportError:
          pass
  
      Path(outpath).parent.mkdir(parents=True, exist_ok=True)
      with Archiver(outpath, mode="w") as archive:
          # Write packed/meta.yaml
          fileobj = BytesIO(yaml.safe_dump(meta_objs).encode())
          info = archive.generate_info(
              "meta.yaml", fileobj.getbuffer().nbytes
          )
          archive.addfile(info, fileobj=fileobj)
  
          for f in (
              list(yaml_files.values())
              + list(files.values())
              + list(option)
          ):
              archive.add(f)
  
      print(f"Generate: {outpath}")
  
imports: import os
  import sys
  import tarfile
  import zipfile
  from datetime import datetime
  from io import BytesIO, TextIOWrapper
  from pathlib import Path
  from typing import Dict, Iterable, Optional, Union
  import yaml
label_desc: Use image node_id 5 for calling a global function with example usage: pack(files, yaml_files, outpath, option) without return types