def _get_review_request_id_to_commits_map(payload, server_url, repository):
 review_request_id_to_commits_map = defaultdict(list)
 commits = payload.get(u'commits', [])
 for commit in commits:
  commit_hash = commit.get(u'raw_node')
  commit_message = commit.get(u'message')
  branch_name = commit.get(u'branch')
  if branch_name:
   review_request_id = get_review_request_id(commit_message, server_url, commit_hash, repository)
   review_request_id_to_commits_map[review_request_id].append((u'%s (%s)' % (branch_name, commit_hash[:7])))
 return review_request_id_to_commits_map

def _get_review_request_id_to_commits_map ( payload , server_url , repository ) : review_request_id_to_commits_map = defaultdict ( list ) commits = payload . get ( u'commits' , [ ] ) for commit in commits : commit_hash = commit . get ( u'raw_node' ) commit_message = commit . get ( u'message' ) branch_name = commit . get ( u'branch' ) if branch_name : review_request_id = get_review_request_id ( commit_message , server_url , commit_hash , repository ) review_request_id_to_commits_map [ review_request_id ] . append ( ( u'%s (%s)' % ( branch_name , commit_hash [ : 7 ] ) ) ) return review_request_id_to_commits_map
returns a dictionary .