The headas-init.sh script generates its variables in a bit of a funky way
        -- it runs a script that generates a list of settings. These are their
        transcriptions.
353172
def modify_environment (self, env):
        
        plat = self._platform

        def path (*args):
            return os.path.join (self._installdir, *args)

        env['CALDB'] = b'http://heasarc.gsfc.nasa.gov/FTP/caldb'
        env['CALDBCONFIG'] = path ('caldb.config')
        env['CALDBALIAS'] = path ('alias_config.fits')

        env['HEADAS'] = path (plat)
        env['LHEASOFT'] = env['HEADAS']
        env['FTOOLS'] = env['HEADAS']

        prepend_environ_path (env, 'PATH', path (plat, 'bin'))
        prepend_environ_path (env, 'LD_LIBRARY_PATH', path (plat, 'lib'))
        prepend_environ_path (env, 'PERLLIB', path (plat, 'lib', 'perl'))
        prepend_environ_path (env, 'PERL5LIB', path (plat, 'lib', 'perl'))
        prepend_environ_path (env, 'PYTHONPATH', path (plat, 'lib'))
        prepend_environ_path (env, 'PYTHONPATH', path (plat, 'lib', 'python'))

        userpfiles = user_data_path ('hea-pfiles')
        io.ensure_dir (userpfiles, parents=True)
        env['PFILES'] = ';'.join ([userpfiles,
                                   path (plat, 'syspfiles')])

        env['LHEA_DATA'] = path (plat, 'refdata')
        env['LHEA_HELP'] = path (plat, 'help')
        env['PGPLOT_DIR'] = path (plat, 'lib')
        env['PGPLOT_FONT'] = path (plat, 'lib', 'grfont.dat')
        env['PGPLOT_RGB'] = path (plat, 'lib', 'rgb.txt')
        env['POW_LIBRARY'] = path (plat, 'lib', 'pow')
        env['TCLRL_LIBDIR'] = path (plat, 'lib')
        env['XANADU'] = path ()
        env['XANBIN'] = path (plat)
        env['XRDEFAULTS'] = path (plat, 'xrdefaults')

        env['EXT'] = b'lnx' # XXX portability probably ...
        env['LHEAPERL'] = b'/usr/bin/perl' # what could go wrong?
        env['PFCLOBBER'] = b'1'
        env['FTOOLSINPUT'] = b'stdin'
        env['FTOOLSOUTPUT'] = b'stdout'
        return env
105032
function main() {
	var snippet;
	var header;
	var fpath;
	var keys;
	var lang;
	var conf;
	var len;
	var i;

	keys = objectKeys( LANGS );
	len = keys.length;

	debug( 'Generating %d license header snippets...', len );
	for ( i = 0; i < len; i++ ) {
		lang = keys[ i ];

		debug( 'Generating license header for `%s`...', lang );
		if ( lang === 'default' ) {
			header = licenseHeader( SPDX, DEFAULT_HEADER_LANG, OPTS );
		} else {
			header = licenseHeader( SPDX, lang, OPTS );
		}
		if ( header === null ) {
			debug( 'Failed to generate a license header for `%s`.', lang );
			continue;
		}
		conf = LANGS[ lang ];

		debug( 'Generating license header snippet...' );
		snippet = createSnippet( header, conf );

		debug( 'Writing license header snippet to file...' );
		if ( lang === 'default' ) {
			fpath = join( OUT_DIR, 'stdlib-license.sublime-snippet' );
		} else {
			fpath = join( OUT_DIR, 'stdlib-license-'+lang+'.sublime-snippet' );
		}
		writeFileSync( fpath, snippet, FOPTS );

		debug( 'Successfully generated license header snippet.' );
	}
	debug( 'Finished generating snippets.' );
}
440188
def start
      puts "\n******************************************************************************************************************************************\n\n"
      puts "  JumpStarting....\n".purple
      check_setup
      execute_install_command
      run_scripts_from_yaml(:run_after_install_command)
      parse_template_dir
      create_dirs
      populate_files_from_whole_templates
      populate_files_from_append_templates
      populate_files_from_line_templates
      remove_unwanted_files
      run_scripts_from_yaml(:run_after_jumpstart)
      check_for_strings_to_replace
      run_scripts_from_yaml(:run_after_string_replace)
      check_local_nginx_configuration
      exit_with_success
    end
1261913
def init_vars
      @quit_key ||= FFI::NCurses::KEY_F10
      # actually this should be maintained inside ncurses pack, so not loaded 2 times.
      # this way if we call an app from existing program, App won't start ncurses.
      unless $ncurses_started
        init_ncurses
      end
      $lastline = Ncurses.LINES - 1
      unless $log
        logpath=ENV["CANIS_LOG_PATH"]
        $log = create_logger(logpath || "/dev/null")
      end
    end
340722
public static function _init()
	{
		// load the file config
		\Config::load('file', true);

		// make sure the log directories exist
		try
		{
			// determine the name and location of the logfile
			$path     = \Config::get('log_path', APPPATH.'logs'.DS);
			$filename = \Config::get('log_file', null);

			if(empty($filename))
			{
				$rootpath = $path.date('Y').DS;
				$filepath = $path.date('Y/m').DS;
				$filename = $filepath.date('d').'.php';
			}
			else
			{
				$rootpath = $path;
				$filepath = $path;
				$filename = $path.$filename;
			}

			// get the required folder permissions
			$permission = \Config::get('file.chmod.folders', 0777);

			if ( ! is_dir($rootpath))
			{
				mkdir($rootpath, 0777, true);
				chmod($rootpath, $permission);
			}
			if ( ! is_dir($filepath))
			{
				mkdir($filepath, 0777, true);
				chmod($filepath, $permission);
			}

			$handle = fopen($filename, 'a');
		}
		catch (\Exception $e)
		{
			\Config::set('log_threshold', \Fuel::L_NONE);
			throw new \FuelException('Unable to create or write to the log file. Please check the permissions on '.\Config::get('log_path').'. ('.$e->getMessage().')');
		}

		if ( ! filesize($filename))
		{
			fwrite($handle, "<?php defined('COREPATH') or exit('No direct script access allowed'); ?>".PHP_EOL.PHP_EOL);
			chmod($filename, \Config::get('file.chmod.files', 0666));
		}
		fclose($handle);

		// create the monolog instance
		static::$monolog = new \Monolog\Logger('fuelphp');

		// create the streamhandler, and activate the handler
		$stream = new \Monolog\Handler\StreamHandler($filename, \Monolog\Logger::DEBUG);
		$formatter = new \Monolog\Formatter\LineFormatter("%level_name% - %datetime% --> %message%".PHP_EOL, "Y-m-d H:i:s");
		$stream->setFormatter($formatter);
		static::$monolog->pushHandler($stream);
	}
911306
public function initChunks()
    {
        if (!$this->t_head) {
            $this->t_head = $this->template->cloneRegion('Head');
            $this->t_row_master = $this->template->cloneRegion('Row');
            $this->t_totals = $this->template->cloneRegion('Totals');
            $this->t_empty = $this->template->cloneRegion('Empty');

            $this->template->del('Head');
            $this->template->del('Body');
            $this->template->del('Foot');
        }
    }
740002
def settings_api():
    
    variables = [
        "%s = %s" % (var, repr(getattr(settings, var)))
        for var in sorted(dir(settings))
        if (not var.startswith("_") and var.upper() == var and
            not var.startswith("SEEDER"))  # hide the private tokens and url
    ]

    return PY_HEADER + "\n\n".join(variables)
118253
def _init_config(self):
        
        options = self.parser.parse_args()
        if options.config is None and options.input is None:
            self.parser.print_help()
            sys.exit(2)

        if options.config is not None:
            configFactory = ConfigFactory()
            config = configFactory.load_from_file(options.config)
        else:
            config = ConfigObject()

        if options.input is not None:
            config["input"]["locations"] = [str(x) for x in options.input]
        if options.arguments is not None:
            config["input"]["arguments"] = dict((x.partition("=")[0], x.partition("=")[2]) for x in options.arguments)

        if options.output is not None:
            config["output"]["location"] = options.output

        if options.no_validate is not None:
            config["input"]["validate"] = not options.no_validate

        if options.dry_run is not None:
            self.dry_run = options.dry_run
        if options.watch is not None:
            self.watch = options.watch
        if options.traceback is not None:
            self.traceback = options.traceback

        if options.quiet is not None:
            self.logger.setLevel(logging.WARNING)
        if options.silence is not None:
            logging.disable(logging.CRITICAL)

        configService = ConfigService()
        configService.validate(config)
        self.config = config
181448
public function Initialize() {
      $this->Head = new HeadModule($this);
      $this->Head->AddTag('meta', array('name' => 'robots', 'content' => 'noindex'));
      
      $this->AddJsFile('jquery.js');
      $this->AddJsFile('jquery.livequery.js');
      $this->AddJsFile('jquery.form.js');
      $this->AddJsFile('jquery.popup.js');
      $this->AddJsFile('jquery.gardenhandleajaxform.js');
      $this->AddJsFile('global.js');
      
      $this->AddCssFile('style.css');
      parent::Initialize();
      Gdn_Theme::Section('Entry');
   }
676621
def gen_setup(config, default_build_type, relative_path, setup_script_name):
    
    from autocmake.extract import extract_list

    s = []
    s.append('#!/usr/bin/env python')
    s.append('\n{0}'.format(autogenerated_notice()))
    s.append('\nimport os')
    s.append('import sys')
    s.append('assert sys.version_info >= (2, 6), \'Python >= 2.6 is required\'')

    s.append("\nsys.path.insert(0, '{0}')".format(relative_path))

    s.append('from autocmake import configure')
    s.append('from autocmake.external import docopt')

    s.append('\n\noptions = """')
    s.append('Usage:')
    s.append('  ./{0} [options] [<builddir>]'.format(setup_script_name))
    s.append('  ./{0} (-h | --help)'.format(setup_script_name))
    s.append('\nOptions:')

    options = []

    for opt in config['docopt']:
        first = opt.split()[0].strip()
        rest = ' '.join(opt.split()[1:]).strip()
        options.append([first, rest])

    options.append(['--type=<TYPE>', 'Set the CMake build type (debug, release, relwithdebinfo, minsizerel) [default: {0}].'.format(default_build_type)])
    options.append(['--generator=<STRING>', 'Set the CMake build system generator [default: Unix Makefiles].'])
    options.append(['--show', 'Show CMake command and exit.'])
    options.append(['--cmake-executable=<CMAKE_EXECUTABLE>', 'Set the CMake executable [default: cmake].'])
    options.append(['--cmake-options=<STRING>', "Define options to CMake [default: '']."])
    options.append(['--prefix=<PATH>', 'Set the install path for make install.'])
    options.append(['<builddir>', 'Build directory.'])
    options.append(['-h --help', 'Show this screen.'])

    s.append(align_options(options))

    s.append('"""')

    s.append(gen_cmake_command(config))

    s.append("\n")
    s.append("# parse command line args")
    s.append("try:")
    s.append("    arguments = docopt.docopt(options, argv=None)")
    s.append("except docopt.DocoptExit:")
    s.append(r"    sys.stderr.write('ERROR: bad input to {0}\n'.format(sys.argv[0]))")
    s.append("    sys.stderr.write(options)")
    s.append("    sys.exit(-1)")
    s.append("\n")
    s.append("# use extensions to validate/post-process args")
    s.append("if configure.module_exists('extensions'):")
    s.append("    import extensions")
    s.append("    arguments = extensions.postprocess_args(sys.argv, arguments)")
    s.append("\n")
    s.append("root_directory = os.path.dirname(os.path.realpath(__file__))")
    s.append("\n")
    s.append("build_path = arguments['<builddir>']")
    s.append("\n")
    s.append("# create cmake command")
    s.append("cmake_command = '{0} -H{1}'.format(gen_cmake_command(options, arguments), root_directory)")
    s.append("\n")
    s.append("# run cmake")
    s.append("configure.configure(root_directory, build_path, cmake_command, arguments['--show'])")

    return s
352653
private void executeInitScript() {
    if (initScript != null && initScript.exists()) {
      try {
        Runtime run = Runtime.getRuntime();
        Process proc = run.exec(new String[] {
            "/bin/bash", "-c", initScript.getAbsolutePath()
        });
        BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
        String line;

        logInfo("Output of running script is");
        while ((line = br.readLine()) != null) {
          logInfo(line);
        }
        proc.waitFor(); // Wait for the process to finish.
        logInfo("Script executed successfully %s", initScript.getAbsolutePath());
      } catch (IOException e) {
        logDebug(debug, "Error executing script for path: %s", initScript.getAbsolutePath());
        e.printStackTrace(System.out);
      } catch (InterruptedException e) {
        logDebug(debug, "Script execution interrupted for path: %s", initScript.getAbsolutePath());
        e.printStackTrace(System.out);
      }
    }
  }
125633
function init (update) {
      var self = this
      var head = (typeof self.$options.head === 'function') ? self.$options.head.bind(self)() : self.$options.head
      if (!head) return
      Object.keys(head).map(function (key) {
        var prop = head[key]
        if (!prop) return
        var obj = (typeof prop === 'function') ? head[key].bind(self)() : head[key]
        if (key === 'title') {
          util[key](obj)
          return
        }
        util.handle(obj, key, 'head', update)
      })
      self.$emit('okHead')
    }
1287942
public function actionInit()
    {
        // username
        $username = $this->getConfig(self::CONFIG_VAR_USERNAME);
        if (!$username) {
            $username = $this->prompt('Whats your Github username?');
            $this->saveConfig(self::CONFIG_VAR_USERNAME, $username);
        }
        
        // clonetype
        $cloneType = $this->getConfig(self::CONFIG_VAR_CLONETYPE);
        if (!$cloneType) {
            $cloneType = $this->select('Are you connected via ssh or https?', ['ssh' => 'ssh', 'http' => 'http']);
            $this->saveConfig(self::CONFIG_VAR_CLONETYPE, $cloneType);
        }
        
        $summary = [];
        $itemWithoutFork = false;
        
        // generate summary overview
        foreach ($this->repos as $repo) {
            $newRepoHome = $this->getFilesystemRepoPath($repo);
            if (file_exists($newRepoHome . DIRECTORY_SEPARATOR . '.git')) {
                $summary[] = $this->summaryItem($repo, false, true);
            } elseif ($this->forkExists($username, $repo)) {
                $summary[] = $this->summaryItem($repo, true, false);
            } else {
                $itemWithoutFork = true;
                $summary[] = $this->summaryItem($repo, false, false);
            }
        }
        
        if ($itemWithoutFork) {
            Console::clearScreen();
            $this->outputInfo($this->markdown($this->text));
            foreach ($summary as $sum) {
                if (!$sum[2] && !$sum[1]) {
                    $this->outputInfo($this->markdown("**{$sum[0]}**: https://github.com/luyadev/{$sum[0]}/fork", true));
                }
            }
            echo (new Table())->setHeaders(['Repo', 'Already initialized', 'Fork exists'])->setRows($summary)->run();
            $this->outputError("Repos without fork detected. Those repos will be initialized as READ ONLY. It means you can not push any changes to them.");
            
            if (!$this->confirm("Continue?")) {
                return $this->outputError('Abort by User.');
            }
        }
        
        // foreach summary and clone
        foreach ($summary as $sum) {
            $repo = $sum[0];
            $hasFork = $sum[2];
            $exists = $sum[1];
            
            // continue already initialized repos.
            if ($exists) {
                continue;
            }
            
            $newRepoHome = $this->getFilesystemRepoPath($repo);
            
            if ($hasFork) {
                $cloneUrl = ($cloneType == 'ssh') ? "git@github.com:{$username}/{$repo}.git" : "https://github.com/{$username}/{$repo}.git";
            } else {
                $cloneUrl = ($cloneType == 'ssh') ? "git@github.com:luyadev/{$repo}.git" : "https://github.com/{$username}/{$repo}.git";
            }
            
            $this->cloneRepo($repo, $cloneUrl, $newRepoHome, 'luyadev');
        }
        
        return $this->outputSuccess("init complete.");
    }
55714
def build_vars(path=None):
        """"""
        init_vars = {
            "__name__": "__main__",
            "__package__": None,
            "reload": reload,
        }
        if path is not None:
            init_vars["__file__"] = fixpath(path)
        # put reserved_vars in for auto-completion purposes
        for var in reserved_vars:
            init_vars[var] = None
        return init_vars
225916
public function init()
    {
        if (Console::isCli()) {
            // fix for fcgi
            defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));

            if (!isset($_SERVER['argv'])) {
                die('This script must be run from the command line.');
            }
            $this->_runner = $this->createCommandRunner();
            $this->_runner->commands = $this->commandMap;
            $this->_runner->addCommands($this->getCommandPath());

            $env = @getenv('CONSOLE_COMMANDS');
            if (!empty($env)) {
                $this->_runner->addCommands($env);
            }

            foreach ($this->modules as $name => $settings) {
                $modulePath = Alias::get("Modules." . $name . ".Commands");
                if ($modulePath) {
                    $this->_runner->addCommands($modulePath);
                }
            }
        } else {
            // preload 'request' so that it has chance to respond to onBeginRequest event.
            $this->getComponent('request');
        }
    }
1283194
def generate_settings():
    
    conf_file = os.path.join(os.path.dirname(base_settings.__file__),
                             'example', 'conf.py')
    conf_template = open(conf_file).read()
    default_url = 'http://salmon.example.com'
    site_url = raw_input("What will be the URL for Salmon? [{0}]".format(
        default_url))
    site_url = site_url or default_url
    secret_key = base64.b64encode(os.urandom(KEY_LENGTH))
    api_key = base64.b64encode(os.urandom(KEY_LENGTH))
    output = conf_template.format(api_key=api_key, secret_key=secret_key,
                                  site_url=site_url)
    return output
1314098
function initApi(opts) {
	var logMarker = require.emitter.id + ':' + process.pid
	log = function () {
		console.log(logMarker, util.format.apply(this, Array.prototype.slice.call(arguments)))
	}
	var logger

	if (Array.isArray(opts.ignoredSignals)) 	opts.ignoredSignals.forEach(function (signal) {
		process.on(signal, getSignalHandler(signal))
	})


	if (process.send) {
		logger = new rotatedlogger.RotatedLog({stdout: false, file: true, streamOpts: {logFile: opts.logName}})

		process.stdin.setEncoding('utf-8') // returns undefined
		process.stdin.on('data', stdinDataListener) // returns this
			.once('close', stdinCloseListener)
			.resume()
		process.send('ok') // let parent know we are ready
	} else {
		log('Fatal: ipc not available')
		shutdown()
	}

	function stdinDataListener(data) {
		logger.write(data)
	}
	function stdinCloseListener() {
		log('Detected pipe close')
		logger.write('Log pipe close event ' + (new Date).toISOString())
		logger.close(cleanup)
	}

	function cleanup(err) {
		if (err) log('logger.close:', err)
		process.stdin.removeListener('data', stdinDataListener)
		process.stdin.removeListener('close', stdinCloseListener)
		process.stdin.pause()
		logger = null
		shutdown()
	}

	function shutdown() {
		apprunner.shutdown()
	}
}