code: def read_requirements(*parts):
      """Return requirements from parts.
  
      Given a requirements.txt (or similar style file),
      returns a list of requirements.
      Assumes anything after a single '#' on a line is a comment, and ignores
      empty lines.
  
      Args:
          parts: List of filenames which contain the installation "parts",
              i.e. submodule-specific installation requirements
  
      Returns:
          A compiled list of requirements.
      """
      requirements = []
      for line in read(*parts).splitlines():
          new_line = re.sub(  # noqa: PD005
              r"(\s*)?#.*$",  # the space immediately before the
              # hash mark, the hash mark, and
              # anything that follows it
              "",  # replace with a blank string
              line,
          )
          new_line = re.sub(  # noqa: PD005
              r"-r.*$",  # link to another requirement file
              "",  # replace with a blank string
              new_line,
          )
          new_line = re.sub(  # noqa: PD005
              r"-e \..*$",  # link to editable install
              "",  # replace with a blank string
              new_line,
          )
          # print(line, "-->", new_line)
          if new_line:  # i.e. we have a non-zero-length string
              requirements.append(new_line)
      return requirements
  
file_path: pyjanitor/setup.py
imports: import codecs
  import os
  import re
  from pathlib import Path
  from pprint import pprint
  from setuptools import find_packages, setup
label_desc: Use image node_id 2 for calling a global function with example usage: read_requirements() and returns: requirements