def GetRecommendedIndexProperties(properties):
 (prefix, postfix) = properties
 result = []
 for sub_list in itertools.chain((prefix,), postfix):
  if isinstance(sub_list, (frozenset, set)):
   for prop in sorted(sub_list):
    result.append((prop, ASCENDING))
  else:
   for (prop, dir) in sub_list:
    result.append((prop, (dir if (dir is not None) else ASCENDING)))
 return tuple(result)

def GetRecommendedIndexProperties ( properties ) : ( prefix , postfix ) = properties result = [ ] for sub_list in itertools . chain ( ( prefix , ) , postfix ) : if isinstance ( sub_list , ( frozenset , set ) ) : for prop in sorted ( sub_list ) : result . append ( ( prop , ASCENDING ) ) else : for ( prop , dir ) in sub_list : result . append ( ( prop , ( dir if ( dir is not None ) else ASCENDING ) ) ) return tuple ( result )
converts the properties returned by datastore_index .