code: def _build_package_finder(
          self,
          options,               # type: Values
          session,               # type: PipSession
          platform=None,         # type: Optional[str]
          python_versions=None,  # type: Optional[List[str]]
          abi=None,              # type: Optional[str]
          implementation=None    # type: Optional[str]
      ):
          # type: (...) -> PackageFinder
          
          index_urls = [options.index_url] + options.extra_index_urls
          if options.no_index:
              logger.debug(
                  'Ignoring indexes: %s',
                  ','.join(redact_password_from_url(url) for url in index_urls),
              )
              index_urls = []
  
          return PackageFinder(
              find_links=options.find_links,
              format_control=options.format_control,
              index_urls=index_urls,
              trusted_hosts=options.trusted_hosts,
              allow_all_prereleases=options.pre,
              session=session,
              platform=platform,
              versions=python_versions,
              abi=abi,
              implementation=implementation,
              prefer_binary=options.prefer_binary,
          )
docs: Create a package finder appropriate to this requirement command.