def get_statuses(pr, session):
 base_url = pr['_links']['statuses']['href']
 statuses = []
 for i in count():
  new_statuses = fetch_page(base_url, i, session)
  if ((not new_statuses) or ('context' not in new_statuses[0])):
   break
  statuses.extend(new_statuses)
 by_context = {}
 for s in statuses:
  by_context.setdefault(s['context'], []).append(s)
 return map(final_status, by_context.values())

def get_statuses ( pr , session ) : base_url = pr [ '_links' ] [ 'statuses' ] [ 'href' ] statuses = [ ] for i in count ( ) : new_statuses = fetch_page ( base_url , i , session ) if ( ( not new_statuses ) or ( 'context' not in new_statuses [ 0 ] ) ) : break statuses . extend ( new_statuses ) by_context = { } for s in statuses : by_context . setdefault ( s [ 'context' ] , [ ] ) . append ( s ) return map ( final_status , by_context . values ( ) )
get all of the statuses for a pull request .