code: def generate_new_combinations(old_combinations):
      """
      Generator of all combinations based on the last state of Apriori algorithm
      Parameters
      -----------
      old_combinations: np.array
          All combinations with enough support in the last step
          Combinations are represented by a matrix.
          Number of columns is equal to the combination size
          of the previous step.
          Each row represents one combination
          and contains item type ids in the ascending order
          ```
                 0        1
          0      15       20
          1      15       22
          2      17       19
          ```
  
      Returns
      -----------
      Generator of all combinations from the last step x items
      from the previous step.
  
      Examples
      -----------
      For usage examples, please see
      https://rasbt.github.io/mlxtend/user_guide/frequent_patterns/apriori
  
      """
  
      items_types_in_previous_step = np.unique(
          old_combinations.flatten()
      )
      for old_combination in old_combinations:
          max_combination = old_combination[-1]
          mask = items_types_in_previous_step > max_combination
          valid_items = items_types_in_previous_step[mask]
          old_tuple = tuple(old_combination)
          for item in valid_items:
              yield from old_tuple
              yield item
  
imports: import numpy
  import pandas
  from ..frequent_patterns import fpcommon
label_desc: Use image node_id 1 for calling a global function with example usage: generate_new_combinations(old_combinations) without return types