code: def _create_subsets_and_weights_exact(
      num_players: int, high_weight: float
  ) -> Tuple[np.ndarray, np.ndarray]:
      """Creates all subsets and the exact weights of each subset. See Section 4.1.1. in
  
      Janzing, D., Minorics, L., & Bloebaum, P. (2020).
      Feature relevance quantification in explainable AI: A causal problem.
      In International Conference on Artificial Intelligence and Statistics (pp. 2907-2916). PMLR.
  
      for more details on this.
  
      :param num_players: Total number of players.
      :param high_weight: A 'high' weight for computational purposes. This is used to resemble 'infinity', but needs to be
                          selected carefully to avoid numerical issues.
      :return: A tuple, where the first entry is a numpy array with all subsets and the second entry is an array with the
               corresponding weights to each subset.
      """
      all_subsets = []
  
      num_iterations = int(np.ceil(num_players / 2))
  
      for i in range(num_iterations):
          # Create all (unique) subsets)
          all_subsets.extend(
              np.array(
                  [
                      np.bincount(combs, minlength=num_players)
                      for combs in itertools.combinations(
                          range(num_players), i
                      )
                  ]
              )
          )
  
          all_subsets.extend(
              np.array(
                  [
                      np.bincount(combs, minlength=num_players)
                      for combs in itertools.combinations(
                          range(num_players), num_players - i
                      )
                  ]
              )
          )
  
          if i == num_iterations - 1 and num_players % 2 == 0:
              all_subsets.extend(
                  np.array(
                      [
                          np.bincount(combs, minlength=num_players)
                          for combs in itertools.combinations(
                              range(num_players), i + 1
                          )
                      ]
                  )
              )
  
      weights = np.zeros(len(all_subsets))
  
      for i, subset in enumerate(all_subsets):
          subset_size = np.sum(subset)
          if subset_size == num_players or subset_size == 0:
              # Assigning a 'high' weight, since this resembles "infinity".
              weights[i] = high_weight
          else:
              # The weight for a subset with a specific length (see paper mentioned in the docstring for more
              # information).
              weights[i] = (num_players - 1) / (
                  scipy.special.binom(num_players, subset_size)
                  * subset_size
                  * (num_players - subset_size)
              )
  
      return np.array(all_subsets, dtype=np.int32), weights.astype(
          float
      )
  
imports: import itertools
  import math
  from enum import Enum
  from typing import Callable, Dict, List, Optional, Set, Tuple, Union
  import numpy
  import scipy
  from joblib import Parallel, delayed
  from scipy.special import comb
  from scipy.stats._qmc import Halton
  from sklearn.linear_model import LinearRegression
  from tqdm import tqdm
  import dowhy.gcm.config
  from dowhy.gcm.util.general import set_random_seed
label_desc: Use image node_id 7 for calling a global function with example usage: _create_subsets_and_weights_exact(num_players, high_weight) and returns: np,  weights