Decide whether we have a template argument list ahead. This actually requires
infinite lookahead but, in practice, is pretty minimal work.

@param scope
@return
186658
public boolean skipTemplate(EnclosingScope scope) {
		int start = index;
		if (tryAndMatch(false, LeftAngle) == null) {
			return true;
		} else {
			boolean firstTime = true;
			while (tryAndMatch(false, RightAngle) == null) {
				if (!firstTime && tryAndMatch(false,Comma) == null) {
					// Failed to match a comma.  Something is wrong
					index = start;
					return false;
				} else if (!skipLifetimeIdentifier(scope) && !skipType(scope)) {
					index = start;
					return false;
				}
				firstTime = false;
			}
		}
		//
		return true;
	}
169402
protected void setScope(String scope) {
        requireArgument(scope != null && !scope.isEmpty(), "Scope cannot be null or empty.");
        _scope = scope;
    }
704282
public static PredicateTemplate predicateTemplate(Template template, List<?> args) {
        return new PredicateTemplate(template, ImmutableList.copyOf(args));
    }
560186
public static TypeBinding skipResolveInitializerIfAlreadyCalled(Expression expr, BlockScope scope) {
		if (expr.resolvedType != null) return expr.resolvedType;
		try {
			return expr.resolveType(scope);
		} catch (NullPointerException e) {
			return null;
		} catch (ArrayIndexOutOfBoundsException e) {
			// This will occur internally due to for example 'val x = mth("X");', where mth takes 2 arguments.
			return null;
		}
	}
1268478
private void tryReplaceArguments(Scope scope) {
    // Find the number of parameters that can be accessed without using `arguments`.
    Node parametersList = NodeUtil.getFunctionParameters(scope.getRootNode());
    checkState(parametersList.isParamList(), parametersList);
    int numParameters = parametersList.getChildCount();

    // Determine the highest index that is used to make an access on `arguments`. By default, assume
    // that the value is the number of parameters to the function.
    int highestIndex = getHighestIndex(numParameters - 1);
    if (highestIndex < 0) {
      return;
    }

    ImmutableSortedMap<Integer, String> argNames =
        assembleParamNames(parametersList, highestIndex + 1);
    changeMethodSignature(argNames, parametersList);
    changeBody(argNames);
  }
7578
public CompletableFuture<CreateScopeStatus> createScope(final String scope) {
        Exceptions.checkNotNullOrEmpty(scope, "scope");
        try {
            NameUtils.validateScopeName(scope);
        } catch (IllegalArgumentException | NullPointerException e) {
            log.warn("Create scope failed due to invalid scope name {}", scope);
            return CompletableFuture.completedFuture(CreateScopeStatus.newBuilder().setStatus(
                    CreateScopeStatus.Status.INVALID_SCOPE_NAME).build());
        }
        return streamStore.createScope(scope);
    }
123345
public Observable<Page<RoleAssignmentInner>> listForScopeAsync(final String scope) {
        return listForScopeWithServiceResponseAsync(scope)
            .map(new Func1<ServiceResponse<Page<RoleAssignmentInner>>, Page<RoleAssignmentInner>>() {
                @Override
                public Page<RoleAssignmentInner> call(ServiceResponse<Page<RoleAssignmentInner>> response) {
                    return response.body();
                }
            });
    }
128513
private List<Artifact> getScopeArtifacts( final MavenProject project, final String scope )
    {
        if ( SCOPE_COMPILE.equals( scope ) )
        {
            return project.getCompileArtifacts();
        }
        if ( SCOPE_RUNTIME.equals( scope ) )
        {
            return project.getRuntimeArtifacts();
        }
        else if ( SCOPE_TEST.equals( scope ) )
        {
            return project.getTestArtifacts();
        }
        else
        {
            throw new RuntimeException( "Not allowed scope " + scope );
        }
    }
278970
def has_variable?(var)
      @stack.reverse_each do |scope|
        if SCOPE_BLOCKER_9000 == scope
          return false
        elsif scope.include?(var)
          return true
        end
      end
    end
335055
protected boolean lookahead() {
        assert next == null : "looking ahead when next is already loaded";
        while(inner.hasNext()) {
            next = transform(inner.next());
            if(next!=null) {
                return true;
            }
        }
        noteExhausted();
        return false;
    }
1324300
protected boolean hasDanglingScope(Attributes a) {
        return (a.getValue(SCOPE) != null && a.getValue(VAR) == null);
    }
745561
function evalList(scope, list) {
  const length = list.length;
  const result = [];
  for (let i = 0; i < length; i++) {
    result[i] = list[i].evaluate(scope);
  }
  return result;
}
190539
public void setScope(String scope) {
        if (scope.equalsIgnoreCase("page")) {
            this.scope = PageContext.PAGE_SCOPE;
        } else if (scope.equalsIgnoreCase("request")) {
            this.scope = PageContext.REQUEST_SCOPE;
        } else if (scope.equalsIgnoreCase("session")) {
            this.scope = PageContext.SESSION_SCOPE;
        } else if (scope.equalsIgnoreCase("application")) {
            this.scope = PageContext.APPLICATION_SCOPE;
        }
        // TODO: Add error handling?  Needs direction from spec.
    }
1102873
def has_scope(self, scope):
        """"""
        if not self.is_oauth_session():
            return False
        if '*' in self._authentication:
            return True
        if isinstance(scope, six.string_types):
            scope = [scope]
        return all(s in self._authentication for s in scope)
970003
public Object eval(Scope scope) {
		Object value = expr.eval(scope);
		if (value == null) {
			if (scope.getCtrl().isNullSafe()) {
				return null;
			}
			throw new TemplateException("The parameter of \"" + op.value() + "\" operator can not be blank", location);
		}
		if (! (value instanceof Number) ) {
			throw new TemplateException(op.value() + " operator only support int long float double BigDecimal type", location);
		}
		
		switch (op) {
		case ADD:
			return value;
		case SUB:
			Number n = (Number)value;
			if (n instanceof Integer) {
                return Integer.valueOf(-n.intValue());
            }
			if (n instanceof Long) {
                return Long.valueOf(-n.longValue());
            }
			if (n instanceof Float) {
                return Float.valueOf(-n.floatValue());
            }
			if (n instanceof Double) {
                return Double.valueOf(-n.doubleValue());
            }
			if (n instanceof BigDecimal) {
            	return ((BigDecimal)n).negate();
			}
            throw new TemplateException("Unsupported data type: " + n.getClass().getName(), location);
		default :
			throw new TemplateException("Unsupported operator: " + op.value(), location);
		}
	}
314831
function(context, args, stack) {
		var name = args[0],
			template = args[1];
		if (template)
			firstPass(template, context, stack); // traverse tag template with frstPass
	}
685727
function(currentScope){
		var currentContext = currentScope._context;
		if(currentContext instanceof TemplateContext) {
			return true;
		} else if( !canHaveProperties(currentContext) ) {
			return true;
		}
		return false;
	}