nodes: 0, module; 1, function_definition; 2, function_name:_sort_cols; 3, parameters; 4, block; 5, identifier:self; 6, identifier:cols; 7, identifier:kwargs; 8, expression_statement; 9, if_statement; 10, if_statement; 11, expression_statement; 12, expression_statement; 13, if_statement; 14, return_statement; 15, comment:""" Return a JVM Seq of Columns that describes the sort order
          """; 16, not_operator; 17, block; 18, boolean_operator; 19, block; 20, assignment; 21, assignment; 22, call; 23, block; 24, elif_clause; 25, else_clause; 26, call; 27, identifier:cols; 28, raise_statement; 29, comparison_operator:len(cols) == 1; 30, call; 31, expression_statement; 32, identifier:jcols; 33, list_comprehension; 34, identifier:ascending; 35, call; 36, identifier:isinstance; 37, argument_list; 38, if_statement; 39, call; 40, block; 41, block; 42, attribute; 43, argument_list; 44, call; 45, call; 46, integer:1; 47, identifier:isinstance; 48, argument_list; 49, assignment; 50, call; 51, for_in_clause; 52, attribute; 53, argument_list; 54, identifier:ascending; 55, tuple; 56, not_operator; 57, block; 58, identifier:isinstance; 59, argument_list; 60, expression_statement; 61, raise_statement; 62, identifier:self; 63, identifier:_jseq; 64, identifier:jcols; 65, identifier:ValueError; 66, argument_list; 67, identifier:len; 68, argument_list; 69, subscript; 70, identifier:list; 71, identifier:cols; 72, subscript; 73, identifier:_to_java_column; 74, argument_list; 75, identifier:c; 76, identifier:cols; 77, identifier:kwargs; 78, identifier:get; 79, string; 80, True; 81, identifier:bool; 82, identifier:int; 83, identifier:ascending; 84, expression_statement; 85, identifier:ascending; 86, identifier:list; 87, assignment; 88, call; 89, string:"should sort by at least one column"; 90, identifier:cols; 91, identifier:cols; 92, integer:0; 93, identifier:cols; 94, integer:0; 95, identifier:c; 96, string_content:ascending; 97, assignment; 98, identifier:jcols; 99, list_comprehension; 100, identifier:TypeError; 101, argument_list; 102, identifier:jcols; 103, list_comprehension; 104, conditional_expression:jc if asc else jc.desc(); 105, for_in_clause; 106, binary_operator:"ascending can only be boolean or list, but got %s" % type(ascending); 107, call; 108, for_in_clause; 109, identifier:jc; 110, identifier:asc; 111, call; 112, pattern_list; 113, call; 114, string:"ascending can only be boolean or list, but got %s"; 115, call; 116, attribute; 117, argument_list; 118, identifier:jc; 119, identifier:jcols; 120, attribute; 121, argument_list; 122, identifier:asc; 123, identifier:jc; 124, identifier:zip; 125, argument_list; 126, identifier:type; 127, argument_list; 128, identifier:jc; 129, identifier:desc; 130, identifier:jc; 131, identifier:desc; 132, identifier:ascending; 133, identifier:jcols; 134, identifier:ascending
code: def _sort_cols(self, cols, kwargs):
          """ Return a JVM Seq of Columns that describes the sort order
          """
          if not cols:
              raise ValueError("should sort by at least one column")
          if len(cols) == 1 and isinstance(cols[0], list):
              cols = cols[0]
          jcols = [_to_java_column(c) for c in cols]
          ascending = kwargs.get('ascending', True)
          if isinstance(ascending, (bool, int)):
              if not ascending:
                  jcols = [jc.desc() for jc in jcols]
          elif isinstance(ascending, list):
              jcols = [jc if asc else jc.desc()
                       for asc, jc in zip(ascending, jcols)]
          else:
              raise TypeError("ascending can only be boolean or list, but got %s" % type(ascending))
          return self._jseq(jcols)