def close_review_requests(payload, server_url):
 review_request_id_to_commits_map = defaultdict(list)
 branch_name = payload.get(u'repository_path')
 if (not branch_name):
  return review_request_id_to_commits_map
 revisions = payload.get(u'revisions', [])
 for revision in revisions:
  revision_id = revision.get(u'revision')
  if (len(revision_id) > 7):
   revision_id = revision_id[:7]
  commit_message = revision.get(u'message')
  review_request_id = get_review_request_id(commit_message, server_url)
  review_request_id_to_commits_map[review_request_id].append((u'%s (%s)' % (branch_name, revision_id)))
 return review_request_id_to_commits_map

def close_review_requests ( payload , server_url ) : review_request_id_to_commits_map = defaultdict ( list ) branch_name = payload . get ( u'repository_path' ) if ( not branch_name ) : return review_request_id_to_commits_map revisions = payload . get ( u'revisions' , [ ] ) for revision in revisions : revision_id = revision . get ( u'revision' ) if ( len ( revision_id ) > 7 ) : revision_id = revision_id [ : 7 ] commit_message = revision . get ( u'message' ) review_request_id = get_review_request_id ( commit_message , server_url ) review_request_id_to_commits_map [ review_request_id ] . append ( ( u'%s (%s)' % ( branch_name , revision_id ) ) ) return review_request_id_to_commits_map
closes all review requests for the google code repository .