def _uniquify_projs(projs, check_active=True, sort=True):
 final_projs = []
 for proj in projs:
  if (not any((_proj_equal(p, proj, check_active) for p in final_projs))):
   final_projs.append(proj)
 my_count = count(len(final_projs))
 def sorter(x):
  'Sort in a nice way.'
  digits = [s for s in x['desc'] if s.isdigit()]
  if digits:
   sort_idx = int(digits[(-1)])
  else:
   sort_idx = next(my_count)
  return (sort_idx, x['desc'])
 return (sorted(final_projs, key=sorter) if sort else final_projs)

def _uniquify_projs ( projs , check_active = True , sort = True ) : final_projs = [ ] for proj in projs : if ( not any ( ( _proj_equal ( p , proj , check_active ) for p in final_projs ) ) ) : final_projs . append ( proj ) my_count = count ( len ( final_projs ) ) def sorter ( x ) : digits = [ s for s in x [ 'desc' ] if s . isdigit ( ) ] if digits : sort_idx = int ( digits [ ( - 1 ) ] ) else : sort_idx = next ( my_count ) return ( sort_idx , x [ 'desc' ] ) return ( sorted ( final_projs , key = sorter ) if sort else final_projs )
make unique projs .