code: def compute_grouped_metric(ungrouped_metric, group_matrix):
      '''
      Computes the mean value for the groups of parameter values in the
      argument ungrouped_metric
      '''
  
      group_matrix = np.array(group_matrix, dtype=np.bool)
  
      mu_star_masked = np.ma.masked_array(ungrouped_metric * group_matrix.T,
                                          mask=(group_matrix ^ 1).T)
      mean_of_mu_star = np.ma.mean(mu_star_masked, axis=1)
  
      return mean_of_mu_staf compute_grouped_metric(ungrouped_metric, group_matrix):
      '''
      Computes the mean value for the groups of parameter values in the
      argument ungrouped_metric
      '''
  
      group_matrix = np.array(group_matrix, dtype=np.bool)
  
      mu_star_masked = np.ma.masked_array(ungrouped_metric * group_matrix.T,
                                          mask=(group_matrix ^ 1).T)
      mean_of_mu_star = np.ma.mean(mu_star_masked, axis=1)
  
      return mean_of_mu_star
docs: Computes the mean value for the groups of parameter values in the
      argument ungrouped_metric