class_docstr: A helper ContextManager decorating a method with a custom function.
class_docstr_tok: ["A","helper","ContextManager","decorating","a","method","with","a","custom","function","."]
docstr: Create a new context manager decorating a function within its scope.
  
  This is a helper Context Manager that decorates a method of a class
  with a custom function.
  The decoration is only valid within the scope.
  :param classx: A class (object)
  :param method_name A string name of the method to be decorated
  :param decorator_func: The decorator function is responsible
   for calling the original method.
   The signature should be: func(instance, original_method,
   original_args, original_kwargs)
   when called, instance refers to an instance of classx and the
   original_method refers to the original method object which can be
   called.
   args and kwargs are arguments passed to the method
docstr_tok: ["Create","a","new","context","manager","decorating","a","function","within","its","scope",".","This","is","a","helper","Context","Manager","that","decorates","a","method","of","a","class","with","a","custom","function",".","The","decoration","is","only","valid","within","the","scope",".",":","param","classx",":","A","class","(","object",")",":","param","method_name","A","string","name","of","the","method","to","be","decorated",":","param","decorator_func",":","The","decorator","function","is","responsible","for","calling","the","original","method",".","The","signature","should","be",":","func","(","instance",",","original_method",",","original_args",",","original_kwargs",")","when","called",",","instance","refers","to","an","instance","of","classx","and","the","original_method","refers","to","the","original","method","object","which","can","be","called",".","args","and","kwargs","are","arguments","passed","to","the","method"]
code: def __init__(self, classx, method_name, decorator_func):
      """
      Create a new context manager decorating a function within its scope.
  
      This is a helper Context Manager that decorates a method of a class
      with a custom function.
      The decoration is only valid within the scope.
      :param classx: A class (object)
      :param method_name A string name of the method to be decorated
      :param decorator_func: The decorator function is responsible
       for calling the original method.
       The signature should be: func(instance, original_method,
       original_args, original_kwargs)
       when called, instance refers to an instance of classx and the
       original_method refers to the original method object which can be
       called.
       args and kwargs are arguments passed to the method
  
      """
      self.method_name = method_name
      self.decorator_func = decorator_func
      self.classx = classx
      self.patched_by_me = False
  
imports: import functools
label_desc: Use image node_id 1 to create a new ContextMethodDecorator object  with example: obj = ContextMethodDecorator(classx, method_name, decorator_func)