code: def _prepare_extras() -> Dict[str, Any]:
      # https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras
      # Define package extras. These are only installed if you specify them.
      # From remote, use like `pip install "lightning[dev, docs]"`
      # From local copy of repo, use like `pip install ".[dev, docs]"`
      req_files = [
          Path(p)
          for p in glob.glob(
              os.path.join(_PATH_REQUIREMENTS, "*", "*.txt")
          )
      ]
      common_args = {
          "unfreeze": "none" if _FREEZE_REQUIREMENTS else "major"
      }
      # per-project extras
      extras = {
          f"{p.parent.name}-{p.stem}": _ASSISTANT.load_requirements(
              file_name=p.name, path_dir=p.parent, **common_args
          )
          for p in req_files
          if p.name not in ("docs.txt", "base.txt")
          and not p.parent.name.startswith("_")
      }
  
      # project specific extras groups
      extras["fabric-all"] = (
          extras["fabric-strategies"] + extras["fabric-examples"]
      )
      extras["fabric-dev"] = (
          extras["fabric-all"] + extras["fabric-test"]
      )
      extras["pytorch-all"] = (
          extras["pytorch-extra"]
          + extras["pytorch-strategies"]
          + extras["pytorch-examples"]
      )
      extras["pytorch-dev"] = (
          extras["pytorch-all"] + extras["pytorch-test"]
      )
      extras["app-extra"] = (
          extras["app-app"]
          + extras["app-cloud"]
          + extras["app-ui"]
          + extras["app-components"]
      )
      extras["app-all"] = extras["app-extra"]
      extras["app-dev"] = extras["app-all"] + extras["app-test"]
      extras["data-all"] = (
          extras["data-data"]
          + extras["data-cloud"]
          + extras["data-examples"]
      )
      extras["data-dev"] = extras["data-all"] + extras["data-test"]
      extras["store-store"] = extras[
          "app-app"
      ]  # todo: consider cutting/leaning this dependency
  
      # merge per-project extras of the same category, e.g. `app-test` + `fabric-test`
      for extra in list(extras):
          name = "-".join(extra.split("-")[1:])
          extras[name] = extras.get(name, []) + extras[extra]
  
      # drop quasi base the req. file has the same name sub-package
      for k in list(extras.keys()):
          kk = k.split("-")
          if not (len(kk) == 2 and kk[0] == kk[1]):
              continue
          extras[kk[0]] = list(extras[k])
          del extras[k]
      extras = {
          name: sorted(set(reqs)) for name, reqs in extras.items()
      }
      print("The extras are: ", extras)
      return extras
  
file_path: pytorch-lightning/src/lightning/__setup__.py
imports: import glob
  import os.path
  from importlib.util import module_from_spec, spec_from_file_location
  from pathlib import Path
  from types import ModuleType
  from typing import Any, Dict
  from setuptools import find_packages
label_desc: Use image node_id 2 for calling a global function with example usage: _prepare_extras() and returns: extras