code: def make_tuples(previous_best, state):
      # alters state, computes support for new tuples
      normalize_tuple = lambda x: tuple(sorted(set(x)))  # noqa
      all_features = range(state["n_features"])
      coverage_data = state["coverage_data"]
      current_idx = state["current_idx"]
      data = state["data"][:current_idx]
      labels = state["labels"][:current_idx]
      if len(previous_best) == 0:
          tuples = [(x,) for x in all_features]
          for x in tuples:
              pres = data[:, x[0]].nonzero()[0]
              # NEW
              state["t_idx"][x] = set(pres)
              state["t_nsamples"][x] = float(len(pres))
              state["t_positives"][x] = float(labels[pres].sum())
              state["t_order"][x].append(x[0])
              # NEW
              state["t_coverage_idx"][x] = set(
                  coverage_data[:, x[0]].nonzero()[0]
              )
              state["t_coverage"][x] = (
                  float(len(state["t_coverage_idx"][x]))
                  / coverage_data.shape[0]
              )
          return tuples
      new_tuples = set()
      for f in all_features:
          for t in previous_best:
              new_t = normalize_tuple(t + (f,))
              if len(new_t) != len(t) + 1:
                  continue
              if new_t not in new_tuples:
                  new_tuples.add(new_t)
                  state["t_order"][new_t] = copy.deepcopy(
                      state["t_order"][t]
                  )
                  state["t_order"][new_t].append(f)
                  state["t_coverage_idx"][new_t] = state[
                      "t_coverage_idx"
                  ][t].intersection(state["t_coverage_idx"][(f,)])
                  state["t_coverage"][new_t] = (
                      float(len(state["t_coverage_idx"][new_t]))
                      / coverage_data.shape[0]
                  )
                  t_idx = np.array(list(state["t_idx"][t]))
                  t_data = state["data"][t_idx]
                  present = np.where(t_data[:, f] == 1)[0]
                  state["t_idx"][new_t] = set(t_idx[present])
                  idx_list = list(state["t_idx"][new_t])
                  state["t_nsamples"][new_t] = float(len(idx_list))
                  state["t_positives"][new_t] = np.sum(
                      state["labels"][idx_list]
                  )
      return list(new_tuples)
  
file_path: anchor/anchor/anchor_base.py
imports: from __future__ import print_function
  import numpy
  import operator
  import copy
  import sklearn
  import collections
label_desc: Use image node_id 7 for calling the AnchorBaseBeam obj's underlying member method code with example usage: obj.make_tuples(previous_best, state) and returns: list, tuples