def add_web_hook(webhook_url, hmac_secret, repo_owner, repo_name, access_token):
    url = 'https://api.github.com/repos/{owner}/{repo}/hooks?access_token={token}'.format(owner=repo_owner, repo=repo_name, token=access_token)
    data = {
        'name': "web",
        'active': True,
        'events': ['push'],
        'config': {
            'url': webhook_url,
            'content_type': "json",
            'secret': hmac_secret,
        }
    }
    r = requests.post(url, data=json.dumps(data))
    if 300 >= r.status_code:
        raise Exception(str(json.loads(r.content.decode('utf-8'))))

# get config and user arguments
dataset/ETHPy150Open RalfJung/git-mirror/github-add-hooks.py/add_web_hook/swapped operands of `>=`