def _sort_keys_by_values(p):
 return sorted((pn for pn in p if p[pn]), key=(lambda pn: p[pn]))

def _sort_keys_by_values ( p ) : return sorted ( ( pn for pn in p if p [ pn ] ) , key = ( lambda pn : p [ pn ] ) )
returns a sorted list of keys of p sorted by values of p .