def _setup_authentication(self, username, password):
<EOL>if self.version < <NUM_LIT>:<EOL><INDENT>if not username:<EOL><INDENT>username = self._key<EOL>self._key = None<EOL><DEDENT><DEDENT>if not username:<EOL><INDENT>return<EOL><DEDENT>if not password:<EOL><INDENT>password = '<STR_LIT>'  <EOL><DEDENT>password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()<EOL>password_mgr.add_password(None, self._url, username, password )<EOL>handler = urllib.request.HTTPBasicAuthHandler( password_mgr )<EOL>self._opener = urllib.request.build_opener( handler )<EOL>self._opener.open( self._url )<EOL>urllib.request.install_opener( self._opener )<EOL>
Create the authentication object with the given credentials.