Transform bindings from the current context to a context that can be evaluated within the view. Returns null if the path shouldn't be changed.  TODO: consider the addition of a prefix that would allow this method to return `path`.
165071
function(path, data) {
        var normalized = normalizePath(null, path, data);
        if (normalized.isKeyword) {
          return 'templateData.keywords.' + path;
        } else if (isGlobalPath(path)) {
          return null;
        } else if (path === 'this' || path === '') {
          return '_parentView.context';
        } else {
          return '_parentView.context.' + path;
        }
      }
1344593
function bind(property, options, preserveContext, shouldDisplay, valueNormalizer) {
  var data = options.data,
      fn = options.fn,
      inverse = options.inverse,
      view = data.view,
      currentContext = this,
      pathRoot, path, normalized;

  normalized = normalizePath(currentContext, property, data);

  pathRoot = normalized.root;
  path = normalized.path;

  // Set up observers for observable objects
  if ('object' === typeof this) {
    // Create the view that will wrap the output of this template/property
    // and add it to the nearest view's childViews array.
    // See the documentation of Ember._HandlebarsBoundView for more.
    var bindView = view.createChildView(Ember._HandlebarsBoundView, {
      preserveContext: preserveContext,
      shouldDisplayFunc: shouldDisplay,
      valueNormalizerFunc: valueNormalizer,
      displayTemplate: fn,
      inverseTemplate: inverse,
      path: path,
      pathRoot: pathRoot,
      previousContext: currentContext,
      isEscaped: !options.hash.unescaped,
      templateData: options.data
    });

    view.appendChild(bindView);

    /** @private */
    var observer = function() {
      Ember.run.once(bindView, 'rerenderIfNeeded');
    };

    // Observes the given property on the context and
    // tells the Ember._HandlebarsBoundView to re-render. If property
    // is an empty string, we are printing the current context
    // object ({{this}}) so updating it is not our responsibility.
    if (path !== '') {
      Ember.addObserver(pathRoot, path, observer);
    }
  } else {
    // The object is not observable, so just render it out and
    // be done with it.
    data.buffer.push(getPath(pathRoot, path, options));
  }
}
717864
public void setContextPath(String contextPath) {
		if (StringUtils.isNotEmpty(contextPath)) {
			if (contextPath.charAt(0) != '/') {
				contextPath = '/' + contextPath;
			}
			if (contextPath.charAt(contextPath.length() - 1) != '/') {
				contextPath = contextPath + '/';
			}
			this.contextPath = contextPath;
		} else {
			this.contextPath = null;
		}
	}
1333465
def render_path(self, template_path, *context, **kwargs):
        
        loader = self._make_loader()
        template = loader.read(template_path)

        return self._render_string(template, *context, **kwargs)
1241156
private static Map<String, ValueExpression> restoreBindings(FacesContext context,
                                                                Object state) {

        // Note: This code is copied from UIComponentBase.  See note above
        // in saveBindings().

        if (state == null) {
            return (null);
        }
        Object values[] = (Object[]) state;
        String names[] = (String[]) values[0];
        Object states[] = (Object[]) values[1];
        Map<String, ValueExpression> bindings = new HashMap<String, ValueExpression>(names.length);
        for (int i = 0; i < names.length; i++) {
            bindings.put(names[i],
                    (ValueExpression) UIComponentBase.restoreAttachedState(context, states[i]));
        }
        return (bindings);
    }
1200440
function Context(view, parentContext) {
    this.view = view == null ? {} : view;
    this.cache = { '.': this.view };
    this.parent = parentContext;
  }
859017
public static void contextPath(String context) {
        if (S.blank(context)) ctx = "";
        else {
            E.illegalArgumentIf(!context.startsWith("/"), "context path should start with \"/\"");
            if (context.endsWith("/")) {
                ctx = S.str(context).beforeLast("/").toString();
            }
        }
    }
1146072
function() {
			if (!this.metaPath) {
				this.oMetaContext = this.oMetaModel.getMetaContext(this.path);
				this.metaPath = this.oMetaContext.getPath();
			} else {
				this.oMetaContext = this.oMetaModel.createBindingContext(this.metaPath);
			}
		}
634073
def context_binding(variables)
      context = TemplateEvaluationContext.new

      helpers.each { |helper| context.extend(helper) }

      variables.each do |k, v|
        context.instance_variable_set("@#{k}", v)
      end

      context.__get_binding
    end
1362939
private void routeHandle(RouteContext context) {
        Object target = context.routeTarget();
        if (null == target) {
            Class<?> clazz = context.routeAction().getDeclaringClass();
            target = WebContext.blade().getBean(clazz);
        }
        if (context.targetType() == RouteHandler.class) {
            RouteHandler routeHandler = (RouteHandler) target;
            routeHandler.handle(context);
        } else if (context.targetType() == RouteHandler0.class) {
            RouteHandler0 routeHandler = (RouteHandler0) target;
            routeHandler.handle(context.request(), context.response());
        } else {
            Method   actionMethod = context.routeAction();
            Class<?> returnType   = actionMethod.getReturnType();

            Path path = target.getClass().getAnnotation(Path.class);
            JSON JSON = actionMethod.getAnnotation(JSON.class);

            boolean isRestful = (null != JSON) || (null != path && path.restful());

            // if request is restful and not InternetExplorer userAgent
            if (isRestful) {
                if (!context.isIE()) {
                    context.contentType(Const.CONTENT_TYPE_JSON);
                } else {
                    context.contentType(Const.CONTENT_TYPE_HTML);
                }
            }

            int len = actionMethod.getParameterTypes().length;

            MethodAccess methodAccess = BladeCache.getMethodAccess(target.getClass());

            Object returnParam = methodAccess.invoke(
                    target, actionMethod.getName(), len > 0 ?
                            context.routeParameters() : null);

            if (null == returnParam) {
                return;
            }

            if (isRestful) {
                context.json(returnParam);
                return;
            }
            if (returnType == String.class) {
                context.body(
                        ViewBody.of(new ModelAndView(returnParam.toString()))
                );
                return;
            }
            if (returnType == ModelAndView.class) {
                context.body(
                        ViewBody.of((ModelAndView) returnParam)
                );
            }
        }
    }
502794
function(path, value, fromParent) {
		// console.log('context.set : ', this.path, path, value, fromParent);
		// .set({ ...:..., ... }) case
		if (typeof path === 'object' && !path.forEach && !value) {
			for (var i in path)
				this.set(i, path[i], fromParent);
			return this;
		}
		path = parsePath(path);
		// $this case : reset
		if (path.length === 1 && path[0] === '$this')
			return this.reset(value, fromParent);

		path = modification(this, 'set', path, [value], fromParent);
		if (path.__yContext__)
			return this;
		// console.log('context.set : really apply : ', this.path, path, value, fromParent);
		var old = utils.setProp(this.data, path, value);
		if (old !== value)
			this.notify('set', path, value, path[path.length - 1]);
		return this;
	}
541094
private ArrayList<String> getBindList(String path)
  {
    if (! path.endsWith("/")) {
      path = path + "/";
    }

    ArrayList<String> bindList = new ArrayList<>();

    for (String bindPath : _bindMap.keySet()) {
      if (bindPath.startsWith(path)) {
        int p = bindPath.indexOf('/', path.length());

        String subpath = null;

        if (p > 0) {
          subpath = bindPath.substring(path.length(), p);
        }
        else {
          subpath = bindPath.substring(path.length());
        }

        if (! bindList.contains(subpath)) {
          bindList.add(subpath);
        }
      }
    }

    return bindList;
  }
736127
@Override
    public String getContextPath() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getContextPath();
        return null;
    }
287300
@Override
	public void updateContext() {

		String newInstancePath = (this.parentInstancePath == null ? "" : this.parentInstancePath) + "/" + this.instanceName;
		this.context.instancePathToComponentName.put( newInstancePath, this.componentName );
	}
866978
@Override
    public String getContextPath() {
        final HttpServletRequest request = getCurrentRequest();
        String appUri = (String) request.getAttribute(GrailsApplicationAttributes.APP_URI_ATTRIBUTE);
        if (appUri == null) {
            appUri = urlHelper.getContextPath(request);
        }
        return appUri;
    }
1325515
function (rootNode) {
        if (!this._parent) {
            return '/';
        }

        var current = this._parent;
        var path = this.name;
        while (current._parent) {
            path = current.name + '/' + path;
            if (current._parent == rootNode) {
                break;
            }
            current = current._parent;
        }
        if (!current._parent && rootNode) {
            return null;
        }
        return path;
    }
883189
function bindingContext(dataItemOrAccessor, parentContext, dataItemAlias, extendCallback, settings) {

      var self = this,
          isFunc = typeof(dataItemOrAccessor) == "function" && !isObservable(dataItemOrAccessor),
          nodes,
          subscribable;

      // The binding context object includes static properties for the current, parent, and root view models.
      // If a view model is actually stored in an observable, the corresponding binding context object, and
      // any child contexts, must be updated when the view model is changed.
      function updateContext() {
          // Most of the time, the context will directly get a view model object, but if a function is given,
          // we call the function to retrieve the view model. If the function accesses any observables or returns
          // an observable, the dependency is tracked, and those observables can later cause the binding
          // context to be updated.
          var dataItemOrObservable = isFunc ? dataItemOrAccessor() : dataItemOrAccessor,
              dataItem = unwrap(dataItemOrObservable);

          if (parentContext) {
              // When a "parent" context is given, register a dependency on the parent context. Thus whenever the
              // parent context is updated, this context will also be updated.
              if (parentContext._subscribable)
                  parentContext._subscribable();

              // Copy $root and any custom properties from the parent context
              extend(self, parentContext);

              // Because the above copy overwrites our own properties, we need to reset them.
              self._subscribable = subscribable;
          } else {
              self.$parents = [];
              self.$root = dataItem;

              // Export 'ko' in the binding context so it will be available in bindings and templates
              // even if 'ko' isn't exported as a global, such as when using an AMD loader.
              // See https://github.com/SteveSanderson/knockout/issues/490
              self.ko = options.knockoutInstance;
          }
          self.$rawData = dataItemOrObservable;
          self.$data = dataItem;
          if (dataItemAlias)
              self[dataItemAlias] = dataItem;

          // The extendCallback function is provided when creating a child context or extending a context.
          // It handles the specific actions needed to finish setting up the binding context. Actions in this
          // function could also add dependencies to this binding context.
          if (extendCallback)
              extendCallback(self, parentContext, dataItem);

          return self.$data;
      }

      function disposeWhen() {
          return nodes && !anyDomNodeIsAttachedToDocument(nodes);
      }

      if (settings && settings.exportDependencies) {
          // The "exportDependencies" option means that the calling code will track any dependencies and re-create
          // the binding context when they change.
          updateContext();
          return;
      }

      subscribable = computed(updateContext, null, { disposeWhen: disposeWhen, disposeWhenNodeIsRemoved: true });

      // At this point, the binding context has been initialized, and the "subscribable" computed observable is
      // subscribed to any observables that were accessed in the process. If there is nothing to track, the
      // computed will be inactive, and we can safely throw it away. If it's active, the computed is stored in
      // the context object.
      if (subscribable.isActive()) {
          self._subscribable = subscribable;

          // Always notify because even if the model ($data) hasn't changed, other context properties might have changed
          subscribable.equalityComparer = null;

          // We need to be able to dispose of this computed observable when it's no longer needed. This would be
          // easy if we had a single node to watch, but binding contexts can be used by many different nodes, and
          // we cannot assume that those nodes have any relation to each other. So instead we track any node that
          // the context is attached to, and dispose the computed when all of those nodes have been cleaned.

          // Add properties to *subscribable* instead of *self* because any properties added to *self* may be overwritten on updates
          nodes = [];
          subscribable._addNode = function(node) {
              nodes.push(node);
              addDisposeCallback(node, function(node) {
                  arrayRemoveItem(nodes, node);
                  if (!nodes.length) {
                      subscribable.dispose();
                      self._subscribable = subscribable = undefined;
                  }
              });
          };
      }
  }