#NEWLINE# def fake_get_all_flavors_sorted_list( context , inactive = False , filters = None , sort_key = 'flavorid' , sort_dir = 'asc' , limit = None , marker = None ) : #NEWLINE# #INDENT# if ( ( filters is None ) or ( filters [ 'is_public' ] is None ) ) : #NEWLINE# #INDENT# return sorted ( INSTANCE_TYPES . values ( ) , key = ( lambda item : item [ sort_key ] ) ) #NEWLINE# #UNINDENT# res = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for ( k , v ) in six . iteritems ( INSTANCE_TYPES ) : #NEWLINE# #INDENT# if ( filters [ 'is_public' ] and _has_flavor_access ( k , context . project_id ) ) : #NEWLINE# #INDENT# res . update ( { #NEWLINE# #INDENT# k : v , #NEWLINE# #UNINDENT# } ) #NEWLINE# continue #NEWLINE# #UNINDENT# if ( v [ 'is_public' ] == filters [ 'is_public' ] ) : #NEWLINE# #INDENT# res . update ( { #NEWLINE# #INDENT# k : v , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# res = sorted ( res . values ( ) , key = ( lambda item : item [ sort_key ] ) ) #NEWLINE# return res