Returns all the references made from this scope and all child scopes to
variables declared outside of this scope.
320748
public VariableRef[] getOutOfScopeVariableRefs() {
        Scope parent;
        if ((parent = getParent()) == null) {
            return new VariableRef[0];
        }

        Collection<VariableRef> allRefs = new ArrayList<VariableRef>();
        fillVariableRefs(allRefs, this);

        Collection<VariableRef> refs =
            new ArrayList<VariableRef>(allRefs.size());

        Iterator<VariableRef> it = allRefs.iterator();
        while (it.hasNext()) {
            VariableRef ref = it.next();
            Variable var = ref.getVariable();
            if (var != null &&
                parent.getDeclaredVariable(var.getName()) == var) {
                refs.add(ref);
            }
        }

        VariableRef[] refsArray = new VariableRef[refs.size()];
        return refs.toArray(refsArray);
    }
1247834
public Map<String, Object> getVariables() {
    final HashMap<String, Object> map = new HashMap<String, Object>();
    if (inherited != null)
      map.putAll(inherited.getVariables());
    if (variables != null)
      map.putAll(variables);
    return map;
  }
1193836
def local_scope(self):
        
        self.scope = self.scope.new_child()
        try:
            yield self.scope
        finally:
            self.scope = self.scope.parents
1073818
private void traverseAndRemoveUnusedReferences(Node root) {
    // Create scope from parent of root node, which also has externs as a child, so we'll
    // have extern definitions in scope.
    Scope scope = scopeCreator.createScope(root.getParent(), null);
    if (!scope.hasSlot(NodeUtil.JSC_PROPERTY_NAME_FN)) {
      // TODO(b/70730762): Passes that add references to this should ensure it is declared.
      // NOTE: null input makes this an extern var.
      scope.declare(
          NodeUtil.JSC_PROPERTY_NAME_FN, /* no declaration node */ null, /* no input */ null);
    }
    worklist.add(new Continuation(root, scope));
    while (!worklist.isEmpty()) {
      Continuation continuation = worklist.remove();
      continuation.apply();
    }

    removeUnreferencedVarsAndPolyfills();
    removeIndependentlyRemovableProperties();
    for (Scope fparamScope : allFunctionParamScopes) {
      removeUnreferencedFunctionArgs(fparamScope);
    }
  }
1291811
function references(node, scope, state) {
  var declared = state.letRefs[node.name];
  if (!declared) return false;

  // declared node is different in this scope
  return scope.getBindingIdentifier(node.name) === declared;
}
1318090
def get_all(self):
        
        if not self.vars:
            return self.parent
        if not self.parent:
            return self.vars
        return dict(self.parent, **self.vars)
857863
def scopes(self):
        
        if not self.__scopes:
            self.__scopes = Scopes(self.__connection)
        return self.__scopes
965648
public Map<String, Variable> getDeclaredVariables() {
        if (declaredVariables == Collections.EMPTY_MAP) {
            return declaredVariables;
        } else {
            return Collections.unmodifiableMap(declaredVariables);
        }
    }
275160
def get_parent_var(name, global_ok=False, default=None, skip_frames=0):
    

    scope = get_parent_scope_from_var(name, global_ok=global_ok, skip_frames=skip_frames + 1)

    if not scope:
        return default

    if name in scope.locals:
        return scope.locals.get(name, default)

    return scope.globals.get(name, default)
184948
public VariableMap getAndClearCachedLocalVariableMap() {
    VariableMap cachedVariablesLocal = associationManager.getCachedLocalVariables();
    VariableMap copy = new VariableMapImpl(cachedVariablesLocal);
    cachedVariablesLocal.clear();
    return copy;
  }
429161
private List<Reference> getAllOneReferences(DomainObject domainObject) {
		List<Reference> allReferences = domainObject.getReferences();
		List<Reference> allOneReferences = new ArrayList<Reference>();
		for (Reference ref : allReferences) {
			if (!ref.isMany()) {
				allOneReferences.add(ref);
			}
		}
		return allOneReferences;
	}
250813
def _get_scope_with_mangled(self, name):
        """"""
        scope = self
        while True:
            parent = scope.get_enclosing_scope()
            if parent is None:
                return

            if name in parent.rev_mangled:
                return parent

            scope = parent
454809
function getAllReferences() {
  return _.reduce(
    this.getInheritanceChain(),
    (acc, cls) => _.reduce(cls.references, (acc2, v, k) => {acc2[k] = v; return acc2}, acc),
    {})
}
677546
public VariableRef[] getVariableRefs() {
        Collection<VariableRef> allRefs = new ArrayList<VariableRef>();
        fillVariableRefs(allRefs, this);
        return allRefs.toArray(new VariableRef[allRefs.size()]);
    }
979063
public final List<ObjectVariable> getObjectVariables() {
    List<ObjectVariable> objectVars = new ArrayList<ObjectVariable>();
    for (int i = 0; i < vars.length; i++) {
      if (vars[i] instanceof ObjectVariable) {
        objectVars.add((ObjectVariable) vars[i]);
      }
    }
    return objectVars;
  }
1311647
protected function _globalScopes()
    {
        if ($this->companyAttribute) {
            
            $this->getBuilder()->where(
                $this->_field($this->companyAttribute), 
                $this->user->getCompanyID();
                );
        }
        
        if ($this->userAttribute) {
            
            $this->getBuilder()->where(
                $this->_field($this->userAttribute), 
                $this->user->getID();
                );
        }
        return parent::_globalScopes();
    }
898537
def scope_choices(self, exclude_internal=True):
        
        return [
            (k, scope) for k, scope in sorted(self.scopes.items())
            if not exclude_internal or not scope.is_internal
        ]