code: def package_list_from_file(file):
      mocked_packages = []
      with open(file) as fp:
          for ln in fp.readlines():
              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: torchmetrics/docs/source/conf.py
imports: import glob
  import inspect
  import os
  import re
  import shutil
  import sys
  import lai_sphinx_theme
  from lightning_utilities.docs import fetch_external_assets
  from lightning_utilities.docs.formatting import _transform_changelog
  import torchmetrics
label_desc: Use image node_id 3 for calling a global function with example usage: package_list_from_file(file) and returns: mocked_packages