nodes: 0, module; 1, function_definition; 2, function_name:split_iterable_as_iterable; 3, parameters; 4, block; 5, identifier:self; 6, identifier:values; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, function_definition; 11, expression_statement; 12, for_statement; 13, comment:"""Group iterable into iterables, in the order of the keys
  
          Parameters
          ----------
          values : iterable of length equal to keys
              iterable of values to be grouped
  
          Yields
          ------
          iterable of items in values
  
          Notes
          -----
          Memory consumption depends on the amount of sorting required
          Worst case, if index.sorter[-1] = 0, we need to consume the entire value iterable,
          before we can start yielding any output
          But to the extent that the keys are already sorted, the grouping is lazy
          """; 14, assignment; 15, assignment; 16, function_name:get_value; 17, parameters; 18, block; 19, assignment; 20, identifier:c; 21, attribute; 22, block; 23, identifier:values; 24, call; 25, identifier:cache; 26, call; 27, identifier:ti; 28, try_statement; 29, identifier:s; 30, call; 31, identifier:self; 32, identifier:count; 33, expression_statement; 34, identifier:iter; 35, argument_list; 36, identifier:dict; 37, argument_list; 38, block; 39, except_clause; 40, identifier:iter; 41, argument_list; 42, yield; 43, call; 44, return_statement; 45, block; 46, attribute; 47, generator_expression; 48, identifier:enumerate; 49, argument_list; 50, call; 51, while_statement; 52, attribute; 53, identifier:sorter; 54, call; 55, for_in_clause; 56, identifier:values; 57, attribute; 58, argument_list; 59, True; 60, block; 61, identifier:self; 62, identifier:index; 63, identifier:get_value; 64, argument_list; 65, identifier:i; 66, call; 67, identifier:cache; 68, identifier:pop; 69, identifier:ti; 70, expression_statement; 71, if_statement; 72, expression_statement; 73, identifier:i; 74, attribute; 75, argument_list; 76, assignment; 77, comparison_operator:i==ti; 78, block; 79, assignment; 80, identifier:itertools; 81, identifier:islice; 82, identifier:s; 83, call; 84, pattern_list; 85, call; 86, identifier:i; 87, identifier:ti; 88, return_statement; 89, subscript; 90, identifier:v; 91, identifier:int; 92, argument_list; 93, identifier:i; 94, identifier:v; 95, identifier:next; 96, argument_list; 97, identifier:v; 98, identifier:cache; 99, identifier:i; 100, identifier:c; 101, identifier:values
code: def split_iterable_as_iterable(self, values):
          """Group iterable into iterables, in the order of the keys
  
          Parameters
          ----------
          values : iterable of length equal to keys
              iterable of values to be grouped
  
          Yields
          ------
          iterable of items in values
  
          Notes
          -----
          Memory consumption depends on the amount of sorting required
          Worst case, if index.sorter[-1] = 0, we need to consume the entire value iterable,
          before we can start yielding any output
          But to the extent that the keys are already sorted, the grouping is lazy
          """
          values = iter(enumerate(values))
          cache = dict()
          def get_value(ti):
              try:
                  return cache.pop(ti)
              except:
                  while True:
                      i, v = next(values)
                      if i==ti:
                          return v
                      cache[i] = v
          s = iter(self.index.sorter)
          for c in self.count:
              yield (get_value(i) for i in itertools.islice(s, int(c)))