<s> from collections import defaultdict <EOL> from django . conf import settings <EOL> from django . db . transaction import non_atomic_requests <EOL> from django . shortcuts import render <EOL> from olympia . devhub . models import ActivityLog <EOL> from olympia . users . models import UserProfile <EOL> @ non_atomic_requests <EOL> def credits ( request ) : <EOL> developers = ( UserProfile . objects <EOL> . exclude ( display_name = None ) <EOL> . filter ( groupuser__group__name = '<STR_LIT>' ) <EOL> . order_by ( '<STR_LIT>' ) <EOL> . distinct ( ) ) <EOL> past_developers = ( UserProfile . objects <EOL> . exclude ( display_name = None ) <EOL> . filter ( <EOL> groupuser__group__name = '<STR_LIT>' ) <EOL> . order_by ( '<STR_LIT>' ) <EOL> . distinct ( ) ) <EOL> other_contribs = ( UserProfile . objects <EOL> . exclude ( display_name = None ) <EOL> . filter ( <EOL> groupuser__group__name = '<STR_LIT>' ) <EOL> . order_by ( '<STR_LIT>' ) <EOL> . distinct ( ) ) <EOL> languages = sorted ( list ( <EOL> set ( settings . AMO_LANGUAGES + settings . HIDDEN_LANGUAGES ) - <EOL> set ( [ '<STR_LIT>' ] ) ) ) <EOL> localizers = [ ] <EOL> for lang in languages : <EOL> users = ( UserProfile . objects <EOL> . exclude ( display_name = None ) <EOL> . filter ( groupuser__group__name = '<STR_LIT>' % lang ) <EOL> . order_by ( '<STR_LIT>' ) <EOL> . distinct ( ) ) <EOL> if users : <EOL> localizers . append ( ( lang , users ) ) <EOL> total_reviews = ( ActivityLog . objects . total_reviews ( ) <EOL> . filter ( approval_count__gt = <NUM_LIT:10> ) ) <EOL> reviewers = defaultdict ( list ) <EOL> for total in total_reviews : <EOL> cnt = total . get ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> if cnt > <NUM_LIT> : <EOL> reviewers [ <NUM_LIT> ] . append ( total ) <EOL> elif cnt > <NUM_LIT> : <EOL> reviewers [ <NUM_LIT> ] . append ( total ) <EOL> elif cnt > <NUM_LIT> : <EOL> reviewers [ <NUM_LIT> ] . append ( total ) <EOL> elif cnt > <NUM_LIT:1000> : <EOL> reviewers [ <NUM_LIT:1000> ] . append ( total ) <EOL> elif cnt > <NUM_LIT> : <EOL> reviewers [ <NUM_LIT> ] . append ( total ) <EOL> elif cnt > <NUM_LIT:100> : <EOL> reviewers [ <NUM_LIT:100> ] . append ( total ) <EOL> elif cnt > <NUM_LIT:10> : <EOL> reviewers [ <NUM_LIT:10> ] . append ( total ) <EOL> context = { <EOL> '<STR_LIT>' : developers , <EOL> '<STR_LIT>' : past_developers , <EOL> '<STR_LIT>' : other_contribs , <EOL> '<STR_LIT>' : localizers , <EOL> '<STR_LIT>' : reviewers , <EOL> } <EOL> return render ( request , '<STR_LIT>' , context ) </s>
