def get_github_payload(repo, signature):
    '''Return the github-style JSON encoded payload (as if we were called as a github webhook)'''
    data = sys.stdin.buffer.read()
    verify_signature = repo.compute_hmac(data)
    if signature != "sha1="+verify_signature:
        raise Exception("You are not GitHub!")
    try:
        data = json.loads(data.decode('utf-8'))
        return data
    except __HOLE__:
        return {} # nothing read
dataset/ETHPy150Open RalfJung/git-mirror/webhook-core.py/get_github_payload