code: def _prepare_extras(
      skip_pattern: str = "^_", skip_files: Tuple[str] = ("base.txt",)
  ) -> dict:
      """Preparing extras for the package listing requirements.
  
      Args:
          skip_pattern: ignore files with this pattern, by default all files starting with _
          skip_files: ignore some additional files, by default base requirements
  
      Note, particular domain test requirement are aggregated in single "_tests" extra (which is not accessible).
  
      """
      # find all extra requirements
      _load_req = partial(_load_requirements, path_dir=_PATH_REQUIRE)
      found_req_files = sorted(
          os.path.basename(p)
          for p in glob.glob(os.path.join(_PATH_REQUIRE, "*.txt"))
      )
      # filter unwanted files
      found_req_files = [
          n for n in found_req_files if not re.match(skip_pattern, n)
      ]
      found_req_files = [
          n for n in found_req_files if n not in skip_files
      ]
      found_req_names = [
          os.path.splitext(req)[0] for req in found_req_files
      ]
      # define basic and extra extras
      extras_req = {"_tests": []}
      for name, fname in zip(found_req_names, found_req_files):
          if name.endswith("_test"):
              extras_req["_tests"] += _load_req(file_name=fname)
          else:
              extras_req[name] = _load_req(file_name=fname)
      # filter the uniques
      extras_req = {n: list(set(req)) for n, req in extras_req.items()}
      # create an 'all' keyword that install all possible dependencies
      extras_req["all"] = list(
          chain(
              [
                  pkgs
                  for k, pkgs in extras_req.items()
                  if k not in ("_test", "_tests")
              ]
          )
      )
      extras_req["dev"] = extras_req["all"] + extras_req["_tests"]
      return {
          k: v for k, v in extras_req.items() if not k.startswith("_")
      }
  
file_path: torchmetrics/setup.py
imports: import glob
  import os
  import re
  from functools import partial
  from importlib.util import module_from_spec, spec_from_file_location
  from itertools import chain
  from pathlib import Path
  from typing import Any, Iterable, Iterator, List, Optional, Tuple, Union
  from pkg_resources import Requirement, yield_lines
  from setuptools import find_packages, setup
label_desc: Use image node_id 5 for calling a global function with example usage: _prepare_extras(skip_pattern, skip_files) and returns: unknown