docstr: Decorator for applying deferred execution pool before wrapped function is executed
  :param condition_or_attr_name: Condition controlling whether deferred pool should be applied. 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.
docstr_tok: ["Decorator","for","applying","deferred","execution","pool","before","wrapped","function","is","executed",":","param","condition_or_attr_name",":","Condition","controlling","whether","deferred","pool","should","be","applied",".","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","."]
code: def apply_before(self, condition_or_attr_name=True):
      """
      Decorator for applying deferred execution pool before wrapped function is executed
      :param condition_or_attr_name: Condition controlling whether deferred pool should be applied. 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.
      """
  
      def decorator(func):
          @wraps(func)
          def wrapper(instance, *args, **kwargs):
              self._apply(instance, condition_or_attr_name)
              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 7 for calling the DeferredExecution obj's underlying member method code with example usage: obj.apply_before(condition_or_attr_name) and returns: decorator, wrapper, func