code: def __init__(self, model, actions):
      self.model = model
      warnings.warn(
          "Note that ActionOptimizer is still in an alpha state and is subjust to API changes."
      )
      # actions go into mutually exclusive groups
      self.action_groups = []
      for group in actions:
          if issubclass(type(group), Action):
              group._group_index = len(self.action_groups)
              group._grouped_index = 0
              self.action_groups.append([copy.copy(group)])
          elif issubclass(type(group), list):
              group = sorted(
                  [copy.copy(v) for v in group], key=lambda a: a.cost
              )
              for i, v in enumerate(group):
                  v._group_index = len(self.action_groups)
                  v._grouped_index = i
              self.action_groups.append(group)
          else:
              raise InvalidAction(
                  "A passed action was not an Action or list of actions!"
              )
  
file_path: shap/shap/actions/_optimizer.py
imports: import copy
  import queue
  import warnings
  from ..utils._exceptions import ConvergenceError, InvalidAction
  from ._action import Action
label_desc: Use image node_id 1 to create a new ActionOptimizer object  with example: obj = ActionOptimizer(model, actions)