code: def generate_all_unique_combinations(C, M, must_use_all_groups=False):
      global master_unique_permutation_list
      if len(master_unique_permutation_list) == 0 and path.exists(
          "master_list.pkl"
      ):
          with open("master_list.pkl", "rb") as cache:
              master_unique_permutation_list = pickle.load(cache)
  
      if (C, M) not in master_unique_permutation_list:
          full_permutation_list = []
          generate_unique_combinations(
              [0], [c for c in range(1, C)], full_permutation_list, M
          )
          master_unique_permutation_list[(C, M)] = full_permutation_list
  
          with open("master_list.pkl", "wb") as cache:
              pickle.dump(master_unique_permutation_list, cache)
  
      unique_permutations = master_unique_permutation_list[(C, M)]
  
      return unique_permutations
  
file_path: apex/apex/contrib/sparsity/permutation_search_kernels/exhaustive_search.py
imports: from .permutation_utilities import *
  import pickle
  import os.path
  from os import path
  import math
label_desc: Use image node_id 3 for calling a global function with example usage: generate_all_unique_combinations(C, M, must_use_all_groups) and returns: unique_permutations