def __init__(self, address, get_auth_token, verbose):
        self.address = address
        self.verbose = verbose
        host = get_address_host(address)
        transport = AuthenticatedTransport(host, lambda cmd: None if cmd == 'login' else get_auth_token(self))
        self.proxy = xmlrpclib.ServerProxy(host, transport=transport, allow_none=True)
        def do_command(command):
            def inner(*args, **kwargs):
                import time
                time_delay = 1
                if self.verbose >= 2:
                    print 'remote_bundle_client: %s %s %s' % (command, args, kwargs)
                while True:
                    try:
                        return getattr(self.proxy, command)(*args, **kwargs)
                    except xmlrpclib.ProtocolError, e:
                        raise UsageError("Could not authenticate on %s: %s" % (host, e))
                    except xmlrpclib.Fault, e:
                        # Transform server-side UsageErrors into client-side UsageErrors.
                        if 'codalab.common.UsageError' in e.faultString:
                            index = e.faultString.find(':')
                            raise UsageError(e.faultString[index + 1:])
                        if 'codalab.common.NotFoundError' in e.faultString:
                            index = e.faultString.find(':')
                            raise NotFoundError(e.faultString[index + 1:])
                        elif 'codalab.common.PermissionError' in e.faultString:
                            index = e.faultString.find(':')
                            raise PermissionError(e.faultString[index + 1:])
                        elif 'codalab.common.AuthorizationError' in e.faultString:
                            index = e.faultString.find(':')
                            raise AuthorizationError(e.faultString[index + 1:])
                        else:
                            raise
                    except socket.error, e:
                        print >>sys.stderr, "Failed to connect to %s: %s. Trying to reconnect in %s seconds..." % (host, e, time_delay)
                        time.sleep(time_delay)
                        time_delay *= 2
                        if time_delay > 512:
                            raise UsageError('Failed to connect to %s: %s' % (host, e))
            return inner
        for command in self.COMMANDS:
            setattr(self, command, do_command(command))
dataset/ETHPy150Open codalab/codalab-cli/codalab/client/remote_bundle_client.py/RemoteBundleClient.__init__/original