code: def package_list_from_file(file):
      """List up package name (not containing version and extras) from a package list file."""
      mocked_packages = []
      with open(file) as fp:
          for ln in fp.readlines():
              # Example: `tqdm>=4.41.0` => `tqdm`
              # `[` is for package with extras
              found = [
                  ln.index(ch) for ch in list(",=<>#[") if ch in ln
              ]
              pkg = ln[: min(found)] if found else ln
              if pkg.rstrip():
                  mocked_packages.append(pkg.rstrip())
      return mocked_packages
  
file_path: pytorch-lightning/docs/source-pytorch/conf.py
imports: import glob
  import os
  import shutil
  import urllib.request
  import warnings
  from importlib.util import module_from_spec, spec_from_file_location
  from types import ModuleType
  import lai_sphinx_theme
  from lightning_utilities.docs import fetch_external_assets
  from lightning_utilities.docs.formatting import _transform_changelog
  import lightning
label_desc: Use image node_id 3 for calling a global function with example usage: package_list_from_file(file) and returns: mocked_packages