docstr: Deferred execution decorator, designed to wrap class functions for classes containing a deferred execution pool.
  :param condition_or_attr_name: Condition controlling whether wrapped function should be deferred.
      True by default. If a callable is provided, it will be called with the class instance (self)
      as first argument. If a string is provided, a class instance (self) attribute by that name is evaluated.
  :return:
docstr_tok: ["Deferred","execution","decorator",",","designed","to","wrap","class","functions","for","classes","containing","a","deferred","execution","pool",".",":","param","condition_or_attr_name",":","Condition","controlling","whether","wrapped","function","should","be","deferred",".","True","by","default",".","If","a","callable","is","provided",",","it","will","be","called","with","the","class","instance","(","self",")","as","first","argument",".","If","a","string","is","provided",",","a","class","instance","(","self",")","attribute","by","that","name","is","evaluated",".",":","return",":"]
code: def defer_execution(self, condition_or_attr_name=True):
      """
      Deferred execution decorator, designed to wrap class functions for classes containing a deferred execution pool.
      :param condition_or_attr_name: Condition controlling whether wrapped function should be deferred.
          True by default. If a callable is provided, it will be called with the class instance (self)
          as first argument. If a string is provided, a class instance (self) attribute by that name is evaluated.
      :return:
      """
  
      def decorator(func):
          @wraps(func)
          def wrapper(instance, *args, **kwargs):
              if self._resolve_condition(
                  instance, condition_or_attr_name
              ):
                  self._pools[instance].add(func, *args, **kwargs)
              else:
                  return func(instance, *args, **kwargs)
  
          return wrapper
  
      return decorator
  
imports: import threading
  from functools import wraps
  import attr
  import six
label_desc: Use image node_id 3 for calling the DeferredExecution obj's underlying member method code with example usage: obj.defer_execution(condition_or_attr_name) and returns: decorator, wrapper, func