parameters: (
          self,
          args,             # type: List[str]
          options,          # type: Values
          finder,           # type: PackageFinder
          session,          # type: PipSession
      )
return_statement: return requirements
docstring: Parse command-line arguments into the corresponding requirements.
docstring_summary: Parse command-line arguments into the corresponding requirements.
docstring_tokens: Parse command - line arguments into the corresponding requirements .
function: def get_requirements(
          self,
          args,             # type: List[str]
          options,          # type: Values
          finder,           # type: PackageFinder
          session,          # type: PipSession
      ):
          # type: (...) -> List[InstallRequirement]
          """
          Parse command-line arguments into the corresponding requirements.
          """
          requirements = []  # type: List[InstallRequirement]
          for filename in options.constraints:
              for parsed_req in parse_requirements(
                      filename,
                      constraint=True, finder=finder, options=options,
                      session=session):
                  req_to_add = install_req_from_parsed_requirement(
                      parsed_req,
                      isolated=options.isolated_mode,
                      user_supplied=False,
                  )
                  requirements.append(req_to_add)
  
          for req in args:
              req_to_add = install_req_from_line(
                  req, None, isolated=options.isolated_mode,
                  use_pep517=options.use_pep517,
                  user_supplied=True,
              )
              requirements.append(req_to_add)
  
          for req in options.editables:
              req_to_add = install_req_from_editable(
                  req,
                  user_supplied=True,
                  isolated=options.isolated_mode,
                  use_pep517=options.use_pep517,
              )
              requirements.append(req_to_add)
  
          # NOTE: options.require_hashes may be set if --require-hashes is True
          for filename in options.requirements:
              for parsed_req in parse_requirements(
                      filename,
                      finder=finder, options=options, session=session):
                  req_to_add = install_req_from_parsed_requirement(
                      parsed_req,
                      isolated=options.isolated_mode,
                      use_pep517=options.use_pep517,
                      user_supplied=True,
                  )
                  requirements.append(req_to_add)
  
          # If any requirement has hash options, enable hash checking.
          if any(req.has_hash_options for req in requirements):
              options.require_hashes = True
  
          if not (args or options.editables or options.requirements):
              opts = {'name': self.name}
              if options.find_links:
                  raise CommandError(
                      'You must give at least one requirement to {name} '
                      '(maybe you meant "pip {name} {links}"?)'.format(
                          **dict(opts, links=' '.join(options.find_links))))
              else:
                  raise CommandError(
                      'You must give at least one requirement to {name} '
                      '(see "pip help {name}")'.format(**opts))
  
          return requirements
function_tokens: def get_requirements ( self , args , # type: List[str] options , # type: Values finder , # type: PackageFinder session , # type: PipSession ) : # type: (...) -> List[InstallRequirement] requirements = [ ] # type: List[InstallRequirement] for filename in options . constraints : for parsed_req in parse_requirements ( filename , constraint = True , finder = finder , options = options , session = session ) : req_to_add = install_req_from_parsed_requirement ( parsed_req , isolated = options . isolated_mode , user_supplied = False , ) requirements . append ( req_to_add ) for req in args : req_to_add = install_req_from_line ( req , None , isolated = options . isolated_mode , use_pep517 = options . use_pep517 , user_supplied = True , ) requirements . append ( req_to_add ) for req in options . editables : req_to_add = install_req_from_editable ( req , user_supplied = True , isolated = options . isolated_mode , use_pep517 = options . use_pep517 , ) requirements . append ( req_to_add ) # NOTE: options.require_hashes may be set if --require-hashes is True for filename in options . requirements : for parsed_req in parse_requirements ( filename , finder = finder , options = options , session = session ) : req_to_add = install_req_from_parsed_requirement ( parsed_req , isolated = options . isolated_mode , use_pep517 = options . use_pep517 , user_supplied = True , ) requirements . append ( req_to_add ) # If any requirement has hash options, enable hash checking. if any ( req . has_hash_options for req in requirements ) : options . require_hashes = True if not ( args or options . editables or options . requirements ) : opts = { 'name' : self . name } if options . find_links : raise CommandError ( 'You must give at least one requirement to {name} ' '(maybe you meant "pip {name} {links}"?)' . format ( * * dict ( opts , links = ' ' . join ( options . find_links ) ) ) ) else : raise CommandError ( 'You must give at least one requirement to {name} ' '(see "pip help {name}")' . format ( * * opts ) ) return requirements