class_docstr: Context manager for dynamic management of a stack of exit callbacks
  
  For example:
  
      with ExitStack() as stack:
          files = [stack.enter_context(open(fname)) for fname in filenames]
          # All opened files will automatically be closed at the end of
          # the with statement, even if attempts to open files later
          # in the list raise an exception
class_docstr_tok: ["Context","manager","for","dynamic","management","of","a","stack","of","exit","callbacks","For","example",":","with","ExitStack","(",")","as","stack",":","files","=","[","stack.enter_context","(","open","(","fname",")",")","for","fname","in","filenames","]","#","All","opened","files","will","automatically","be","closed","at","the","end","of","#","the","with","statement",",","even","if","attempts","to","open","files","later","#","in","the","list","raise","an","exception"]
docstr: Registers an arbitrary callback and arguments.
  
  Cannot suppress exceptions.
docstr_tok: ["Registers","an","arbitrary","callback","and","arguments",".","Can","not","suppress","exceptions","."]
code: def callback(self, callback, *args, **kwds):
      """Registers an arbitrary callback and arguments.
  
      Cannot suppress exceptions.
      """
  
      def _exit_wrapper(exc_type, exc, tb):
          callback(*args, **kwds)
  
      # We changed the signature, so using @wraps is not appropriate, but
      # setting __wrapped__ may still help with introspection
      _exit_wrapper.__wrapped__ = callback
      self.push(_exit_wrapper)
      return callback
  
imports: import abc
  import sys
  import warnings
  from collections import deque
  from functools import wraps
label_desc: Use image node_id 5 for calling the ExitStack obj's underlying member method code with example usage: obj.callback(callback) and returns: callback