Main browser-demo.
Render a message and boot the web worker.
175480
async function main() {
  const { window } = webContext();
  if (window) {
    await windowReadiness(window);
    render(window);
    bootWebWorker(window);
  } else {
    console.warn("No web window. Can't run browser-demo.");
  }
}
1280452
public static void main(String[] args) {
        JmxDemo demo=new JmxDemo();
        demo.addNotificationListener((notification, handback) -> System.out.println(">> " + notification + ", handback=" + handback), null, "myHandback");
        demo.startNotifications();

        MBeanServer server=Util.getMBeanServer();
        if(server != null) {
            try {
                JmxConfigurator.register(demo, server, "demo:name=DemoObject");
                while(true) {
                    Util.sleep(10000);
                }
            }
            catch(Exception e) {
                e.printStackTrace();
            }
        }
    }
21671
public function run() {
        try {
            $request  = $this->getLoops()->getService("request");
            $response = $this->getLoops()->getService("response");
            $web_core = $this->getLoops()->getService("web_core");

            //dispatch request
            echo $web_core->dispatch($this->url, $request, $response);
        }
        catch(Throwable $exception) {
            http_response_code(500);

            try {
                $renderer = $this->getLoops()->getService("renderer");
                echo $renderer->render($exception);
            }
            catch(Throwable $render_exception) {
                Misc::displayException($exception);
            }
        }
    }
651031
function main(onStart) {
    const conf = config.read();

    initLogging(conf);
    initFsStorage(conf);

    logger.debug('Default configuration file: %s', conf.path);
    logger.debug('Configuration parameters: %s', JSON.stringify(conf));

    runWebServer(conf, onStart);
}
1212355
def Run(self, unused_arg, ttl=None):
    """"""
    logging.debug("Sending startup information.")
    boot_time = rdfvalue.RDFDatetime.FromSecondsSinceEpoch(psutil.boot_time())
    response = rdf_client.StartupInfo(
        boot_time=boot_time, client_info=GetClientInformation())

    self.grr_worker.SendReply(
        response,
        session_id=self.well_known_session_id,
        response_id=0,
        request_id=0,
        message_type=rdf_flows.GrrMessage.Type.MESSAGE,
        require_fastpoll=False,
        ttl=ttl)
1048
function startInlineServices() {
  // Provide a webhook definition
  var hook = {
    name: 'Inline Sample',
    events: ['message.sent'],
    path: '/inline_sample_message_sent',
  };

  // Register this webhook with Layer's Services
  webhooksServices.register({
    secret: SECRET,
    url: HOST + ':' + PORT,
    hooks: [hook]
  });

  // Listen for events from Layer's Services, and call our callbackAsync with each event
  webhooksServices.listen({
    expressApp: app,
    secret: SECRET,
    hooks: [hook]
  }, redis);

  // Setup your callback to handle the webhook events
  queue.process(hook.name, 50, function(job, done) {
    console.log(new Date().toLocaleString() + ': Inline Sample: Message Received from ' + (job.data.message.sender.user_id || job.data.message.sender.name));
    done();
  });
}
1314425
def run(self):
        ''''''

        if subprocess.call(['npm', '--version']) != 0:
            raise RuntimeError('npm is required to build the HTML renderer.')

        self.check_call(['npm', 'install'], cwd=HTML_RENDERER_DIR)
        self.check_call(['npm', 'run', 'build'], cwd=HTML_RENDERER_DIR)

        self.copy_file(HTML_RENDERER_DIR+'/dist/js/app.js', 'pyinstrument/renderers/html_resources/app.js')

        setuptools.command.build_py.build_py.run(self)
1001741
def main():
    

    print("Ontospy " + VERSION)

    Shell()._clear_screen()
    print(Style.BRIGHT + "** Ontospy Interactive Ontology Browser " + VERSION + " **" + Style.RESET_ALL)
    # manager.get_or_create_home_repo()
    Shell().cmdloop()
    raise SystemExit(1)
17463
def real_main(new_url=None,
              baseline_url=None,
              upload_build_id=None,
              upload_release_name=None):
    """"""
    coordinator = workers.get_coordinator()
    fetch_worker.register(coordinator)
    coordinator.start()

    item = UrlPairDiff(
        new_url,
        baseline_url,
        upload_build_id,
        upload_release_name=upload_release_name,
        heartbeat=workers.PrintWorkflow)
    item.root = True

    coordinator.input_queue.put(item)
    coordinator.wait_one()
    coordinator.stop()
    coordinator.join()
589683
async function start () {
  if (!process.argv.slice(2).length) {
    return program.outputHelp()
  }

  program.parse(process.argv)

  try {
    const rendered = await render(program)
    if (rendered) console.log(rendered)
  } catch (err) {
    console.log(chalk.red(err))
  }
}
1229441
def main():
    """"""
    parser, args = parser_factory()
    try:
        action_runner(parser, args)

    # this is our uncaught handler so yes we want to actually
    # catch every error. the format may vary based on the error handler tho
    except Exception as uncaught:  # pylint: disable=broad-except
        unhandled(uncaught, args)
        sys.exit(1)
663111
async function start() {
  if (child) {
    await stop();
  }

  return new Promise((resolve) => {
    const serverPath = path.resolve(process.cwd(), 'packages/node_modules/@webex/test-helper-server');

    child = spawn(process.argv[0], [serverPath], {
      env: process.env,
      stdio: ['ignore', 'pipe', process.stderr]
    });

    child.stdout.on('data', (data) => {
      const message = `${data}`;
      const pattern = /.+/gi;

      if (message.match(pattern)) {
        resolve();
      }
    });

    process.on('exit', stop);
  });
}
337162
public function main()
    {
        $buffer = '';
        $registry = GeneralUtility::makeInstance('KayStrobach\Dyncss\Configuration\BeRegistry');
        $handlers = $registry->getAllFileHandler();
        if (count($handlers)) {
            foreach ($handlers as $extension => $class) {
                /** @var AbstractParser $parser */
                $parser = new $class();
                $buffer .= '<tr><td>*.'.$extension.'</td>';
                $buffer .= '<td>'.$class.'</td>';
                $buffer .= '<td><a href="'.$parser->getParserHomepage().'" target="_blank">'.$parser->getParserName().'</a></td>';
                $buffer .= '<td>'.$parser->getVersion().'</td>';
                $buffer .= '</tr>';
            }
            /** @var FlashMessage $flashMessage */
            $flashMessage = GeneralUtility::makeInstance(
                FlashMessage::class,
                'Congrats, you have '.count($handlers).' handlers registered.',
                '',
                FlashMessage::OK,
                true
            );
            $this->addFlashMessage($flashMessage);
            $buffer = '<table class="t3-table table"><thead><tr><th>extension</th><th>class</th><th>name</th><th>version</th></tr></thead>'.$buffer.'</table>';
        } else {
            /** @var FlashMessage $flashMessage */
            $flashMessage = GeneralUtility::makeInstance(
                FlashMessage::class,
                'Please install one of the dyncss_* extensions',
                'No handler registered! - No dynamic css is handled at all ;/',
                FlashMessage::WARNING,
                true
            );
            $this->addFlashMessage($flashMessage);
            return $this->renderFlashMessage();
        }
        $renderedFlashMessages = $this->renderFlashMessage();
        return $renderedFlashMessages . $buffer;
    }
1134693
def startup(self):
        
        self.runner.info_log("Startup")

        if self.browser_config.config.get('enable_proxy'):
            self.start_proxy()
705454
function render(msg, cb, ms, level) {
    if (typeof cb === 'number') {
      ms = cb;
      cb = null;
    }

    return new Message({
      parentNode: '#msgbox',
      model: {
        msg: msg,
        close: cb,
        timeout: ms || util.TOAST_DURATION,
        level: level
      }
    }).render();
  }
703480
def start(self):
        
        self.broker.emit_before("worker_boot", self)

        worker_middleware = _WorkerMiddleware(self)
        self.broker.add_middleware(worker_middleware)
        for _ in range(self.worker_threads):
            self._add_worker()

        self.broker.emit_after("worker_boot", self)
1226594
def real_main(start_url=None,
              ignore_prefixes=None,
              upload_build_id=None,
              upload_release_name=None):
    """"""
    coordinator = workers.get_coordinator()
    fetch_worker.register(coordinator)
    coordinator.start()

    item = SiteDiff(
        start_url=start_url,
        ignore_prefixes=ignore_prefixes,
        upload_build_id=upload_build_id,
        upload_release_name=upload_release_name,
        heartbeat=workers.PrintWorkflow)
    item.root = True

    coordinator.input_queue.put(item)
    coordinator.wait_one()
    coordinator.stop()
    coordinator.join()