def __init__(<EOL>self,<EOL>find_links,  <EOL>index_urls,  <EOL>allow_all_prereleases=False,  <EOL>trusted_hosts=None,  <EOL>session=None,  <EOL>format_control=None,  <EOL>platform=None,  <EOL>versions=None,  <EOL>abi=None,  <EOL>implementation=None,  <EOL>prefer_binary=False  <EOL>):<EOL>
if session is None:<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>self.find_links = []  <EOL>for link in find_links:<EOL><INDENT>if link.startswith('<STR_LIT>'):<EOL><INDENT>new_link = normalize_path(link)<EOL>if os.path.exists(new_link):<EOL><INDENT>link = new_link<EOL><DEDENT><DEDENT>self.find_links.append(link)<EOL><DEDENT>self.index_urls = index_urls<EOL>self.logged_links = set()  <EOL>self.format_control = format_control or FormatControl(set(), set())<EOL>self.secure_origins = [<EOL>("<STR_LIT:*>", host, "<STR_LIT:*>")<EOL>for host in (trusted_hosts if trusted_hosts else [])<EOL>]  <EOL>self.allow_all_prereleases = allow_all_prereleases<EOL>self.session = session<EOL>self.extra = None<EOL>self.valid_tags = get_supported(<EOL>versions=versions,<EOL>platform=platform,<EOL>abi=abi,<EOL>impl=implementation,<EOL>)<EOL>self.prefer_binary = prefer_binary<EOL>if not HAS_TLS:<EOL><INDENT>for link in itertools.chain(self.index_urls, self.find_links):<EOL><INDENT>parsed = urllib_parse.urlparse(link)<EOL>if parsed.scheme == "<STR_LIT>":<EOL><INDENT>logger.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL>break<EOL><DEDENT><DEDENT><DEDENT>
Create a PackageFinder.

        :param format_control: A FormatControl object or None. Used to control
            the selection of source packages / binary packages when consulting
            the index and links.
        :param platform: A string or None. If None, searches for packages
            that are supported by the current system. Otherwise, will find
            packages that can be built on the platform passed in. These
            packages will only be downloaded for distribution: they will
            not be built locally.
        :param versions: A list of strings or None. This is passed directly
            to pep425tags.py in the get_supported() method.
        :param abi: A string or None. This is passed directly
            to pep425tags.py in the get_supported() method.
        :param implementation: A string or None. This is passed directly
            to pep425tags.py in the get_supported() method.