def __init__(self, url=None):
self.url = url or DEFAULT_INDEX<EOL>self.read_configuration()<EOL>scheme, netloc, path, params, query, frag = urlparse(self.url)<EOL>if params or query or frag or scheme not in ('<STR_LIT:http>', '<STR_LIT>'):<EOL><INDENT>raise DistlibException('<STR_LIT>' % self.url)<EOL><DEDENT>self.password_handler = None<EOL>self.ssl_verifier = None<EOL>self.gpg = None<EOL>self.gpg_home = None<EOL>self.rpc_proxy = None<EOL>with open(os.devnull, '<STR_LIT:w>') as sink:<EOL><INDENT>for s in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>try:<EOL><INDENT>rc = subprocess.check_call([s, '<STR_LIT>'], stdout=sink,<EOL>stderr=sink)<EOL>if rc == <NUM_LIT:0>:<EOL><INDENT>self.gpg = s<EOL>break<EOL><DEDENT><DEDENT>except OSError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>
Initialise an instance.

:param url: The URL of the index. If not specified, the URL for PyPI is
            used.