#NEWLINE# @ api . cache . memoize ( timeout = 120 , fast = True ) #NEWLINE# def get_pid_categories( ) : #NEWLINE# #INDENT# pid_map = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for cat in api . problem . get_all_categories ( ) : #NEWLINE# #INDENT# for p in api . problem . get_all_problems ( category = cat ) : #NEWLINE# #INDENT# pid_map [ p [ 'pid' ] ] = cat #NEWLINE# #UNINDENT# #UNINDENT# return pid_map