def get_api(server_url, username, password):
    """Returns an RBClient instance and the associated root resource.

    Hooks should use this method to gain access to the API, instead of
    instantianting their own client.
    """
    api_client = RBClient(server_url, username=username, password=password)

    try:
        api_root = api_client.get_root()
    except ServerInterfaceError as e:
        raise HookError('Could not reach the Review Board server at %s: %s'
                        % (server_url, e))
    except APIError as e:
        raise HookError(e % 'Unexpected API Error: %s')

    return api_client, api_root
dataset/ETHPy150Open reviewboard/rbtools/rbtools/hooks/common.py/get_api/swapped operands of `%`