def sort_return_tuples(response, **options):
 if ((not response) or (not options['groups'])):
  return response
 n = options['groups']
 return list(izip(*[response[i::n] for i in range(n)]))

def sort_return_tuples ( response , ** options ) : if ( ( not response ) or ( not options [ 'groups' ] ) ) : return response n = options [ 'groups' ] return list ( izip ( * [ response [ i : : n ] for i in range ( n ) ] ) )
if groups is specified .