Tries to find the last value assigned to `name` in the scope created by
`scope`. We are not descending into any statements (blocks).
961666
function findLastAssignedValue(scope, name) {
  const results = [];

  traverseShallow(scope.path.node, {
    visitAssignmentExpression: function(path) {
      const node = path.node;
      // Skip anything that is not an assignment to a variable with the
      // passed name.
      if (
        !t.Identifier.check(node.left) ||
        node.left.name !== name ||
        node.operator !== '='
      ) {
        return this.traverse(path);
      }
      results.push(path.get('right'));
      return false;
    },
  });

  if (results.length === 0) {
    return null;
  }
  return resolveToValue(results.pop());
}
1324359
def lastChild(self):
        '''
            
        '''
        blocks = object.__getattribute__(self, 'blocks')
        # First block is empty string for indent, but don't hardcode incase that changes
        if blocks[0] == '':
           firstIdx = 1
        else:
           firstIdx = 0

        if len(blocks) <= firstIdx:
            return None

        return blocks[-1]
1093635
def lookup_in_scope(name, scope)
      loop do
        tn = scope.path_with_task_name(name)
        task = @tasks[tn]
        return task if task
        break if scope.empty?
        scope = scope.tail
      end
      nil
    end
784435
@Nullable
    private ScopeBlock findPreviousSiblingScopeBlock(ScopeBlock sb) {
        ScopeBlock parent = sb.getParent();
        if (parent == null) {
            return null;
        }

        List<ScopeBlock> children = parent.getChildren();
        if (children == null) {
            return null;
        }

        ScopeBlock lastSibling = null;
        for (ScopeBlock sibling : children) {
            if (sibling.equals(sb)) {
                return lastSibling;
            }
            lastSibling = sibling;
        }

        return null;
    }
313289
private static boolean hasBlockScopedVarsFollowing(Node start) {
    for (Node n = start.getNext(); n != null; n = n.getNext()) {
      if (n.isLet() || n.isConst()) {
        return true;
      }
    }
    return false;
  }
151393
def Scope(value) # rubocop:disable Naming/MethodName
      case value
      when ObjectInspector::Scope
        value
      else
        ObjectInspector::Scope.new(value)
      end
    end
522445
private String getNarrowestScope(FacesContext facesContext, String valueExpression)
    {
        List<String> expressions = extractExpressions(valueExpression);
        // exclude NONE scope, if there are more than one ValueExpressions (see Spec for details)
        String narrowestScope = expressions.size() == 1 ? NONE : APPLICATION;
        boolean scopeFound = false;
        
        for (String expression : expressions)
        {
            String valueScope = getScope(facesContext, expression);
            if (valueScope == null)
            {
                continue;
            }
            // we have found at least one valid scope at this point
            scopeFound = true;
            if (SCOPE_COMPARATOR.compare(valueScope, narrowestScope) < 0)
            {
                narrowestScope = valueScope;
            }
        }
        
        return scopeFound ? narrowestScope : null;
    }
496056
private ScopeBlock findSynchronizedScopeBlock(ScopeBlock sb, int monitorEnterPC) {

        ScopeBlock monitorBlock = sb;

        if (sb.hasChildren()) {
            for (ScopeBlock child : sb.getChildren()) {
                if (child.isSync() && (child.getStart() > monitorBlock.getStart())) {
                    monitorBlock = child;
                    monitorBlock = findSynchronizedScopeBlock(monitorBlock, monitorEnterPC);
                }
            }
        }

        return monitorBlock;
    }
565495
protected int findValue( Object name)
    {
    int valueCount = values_.size();
    int i;
    for( i = 0; i < valueCount && !Objects.equals( name, values_.get(i).getName()); i++);
    return i < valueCount? i : -1;
    }
741213
def findScopedPar(theDict, scope, name):
    
    # Do not search (like findFirstPar), but go right to the correct
    # sub-section, and pick it up.  Assume it is there as stated.
    if len(scope):
        theDict = theDict[scope] # ! only goes one level deep - enhance !
    return theDict, theDict[name]
1062410
def variable(
            self,
            name=None,
            function=None,
            decl_type=None,
            header_dir=None,
            header_file=None,
            recursive=None):
        """"""

        return (
            self._find_single(
                self._impl_matchers[
                    scopedef_t.variable],
                name=name,
                function=function,
                decl_type=decl_type,
                header_dir=header_dir,
                header_file=header_file,
                recursive=recursive)
        )
672899
def get_scope_name(self):
        
        name = 'validate_' + unquote(self.resolution_scope).replace('~1', '_').replace('~0', '_')
        name = re.sub(r'[:/#\.\-\%]', '_', name)
        name = name.lower().rstrip('_')
        return name
1208999
function (fnc, scope) {
            scope = scope || this;
            var b = false,
                items = this.$items,
                length = items.length;

            for (var i = 0; i < length; i++) {
                b = fnc.call(scope, items[i], i, this.$items);
                if (b === true) {
                    break;
                }
            }

            return i < length ? items[i] : null;
        }
327248
public VarValueDef getValue( Object name)
    {
    int i = findValue( name);
    return i >= 0? values_.get(i) : null;
    }
749404
function () {
      let scope = context.getScope();
      while (scope && scope.type !== 'class') {
        scope = scope.upper;
      }
      const node = scope && scope.block;
      if (!node || !utils.isES6Component(node)) {
        return null;
      }
      return node;
    }
491519
def get_last_block(working_dir):
    

    # make this usable even if we haven't explicitly configured virtualchain 
    impl = sys.modules[__name__]
    return BlockstackDB.get_lastblock(impl, working_dir)
226316
public function getLastInsertId($name = NULL)
	{
		$query = $this->query("SELECT SCOPE_IDENTITY() AS Result");
		
		if(!$query)
			return false;
			
		return intval($this->fetch($query, LikePDO::FETCH_OBJ)->Result);
	}