Main integration loop
549074
function step ({tick}) {
  setFBO({ framebuffer: FIELDS[0] }, () => {
    regl.clear({ color: [0, 0, 0, 1] })
    splatMouse()
    splatVerts({
      vertexState: VERTEX_STATE[(tick + 1) % 2]
    })
  })
  for (let i = 0; i < 2 * BLUR_PASSES; ++i) {
    blurPass({
      dest: FIELDS[(i + 1) % 2],
      src: FIELDS[i % 2],
      axis: (i % 2)
    })
  }
  gradPass({
    dest: FIELDS[1],
    src: FIELDS[0]
  })
  applySpringForces({
    dest: VERTEX_STATE[(tick + 1) % 2],
    src: VERTEX_STATE[tick % 2]
  })
  integrateVerts({
    dest: VERTEX_STATE[tick % 2],
    src: VERTEX_STATE[(tick + 1) % 2],
    field: FIELDS[1]
  })
}
879475
def main():
    
    setup_main()
    config = ConfigData(clean=True)
    try:
        config.register()
    finally:
        config.clean_after_if_needed()
1133777
async function main () {
  const version = await getVersion()

  for (const MODULE of ELECTRON_MODULES) {
    for (const PLATFORM of PLATFORMS) {
      for (const ARCH of ARCHS) {
        const name = getElectronName(MODULE, PLATFORM, ARCH)
        const filename = name + '.tar.gz'
        const url = getUrl(version, name)
        const binary = await download(url).catch(error => console.error(error, url))
        if (binary) {
          console.info(`Success ${url}`)
          fs.writeFileSync(filename, binary)
          await decompress(filename, path.join(__dirname, '..', 'binaries', `sqlite3-${PLATFORM}`))
          fs.removeSync(filename)
        }
      }
    }
  }

  for (const MODULE of MODULES) {
    for (const PLATFORM of PLATFORMS) {
      for (const ARCH of ARCHS) {
        const name = getName(MODULE, PLATFORM, ARCH)
        const filename = name + '.tar.gz'
        const url = getUrl(version, name)
        const binary = await download(url).catch(error => console.error(error, url))
        if (binary) {
          console.info(`Success ${url}`)
          fs.writeFileSync(filename, binary)
          await decompress(filename, path.join(__dirname, '..', 'binaries', `sqlite3-${PLATFORM}`))
          fs.removeSync(filename)
        }
      }
    }
  }

}
789637
function main() {
  var wtfOptions = self.options.wtfOptions || {};

  setupCommunications();

  injectScriptFile(
      'wtf_trace_web_js_compiled.js', self.options.wtfScriptContents);
  injectScriptFunction(function(options) {
    wtf.trace.prepare(options);
  }, [
    wtfOptions
  ]);
  injectScriptFunction(startTracing, []);
}
1446
function main(){

    var argv =      yargs
                    .boolean( "a" )
                    .boolean( "r" )
                    .boolean( "s" )
                    .boolean( "c" )
                    .boolean( "h" )
                    .boolean( "v" )
                    .argv;

    var options =   {
        all:        argv.a || argv.all || false,
        recursive:  argv.r || argv.recursive || false,
        sort:       argv.s || argv.sort || false,
    };

    if ( argv.v || argv.version ){
        return printAndExitOk( getVersion() );
    }

    if ( argv.h || argv.help ){
        return printAndExitOk( getHelp() );
    }
        
    if ( !argv._ || !argv._.length ){
        return printAndExitError( getHelp() );
    }

    if ( argv.p || argv.parts ){
        options.parts = ( argv.p || argv.parts ).split( "," );
    }

    if( argv.i || argv["include-path"] ){
        options.includePath = ( argv.i || argv["include-path"] ).split( path.delimiter );
    }

    var cat =       argv.c || argv.cat;
    var fmt =       argv.f || argv.format;

    if ( cat && !options.parts ){
        return printAndExitError( "Please specify which parts should be concatenated with the -p option." );
    }

    if ( cat && fmt ){
        return printAndExitError( "Please choose either concatenating parts (-c) or outputing components (-f)." );
    }

    var components =    mpc.apply( this, [ options ].concat( argv._ ));

    if ( cat ){
        return catParts( components, options.parts );
    }

    switch( fmt ){
        
        case "json":
            console.log( JSON.stringify( components ));
            break;

        case "csv":
        default:
            return printCsv( components );
    }
}
1356121
async function main() {
  const csv = fs.readFileSync('fsm.csv', { encoding: 'utf8' })
  const dot = graphViz(parseCSV(csv))
  fs.writeFileSync('fsm.dot', dot)
  const viz = new Viz({ Module, render })
  const svg = await viz.renderString(dot)
  fs.writeFileSync('fsm.svg', svg)
}
856063
async function main () {

    let exchanges = []

    // instantiate all exchanges
    await Promise.all (ccxt.exchanges.map (async id => {
        let exchange = new (ccxt)[id] ()
        exchanges.push (exchange)
        await test (exchange, symbol)
    }))

    let succeeded = exchanges.filter (exchange => exchange.markets ? true : false).length.toString ().bright.green
    let failed = exchanges.filter (exchange => exchange.markets ? false : true).length
    let total = ccxt.exchanges.length.toString ().bright.white
    console.log (succeeded, 'of', total, 'exchanges loaded', ('(' + failed + ' errors)').red)
}
677375
def main():
    
    # Setup an initial logging handler that buffers log messages before
    # applying the final logging configuration.
    initial_handler = logging.handlers.MemoryHandler(100)
    root_logger = logging.getLogger()
    root_logger.addHandler(initial_handler)

    # Parse configuration and setup logging.
    conf = config.Config(get_config_options())
    conf.parse_args()
    setup_logging(conf)

    # Flush the buffered log messages to the final logging handler.
    initial_handler.setTarget(root_logger.handlers[-1])
    initial_handler.flush()
    root_logger.removeHandler(initial_handler)

    log_startup_info()

    connector = Connector.from_config(conf)

    # Catch SIGTERM and SIGINT to cleanup the connector gracefully
    def signame_handler(signal_name):
        def sig_handler(signum, frame):
            # Save the signal so it can be printed later
            connector.signal = (signal_name, signum)
            connector.can_run = False

        return sig_handler

    signal.signal(signal.SIGTERM, signame_handler("SIGTERM"))
    signal.signal(signal.SIGINT, signame_handler("SIGINT"))

    connector.start()

    while True:
        if not connector.is_alive():
            break
        time.sleep(3)
1349850
public function main() {
        $this->stdout->styles('success', array('text' => 'green'));

        $this->hr(1);
        $this->out(sprintf('%s Steps:', $this->name));

        $counter = 1;

        foreach ($this->steps as $method) {
            $this->steps($counter);

            try {
                if (!call_user_func(array($this, $method))) {
                    $this->err('<error>Process aborted!</error>');
                    break;
                }
            } catch (Exception $e) {
                $this->err(sprintf('<error>Unexpected error has occurred; %s</error>', $e->getMessage()));
                break;
            }

            $counter++;
        }
    }
572960
def main():
    """"""
    # Helper method so that the coroutine exits cleanly if an exception
    # happens (which would leave resources dangling)
    async def _run_application(loop):
        try:
            return await cli_handler(loop)

        except KeyboardInterrupt:
            pass  # User pressed Ctrl+C, just ignore it

        except SystemExit:
            pass  # sys.exit() was used - do nothing

        except:  # pylint: disable=bare-except  # noqa
            import traceback

            traceback.print_exc(file=sys.stderr)
            sys.stderr.writelines(
                '\n>>> An error occurred, full stack trace above\n')

        return 1

    try:
        loop = asyncio.get_event_loop()
        return loop.run_until_complete(_run_application(loop))
    except KeyboardInterrupt:
        pass

    return 1
547916
def main(self):
        
        self.loop = urwid.MainLoop(self.top, self.palettes[self.palette_names[0]], screen=self.tui,
                                   handle_mouse=False, input_filter=self.handle_keys,
                                   unhandled_input=self.unhandled)
        self.loop.run()
1238054
def main(self):
        
        parser = self.init_parser()
        if len(sys.argv) < 2:
            parser.print_usage()
            sys.exit(0)

        self.args = parser.parse_args()
        self.roca.args.flatten = self.args.flatten
        self.roca.args.indent = self.args.indent

        if self.args.debug:
            coloredlogs.install(level=logging.DEBUG)
            self.roca.args.debug = True

        self.work()
1371814
function main()
{
	aqParseOptions();

	aq_amqp = mod_amqp.createConnection(aq_broker);
	aq_amqp.on('ready', function () {
		aq_exchange = aq_amqp.exchange('amq.topic');
		setInterval(aqBlast, 1000);
	});
}
59596
def main():
    
    args = parse_args()
    logging.basicConfig(level=LOG_LEVELS[min(
        args.verbosity, len(LOG_LEVELS) - 1)])

    loop = asyncio.get_event_loop()
    loop.run_until_complete(_run(args))
662094
function main() {
    loadDependencies();
    setInitialData();
    domHelpers.initDomElements();

    setDataInInputField();
    setConfigInInputField();
    setChartSelectorType();
    setNewChart();
    setHandlers();
}
678157
function mainloop(){
		// console.log('mainloop()');
		var queue = [];
		if( !_this.canceled && _this.queue.length ){
			// var row = _this.queue.shift();
			queue = _this.queue;
			_this.queue = [];

			it79.ary(
				queue,
				5,
				function(it1, row, idx){
					searchInFile(row, function(){
						if( _this.canceled ){
							it1.break();
							return;
						}
						it1.next();
						return;
					});
				},
				function(){
					if( _this.canceled ){
						complete();
						return;
					}
				}
			);
		}

		if( _this.canceled || statusFilelist == true && !_this.queue.length && countTarget == countDone ){
			complete();
			return;
		}

		_this.mainloopTimer = setTimeout( mainloop, 3);
		return;
	}
1213848
def main():
    """"""
    source_files = (
        ('integration', r'results/results.xml'),
        ('unittests', r'results/unittests.xml'),
        ('coverage', r'results/coverage.xml')
    )

    parsed = {k: ElementTree.parse(v).getroot().attrib for k, v in source_files}

    with open(r'results/summary.json', 'w') as fh:
        json.dump(parsed, fh)