class_docstr: Decorator pattern. It simply iterates the method of its member as many times as needed.
  It thus extends any class to apply its methods to a list of arguments.
class_docstr_tok: ["Decorator","pattern",".","It","simply","iterates","the","method","of","its","member","as","many","times","as","needed",".","It","thus","extends","any","class","to","apply","its","methods","to","a","list","of","arguments","."]
docstr: Delegate the call to a function with arguments to its member.
  The function is executed as many times as there are elements in the first argument,
  which should be a list.
  
  Parameters
  ----------
  func : string
      Name of the method to apply.
  first_arg : list
      contains arguments to specify to each call of method
      if first_arg is a list of tuple, the delegate function use each element of tuple as
      an argument
  other_args : str, list, pd.DataFrame, array (optional)
      any argument that method needs
      notice: other_args is constant for each call of method
  
  Returns
  -------
  list
      Result of the function applied iteratively to all elements of the first argument.
docstr_tok: ["Delegate","the","call","to","a","function","with","arguments","to","its","member",".","The","function","is","executed","as","many","times","as","there","are","elements","in","the","first","argument",",","which","should","be","a","list",".","Parameters","--","--","--","--","--","func",":","string","Name","of","the","method","to","apply",".","first_arg",":","list","contains","arguments","to","specify","to","each","call","of","method","if","first_arg","is","a","list","of","tuple",",","the","delegate","function","use","each","element","of","tuple","as","an","argument","other_args",":","str",",","list",",","pd.DataFrame",",","array","(","optional",")","any","argument","that","method","needs","notice",":","other_args","is","constant","for","each","call","of","method","Returns","--","--","--","-","list","Result","of","the","function","applied","iteratively","to","all","elements","of","the","first","argument","."]
code: def delegate(self, func, *args, **kwargs):
      """
      Delegate the call to a function with arguments to its member.
      The function is executed as many times as there are elements in the first argument,
      which should be a list.
  
      Parameters
      ----------
      func : string
          Name of the method to apply.
      first_arg : list
          contains arguments to specify to each call of method
          if first_arg is a list of tuple, the delegate function use each element of tuple as
          an argument
      other_args : str, list, pd.DataFrame, array (optional)
          any argument that method needs
          notice: other_args is constant for each call of method
  
      Returns
      -------
      list
          Result of the function applied iteratively to all elements of the first argument.
      """
      self.check_args(args, func)
      method = getattr(self.member, func)
      self.check_method(method, func)
      first_arg, other_args = args[0], args[1:]
      self.check_first_arg(first_arg, func)
      if isinstance(first_arg[0], tuple):
          output_list = [
              method(*elem, *other_args, **kwargs) for elem in first_arg
          ]
      else:
          output_list = [
              method(elem, *other_args, **kwargs) for elem in first_arg
          ]
      return output_list
  
file_path: shapash/shapash/explainer/multi_decorator.py
imports: from shapash.explainer.smart_state import SmartState
label_desc: Use image node_id 3 for calling the MultiDecorator obj's underlying member method code with example usage: obj.delegate(func) and returns: output_list