Module main execution
430671
def main():
    """"""
    # Initialization variables - update to change your model and execution context
    model_prefix = "FCN8s_VGG16"
    epoch = 19

    # By default, MXNet will run on the CPU. Change to ctx = mx.gpu() to run on GPU.
    ctx = mx.cpu()

    fcnxs, fcnxs_args, fcnxs_auxs = mx.model.load_checkpoint(model_prefix, epoch)
    fcnxs_args["data"] = mx.nd.array(get_data(args.input), ctx)
    data_shape = fcnxs_args["data"].shape
    label_shape = (1, data_shape[2]*data_shape[3])
    fcnxs_args["softmax_label"] = mx.nd.empty(label_shape, ctx)
    exector = fcnxs.bind(ctx, fcnxs_args, args_grad=None, grad_req="null", aux_states=fcnxs_args)
    exector.forward(is_train=False)
    output = exector.outputs[0]
    out_img = np.uint8(np.squeeze(output.asnumpy().argmax(axis=1)))
    out_img = Image.fromarray(out_img)
    out_img.putpalette(get_palette())
    out_img.save(args.output)
480807
def main() -> None:
    """""""
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--module", help="name of the module to import",
                        choices=[
                            "functions_100_with_no_contract",

                            "functions_100_with_1_contract",
                            "functions_100_with_5_contracts",
                            "functions_100_with_10_contracts",

                            "functions_100_with_1_disabled_contract",
                            "functions_100_with_5_disabled_contracts",
                            "functions_100_with_10_disabled_contracts",

                            "classes_100_with_no_invariant",

                            "classes_100_with_1_invariant",
                            "classes_100_with_5_invariants",
                            "classes_100_with_10_invariants",

                            "classes_100_with_1_disabled_invariant",
                            "classes_100_with_5_disabled_invariants",
                            "classes_100_with_10_disabled_invariants",
                        ],
                        required=True)
    args = parser.parse_args()


    a_module = str(args.module)
    if a_module == "functions_100_with_no_contract":
        start = time.time()
        import functions_100_with_no_contract
        print(time.time() - start)

    elif a_module == "functions_100_with_1_contract":
        start = time.time()
        import functions_100_with_1_contract
        print(time.time() - start)

    elif a_module == "functions_100_with_5_contracts":
        start = time.time()
        import functions_100_with_5_contracts
        print(time.time() - start)

    elif a_module == "functions_100_with_10_contracts":
        start = time.time()
        import functions_100_with_10_contracts
        print(time.time() - start)

    elif a_module == "functions_100_with_1_disabled_contract":
        start = time.time()
        import functions_100_with_1_disabled_contract
        print(time.time() - start)

    elif a_module == "functions_100_with_5_disabled_contracts":
        start = time.time()
        import functions_100_with_5_disabled_contracts
        print(time.time() - start)

    elif a_module == "functions_100_with_10_disabled_contracts":
        start = time.time()
        import functions_100_with_10_disabled_contracts
        print(time.time() - start)

    elif a_module == "classes_100_with_no_invariant":
        start = time.time()
        import classes_100_with_no_invariant
        print(time.time() - start)

    elif a_module == "classes_100_with_1_invariant":
        start = time.time()
        import classes_100_with_1_invariant
        print(time.time() - start)

    elif a_module == "classes_100_with_5_invariants":
        start = time.time()
        import classes_100_with_5_invariants
        print(time.time() - start)

    elif a_module == "classes_100_with_10_invariants":
        start = time.time()
        import classes_100_with_10_invariants
        print(time.time() - start)

    elif a_module == "classes_100_with_1_disabled_invariant":
        start = time.time()
        import classes_100_with_1_disabled_invariant
        print(time.time() - start)

    elif a_module == "classes_100_with_5_disabled_invariants":
        start = time.time()
        import classes_100_with_5_disabled_invariants
        print(time.time() - start)

    elif a_module == "classes_100_with_10_disabled_invariants":
        start = time.time()
        import classes_100_with_10_disabled_invariants
        print(time.time() - start)

    else:
        raise NotImplementedError("Unhandled module: {}".format(a_module))
1134707
def main():
    
    global args, server_address

    # parse the command line arguments
    parser = ArgumentParser(description=__doc__)
    parser.add_argument(
        "host", nargs='?',
        help="address of host (default %r)" % (SERVER_HOST,),
        default=SERVER_HOST,
        )
    parser.add_argument(
        "port", nargs='?', type=int,
        help="server port (default %r)" % (SERVER_PORT,),
        default=SERVER_PORT,
        )
    parser.add_argument(
        "--hello", action="store_true",
        default=False,
        help="send a hello message",
        )
    parser.add_argument(
        "--connect-timeout", nargs='?', type=int,
        help="idle connection timeout",
        default=CONNECT_TIMEOUT,
        )
    parser.add_argument(
        "--idle-timeout", nargs='?', type=int,
        help="idle connection timeout",
        default=IDLE_TIMEOUT,
        )
    args = parser.parse_args()

    if _debug: _log.debug("initialization")
    if _debug: _log.debug("    - args: %r", args)

    # extract the server address and port
    host = args.host
    port = args.port
    server_address = (host, port)
    if _debug: _log.debug("    - server_address: %r", server_address)

    # build the stack
    this_console = ConsoleClient()
    if _debug: _log.debug("    - this_console: %r", this_console)

    this_middle_man = MiddleMan()
    if _debug: _log.debug("    - this_middle_man: %r", this_middle_man)

    this_director = TCPClientDirector(
        connect_timeout=args.connect_timeout,
        idle_timeout=args.idle_timeout,
        )
    if _debug: _log.debug("    - this_director: %r", this_director)

    bind(this_console, this_middle_man, this_director)
    bind(MiddleManASE(), this_director)

    # create a task manager for scheduled functions
    task_manager = TaskManager()
    if _debug: _log.debug("    - task_manager: %r", task_manager)

    # don't wait to connect
    deferred(this_director.connect, server_address)

    # send hello maybe
    if args.hello:
        deferred(this_middle_man.indication, PDU(b'Hello, world!\n'))

    if _debug: _log.debug("running")

    run()

    if _debug: _log.debug("fini")
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)
        }
      }
    }
  }

}
851395
def main():
    
    parser = argparse.ArgumentParser(
        description='Performs option handling operations from the command-line. Calls JVM start/stop automatically.')
    parser.add_argument("-j", metavar="classpath", dest="classpath", help="additional classpath, jars/directories")
    parser.add_argument("-action", metavar="action", dest="action", required=True,
                        help="The action to perform on the options: join=create single string, "\
                             "split=create array from quoted option, code=generate code from options")
    parser.add_argument("option", nargs=argparse.REMAINDER, help="The option(s) to process")
    parsed = parser.parse_args()
    jars = []
    if parsed.classpath is not None:
        jars = parsed.classpath.split(os.pathsep)

    jvm.start(jars, packages=True)

    try:
        if parsed.action == "join":
            output = "cmdline = \"" + backquote(join_options(parsed.option)) + "\""
        elif parsed.action == "split" and len(parsed.option) == 1:
            output = "options = [\n"
            opts = split_options(parsed.option[0])
            for idx, opt in enumerate(opts):
                if idx > 0:
                    output += ",\n"
                output += "    \"" + backquote(opt) + "\""
            output += "]"
        elif parsed.action == "code":
            options = parsed.option[:]
            cname = None
            # classname + options?
            if options[0].find(".") > -1:
                cname = options[0]
                options = options[1:]
            output = "options = [ \n"
            for idx, opt in enumerate(options):
                if idx > 0:
                    output += ",\n"
                output += "    \"" + backquote(opt) + "\""
            output += "]\n"
            if cname is not None:
                output += 'handler = OptionHandler(JavaObject.new_instance("' + cname + '"))\n'
                output += 'handler.options = options\n'
        else:
            raise Exception("Unsupported action: " + parsed.action)
        if output is not None:
            print(output)
    except Exception as e:
        print(e)
    finally:
        jvm.stop()
889412
async function main() {
  event.$emit('before-client-render')

  if (globalState.initialData) {
    dataStore.replaceState(globalState.initialData)
  }

  await routerReady(router)

  if (router.getMatchedComponents().length === 0) {
    throw new ReamError(pageNotFound(router.currentRoute.path))
  }
}
1235381
public function main()
    {
        $buildFileRoot = $this->getProject()->getProperty('phing.file');
        $buildFile     = isset($this->_buildFile) ? $this->_buildFile : $buildFileRoot;
        $buildList     = $this->getBuildList($buildFileRoot);
        $parents       = array();
        $targets       = array();

        if (isset($this->_buildFile) && is_file($this->_buildFile)
            && !empty($this->getOwningTarget()->getName())
        ) {
            foreach ($buildList as $buildFile => $buildInfo) {
                if ($this->_buildFile === $buildFile
                    || in_array($buildInfo['parent'], $parents)
                ) {
                    $parents[] = $buildFile;
                    $targets   = array_merge(
                        $targets,
                        $this->getBuildTargets($buildFile)
                    );
                }
            }

            $targets = array_merge($targets, $this->project->helpTargets);
            $this->printBuildTargets($targets, $buildFile, $buildList);
        }

    }
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();
    }
648964
function main() {
	// TODO: move loading of inputs into main function
	check(lookupQType(typeDecl.global,[]), {key: snapshot.global}, '', false, null, '<global>');
	if (program.missing) {
		findSuggestions()
	}
	if (program.coverage) {
		printCoverage();
	}
	if (program.stats) {
		console.log("# heap objects = " + snapshot.heap.length)
		console.log("# call signatures = " + num_callsigs_analyzed)
	}
}
213277
function main() {
		var el;

		el = document.querySelector( 'title' );
		cleanTitle( el );

		el = document.querySelectorAll( '.tsd-kind-external-module a' );
		cleanLinks( el );

		el = document.querySelectorAll( '.tsd-is-not-exported a' );
		cleanLinks( el );

		el = document.querySelectorAll( '.tsd-breadcrumb a' );
		cleanLinks( el );

		el = document.querySelectorAll( '.tsd-page-title h1' );
		cleanHeadings( el );

		el = document.querySelectorAll( '.tsd-description .tsd-parameters .tsd-comment p' );
		updateDescriptions( el );

		el = document.querySelectorAll( '.tsd-description .tsd-returns-title + p' );
		updateDescriptions( el );
	}
446392
def main():
    
    parser = optparse.OptionParser(usage="""usage: %prog [options] <package path> [exclude paths, ...]

Note: By default this script will not overwrite already created files.""")
    parser.add_option("-n", "--doc-header", action="store", dest="header", help="Documentation Header (default=Project)", default="Project")
    parser.add_option("-d", "--dest-dir", action="store", dest="destdir", help="Output destination directory", default="")
    parser.add_option("-s", "--suffix", action="store", dest="suffix", help="module suffix (default=txt)", default="txt")
    parser.add_option("-m", "--maxdepth", action="store", dest="maxdepth", help="Maximum depth of submodules to show in the TOC (default=4)", type="int", default=4)
    parser.add_option("-r", "--dry-run", action="store_true", dest="dryrun", help="Run the script without creating the files")
    parser.add_option("-f", "--force", action="store_true", dest="force", help="Overwrite all the files")
    parser.add_option("-t", "--no-toc", action="store_true", dest="notoc", help="Don't create the table of content file")
    (opts, args) = parser.parse_args()
    if not args:
        parser.error("package path is required.")
    else:
        rootpath, excludes = args[0], args[1:]
        if os.path.isdir(rootpath):
            # check if the output destination is a valid directory
            if opts.destdir and os.path.isdir(opts.destdir):
                excludes = normalize_excludes(rootpath, excludes)
                recurse_tree(rootpath, excludes, opts)
            else:
                print '%s is not a valid output destination directory.' % opts.destdir
        else:
            print '%s is not a valid directory.' % rootpath
968921
def main():
    
    arguments = docopt(__doc__)
    if arguments['init']:
        return_code = init()
        sys.exit(return_code)

    run_converter(arguments)
541248
function main(option, parser, force) {
  if(typeof option === 'function') {
    parser = option;
    option = null;
  }
  if(option !== false) {
    option = option || parse.option;
    parser = parser || parse;
  }
  //var mode = parse.auto;
  if(typeof parser === 'function') {
    module.exports.mode = parser(parse.modes, option, process.argv.slice(2));
  }
  initialize(force);
  return module.exports;
}
571309
def main():
	
	parser = cli.Cli()
	parser.parse(sys.argv[1:])
	return parser.run()
880047
def main():
    ''''''
    arguments = docopt(__doc__, version=__version__)
    if arguments['FILE']:
        display_output(arguments)
    else:
        print(__doc__)
148093
def main() -> None:
    """""""
    modules = [
        "functions_100_with_no_contract",

        "functions_100_with_1_contract",
        "functions_100_with_5_contracts",
        "functions_100_with_10_contracts",

        "functions_100_with_1_disabled_contract",
        "functions_100_with_5_disabled_contracts",
        "functions_100_with_10_disabled_contracts",

        "classes_100_with_no_invariant",

        "classes_100_with_1_invariant",
        "classes_100_with_5_invariants",
        "classes_100_with_10_invariants",

        "classes_100_with_1_disabled_invariant",
        "classes_100_with_5_disabled_invariants",
        "classes_100_with_10_disabled_invariants",
    ]

    for a_module in modules:
        durations = []  # type: List[float]
        for i in range(0, 10):
            duration = float(
                subprocess.check_output(["./measure.py", "--module", a_module], cwd=os.path.dirname(__file__)).strip())
            durations.append(duration)

        print("Duration to import the module {} (in milliseconds): {:.2f} ± {:.2f}".format(
            a_module, statistics.mean(durations) * 10e3, statistics.stdev(durations) * 10e3))
1250932
def execute(self, *args, **kwargs):
        '''
        
        '''
        run_modules = []
        orig_arguments = self.arguments

        if args or kwargs:
            self._set_arguments(list(args), kwargs)

        # Run all modules
        for module in self.list():
            obj = self.run(module)

        # Add all loaded modules that marked themselves as enabled to the
        # run_modules list
        for (module, obj) in iterator(self.executed_modules):
            # Report the results if the module is enabled and if it is a
            # primary module or if it reported any results/errors
            if obj.enabled and (obj.PRIMARY or obj.results or obj.errors):
                run_modules.append(obj)

        self.arguments = orig_arguments

        return run_modules