def _get_pull_request(remote_repo, branch_name, base_name):
    """
    Gets the active pull request with the given branch and base

    :param Repository remote_repo:
    :param unicode branch_name:
    :param unicode base_name:
    :return:
    """
    all_active_pull_request = remote_repo.get_pulls(state='open')
    for pull_request in all_active_pull_request:
        if (pull_request.base.ref == base_name and pull_request.head.ref ==
            branch_name):
            return pull_request
