def bitbucket_webhook_helper(data):
 repos = [(repo % {'full_name': data['repository']['full_name']}) for repo in BITBUCKET_REPOS]
 return {'service_long_name': 'Bitbucket', 'repo_url': data['repository']['links']['html']['href'], 'repos': repos, 'branch': data['push']['changes'][(-1)]['new']['name']}

def bitbucket_webhook_helper ( data ) : repos = [ ( repo % { 'full_name' : data [ 'repository' ] [ 'full_name' ] } ) for repo in BITBUCKET_REPOS ] return { 'service_long_name' : 'Bitbucket' , 'repo_url' : data [ 'repository' ] [ 'links' ] [ 'html' ] [ 'href' ] , 'repos' : repos , 'branch' : data [ 'push' ] [ 'changes' ] [ ( - 1 ) ] [ 'new' ] [ 'name' ] }
api to handle webhooks from bitbucket .