Call a new function body with some global objects.
@param  {object} globalObjects
@param  {string} code
@return {any}
970619
function callFunction (globalObjects, body) {
  var globalKeys = [];
  var globalValues = [];
  for (var key in globalObjects) {
    globalKeys.push(key);
    globalValues.push(globalObjects[key]);
  }
  globalKeys.push(body);

  var result = new (Function.prototype.bind.apply( Function, [ null ].concat( globalKeys) ));
  return result.apply(void 0, globalValues)
}
609543
function ensureCodeBehind(code_behind) {
    if (typeof code_behind === 'undefined')
        throw "Missing mandatory global variable CODE_BEHIND!";

    var i, funcName;
    for (i = 1; i < arguments.length; i++) {
        funcName = arguments[i];
        if (typeof code_behind[funcName] !== 'function')
            throw "Expected CODE_BEHIND." + funcName + " to be a function!";
    }
}
1062893
function (code) {
        return function (data) {
            return data ? res.status(code).send(data):
                          res.status(code);
        };
    }
396618
function () {
                //Push all the globalDefQueue items into the context's defQueue
                if (globalDefQueue.length) {
                    //Array splice in the values since the context code has a
                    //local var ref to defQueue, so cannot just reassign the one
                    //on context.
                    apsp.apply(context.defQueue,
                               [context.defQueue.length - 1, 0].concat(globalDefQueue));
                    globalDefQueue = [];
                }
            }
1223446
function registerElementPatch(_global) {
    if ((!isBrowser && !isMix) || !('registerElement' in _global.document)) {
        return;
    }
    var _registerElement = document.registerElement;
    var callbacks = ['createdCallback', 'attachedCallback', 'detachedCallback', 'attributeChangedCallback'];
    document.registerElement = function (name, opts) {
        if (opts && opts.prototype) {
            callbacks.forEach(function (callback) {
                var source = 'Document.registerElement::' + callback;
                var prototype = opts.prototype;
                if (prototype.hasOwnProperty(callback)) {
                    var descriptor = ObjectGetOwnPropertyDescriptor(prototype, callback);
                    if (descriptor && descriptor.value) {
                        descriptor.value = wrapWithCurrentZone(descriptor.value, source);
                        _redefineProperty(opts.prototype, callback, descriptor);
                    }
                    else {
                        prototype[callback] = wrapWithCurrentZone(prototype[callback], source);
                    }
                }
                else if (prototype[callback]) {
                    prototype[callback] = wrapWithCurrentZone(prototype[callback], source);
                }
            });
        }
        return _registerElement.call(document, name, opts);
    };
    attachOriginToPatched(document.registerElement, _registerElement);
}
812764
function globals() {
    return {
        range: function(start, stop, step) {
            if(typeof stop === 'undefined') {
                stop = start;
                start = 0;
                step = 1;
            }
            else if(!step) {
                step = 1;
            }

            var arr = [];
            var i;
            if (step > 0) {
                for (i=start; i<stop; i+=step) {
                    arr.push(i);
                }
            } else {
                for (i=start; i>stop; i+=step) {
                    arr.push(i);
                }
            }
            return arr;
        },

        // lipsum: function(n, html, min, max) {
        // },

        cycler: function() {
            return cycler(Array.prototype.slice.call(arguments));
        },

        joiner: function(sep) {
            return joiner(sep);
        }
    };
}
539390
function(code){
        this.obj.should.have.property('statusCode');
        var status = this.obj.statusCode;

        this.assert(
            code == status
            , function(){ return 'expected response code of ' + code + ' ' + i(statusCodes[code])
                + ', but got ' + status + ' ' + i(statusCodes[status]) }
            , function(){ return 'expected to not respond with ' + code + ' ' + i(statusCodes[code]) });

        return this;
    }
1248254
public String[] generateCodes(final String code, final String objectName) {
        return generateCodes(code, objectName, null, null);
    }
1329754
function (parts, scope) {
      var o = scope !== undefined ? scope : Global;
      for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
        o = o[parts[i]];
      return o;
    }
1078111
function(code, err) {
        this.response = {
            response: {
                statusCode: code,
                headers: {},
            },
            body: null,
            err: err,
        };
    }
810264
function any(obj) {
  var ctx = this;

  if (typeof obj === 'function') {
    obj = slice.call(arguments);
  }

  return function(done) {
    var keys = Object.keys(obj);
    var isArray = Array.isArray(obj);
    var finished;

    function getkey(key) {
      return isArray ? Number(key) : key;
    }

    if (!keys.length) {
      setImmediate(function() {
        done(null, null);
      });
      return;
    }

    for (var i = 0; i < keys.length; i++) {
      run(obj[keys[i]], keys[i]);
    }

    function run(fn, key) {
      if (finished) return;
      try {
        fn = toThunk(fn, ctx);
        if (typeof fn !== 'function') {
          done(new Error('co.any only accept yieldables'));
        }
        fn.call(ctx, function(err, res) {
          if (finished) return;
          finished = true;
          if (err) {
            err._key = getkey(key);
            return done(err);
          }
          done(null, {
            _key: getkey(key),
            value: res
          });
        });
      } catch (err) {
        finished = true;
        err._key = getkey(key);
        done(err);
      }
    }
  }
}
1356681
function takeGlobalQueue() {
            //Push all the globalDefQueue items into the context's defQueue
            if (globalDefQueue.length) {
                //Array splice in the values since the context code has a
                //local var ref to defQueue, so cannot just reassign the one
                //on context.
                apsp.apply(defQueue,
                           [defQueue.length - 1, 0].concat(globalDefQueue));
                globalDefQueue = [];
            }
        }
994148
function (statements, global) {
            var source = [];
            if (!global) {
                source.push('function(scopes) {');
            }
            source.push('var buffer = ""' + (global ? ',' : ';'));
            if (global) {
                source.push('config = this.config,' +
                    // current xtemplate engine
                    'engine = this, ' +
                    'utils = config.utils;');

                var natives = '',
                    c,
                    utils = XTemplateRuntime.utils;

                for (c in utils) {
                    natives += c + 'Util = utils["' + c + '"],';
                }

                if (natives) {
                    source.push('var ' + natives.slice(0, natives.length - 1) + ';');
                }
            }
            if (statements) {
                for (var i = 0, len = statements.length; i < len; i++) {
                    pushToArray(source, this[statements[i].type](statements[i]));
                }
            }
            source.push('return buffer;');
            if (!global) {
                source.push('}');
                return source;
            } else {
                return {
                    params: ['scopes', 'S', 'undefined'],
                    source: source
                };
            }
        }
558197
def global_state(self):
        
        self._generate_func_code()

        return dict(
            REGEX_PATTERNS=self._compile_regexps,
            re=re,
            JsonSchemaException=JsonSchemaException,
        )
1312967
def func_load(code, defaults=None, closure=None, globs=None):
    ''''''
    if isinstance(code, (tuple, list)):  # unpack previous dump
        code, defaults, closure = code
    code = marshal.loads(code.encode('raw_unicode_escape'))
    if globs is None:
        globs = globals()
    return python_types.FunctionType(code, globs,
                                     name=code.co_name,
                                     argdefs=defaults,
                                     closure=closure)
772175
function (code) {

            var shippingCountries = this.$.shippingCountries;

            if (!shippingCountries) {
                return null;
            }

            for (var i = 0; i < shippingCountries.$items.length; i++) {
                var shippingCountry = shippingCountries.$items[i];
                if (shippingCountry.$.code == code) {
                    return shippingCountry;
                }
            }

            return null;
        }
1143561
function(code) {
  executeJailed(code, DYNAMIC_PLUGIN_NAME, onExecute)

  function onExecute(error) {
    if (error) {
      printError(error.stack)
      return processSend({type: 'executeFailure', error: exportError(error)})
    }

    processSend({type: 'executeSuccess'})
  }
}