def _translate_raw_sort(sort):
 sort_dir = ''
 if sort.startswith('-'):
  sort = sort[1:]
  sort_dir = ' desc'
 sort = SORTS_DICT.get(sort, sort)
 return ('%s%s' % (sort, sort_dir))

def _translate_raw_sort ( sort ) : sort_dir = '' if sort . startswith ( '-' ) : sort = sort [ 1 : ] sort_dir = ' desc' sort = SORTS_DICT . get ( sort , sort ) return ( '%s%s' % ( sort , sort_dir ) )
translate from cloudsearch syntax .