code: def build_mpljs(web_backend_path, license_path):
      mpljs_path = web_backend_path / "js/mpl.js"
      mpljs_orig = mpljs_path.read_text().splitlines(keepends=True)
      try:
          mpljs_orig = mpljs_orig[
              : mpljs_orig.index(MPLJS_MAGIC_HEADER) + 1
          ]
      except IndexError as err:
          raise ValueError(
              f"The mpl.js file *must* have the exact line: {MPLJS_MAGIC_HEADER}"
          ) from err
  
      with mpljs_path.open("w") as mpljs:
          mpljs.writelines(mpljs_orig)
  
          for pkg in JAVASCRIPT_PACKAGES:
              source, license = prep_package(web_backend_path, pkg)
              mpljs.writelines(gen_embedded_lines(pkg, source))
  
              shutil.copy(
                  license,
                  license_path / f"LICENSE{safe_name(pkg.name)}",
              )
  
file_path: matplotlib/tools/embed_js.py
imports: from collections import namedtuple
  from pathlib import Path
  import re
  import shutil
  import subprocess
  import sys
label_desc: Use image node_id 4 for calling a global function with example usage: build_mpljs(web_backend_path, license_path) without return types