code: def build_vis_if_needed():
      script_path = os.path.dirname(os.path.abspath(__file__))
      js_bundle_dest = os.path.join(
          script_path,
          "interpret",
          "root",
          "bld",
          "lib",
          "interpret-inline.js",
      )
      if os.path.exists(js_bundle_dest):
          # already exists, so we are done
          return
  
      # JavaScript compile
      js_path = os.path.join(script_path, "..", "..", "shared", "vis")
      subprocess.run(
          "npm install && npm run build-prod", cwd=js_path, shell=True
      )
  
      js_bundle_src = os.path.join(
          js_path, "dist", "interpret-inline.js"
      )
      os.makedirs(os.path.dirname(js_bundle_dest), exist_ok=True)
      shutil.copyfile(js_bundle_src, js_bundle_dest)
  
      js_bundle_src_lic = os.path.join(
          js_path, "dist", "interpret-inline.js.LICENSE.txt"
      )
      js_bundle_dest_lic = os.path.join(
          script_path,
          "interpret",
          "root",
          "bld",
          "lib",
          "interpret-inline.js.LICENSE.txt",
      )
      shutil.copyfile(js_bundle_src_lic, js_bundle_dest_lic)
  
imports: import subprocess
  import os
  import glob
  import shutil
  from setuptools.command.build import build
  from setuptools.command.install import install
  from setuptools import setup, find_packages
  from setuptools.command.sdist import sdist
label_desc: Use image node_id 4 for calling a global function with example usage: build_vis_if_needed() without return types