code: public Collection getScopeFor(Collection.Key key, Scope defaultValue) {
  	Object rtn = null;
  
  	if (checkArguments) {
  	    rtn = local.get(key, NullSupportHelper.NULL());
  	    if (rtn != NullSupportHelper.NULL()) return local;
  	    rtn = argument.getFunctionArgument(key, NullSupportHelper.NULL());
  	    if (rtn != NullSupportHelper.NULL()) return argument;
  	}
  
  	// get data from queries
  	if (allowImplicidQueryCall && pc.getCurrentTemplateDialect() == CFMLEngine.DIALECT_CFML && !qryStack.isEmpty()) {
  	    QueryColumn qc = qryStack.getColumnFromACollection(key);
  	    if (qc != null) return (Query) qc.getParent();
  	}
  
  	// variable
  	rtn = variable.get(key, NullSupportHelper.NULL());
  	if (rtn != NullSupportHelper.NULL()) {
  	    return variable;
  	}
  
  	// thread scopes
  	if (pc.hasFamily()) {
  	    Threads t = (Threads) pc.getThreadScope(key, NullSupportHelper.NULL());
  	    if (rtn != NullSupportHelper.NULL()) return t;
  	}
  
  	// get a scope value (only cfml is searcing additional scopes)
  	if (pc.getCurrentTemplateDialect() == CFMLEngine.DIALECT_CFML) {
  	    for (int i = 0; i < scopes.length; i++) {
  		rtn = scopes[i].get(key, NullSupportHelper.NULL());
  		if (rtn != NullSupportHelper.NULL()) {
  		    return scopes[i];
  		}
  	    }
  	}
  	return defaultValue;
      }
docs: returns the scope that contains a specific key
  
  @param key
  @return