code: def read_requirements(filename='requirements.txt'):
      
      # allow for some leeway with the argument
      if not filename.startswith('requirements'):
          filename = 'requirements-' + filename
      if not os.path.splitext(filename)[1]:
          filename += '.txt'  # no extension, add default
  
      def valid_line(line):
          line = line.strip()
          return line and not any(line.startswith(p) for p in ('#', '-'))
  
      def extract_requirement(line):
          egg_eq = '#egg='
          if egg_eq in line:
              _, requirement = line.split(egg_eq, 1)
              return requirement
          return line
  
      with open(filename) as f:
          lines = f.readlines()
          return list(map(extract_requirement, filter(valid_line, lines)))
docs: Reads the list of requirements from given file.
  
      :param filename: Filename to read the requirements from.
                       Uses ``'requirements.txt'`` by default.
  
      :return: Requirments as list of strings.