code: def _mean_match_binary_fast(
      mean_match_candidates, bachelor_preds, random_state, hashed_seeds
  ):
      """
      Chooses 0/1 randomly based on probability obtained from prediction.
      If mean_match_candidates is 0, choose class with highest probability.
      """
      if mean_match_candidates == 0:
          imp_values = np.floor(bachelor_preds + 0.5)
  
      else:
          num_bachelors = bachelor_preds.shape[0]
          if hashed_seeds is None:
              imp_values = random_state.binomial(n=1, p=bachelor_preds)
          else:
              imp_values = []
              for i in range(num_bachelors):
                  np.random.seed(seed=hashed_seeds[i])
                  imp_values.append(
                      np.random.binomial(n=1, p=bachelor_preds[i])
                  )
  
              imp_values = np.array(imp_values)
  
      return imp_values
  
imports: import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: _mean_match_binary_fast(mean_match_candidates, bachelor_preds, random_state, hashed_seeds) and returns: imp_values