code: def _pruning_irep(pos, neg, rule):
      """
      Pruning literals in a rule
  
      Parameters
      ----------
      pos : const double[::1, :]
          Positive instances of pruning data set
      neg : const double[::1, :]
          Negative instances of pruning data set
      rule: list
          Input rule
  
      Returns
      -------
      double
          Pruned rule
      """
      return max(
          __last_sequences(rule, True, False),
          key=lambda rule_iter: irep_pm(
              np.count_nonzero(_rule_predict(pos, rule_iter)),
              np.count_nonzero(_rule_predict(neg, rule_iter)),
          ),
      )
  
file_path: AIX360/aix360/algorithms/rule_induction/ripper/pruning.py
imports: import numba
  import numpy
  from aix360.algorithms.rule_induction.ripper.binding import _rule_predict, _rule_list_predict
  from aix360.algorithms.rule_induction.ripper.mdl import _mdl
label_desc: Use image node_id 5 for calling a global function with example usage: _pruning_irep(pos, neg, rule) and returns: max