/*
Create the appropriate version of factories depending
if whether we are running dev-mode
198574
private static void initFactory() {
    if (jsonFactory == null) {
      try {
        // We use reflection because the server side should not
        // depend on gwt-servlet nor gwt-dev. Hence if GWT is not
        // in our classpath means that we are in server side, otherwise
        // we use GWT to figure out if we are running devmode.
        // This is run once, so no performance issues to worry about.
        Class.forName("com.google.gwt.core.shared.GWTBridge");
        Class<?> gwt = Class.forName("com.google.gwt.core.shared.GWT");
        Method method = gwt.getMethod("isClient");
        Object ret = method.invoke(null);
        if (ret instanceof Boolean && ((Boolean) ret)) {
          // We are running DevMode, so create Js versions of the factories
          method = gwt.getMethod("create", Class.class);
          ret = method.invoke(null,
              new Object[] {JsonFactory.class});
          jsonFactory = (JsonFactory) ret;
          ajaxTransport = new AjaxTransportJs();
          return;
        }
      } catch (ClassNotFoundException ignore) {
      } catch (NoSuchMethodException ignore) {
      } catch (SecurityException ignore) {
      } catch (IllegalAccessException ignore) {
      } catch (IllegalArgumentException ignore) {
      } catch (InvocationTargetException ignore) {
      }
      // We are running in the JVM, so create Jre versions.
      jsonFactory = new JsonFactoryJre();
      ajaxTransport = new AjaxTransportJre();
    }
  }
341046
function create_require (env) {
  function require (id) {
    // `require('a@0.0.0')` is prohibited.
    prohibit_require_id_with_version(id);

    // When `require()` another module inside the factory,
    // the module of depdendencies must already been created
    var module = get_module(id, env, true);
    return get_exports(module);
  }

  // @param {string} id Module identifier.
  // Since 4.2.0, we only allow to asynchronously load a single module
  require.async = function(id, callback) {
    if (callback) {
      // `require.async('a@0.0.0')` is prohibited
      prohibit_require_id_with_version(id);
      var module = get_module(id, env);

      // If `require.async` a foreign module, it must be a main entry
      if (!module.main) {

        // Or it should be a module inside the current package
        if (module.n !== env.n) {
          // Otherwise, we will stop that.
          return;
        }
        module.a = true;
      }

      use_module(module, callback);
    }
  };

  // @param {string} path
  require.resolve = function (path) {
    return NEURON_CONF.resolve(parse_id(path, env).id);
  };

  return require;
}
650099
def generate(env):
    """"""
    SCons.Tool.cc.generate(env)

    env['CC'] = env.Detect(compilers) or 'clang'
    if env['PLATFORM'] in ['cygwin', 'win32']:
        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
    else:
        env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')
    # determine compiler version
    if env['CC']:
        #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'],
        pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
                                     stdin='devnull',
                                     stderr='devnull',
                                     stdout=subprocess.PIPE)
        if pipe.wait() != 0: return
        # clang -dumpversion is of no use
        line = pipe.stdout.readline()
        if sys.version_info[0] > 2:
            line = line.decode()
        match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line)
        if match:
            env['CCVERSION'] = match.group(1)
29272
function runRebase(options) {
    const platforms = detectPorting(options.platform);
    if (platforms.length <= 0) {
        return Promise.resolve();
    } else {
        const target = platforms[0];
        options.platform = target;
        runBuild(options)
        .then(() => {
            if ('dev' !== target) {
                const srcDir = path.join(__dirname, '..', config.dir.pkg, config.dir.porting + '_' + target);
                const dstDir = path.join(__dirname, '..', config.dir.pkg, config.dir.porting);
                if (fs.existsSync(srcDir)) {
                    fs.moveSync(srcDir, dstDir);
                }
            }
        })
        .catch((reason) => {
            console.error(reason);
            process.exit(1);
        });
    }
}
503716
function(src, buildPath) {
    src = Array.isArray(src) ? src : [src];

    return new Elixir.GulpPaths()
        .src(src, config.publicPath)
        .output(buildPath || config.get('public.versioning.buildFolder'));
}
975324
private void scheduleUpdateFactory(final ServerControllerFactory controllerFactory) {
		// change configuration using new (or null when not available) ServerControllerFactory
		Future<?> future = configExecutor.submit(() -> updateController(config, controllerFactory));

		// Make sure we destroy things synchronously
		if (controllerFactory == null) {
			try {
				future.get(20, TimeUnit.SECONDS);
				// CHECKSTYLE:OFF
			} catch (Exception e) {
				LOG.info("Error when updating factory: " + e.getMessage(), e);
			}
			// CHECKSTYLE:ON
		}
	}
1182106
function build(previousFileSizes) {

  console.log('\n\nThe process.env.NODE_ENV is: ', chalk.cyan.bold(process.env.NODE_ENV))
  customEnvVarKey && console.log('The custom environment variable is: ', chalk.cyan.bold(customEnvVarKey))
  const spinner = ora('Creating an optimized production build...')
  spinner.color = 'blue'
  spinner.start()
  // console.log('Creating an optimized production build...');

  let compiler = webpack(config);
  return new Promise((resolve, reject) => {
    compiler.run((err, stats) => {
      if (err) {
        return reject(err);
      }
      const messages = formatWebpackMessages(stats.toJson({}, true));
      if (messages.errors.length) {
        // Only keep the first error. Others are often indicative
        // of the same problem, but confuse the reader with noise.
        if (messages.errors.length > 1) {
          messages.errors.length = 1;
        }
        return reject(new Error(messages.errors.join('\n\n')));
      }
      if (
        process.env.CI &&
        (typeof process.env.CI !== 'string' ||
          process.env.CI.toLowerCase() !== 'false') &&
        messages.warnings.length
      ) {
        console.log(
          chalk.yellow(
            '\nTreating warnings as errors because process.env.CI = true.\n' +
            'Most CI servers set it automatically.\n'
          )
        );
        return reject(new Error(messages.warnings.join('\n\n')));
      }
      spinner.succeed()
      return resolve({
        stats,
        previousFileSizes,
        warnings: messages.warnings,
      });
    });
  });
}
1189344
function() {
    var callbacks = this._callbacks;
    var contexts = this._contexts;
    if (callbacks) {
      ("production" !== "development" ? invariant(
        callbacks.length === contexts.length,
        'Mismatched list of contexts in callback queue'
      ) : invariant(callbacks.length === contexts.length));
      this._callbacks = null;
      this._contexts = null;
      for (var i = 0, l = callbacks.length; i < l; i++) {
        callbacks[i].call(contexts[i]);
      }
      callbacks.length = 0;
      contexts.length = 0;
    }
  }
1049701
function DependencyInjector(opts) {
    var rootDefault = p.join(__dirname, '../../..');
    this.rootDir = opts.rootDir || rootDefault;                 // project base dir (default is a guess)
    this.require = opts.require || require;                     // we need require from the project
    this.container = opts.container || 'api';                   // resource has diff profiles for diff containers
    this.servicesDir = opts.servicesDir || 'services';          // dir where services reside
    this.tplDir = opts.tplDir || 'dist/tpls';                   // precompiled templates
    this.debug = opts.debug || false;                           // debug mode will have us firing more events
    this.debugPattern = opts.debugPattern;                      // by default if debug on, we view EVERYTHING
    this.debugHandler = opts.debugHandler;                      // function used when debug event occurs
    this.adapters = opts.adapters || {};                        // if client uses plugins, they will pass in adapters
    this.reactors = opts.reactors || {};                        // if client uses plugins, they will pass in reactors
    this.adapterMap = this.loadAdapterMap(opts);                // mappings from adapter type to impl
    this.aliases = this.loadAliases(opts);                      // mapping of names to locations
    this.factories = this.loadFactories(opts);                  // load all the factories
}
243429
function define(id, deps, exp) {
		if (!exp) { exp = deps; deps = [ 'require', 'exports', 'module' ]; }
		var module = getModule(undefined, id);
		module.children = map(deps, function(dep) { return getModule(module, dep); });
		module.loaded = true;
		factories[id] = exp;
		fireWaits(module);
	}
732220
function AdapterFactory(injector) {
    if (!injector.adapters) { return; }
    var me = this;

    this.adapterMap = {};
    _.each(injector.adapterMap, function (adapterName, adapterType) {
        var adapter = injector.adapters[adapterName];
        if (adapter) {
            me.adapterMap[adapterType + 'adapter'] = adapter;
        }
    });
}
374072
function generateResourceListingForVersion(options) {
  var clone = JSON.parse(JSON.stringify(options.rootDocument));
  clone.info.version =  options.version;
  clone.basePath = options.basePath;
  clone.paths = clone.paths || {};
  clone.definitions = clone.definitions || {};
  mergeIn(clone.paths, buildPaths(options.controllers));
  mergeIn(clone.definitions, buildDefinitions(options.controllers));

  return clone;
}
56276
def versions(args = {}, &bl)
      local_args = Hash[args]
      recursive  = local_args[:recursive]
      dev_deps   = local_args[:dev_deps]
      versions   = local_args[:versions] || {}

      gem_versions = Polisher::VersionChecker.versions_for(name, &bl)
      versions.merge! name => gem_versions
      local_args[:versions] = versions

      if recursive
        versions.merge! dependency_versions local_args, &bl
        versions.merge! dependency_versions local_args.merge(:dev => true), &bl if dev_deps
      end

      versions
    end
158247
private static synchronized void initDEVTESTPROD() {
    if (IS_DEV != null)
      return;
    IS_DEV = false;
    IS_TEST = false;
    IS_PROD = false;
    final List<String> envs = singletonInstance.getSearchEnvironments();
    for (final String env : envs) {
      if (env.equalsIgnoreCase("DEV")) {
        IS_DEV = true;
      }
    }
    for (final String env : envs) {
      if (env.equalsIgnoreCase("TEST")) {
        IS_DEV = false;
        IS_TEST = true;
      }
    }
    for (final String env : envs) {
      if (env.equalsIgnoreCase("PROD")) {
        IS_DEV = false;
        IS_TEST = false;
        IS_PROD = true;
      }
    }

  }
101156
private DevUtilsDemoObject create(final String name, ExecutionContext executionContext) {
        return executionContext.add(this, devUtilsDemoObjects.create(name));
    }
931978
function createPlatformFactory(parentPlatformFactory, name, providers) {
    if (providers === void 0) { providers = []; }
    var desc = "Platform: " + name;
    var marker = new InjectionToken(desc);
    return function (extraProviders) {
        if (extraProviders === void 0) { extraProviders = []; }
        var platform = getPlatform();
        if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {
            if (parentPlatformFactory) {
                parentPlatformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));
            }
            else {
                var injectedProviders = providers.concat(extraProviders).concat({ provide: marker, useValue: true });
                createPlatform(Injector.create({ providers: injectedProviders, name: desc }));
            }
        }
        return assertPlatform(marker);
    };
}
927917
function factory(key, options) {
  var settings = options || {}

  function one(value) {
    var fn = one.invalid
    var handlers = one.handlers

    if (value && own.call(value, key)) {
      fn = own.call(handlers, value[key]) ? handlers[value[key]] : one.unknown
    }

    return (fn || noop).apply(this, arguments)
  }

  one.handlers = settings.handlers || {}
  one.invalid = settings.invalid
  one.unknown = settings.unknown

  return one
}