code: def _link_and_save_file(
      path: str,
      base_path: str,
      interface: "InterfaceQueue",
      settings: "SettingsStatic",
  ) -> None:
      # TODO(jhr): should this logic be merged with Run.save()
      files_dir = settings.files_dir
      file_name = os.path.relpath(path, base_path)
      abs_path = os.path.abspath(path)
      wandb_path = os.path.join(files_dir, file_name)
      filesystem.mkdir_exists_ok(os.path.dirname(wandb_path))
      # We overwrite existing symlinks because namespaces can change in Tensorboard
      if os.path.islink(wandb_path) and abs_path != os.readlink(
          wandb_path
      ):
          os.remove(wandb_path)
          os.symlink(abs_path, wandb_path)
      elif not os.path.exists(wandb_path):
          os.symlink(abs_path, wandb_path)
      # TODO(jhr): need to figure out policy, live/throttled?
      interface.publish_files(
          dict(files=[(GlobStr(glob.escape(file_name)), "live")])
      )
  
imports: import glob
  import logging
  import os
  import queue
  import socket
  import sys
  import threading
  import time
  from typing import TYPE_CHECKING, Any, Dict, List, Optional
  import wandb
  from wandb import util
  from wandb.sdk.interface.interface import GlobStr
  from wandb.sdk.lib import filesystem
  from wandb.viz import CustomChart
  from .None import run
label_desc: Use image node_id 1 for calling a global function with example usage: _link_and_save_file(path, base_path, interface, settings) without return types