The bot's main entry point.

    | Initialize the bot and start processing messages.
341946
def init(confdir="/etc/cslbot"):
    
    multiprocessing.set_start_method('spawn')

    parser = argparse.ArgumentParser()
    parser.add_argument('-d', '--debug', help='Enable debug logging.', action='store_true')
    parser.add_argument('--validate', help='Initialize the db and perform other sanity checks.', action='store_true')
    args = parser.parse_args()
    loglevel = logging.DEBUG if args.debug else logging.INFO
    logging.basicConfig(level=loglevel, format="%(asctime)s %(levelname)s:%(module)s:%(message)s")
    # We don't need a bunch of output from the requests module.
    logging.getLogger("requests").setLevel(logging.WARNING)

    cslbot = IrcBot(confdir)

    if args.validate:
        cslbot.shutdown_mp()
        print("Everything is ready to go!")
        return

    try:
        cslbot.start()
    except KeyboardInterrupt:
        # KeyboardInterrupt means someone tried to ^C, so shut down the bot
        cslbot.disconnect('Bot received a Ctrl-C')
        cslbot.shutdown_mp()
        sys.exit(0)
    except Exception as ex:
        cslbot.shutdown_mp(False)
        logging.error("The bot died! %s", ex)
        output = "".join(traceback.format_exc()).strip()
        for line in output.split('\n'):
            logging.error(line)
        sys.exit(1)
1147473
def start(self):
        

        # Spawn the listening thread
        self.listen_thread = eventlet.spawn_n(self.listen)

        # Now do the initial load
        self.reload()
1210980
def main(*args, **kwargs):
    
    kwargs = {**kwargs, **_get_kwargs()}
    # FIXME: This filepath handeling is messed up and not transparent as it should be
    default_filepath = get_config_filepath()
    configuration_filepath = kwargs.get('configuration_filepath')
    if configuration_filepath is None:
        configuration_filepath = default_filepath
    # configuration is from an `ini` file
    configuration = _get_config(configuration_filepath)
    # setup some sane defaults
    robot_name = _configuration_sane_defaults(configuration)
    # Get the port configuration out of the configuration
    port_config = _port_configuration_helper(configuration)
    # create the settings manager using the port config
    if _setproctitle:
        _setproctitle.setproctitle('vexbot')

    robot = Robot(robot_name, port_config)
    robot.run()
1130938
function main() {
  var server = new grpc.Server();
  server.addService(services.GreeterService, {sayHello: sayHello});
  server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
  server.start();
}
579072
def main():
    
    log = logging.getLogger(Logify.get_name() + '.logify.main')
    log.info('logger name is: %s', Logify.get_name())
    log.debug('This is DEBUG')
    log.info('This is INFO')
    log.warning('This is a WARNING')
    log.error('This is an ERROR')
1212672
def main(**kwargs):
    

    config = _from_argv(irc3.IrcBot, kwargs=kwargs)
    if not 'includes' in config:
        config['includes'] = []

    message_plug = 'vexbot.adapters.irc.echo_to_message'
    if not message_plug in config['includes']:
        config['includes'].append(message_plug)
    service_name = config.get('service_name', 'irc')
    connection = config.get('connection', {})
    interface = IrcInterface(service_name, irc_config=config, connection=connection)

    interface.run()
    sys.exit()
806786
public function onStart()
    {
        $this->setProcessName('master process');
        $this->createPidFile();

        $this->container->make('events')->dispatch('swoole.start', func_get_args());
    }
1188129
function main() {
    this.prior = this.current;
    this.current = this.current.apply(this, arguments) || this.current;
    // Call user transition function, if defined
    if (this.transition) {
        this.transition.apply(this, arguments);
    }
}
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, []);
}
616360
def run(self):
        
        self._connect()
        super(irc.bot.SingleServerIRCBot, self).start()
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()
1096389
public void init()
	{
		pipeline = pipeline();
		
		pipeline.addLast("messageBufferEventDecoder", messageBufferEventDecoder);
		pipeline.addLast("upstream", upstream);
		
		// Downstream handlers - Filter for data which flows from server to
		// client. Note that the last handler added is actually the first
		// handler for outgoing data.
		pipeline.addLast("messageBufferEventEncoder",messageBufferEventEncoder);
	}
1295197
def startup():
    
    model.setup()
    index.scan_index(config.content_folder)
    index.background_scan(config.content_folder)
571309
def main():
	
	parser = cli.Cli()
	parser.parse(sys.argv[1:])
	return parser.run()
738073
function main() {
  config = createConfig(process.argv.slice(2));

  if (config.options.help) {
    config.options.showHelp(NODE_DEBUG_MODE);
    process.exit();
  }

  if (config.options.version) {
    config.options.showVersion();
    process.exit();
  }

  process.on('SIGINT', function() {
     process.exit();
  });

  startInspectorProcess(function(error, result) {
    if (error) {
      console.error(formatNodeInspectorError(error));
      process.exit(1);
    }

    var url = result.address.url;
    var isUnixSocket = result.address.isUnixSocket;

    startDebuggedProcess(function(error) {
      if (error) {
        console.error('Cannot start %s: %s', config.subproc.script, error.message || error);
        process.exit(2);
      }

      openBrowserAndPrintInfo(url, isUnixSocket);
    });
  });
}
1231795
def start(self):
        
        origin = inspect.stack()[1][0]

        self.reset()

        # Install the tracer on this thread.
        self._start_tracer(origin)
30727
def start(self):
        
        Global.LOGGER.info("starting the flow manager")
        self._start_actions()
        self._start_message_fetcher()
        Global.LOGGER.debug("flow manager started")