code: def import_vegafusion() -> ModuleType:
      min_version = "1.5.0"
      try:
          version = importlib_version("vegafusion")
          embed_version = importlib_version("vegafusion-python-embed")
          if version != embed_version or Version(version) < Version(
              min_version
          ):
              raise RuntimeError(
                  "The versions of the vegafusion and vegafusion-python-embed packages must match\n"
                  f"and must be version {min_version} or greater.\n"
                  f"Found:\n"
                  f" - vegafusion=={version}\n"
                  f" - vegafusion-python-embed=={embed_version}\n"
              )
          import vegafusion as vf  # type: ignore
  
          return vf
      except ImportError as err:
          raise ImportError(
              'The "vegafusion" data transformer and chart.transformed_data feature requires\n'
              f"version {min_version} or greater of the 'vegafusion-python-embed' and 'vegafusion' packages.\n"
              "These can be installed with pip using:\n"
              f'    pip install "vegafusion[embed]>={min_version}"\n'
              "Or with conda using:\n"
              f'    conda install -c conda-forge "vegafusion-python-embed>={min_version}" '
              f'"vegafusion>={min_version}"\n\n'
              f"ImportError: {err.args[0]}"
          ) from err
  
file_path: altair/altair/utils/_importers.py
imports: from types import ModuleType
  from packaging.version import Version
  from importlib.metadata import version
label_desc: Use image node_id 1 for calling a global function with example usage: import_vegafusion() and returns: vf