

def is_merged_to_master(db, set_id, job_id, commit_sha, github_auth):
    '\n    '
    (set, job) = (objects.read_set(db, set_id), objects.read_job(db, job_id))
    if (set is not None):
        return True
    elif (job is None):
        return None
    try:
        template1 = get('https://api.github.com/', auth=github_auth).json().get('repository_url')
        repo_url = expand_uri(template1, dict(owner=job.github_owner, repo=job.github_repository))
        template2 = get(repo_url, auth=github_auth).json().get('compare_url')
        compare_url = expand_uri(template2, dict(base=commit_sha, head='master'))
        compare = get(compare_url, auth=github_auth).json()
        return (compare['base_commit']['sha'] == compare['merge_base_commit']['sha'])
    except Exception as e:
        _L.error('Failed to check merged status of {}/{} {}: {}'.format(job.github_owner, job.github_repository, commit_sha, e))
        return None

dataset/ETHPy150Open openaddresses/machine/openaddr/ci/__init__.py is_merged_to_master/original