Done here so it gets the right scope
961337
function maybeFireCallback() {
		// This function is called in any place where we might have completed a task that allows us to fire

		if (callbackFired) return;

		// If everything is ready, we *should* fire the callback, and it hasn't already been fired, then do so
		if (stdoutReady && stderrReady && wantCallback && !callbackFired) {
			callbackFired = true;
			callback(callbackErr, stdout);
		}
	}
538785
function fixrefs(scope, i) {
                        // do children first; order shouldn't matter
                        for (i = scope.children.length; --i >= 0;)
                                fixrefs(scope.children[i]);
                        for (i in scope.refs) if (HOP(scope.refs, i)) {
                                // find origin scope and propagate the reference to origin
                                for (var origin = scope.has(i), s = scope; s; s = s.parent) {
                                        s.refs[i] = origin;
                                        if (s === origin) break;
                                }
                        }
                }
744511
def scope= (new_scope)
      raise JSS::InvalidDataError, "JSS::Scopable::Scope instance required" unless new_criteria.kind_of?(JSS::Scopable::Scope)
      raise JSS::InvalidDataError, "Scope object must have target_key of :#{self.class::SCOPE_TARGET_KEY}" unless self.class::SCOPE_TARGET_KEY == new_scope.target_key
      @scope = new_scope
      @need_to_update = true
    end
1047780
def runDeferred(self, deferred):
        
        for handler, scope, offset in deferred:
            self.scopeStack = scope
            self.offset = offset
            handler()
262318
function() {
		var lastScope;

		// find the first reference scope
		var templateContext = this.getScope(function(scope) {
			lastScope = scope;
			return scope._context instanceof TemplateContext;
		});

		// if there is no reference scope, add one as the root
		if(!templateContext) {
			templateContext = new Scope(new TemplateContext());

			// add templateContext to root of the scope chain so it
			// can be found using `getScope` next time it is looked up
			lastScope._parent = templateContext;
		}
		return templateContext;
	}
100912
function attachToScope(scope, itemsToAttach) {
        if (!itemsToAttach || !itemsToAttach.length) { return; }

        itemsToAttach.push(function () {
            var i, val;
            for (i = 0; i < arguments.length; i++) {
                val = arguments[i];
                scope[itemsToAttach[i]] = val;
            }
        });

        $injector.invoke(itemsToAttach);
    }
299816
private void sawStore(int seen, int pc) {
        int reg = RegisterUtils.getStoreReg(this, seen);

        if (catchHandlers.get(pc)) {
            ignoreRegs.set(reg);
            ScopeBlock catchSB = findScopeBlock(rootScopeBlock, pc + 1);
            if ((catchSB != null) && (catchSB.getStart() < pc)) {
                ScopeBlock sb = new ScopeBlock(pc, catchSB.getFinish());
                catchSB.setFinish(getPC() - 1);
                rootScopeBlock.addChild(sb);
            }
        } else if (!monitorSyncPCs.isEmpty()) {
            ignoreRegs.set(reg);
        } else if (sawNull) {
            ignoreRegs.set(reg);
        } else if (isRiskyStoreClass(reg)) {
            ignoreRegs.set(reg);
        }

        if (!ignoreRegs.get(reg)) {
            ScopeBlock sb = findScopeBlock(rootScopeBlock, pc);
            if (sb != null) {
                UserObject assoc = null;
                if (stack.getStackDepth() > 0) {
                    OpcodeStack.Item srcItm = stack.getStackItem(0);
                    assoc = (UserObject) srcItm.getUserValue();
                    if (assoc == null) {
                        if (srcItm.getRegisterNumber() >= 0) {
                            assoc = new UserObject(srcItm.getRegisterNumber());
                        }
                    }
                }

                if ((assoc != null) && assoc.isRisky) {
                    ignoreRegs.set(reg);
                } else {
                    sb.addStore(reg, pc, assoc);
                    if (sawDup) {
                        sb.addLoad(reg, pc);
                    }
                }
            } else {
                ignoreRegs.set(reg);
            }
        }

        ScopeBlock sb = findScopeBlock(rootScopeBlock, pc);
        if (sb != null) {
            sb.markFieldAssociatedWrites(reg);
        }
    }
169304
def is_in_scope(cls, want_scope: str, have_scopes: List[Scope]) -> bool:
        
        if not want_scope:
            return True
        if want_scope in have_scopes or want_scope.split(':')[0] in have_scopes:
            return True
        elif want_scope.startswith('read'):
            return cls.is_in_scope(want_scope.replace('read', 'write'), have_scopes)
        elif want_scope.startswith('write'):
            return cls.is_in_scope(want_scope.replace('write', 'admin'), have_scopes)
        else:
            return False
730548
public void finalizeScope() {
            for (List<Scope> scopes = this.subScopes; scopes.nonEmpty(); scopes = scopes.tail) {
                Scope impScope = scopes.head;

                if (impScope instanceof FilterImportScope && impScope.owner.kind == Kind.TYP) {
                    WriteableScope finalized = WriteableScope.create(impScope.owner);

                    for (Symbol sym : impScope.getSymbols()) {
                        finalized.enter(sym);
                    }

                    finalized.listeners.add(new ScopeListener() {
                        @Override
                        public void symbolAdded(Symbol sym, Scope s) {
                            Assert.error("The scope is sealed.");
                        }

                        @Override
                        public void symbolRemoved(Symbol sym, Scope s) {
                            Assert.error("The scope is sealed.");
                        }
                    });

                    scopes.head = finalized;
                }
            }
        }
1024491
function determineUserScope (req, res, next) {
  var params = req.connectParams
  var scope = params.scope
  var subject = req.user

  Scope.determine(scope, subject, function (err, scope, scopes) {
    if (err) { return next(err) }
    req.scope = scope
    req.scopes = scopes
    next()
  })
}
1108147
function For(o){
	if(o === undefined) o = {};
	this._traversed = false;
	this._options = o;
	this._scope = new ForScope(this);
	this._catcher = null;
}
948294
def state_invariant_scope(self, state: Sequence[tf.Tensor]):
        '''
        '''
        scope = {}
        scope.update(self.non_fluents_scope())
        scope.update(self.state_scope(state))
        return scope
789745
function processScope(scope) {
  if (!isObject(scope) || scope._bsontype === 'ObjectID') {
    return scope;
  }

  const keys = Object.keys(scope);
  let key;
  const new_scope = {};

  for (let i = keys.length - 1; i >= 0; i--) {
    key = keys[i];
    if ('function' === typeof scope[key]) {
      new_scope[key] = new Code(String(scope[key]));
    } else {
      new_scope[key] = processScope(scope[key]);
    }
  }

  return new_scope;
}
1244298
function shouldDeoptBasedOnScope(binding, refPath) {
  if (binding.scope.path.isProgram() && refPath.scope !== binding.scope) {
    return true;
  }
  return false;
}
961873
private void popScope(boolean quietly) {
    if (!quietly && scopeCallback != null) {
      scopeCallback.exitScope(this);
    }
    Node scopeRoot;
    int roots = scopeRoots.size();
    if (roots > 0) {
      scopeRoot = scopeRoots.remove(roots - 1);
    } else {
      scopeRoot = scopes.pop().getRootNode();
    }
    if (NodeUtil.isValidCfgRoot(scopeRoot)) {
      cfgs.pop();
    }
  }
672802
function (fnc, scope) {
            scope = scope || this;

            for (var i = 0; i < this.$items.length; i++) {
                fnc.call(scope, this.$items[i], i, this.$items);
            }
        }
61126
private void sawLoad(int seen, int pc) {
        int reg = RegisterUtils.getLoadReg(this, seen);
        if (!ignoreRegs.get(reg)) {
            ScopeBlock sb = findScopeBlock(rootScopeBlock, pc);
            if (sb != null) {
                sb.addLoad(reg, pc);
            } else {
                ignoreRegs.set(reg);
            }
        }
    }