nodes: 0, module; 1, function_definition; 2, function_name:sort_and_distribute; 3, parameters; 4, block; 5, identifier:array; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, if_statement; 10, expression_statement; 11, if_statement; 12, expression_statement; 13, while_statement; 14, return_statement; 15, identifier:splits; 16, integer:2; 17, comment:""" Sort an array of strings to groups by alphabetically continuous
         distribution
     """; 18, not_operator; 19, block; 20, not_operator; 21, block; 22, assignment; 23, comparison_operator:sys.version_info < (3, 0); 24, block; 25, else_clause; 26, assignment; 27, comparison_operator:len(remaining) > 0; 28, block; 29, identifier:groups; 30, call; 31, raise_statement; 32, call; 33, raise_statement; 34, identifier:remaining; 35, call; 36, attribute; 37, tuple; 38, expression_statement; 39, block; 40, identifier:groups; 41, list_comprehension; 42, call; 43, integer:0; 44, for_statement; 45, identifier:isinstance; 46, argument_list; 47, call; 48, identifier:isinstance; 49, argument_list; 50, call; 51, identifier:sorted; 52, argument_list; 53, identifier:sys; 54, identifier:version_info; 55, integer:3; 56, integer:0; 57, assignment; 58, expression_statement; 59, list; 60, for_in_clause; 61, identifier:len; 62, argument_list; 63, identifier:i; 64, identifier:myrange; 65, block; 66, identifier:array; 67, tuple; 68, identifier:TypeError; 69, argument_list; 70, identifier:splits; 71, identifier:int; 72, identifier:TypeError; 73, argument_list; 74, identifier:array; 75, identifier:myrange; 76, call; 77, assignment; 78, identifier:i; 79, identifier:myrange; 80, identifier:remaining; 81, if_statement; 82, identifier:list; 83, identifier:tuple; 84, string:"array must be a list"; 85, string:"splits must be an integer"; 86, identifier:xrange; 87, argument_list; 88, identifier:myrange; 89, call; 90, comparison_operator:len(remaining) > 0; 91, block; 92, identifier:splits; 93, identifier:range; 94, argument_list; 95, call; 96, integer:0; 97, expression_statement; 98, identifier:splits; 99, identifier:len; 100, argument_list; 101, call; 102, identifier:remaining; 103, attribute; 104, argument_list; 105, subscript; 106, identifier:append; 107, call; 108, identifier:groups; 109, identifier:i; 110, attribute; 111, argument_list; 112, identifier:remaining; 113, identifier:pop; 114, integer:0
code: def sort_and_distribute(array, splits=2):
     """ Sort an array of strings to groups by alphabetically continuous
         distribution
     """
     if not isinstance(array, (list,tuple)): raise TypeError("array must be a list")
     if not isinstance(splits, int): raise TypeError("splits must be an integer")
     remaining = sorted(array)
     if sys.version_info < (3, 0):
        myrange = xrange(splits)
     else:
        myrange = range(splits)
     groups = [[] for i in myrange]
     while len(remaining) > 0:
        for i in myrange:
           if len(remaining) > 0: groups[i].append(remaining.pop(0))
     return groups