Grab global defines, will start at 'FIRST_APP_CONSTANT', if defined

@return type
501630
public function defines() {
        $defines = get_defined_constants();
        $ret = array(); $offset = -1;
        while ($def = array_slice($defines, $offset--, 1)) {
            $key = key($def);
            $value = current($def);
            if ($key  == 'FIRST_APP_CONSTANT') break;
            $ret[$key ] = $value;
        }
        return $ret;
    }
841813
protected function defineGlobals()
    {
        $wpRootFolder = $this->getWpRootFolder();

        // load an extra config file if any
        $this->loadConfigFile();

        $constants = [
            // by default install WordPress in an isolated process
            'WPCEPT_ISOLATED_INSTALL' => $this->requiresIsolatedInstallation(),
            'ABSPATH'                 => $wpRootFolder,
            'DB_NAME'                 => $this->config['dbName'],
            'DB_USER'                 => $this->config['dbUser'],
            'DB_PASSWORD'             => $this->config['dbPassword'],
            'DB_HOST'                 => $this->config['dbHost'],
            'DB_CHARSET'              => $this->config['dbCharset'],
            'DB_COLLATE'              => $this->config['dbCollate'],
            'WP_TESTS_TABLE_PREFIX'   => $this->config['tablePrefix'],
            'WP_TESTS_DOMAIN'         => $this->config['domain'],
            'WP_TESTS_EMAIL'          => $this->config['adminEmail'],
            'WP_TESTS_TITLE'          => $this->config['title'],
            'WP_PHP_BINARY'           => $this->config['phpBinary'],
            'WPLANG'                  => $this->config['language'],
            'WP_DEBUG'                => $this->config['wpDebug'],
            'WP_TESTS_MULTISITE'      => $this->config['multisite'],
        ];

        foreach ($constants as $key => $value) {
            if (!defined($key)) {
                define($key, $value);
            }
        }

        if (!defined('WP_PLUGIN_DIR') && !empty($this->config['pluginsFolder'])) {
            define('WP_PLUGIN_DIR', $this->getPluginsFolder());
        }
    }
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);
}
434930
function setGlobalDefine(requiredModule)
{
  // pass globalDefine instance from parent to child module
  if (requiredModule.parent && requiredModule.parent._globalDefine)
  {
    // inherited instance
    requiredModule._globalDefine = requiredModule.parent._globalDefine;
  }

  // create global define specific to the module
  // but only if its whitelisted and not blacklisted
  if (requiredModule._globalDefine && requiredModule._globalDefine.isWhitelisted(requiredModule.id) && !requiredModule._globalDefine.isBlacklisted(requiredModule.id))
  {
    global.define = requiredModule._globalDefine.amdefineWorkaround(requiredModule);

    // run required paths through alias substituion
    if (requiredModule._globalDefine.aliasRequire)
    {
      requiredModule._originalRequire = requiredModule.require;
      requiredModule.require = function(modulePath)
      {
        return requiredModule._originalRequire.call(this, requiredModule._globalDefine.checkPath(modulePath));
      }
    }
  }
  else
  {
    // reset global define
    delete global.define;
  }
}
129785
def load_constant(constant)
      return if loaded?(constant)

      registry.load(constant)

      return unless registry.include?(constant)

      apply(constant)
    end
1065628
def get_globals(self):
        """"""
        if self.shell:
            globals_ = dict(_initial_globals)
        else:
            globals_ = dict(self.current_frame.f_globals)
        globals_['_'] = self.db.last_obj
        if cut is not None:
            globals_.setdefault('cut', cut)
        # For meta debuging purpose
        globals_['___wdb'] = self.db
        # Hack for function scope eval
        globals_.update(self.current_locals)
        for var, val in self.db.extra_vars.items():
            globals_[var] = val
        self.db.extra_items = {}
        return globals_
715319
def noglobals(fn):
    
    return type(fn)(
        getattr(fn, 'func_code', getattr(fn, '__code__')),
        {'__builtins__': builtins},
        getattr(fn, 'func_name', getattr(fn, '__name__')),
        getattr(fn, 'func_defaults', getattr(fn, '__defaults__')),
        getattr(fn, 'func_closure', getattr(fn, '__closure__'))
    )
685761
function initAppHandlers (cfg = {}) {
	_.each(handlers, (handler, name) => App[name] = _.partial(handler, _, (_.isFunction(cfg[name])) ? cfg[name] : _.noop));
}
1283246
function spyGlobalVar(varName, callback) {
			phantomas.log('spy: attaching to %s global variable', varName);

			window.__defineSetter__(varName, function(val) {
				phantomas.log('spy: %s global variable has been defined', varName);

				spiedGlobals[varName] = val;
				callback(val);
			});

			window.__defineGetter__(varName, function() {
				return spiedGlobals[varName] || undefined;
			});

		}
1225536
public function getTypes()
    {
        $types = $this->config()->get('types');

        if ($this->allowed_types) {
            // Prioritise local field over global settings
            $allowed_types = $this->allowed_types;
        }
        if ($allowed_types = $this->config()->get('allowed_types')) {
           foreach ($allowed_types as $type) {
                if (!array_key_exists($type, $types)) {
                    user_error("{$type} is not a valid link type");
                }
            }

            foreach (array_diff_key($types, array_flip($allowed_types)) as $key => $value) {
                unset($types[$key]);
            }
        }
        $this->extend('updateTypes', $types);
        return $types;
    }
559514
protected function getUserDefinedGlobals()
    {
        if (file_exists(realpath(__DIR__.'/../../../../config/twig.php'))) {
            $this->config = require realpath(__DIR__.'/../../../../config/twig.php');
        } elseif (file_exists(realpath(__DIR__.'/../config/twig.php'))) {
            $this->config = require realpath(__DIR__.'/../config/twig.php');
        }

        return isset($this->config['twig_global']) ? $this->config['twig_global'] : [];
    }
784414
function getGlob() {
			if (isNode) {
				return loader.import("@node-require", { name: module.id })
					.then(function(nodeRequire) {
						return nodeRequire("glob");
					});
			}

			return Promise.resolve();
		}
1121289
private function getDefaultPreset() {
    if (!empty($GLOBALS['install_state']['forms'][$this->getFormId()]['preset'])) {
      return $GLOBALS['install_state']['forms'][$this->getFormId()]['preset'];
    };

    if (function_exists('drush_main')) {
      return self::DEFAULT_PRESET_DRUSH;
    }

    return self::DEFAULT_PRESET;
  }
272582
def get_global_step_var():
    
    scope = tfv1.VariableScope(reuse=False, name='')  # the root vs
    with tfv1.variable_scope(scope):
        var = tfv1.train.get_or_create_global_step()
    return var
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
                };
            }
        }
525201
function define() {
    var type = this.data.type || this.defaults.type;

    //
    // If not production use development keys.
    //
    if (process.env.NODE_ENV !== 'production') this.data.key = this[type];

    //
    // Remove unneeded static libraries, always keep Cortex.JS
    //
    this.js = this.js.filter(function filter(file) {
      return ~file.indexOf('analytics/base.js') || ~file.indexOf('static/' + type);
    });

    return this;
  }
1072642
function getGlobalThis() {
    return t.callExpression(
      t.sequenceExpression([t.valueToNode(0), t.identifier("eval")]),
      [t.valueToNode("this")]
    );
  }