Main entry point.
559128
def run(self, error_on_warning=False, region=None, accounts=[]):
        
        all_warnings = []
        all_criticals = []
        if len(accounts) == 0:
            # if no accounts specified, run all of them
            accounts = self._conf.list_account_ids
        for acct_id in accounts:
            acct_conf = self._conf.get_account_config(acct_id)
            if region is None:
                regions = list(acct_conf['regions'].keys())
            elif region in acct_conf['regions']:
                regions = [region]
            else:
                print('\nAccount %s is not configured for region %s' % (
                    acct_id, region
                ))
                regions = []
            for rname in regions:
                print('\n%s (%s) %s' % (acct_id, acct_conf['name'], rname))
                warnings, criticals = self.check_limits(
                    acct_id, rname, role_name=acct_conf['role_name'],
                    limit_overrides=acct_conf[
                        'regions'][rname]['limit_overrides'],
                    threshold_overrides=acct_conf[
                        'regions'][rname]['threshold_overrides'],
                )
                # output
                for w in warnings:
                    print("\tWARNING: %s" % w)
                    all_warnings.append(w)
                for c in criticals:
                    print("\tCRITICAL: %s" % c)
                    all_criticals.append(c)
                if len(warnings) == 0 and len(criticals) == 0:
                    print("\tNo problems found.")

        # summary
        if len(all_warnings) > 0 or len(all_criticals) > 0:
            print(
                "\n{c} limit(s) above CRITICAL threshold; {w} limit(s) above "
                "WARNING threshold".format(
                    c=len(all_criticals), w=len(all_warnings)
                )
            )
        else:
            print("All limits are within thresholds.")
        if (
            (len(all_warnings) > 0 and error_on_warning) or
            len(all_criticals) > 0
        ):
            print('PROBLEMS FOUND. See above output for details.')
            raise SystemExit(1)
156600
public function main()
    {
        $this->setup('export');

        $this->log("Exporting SVN repository to '" . $this->getToDir() . "'");

        $switches = [];

        if (!empty($this->revision)) {
            $switches['r'] = $this->revision;
        }

        $this->run([$this->getToDir()], $switches);
    }
690868
def main():
    """"""
    parser = build_command_parser()
    options = parser.parse_args()
    file_pointer = options.filename
    input_format = options.input_format

    with file_pointer:
        json_data = json.load(file_pointer)

    if input_format == SIMPLE_JSON:
        report = Report(json_data)
    elif input_format == EXTENDED_JSON:
        report = Report(
            json_data.get('messages'),
            json_data.get('stats'),
            json_data.get('previous'))

    print(report.render(), file=options.output)
170187
def main():
    """"""
    parser = argparse.ArgumentParser(description='Compose a yaml file.')
    parser.add_argument(
        'root',
        type=argparse.FileType('r'),
        help='The root yaml file to compose.'
    )

    args = parser.parse_args()

    result = yaml.load(args.root, Loader=ComposeLoader)

    print(yaml.dump(result))
1321
def main():
    """"""
    conf = init_and_get_conf()
    logger = make_logger(__name__)
    logger.info('YaBT version {}', __version__)
    handlers = {
        'build': YabtCommand(func=cmd_build, requires_project=True),
        'dot': YabtCommand(func=cmd_dot, requires_project=True),
        'test': YabtCommand(func=cmd_test, requires_project=True),
        'tree': YabtCommand(func=cmd_tree, requires_project=True),
        'version': YabtCommand(func=cmd_version, requires_project=False),
        'list-builders': YabtCommand(func=cmd_list, requires_project=False),
    }
    command = handlers[conf.cmd]
    if command.requires_project and not conf.in_yabt_project():
        fatal('Not a YABT project (or any of the parent directories): {}',
              BUILD_PROJ_FILE)
    try:
        command.func(conf)
    except Exception as ex:
        fatal('{}', ex)
29671
public function main()
    {
        # The theme is activated.
        # Location: Resources/Themes/Default/
        Theme::active('Default');
        
        # The current settings are being configured.
        Masterpage::headPage('Sections/head')
                  ->bodyPage('Sections/body')
                  ->browserIcon(FILES_DIR . 'favicon.ico')
                  ->backgroundImage(FILES_DIR . 'background.jpg');
    }
619113
def main():
    """"""
    from docopt import docopt
    args = docopt(__doc__)
    infile = args['INFILE']
    outfile = args['OUTFILE']
    i3extract(infile, outfile)
41538
public function main()
    {
        $this->vendorDir = WWW_ROOT . 'node_modules';
        
        $this->fontawesomePath = $this->vendorDir . DS . '@fortawesome' . DS . 'fontawesome-free' . DS;
        $this->jqueryBackstretchPath = $this->vendorDir . DS . 'jquery-backstretch' . DS;
        $this->jqueryUiPath = $this->vendorDir . DS . 'components-jqueryui' . DS;
        $this->owlCarouselPath = $this->vendorDir . DS . 'owl.carousel' . DS;
        $this->tooltipsterPath = $this->vendorDir . DS . 'tooltipster' . DS;
        
        $this->cleanOverheadFromDependencies();
        $this->copyAdaptedElfinderFiles();
        $this->copyJqueryUiImages();
        $this->copyFontawesomeFonts();
    }
1372199
def main():
    """"""
    options = _parse_args()
    archive = download_setuptools(
        version=options.version,
        download_base=options.download_base,
        downloader_factory=options.downloader_factory,
    )
    return _install(archive, _build_install_args(options))
1082074
def main():
    """"""
    util.create_dir(os.path.join(CONF_DIR, "templates"))
    util.create_dir(os.path.join(CONF_DIR, "colorschemes/light/"))
    util.create_dir(os.path.join(CONF_DIR, "colorschemes/dark/"))

    util.setup_logging()
    parser = get_args()

    parse_args_exit(parser)
    parse_args(parser)
1261483
def entry_point():
    """"""
    signal.signal(signal.SIGINT, lambda *_: getattr(os, '_exit')(0))  # Properly handle Control+C
    config = get_arguments()
    setup_logging(config['verbose'])
    try:
        main(config)
    except HandledError:
        if config['raise']:
            raise
        logging.critical('Failure.')
        sys.exit(0 if config['ignore_errors'] else 1)
1340333
def main(**options):
    """"""
    configure_logging(log_all=options.get('log'))

    stdin_stream = click.get_text_stream('stdin')
    stdin_text = stdin_stream.read()

    click.echo(stdin_text)

    ci = find_ci_provider()
    config = Config(options, ci=ci)

    build = LintlyBuild(config, stdin_text)
    try:
        build.execute()
    except NotPullRequestException:
        logger.info('Not a PR. Lintly is exiting.')
        sys.exit(0)

    # Exit with the number of files that have violations
    sys.exit(len(build.violations))
659307
public function main() {
		if (!empty($this->args)) {
			$arguments = $this->_parseArguments($this->args);
		} else {
			$arguments = $this->_interactive();
		}
		$this->_inflect($arguments['method'], $arguments['words']);
	}
1045462
public function main()
    {
        $this->setup('proplist');

        $this->log("List all properties on files, dirs, or revisions from '" . $this->getWorkingCopy() ."'");
        
        $output = $this->run([$this->getWorkingCopy()], ['recursive' => $this->getRecursive()]);
        
        $this->project->setProperty($this->getPropertyName(), $output);
    }
170398
public function main()
    {
        if ($this->composer === null) {
            $this->findComposer();
        }

        $files = array();
        if (!empty($this->file) && file_exists($this->file)) {
            $files[] = $this->file;
        }

        if (!empty($this->dir)) {
            $found = $this->findFiles();
            foreach ($found as $file) {
                $files[] = $this->dir . DIRECTORY_SEPARATOR . $file;
            }
        }

        foreach ($files as $file) {

            $cmd = $this->composer . ' validate ' . $file;
            $cmd = escapeshellcmd($cmd);

            if ($this->passthru) {
                $retval = null;
                passthru($cmd, $retval);
                if ($retval == 1) {
                    throw new BuildException('invalid composer.json');
                }
            } else {
                $out = array();
                $retval = null;
                exec($cmd, $out, $retval);
                if ($retval == 1) {
                    $err = join("\n", $out);
                    throw new BuildException($err);
                } else {
                    $this->log($out[0]);
                }
            }

        }

    }
98964
public function main()
    {
        $this->setup('copy');

        $this->log("Copying SVN repository from '" . $this->getRepositoryUrl() . "' to '" . $this->getToDir() . "'");

        $options = [];

        if (strlen($this->getMessage()) > 0) {
            $options['message'] = $this->getMessage();
        }

        $this->run([$this->getToDir()], $options);
    }
92450
def main():
    """"""
    (cred, providers) = config_read()
    cmd_mode = True
    conn_objs = cld.get_conns(cred, providers)
    while cmd_mode:
        nodes = cld.get_data(conn_objs, providers)
        node_dict = make_node_dict(nodes, "name")
        idx_tbl = table.indx_table(node_dict, True)
        cmd_mode = ui.ui_main(idx_tbl, node_dict)
    print("\033[?25h")