def __init__(self, url='<STR_LIT>'):
self._timeout = None<EOL>if isinstance(url, str):<EOL><INDENT>parsed_url = urlparse(url)<EOL>scheme = parsed_url.scheme<EOL>netloc = parsed_url.netloc<EOL>if not scheme or not netloc:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(url))<EOL><DEDENT>elif scheme not in ('<STR_LIT:http>', '<STR_LIT>'):<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(url, scheme))<EOL><DEDENT>else:<EOL><INDENT>self._url = url<EOL><DEDENT><DEDENT>elif isinstance(url, dict):<EOL><INDENT>scheme = url.get('<STR_LIT>', None)or url.get('<STR_LIT>', None)or '<STR_LIT:http>'<EOL>if scheme not in ('<STR_LIT:http>', '<STR_LIT>'):<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(scheme))<EOL><DEDENT>hostname = url.get('<STR_LIT>', '<STR_LIT:127.0.0.1>')<EOL>port = url.get('<STR_LIT:port>', <NUM_LIT>)<EOL>path = url.get('<STR_LIT:path>', '<STR_LIT>')<EOL>username = url.get('<STR_LIT:username>', None)<EOL>password = url.get('<STR_LIT:password>', None)<EOL>if username and password:<EOL><INDENT>netloc = '<STR_LIT>'.format(<EOL>username, password, hostname, port)<EOL><DEDENT>else:<EOL><INDENT>netloc = '<STR_LIT>'.format(hostname, port)<EOL><DEDENT>self._url = urlunparse((scheme, netloc, path, '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'))<EOL><DEDENT>else:<EOL><INDENT>raise TypeError(<EOL>'<STR_LIT>'.format(url))<EOL><DEDENT>self._formatter = MemorizeFormatter()<EOL>
Init the RemoteInvoker by remote url

        Args:
            url(str|dict): The url of remote server.
        Defaults:
            if url is str:
                url = http://127.0.0.1:3456/wd/hub
            if url is dict:
                url = {
                    'protocol': 'http',
                    'hostname': '127.0.0.1',
                    'port': 3456,
                    'path': '/wd/hub'
                }
        Examples:
            r = RemoteInvoker('http://127.0.0.1:3456/wd/hub')
            r = RemoteInvoker({
                'protocol': 'https',
                'hostname': '127.0.0.1',
                'port': 5678,
                'username': 'macaca',
                'password': '123456',
                'path': '/how/r/u'
            }) => "https://macaca:123456@127.0.0.1:5678/how/r/u"