def pop(self, apply_staged=False, clear_staged=False, discard=False):
        from . import caching


        if not discard:
            self.staged.insert(0, self.stack.pop())
        else:
            self.stack.pop()

        if apply_staged:
            while self.staged:
                to_apply = self.staged.pop()
                keys = to_apply.reverse_cache.keys()
                if keys:
                    # This assumes that all keys are in the same namespace, which is almost definitely
                    # going to be the case, but it feels a bit dirty
                    namespace = keys[0].namespace() or None
                    caching.remove_entities_from_cache_by_key(
                        keys, namespace=namespace, memcache_only=True
                    )

                self.top.apply(to_apply)

        if clear_staged or len(self.stack) == 1:
            self.staged = []
a.__init__(...)
dataset/ETHPy150Open potatolondon/djangae/djangae/db/backends/appengine/context.py/ContextStack.pop--crossover with--dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/util/arrays.py/Array.__init__