INSTANCE SCOPE ==========================================================
496284
@Override
    public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException {
        String stackTrace = getStackTrace(baseRequest);
        if (stackTrace != null) {
            response.getWriter().print(getStackTrace(baseRequest));
        } else {
            super.handle(target, baseRequest, request, response);
        }
    }
1347487
function $$(instance, Clazz, ctor, args) {
                args = ria.__API.clone(args);
                var clazz = args[0],
                    specs = args[1];

                if (clazz instanceof ria.__API.ClassDescriptor)
                    clazz = clazz.ctor;

                if (clazz instanceof ria.__API.Class) {
                    var instance = clazz;
                    clazz = instance.getClass();
                    // TODO; fetch specs from instance
                }

                if (ria.__API.isSpecification(clazz)) {
                    var specify = clazz;
                    clazz = specify.type;
                    specs = specify.specs;
                }

                if (!ria.__API.isClassConstructor(clazz))
                    throw new ria.reflection.Exception('ReflectionFactory works only on CLASS');

                args.splice(0, 1, clazz, specs);

                var name = ria.__API.getIdentifierOfType(ria.__API.specify(clazz, specs)) + '@' + clazz.__REF_ID;
                if (cache.hasOwnProperty(name))
                    return cache[name];

                return cache[name] = new ria.__API.init(instance, Clazz, ctor, args);
            }
1302580
private static void initializeWithDefaultScope() {
        try {
            Class<?> aClass = Class.forName(DEFAULT_SCOPE_FACTORY);
            INSTANCE = (SingletonProvider) aClass.newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
428839
function _execute($vm, $scope/*, expression, [label], [target]*/) {
    /**
     *  $scope is passed when call instance method $compile, 
     *  Each "scope" object maybe include "$parent, data, methods" properties
     */
    // var $parent = $scope && $scope.$parent ? util.extend({}, $scope.$parent.methods, $scope.$parent.data) : {}
    if ($scope && $scope.$parent) {
        $scope.data.$parent = $scope.$parent.data
    }
    var __$expression__ = arguments[2]
    var __$fn__ = __$compiledExprs___[__$expression__]
    $scope = $scope || {}
    $scope = util.extend({}, $vm.$methods, $vm.$data, $scope.methods, $scope.data)
    try {
        if (!__$fn__) {
            __$fn__ = __$compiledExprs___[__$expression__] = __$compile__(__$expression__)
        }
        return util.immutable(__$fn__($scope))
    } catch (e) {
        __$expression__ = /^\{/.test(__$expression__) 
                        ? '. ' + __$expression__
                        : '. {' + __$expression__ + '}' // expr
        // arguments[3] // label
        // arguments[4] // target
        switch (e.name) {
            case 'ReferenceError':
                console.warn(e.message + __$expression__)
                break
            default:
                console.error(
                     (arguments[3] ? '\'' + arguments[3] + '\': ' : ''),
                    e.message + __$expression__,
                    arguments[4] || ''
                )
        }
        return ''
    }
}
424836
function () {
      var a$ = this._instanceAttributes;
      for (var k in a$) {
        if (!this.hasAttribute(k)) {
          this.setAttribute(k, a$[k]);
        }
      }
    }
1133244
function(callback) {
		if (this.instance) {
			this.instance.createPage(function(page) {
				callback(page);
			});
		} else {
			var that = this;
			this._createInstance(function() {
				that.createPage(callback);
			});
		}
	}
1297657
def view_assigns
      protected_vars = _protected_ivars
      variables      = instance_variables

      variables.reject! { |s| protected_vars.include? s }
      variables.each_with_object({}) { |name, hash|
        hash[name.slice(1, name.length)] = instance_variable_get(name)
      }
    end
270720
function () {
	          var _this = this;
	          var args = [];
	          for (var _i = 0; _i < arguments.length; _i++) {
	              args[_i - 0] = arguments[_i];
	          }
	          var instanceCtx = new _ExecutionContext(_ctx, this, _classStmt.name, _ctx.vars);
	          _classStmt.fields.forEach(function (field) { _this[field.name] = undefined; });
	          _executeFunctionStatements(ctorParamNames, args, _classStmt.constructorMethod.body, instanceCtx, _visitor);
	      }
989955
def _method_scope(input_layer, name):
  """"""
  global _in_method_scope
  # pylint: disable=protected-access

  with input_layer.g.as_default(), \
       scopes.var_and_name_scope(
           None if _in_method_scope else input_layer._scope), \
       scopes.var_and_name_scope((name, None)) as (scope, var_scope):
    was_in_method_scope = _in_method_scope
    yield scope, var_scope
    _in_method_scope = was_in_method_scope
942601
function(instance, handle) {
        if (!handle) return angular.noop;

        instance.$$mdHandle = handle;
        instances.push(instance);
        resolveWhen();

        return deregister;

        /**
         * Remove registration for an instance
         */
        function deregister() {
          var index = instances.indexOf(instance);
          if (index !== -1) {
            instances.splice(index, 1);
          }
        }

        /**
         * Resolve any pending promises for this instance
         */
        function resolveWhen() {
          var dfd = pendings[handle];
          if (dfd) {
            dfd.forEach(function (promise) {
              promise.resolve(instance);
            });
            delete pendings[handle];
          }
        }
      }
751432
function build(scope, attrs) {

                // Block divide by 0 and empty page size
                if (!scope.pageSize || scope.pageSize < 0)
                {
                    return;
                }

                // Assign scope values
                setScopeValues(scope, attrs);

                // local variables
                var start,
                    size = scope.adjacent * 2,
                    pageCount = Math.ceil(scope.total / scope.pageSize);

                // Validation Scope
                validateScopeValues(scope, pageCount);

                // Add the Next and Previous buttons to our list
                addPrevNext(scope, pageCount, 'prev');

                if (pageCount < (5 + size)) {

                    start = 1;
                    addRange(start, pageCount, scope);

                } else {

                    var finish;

                    if (scope.page <= (1 + size)) {

                        start = 1;
                        finish = 2 + size + (scope.adjacent - 1);

                        addRange(start, finish, scope);
                        addLast(pageCount, scope, finish);

                    } else if (pageCount - size > scope.page && scope.page > size) {

                        start = scope.page - scope.adjacent;
                        finish = scope.page + scope.adjacent;

                        addFirst(scope, start);
                        addRange(start, finish, scope);
                        addLast(pageCount, scope, finish);

                    } else {

                        start = pageCount - (1 + size + (scope.adjacent - 1));
                        finish = pageCount;

                        addFirst(scope, start);
                        addRange(start, finish, scope);

                    }
                }
                addPrevNext(scope, pageCount, 'next');
            }
1168898
@Override
  public final void onBeforeScopeDestruction (@Nonnull final IScope aScopeToBeDestroyed) throws Exception
  {
    if (LOGGER.isDebugEnabled ())
      LOGGER.debug ("onBeforeScopeDestruction for '" + toString () + "' in scope " + aScopeToBeDestroyed.toString ());

    // Check init state
    if (isInInstantiation ())
    {
      if (LOGGER.isWarnEnabled ())
        LOGGER.warn ("Object currently in instantiation is destroyed soon: " + toString ());
    }
    else
      if (!isInstantiated ())
      {
        if (LOGGER.isWarnEnabled ())
          LOGGER.warn ("Object not instantiated is destroyed soon: " + toString ());
      }

    // Check destruction state
    if (isInPreDestruction ())
    {
      if (LOGGER.isErrorEnabled ())
        LOGGER.error ("Object already in pre destruction is destroyed soon again: " + toString ());
    }
    else
      if (isInDestruction ())
      {
        if (LOGGER.isErrorEnabled ())
          LOGGER.error ("Object already in destruction is destroyed soon again: " + toString ());
      }
      else
        if (isDestroyed ())
        {
          if (LOGGER.isErrorEnabled ())
            LOGGER.error ("Object already destroyed is destroyed soon again: " + toString ());
        }

    setInPreDestruction (true);

    onBeforeDestroy (aScopeToBeDestroyed);

    // do not reset PreDestruction - happens in onScopeDestruction
  }
481523
function() {
      // inherit instance attributes
      var clonable = this.prototype._instanceAttributes;
      // merge attributes from element
      var a$ = this.attributes;
      for (var i=0, l=a$.length, a; (i<l) && (a=a$[i]); i++) {  
        if (this.isInstanceAttribute(a.name)) {
          clonable[a.name] = a.value;
        }
      }
    }
773614
public static void initialize(SingletonProvider instance) {
        synchronized (SingletonProvider.class) {
            if (INSTANCE == null) {
                INSTANCE = instance;
            } else {
                throw new RuntimeException("SingletonProvider is already initialized with " + INSTANCE);
            }
        }
    }
376399
public void assignInstance(XEvent event, String instance) {
		if (instance != null && instance.trim().length() > 0) {
			XAttributeLiteral attr = (XAttributeLiteral) ATTR_INSTANCE.clone();
			attr.setValue(instance);
			event.getAttributes().put(KEY_INSTANCE, attr);
		}
	}
804227
function( a, b ) {
            this.id = b.attr('id');
            this.instances = [];
            this.element = b;
            this.options = jQuery.extend(this.options, a);
            this._create();
            if ( this._init ) {
                this._init();
            }
        }
207031
function(instance) {

		this._views_by_guid[instance.guid] = instance;

		if (instance.id) {

			if (Lava.schema.DEBUG && (instance.id in this._views_by_id)) Lava.t("Duplicate view id: " + instance.id);
			this._views_by_id[instance.id] = instance;

		}

	}