code: def enter_context(self, cm):
          
          # We look up the special methods on the type to match the with
          # statement.
          _cm_type = type(cm)
          _exit = _cm_type.__exit__
          result = _cm_type.__enter__(cm)
          self._push_cm_exit(cm, _exit)
          return result
docs: Enters the supplied context manager.
          If successful, also pushes its __exit__ method as a callback and
          returns the result of the __enter__ method.