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: Enters the supplied context manager
  
  If successful, also pushes its __exit__ method as a callback and
  returns the result of the __enter__ method.
docstr_tok: ["Enters","the","supplied","context","manager","If","successful",",","also","pushes","its","__exit__","method","as","a","callback","and","returns","the","result","of","the","__enter__","method","."]
code: def enter_context(self, cm):
      """Enters the supplied context manager
  
      If successful, also pushes its __exit__ method as a callback and
      returns the result of the __enter__ method.
      """
      # We look up the special methods on the type to match the with statement
      _cm_type = _get_type(cm)
      _exit = _cm_type.__exit__
      result = _cm_type.__enter__(cm)
      self._push_cm_exit(cm, _exit)
      return result
  
imports: import abc
  import sys
  import warnings
  from collections import deque
  from functools import wraps
label_desc: Use image node_id 6 for calling the ExitStack obj's underlying member method code with example usage: obj.enter_context(cm) and returns: result