Based on https://github.com/alexdavid/scope-eval v0.0.3 (source: https://unpkg.com/scope-eval@0.0.3/scope_eval.js) This is basically just a wrapper around new Function()
769648
function scopeEval(source, scope) {
  var keys = [];
  var values = [];
  for (var key in scope) {
    if (scope.hasOwnProperty(key)) {
      keys.push(key);
      values.push(scope[key]);
    }
  }
  keys.push(source);
  return Function.apply(null, keys).apply(null, values);
}
97087
function checkOnScopeChangeVals(partial, partialName) {
    var remodelOnScopeChange = partial.remodelOnScopeChange || (partial.remodel && partial.remodel.onScopeChange);
    var rerenderOnScopeChange = partial.rerenderOnScopeChange || (partial.rerender && partial.rerender.onScopeChange);
    var scope = partial.scope || {};

    _.each(remodelOnScopeChange, function (scopeVal) {
        var idx = scopeVal.indexOf('.');
        var val = idx > 0 ? scopeVal.substring(0, idx) : scopeVal;
        if (!scope[val]) {
            throw new Error(partialName + ' remodelOnScope value \'' + scopeVal + '\' is not defined in the scope definition.');
        }
    });

    _.each(rerenderOnScopeChange, function (scopeVal) {
        var idx = scopeVal.indexOf('.');
        var val = idx > 0 ? scopeVal.substring(0, idx) : scopeVal;
        if (!scope[val]) {
            throw new Error(partialName + ' rerenderOnScopeChange value \'' + scopeVal + '\' is not defined in the scope definition.');
        }
    });
}
754151
function gen(providedScope, baseOptions) {

  // holds the created instance.
  var theUse

  // NOTE:
  //  using their object instead of grabbing each property individually for
  //  an object we create here because I want to allow them to put anything
  //  into the `scope` object they provide so it'll be available to them.

  // if no scope is provided then create one.
  var scope = providedScope || {}

  // ensure we have the usuals available in the scope.
  scope.require = scope.require || require
  scope.load    = scope.load    || load
  scope.combine = scope.combine || combine
  scope.use     = scope.use     || use
  scope.inTwos  = scope.inTwos  || inTwos
  scope.withOptions = scope.withOptions || withOptions

  // lastly, wrap this in the "inTwos" helper which smartly handles arrays of
  // plugins and options and passes them in as pairs, or as a single plugin
  // without options.
  // NOTE: the first arg is `this` which is the object we're attached to.
  theUse = scope.inTwos(function(plugin, options) {
    return scope.use(this, scope, plugin, scope.combine(baseOptions, options))
  })

  //
  // NOTE: the first arg is `scope`, not `this` as it is above because this
  // use() affects the @use/core instance: thing.use.use(...)
  theUse.use = scope.inTwos(function(plugin, options) {
    return scope.use(scope, scope, plugin, scope.combine(baseOptions, options))
  })

  // allow creating a new instance with new `defaultOptions`.
  theUse.withOptions = function(defaultOptions) {
    return scope.withOptions(scope, scope.combine(baseOptions, defaultOptions))
  }

  return theUse
}
825368
def query_eval(scope, query)
      query_parts = query.split('.')
      if query_parts.length > 2
        title = self.class.acronymize(query_parts[-2..-1].join(' '))
        resp = 'None' if scope.instance_eval(query_parts[0]).nil? || scope.instance_eval(query_parts[0..1].join('.')).nil?
      elsif query_parts[-1] == 'name'
        title = self.class.acronymize(query_parts.join(' '))
        resp = 'None' if scope.instance_eval(query_parts[0]).nil?
      else
        title = self.class.acronymize query_parts[-1]
        resp = 'None' if scope.instance_eval(query_parts[0]).nil?
      end

      resp = scope.instance_eval(query) unless resp == 'None'
      { title => resp }
    end
639940
def add_arg_scope(func):
  
  @functools.wraps(func)
  def func_with_args(*args, **kwargs):
    current_scope = _current_arg_scope()
    current_args = kwargs
    key_func = (func.__module__, func.__name__)
    if key_func in current_scope:
      current_args = current_scope[key_func].copy()
      current_args.update(kwargs)
    return func(*args, **current_args)
  _add_op(func)
  return func_with_args
112361
function () {
/*Line 29 - 'AtomUIComponent.js' */                if (this._localScope === undefined) {
/*Line 30 - 'AtomUIComponent.js' */                    var ap = this.get_atomParent(this._element._logicalParent || this._element.parentNode);
/*Line 31 - 'AtomUIComponent.js' */                    if (ap) {
/*Line 32 - 'AtomUIComponent.js' */                        return ap.get_localScope();
/*Line 33 - 'AtomUIComponent.js' */                    } else {
/*Line 34 - 'AtomUIComponent.js' */                        throw new Error("Local Scope does not exist");
/*Line 35 - 'AtomUIComponent.js' */                    }
/*Line 36 - 'AtomUIComponent.js' */                }
/*Line 37 - 'AtomUIComponent.js' */                return this._localScope;
/*Line 38 - 'AtomUIComponent.js' */            }
498791
private Object js_eval(Context cx, Scriptable scope, Object[] args)
    {
        Scriptable global = ScriptableObject.getTopLevelScope(scope);
        return ScriptRuntime.evalSpecial(cx, global, global, args, "eval code", 1);
    }
628910
function addScopedHandler (event, handler, scope) {
    if (handlers[event] === undefined) {
        handlers[event] = [];
    }

    let scopedHandler = scope ? handler.bind(scope) : handler;

    handlers[event].push({
        original: handler,
        scoped: scopedHandler
    });

    return scopedHandler;
}
360969
function createNewDebugger(scopename, opts = {}) {
    const handler = {

        get(target, propKey, receiver) {

            return function (...args) {

                const origMethod = target[propKey];

                // Always return immediately all but the specified console methods.
                if (!propKey.match(/debug|log|info|group|groupEnd/)) {
                    if(opts.quiet) {return}
                    const result = origMethod.apply(this, args);
                    return result
                }
                
                if (typeof localStorage === "undefined") {
                    // "Your environment does not have localStorage"
                    return
                } else if (!localStorage['cth-debug']) {
                    // Returning because no cth-debug variable is set
                    return
                }

                const pattern = globToRegexp(localStorage['cth-debug'])

                if (pattern.test(scopename)) {
                    if(opts.quiet) {return}
                    const result = origMethod.apply(this, args);
                    return result
                } else {
                    // Return null when a call was rejected (mainly for unit tests)
                    return null
                }
            }
        }
    }
    return new Proxy(console, handler)
}
413834
function evalFn(token, format_lib) {
    var splited = token.trim().split(/[\(\)]/g);

    if (splited.length < 3)
        return token;

    if (!format_lib)
        return token

    var fnstring = splited[0];
    var fnparams = splited.slice(1, splited.length - 1);
    var fn = format_lib[fnstring];

    if (typeof fn !== "function")
        return "";

    return fn.apply(null, fnparams);
}
123921
function(original, scope, options) {
                var originalWithScope = function(ctx, opts) {
                    return original(ctx || scope, opts);
                };
                return function(updatedScope, updatedOptions) {
                    if (updatedScope !== undefined && !(updatedScope instanceof can.view.Scope)) {
                        updatedScope = scope.add(updatedScope);
                    }
                    if (updatedOptions !== undefined && !(updatedOptions instanceof can.view.Options)) {
                        updatedOptions = options.add(updatedOptions);
                    }
                    return originalWithScope(updatedScope, updatedOptions || options);
                };
            }
378081
function wrapApply (callback) {
        // return mousetrap a function to call
        return function (event, combo) {

          // if this is an array, it means we provided a route object
          // because the scope wasn't available yet, so rewrap the callback
          // now that the scope is available:
          if (callback instanceof Array) {
            var funcString = callback[0];
            var route = callback[1];
            callback = function (event) {
              route.scope.$eval(funcString);
            };
          }

          // this takes place outside angular, so we'll have to call
          // $apply() to make sure angular's digest happens
          $rootScope.$apply(function() {
            // call the original hotkey callback with the keyboard event
            callback(event, _get(combo));
          });
        };
      }
138807
function Scope(options) {

	this.__proto__ = new Control();

	this.init = function(options) {
		this.type = options.type = 'Scope';
		this.parent = options.parent;
		this.defaults = {
			x:48, y:48, w:288, h:144,
			value: 0,
			text: '',
			script: undefined,
			onload: undefined,
			fill: this.parent.fill,
			fill_highlight: this.parent.lighter(this.parent.stroke),
			stroke: this.parent.stroke,
			'stroke-width': this.parent.control_stroke,
			fontsize: this.parent.fontsize,
			repeat: 0,
			running: 0,
			corner: this.parent.button_corner,
			subtype: undefined,
			autorun: undefined,
			ticks: 5,
			source: undefined,
			refresh: 0,
			min: 0,
			max: 1024,
			tickwidth: 3
		};
		console.log('Scope defaults:', this.defaults);

		this.setoptions(options);
		this.render();

		if (this.autorun) {
			var self = this;
			this.intervalid = window.setInterval(function() {
				//console.log('plotting:', self.value);
				self.scroll();
				self.plot(self.value);
			}, this.autorun);
		}

		return this;
	};

	this.layout = function() {
		this.lx = this.x + (this.w/2);
		this.ly = this.y + this.h + this.fontsize*2;
	};

	this.render = function() {
		this.layout();
		var self = this;
		this.outerrect = this.parent.paper.rect(this.x, this.y, this.w, this.h, this.parent.button_corner)
			.attr({fill: this.fill, stroke: this.stroke, 'stroke-width':this['stroke-width']});
		this.elts.push(this.outerrect);

		this.label = this.parent.paper.text(this.lx, this.ly, this.text)
			.attr({fill:this.stroke, stroke:this.stroke, 'font-size': this.fontsize});
		this.textelts.push(this.label);

		var axisx = this.x + this.w + this.fontsize;
		var step = (this.max - this.min) / (this.ticks-1);
		for (var t=0; t<this.ticks; t++) {
			var value = Math.floor(this.min + (t * step));
			var y = this.mapy(value);

			var tick = this.parent.paper.rect(this.x + this.w, y, this.tickwidth, 1)
				.attr({fill:this.fill, stroke:this.stroke});
			this.elts.push(tick);

			var label = this.parent.paper.text(axisx, y, ''+value)
				.attr({fill:this.stroke, stroke:this.stroke, 'font-size': 0.7 * this.fontsize});
			this.textelts.push(label);
		}
		this.sethandlers();
	};

	this.move = function(x, y) {
		this.x = x;
		this.y = y;
		this.layout();
		this.outerrect.attr({x:this.x, y:this.y, width:this.w, height:this.h});
		this.label.attr({x:this.lx, y:this.ly});
	};

	this.mapy = function(value) {
		var fraction = (value - this.min) / (this.max-this.min);
		fraction = 1 - fraction;	// y axis is inverted
		var y = Math.floor(this.y + (fraction * (this.h-this['stroke-width']))) + this['stroke-width']/2;
		return y;
	};

	this.points = [];

	this.remove = function() {
		for (var i=0; i<this.points.length; i++) this.points[i].remove();
		this.points = [];
		this.__proto__.remove.call(this);
	};

	this.setValue = function(value) {
		this.value = value;
		this.plot(value);
		var update = {id: this.id, value: this.value};
		this.fire('update', update);
	};

	this.plot = function(value) {
		if (!this.autorun) this.scroll();
		var y = this.mapy(value);
		var point = this.parent.paper.rect(this.x + this.w - this['stroke-width']/2, y, 1, 1)
			.attr({fill:'red', stroke:'red'});
		this.points.push(point);
	};

	this.scroll = function() {
		var p=0;
		while (p < this.points.length) {
			var point = this.points[p];
			var pointx = point.attr('x');
			if (pointx > this.x+this['stroke-width']/2) {
				point.attr({x:pointx - 1});
				p++;
			}
			else {
				point.remove();
				this.points.splice(p, 1);
			}
		}
	};

	return this.init(options || {});
}
1311530
function Scope(parent) {
        this.names = {};        // names defined in this scope
        this.mangled = {};      // mangled names (orig.name => mangled)
        this.rev_mangled = {};  // reverse lookup (mangled => orig.name)
        this.cname = -1;        // current mangled name
        this.refs = {};         // names referenced from this scope
        this.uses_with = false; // will become TRUE if eval() is detected in this or any subscopes
        this.uses_eval = false; // will become TRUE if with() is detected in this or any subscopes
        this.parent = parent;   // parent scope
        this.children = [];     // sub-scopes
        if (parent) {
                this.level = parent.level + 1;
                parent.children.push(this);
        } else {
                this.level = 0;
        }
}
362369
function (f) {
      // equivalent to arguments.slice(1)
      // starting at 1 because 0 is the f, makes things tricky.
      // Pay attention to what variable is where, and the -1 magic.
      // thankfully, we have tests for this.
      var args = new Array(arguments.length - 1);
      for (var i = 1; i < arguments.length; i++) args[i-1] = arguments[i];

      return function () {
        var newArgs = new Array(arguments.length);
        for (var j = 0; j < newArgs.length; j++) newArgs[j] = arguments[j];

        var all = args.concat(newArgs);
        return f.apply(null, all);
      };
    }
1315088
function observe($scope, $attrs, key, defValue, callbackFunc) {
        if (callbackFunc === void 0) { callbackFunc = null; }
        $attrs.$observe(key, function (value) {
            if (!angular.isDefined(value)) {
                $scope[key] = defValue;
            }
            else {
                $scope[key] = value;
            }
            if (angular.isDefined(callbackFunc) && callbackFunc) {
                callbackFunc($scope[key]);
            }
        });
    }
124371
function(jsStr, __parObj){
      if (!__parObj){
        return eval(jsStr);
      };
      
      var s = "";
      var n;
      for (n in __parObj){
        s += "var " + n + " = __parObj." + n + ";";
      };
      
      //s = "(function(){" + s;
      s += jsStr;
      //s += "})();";
      
      return eval(s);
    }