Run the operator.

        :param module: The target module path.
        :type  module: ``str``

        :param options: Any runtime options.
        :type  options: ``dict``

        :return: The operator results.
        :rtype: ``dict``
359522
def run(self, module, options):
        
        logger.debug("Running CC harvester")
        results = {}
        for filename, details in dict(self.harvester.results).items():
            results[filename] = {}
            total = 0  # running CC total
            for instance in details:
                if isinstance(instance, Class):
                    i = self._dict_from_class(instance)
                elif isinstance(instance, Function):
                    i = self._dict_from_function(instance)
                else:
                    if isinstance(instance, str) and instance == "error":
                        logger.warning(
                            f"Failed to run CC harvester on {filename} : {details['error']}"
                        )
                        continue
                    else:
                        logger.warning(
                            f"Unexpected result from Radon : {instance} of {type(instance)}. Please report on Github."
                        )
                        continue
                results[filename][i["fullname"]] = i
                del i["fullname"]
                total += i["complexity"]
            results[filename]["complexity"] = total
        return results
1082362
def run_payload(self, payload, *, flavour: ModuleType):
        """"""
        return self.runners[flavour].run_payload(payload)
311708
def visit(self, module):
        
        module.body = [self._visit(child) for child in module.body]
        return self._transform(module)
10201
def call_multiple_modules(module_gen):
    
    for args_seq in module_gen:
        module_name_or_path = args_seq[0]
        with replace_sys_args(args_seq):
            if re.match(VALID_PACKAGE_RE, module_name_or_path):
                runpy.run_module(module_name_or_path,
                                 run_name='__main__')
            else:
                runpy.run_path(module_name_or_path,
                               run_name='__main__')
1319289
def run(self):
        """"""
        if not self.py_modules and not self.packages:
            return

        if self.py_modules:
            self.build_modules()

        if self.packages:
            self.build_packages()
            self.build_package_data()

        self.run_2to3(self.__updated_files, False)
        self.run_2to3(self.__updated_files, True)
        self.run_2to3(self.__doctests_2to3, True)

        # Only compile actual .py files, using our base class' idea of what our
        # output files are.
        self.byte_compile(orig.build_py.get_outputs(self, include_bytecode=0))
1222821
def run(self, module, options):
        
        logger.debug("Running halstead harvester")
        results = {}
        for filename, details in dict(self.harvester.results).items():
            results[filename] = {}
            for instance in details:
                if isinstance(instance, list):
                    for item in instance:
                        function, report = item
                        results[filename][function] = self._report_to_dict(report)
                else:
                    if isinstance(instance, str) and instance == "error":
                        logger.warning(
                            f"Failed to run Halstead harvester on {filename} : {details['error']}"
                        )
                        continue
                    results[filename] = self._report_to_dict(instance)
        return results
1112604
def execute(self, payload, *args, flavour: ModuleType, **kwargs):
        
        if args or kwargs:
            payload = functools.partial(payload, *args, **kwargs)
        return self._meta_runner.run_payload(payload, flavour=flavour)
69921
def run():
    
    plugin_list = load_plugins()

    module = sys.modules['__main__']
    plugin_list.insert(0, ObjectSupplier(module))

    return run_with_plugins(plugin_list)
489901
public function run($module)
    {
        $moduleSettings = $module->getInfo('settings');
        $isTheme = $this->isTheme($module->getId());
        if (!$isTheme || ($isTheme && is_array($moduleSettings))) {
            $this->addModuleSettings($moduleSettings, $module->getId());
        }
    }
1313328
def run(self, conf, arg, err):
        
        weld_context_new = weld.weld_context_new
        weld_context_new.argtypes = [c_weld_conf]
        weld_context_new.restype = c_weld_context
        ctx = weld_context_new(conf.conf)

        weld_module_run = weld.weld_module_run
        # module, context, arg, &err
        weld_module_run.argtypes = [
            c_weld_module, c_weld_context, c_weld_value, c_weld_err]
        weld_module_run.restype = c_weld_value
        ret = weld_module_run(self.module, ctx, arg.val, err.error)
        return WeldValue(ret, assign=True, _ctx=ctx)
104692
def _compile(self, module=None):
        
        # get the main module
        mod = module or sys.modules['__main__']
        self.mod = mod
        # setup the script version
        if hasattr(mod, '__version__'):
            version = "%(prog)s " + mod.__version__
            self.ap_args.append(
                ap_arg('-v', '--version', action='version', version=version))
        # setup the script description
        if module is None:
            if 'description' not in self.argparse_args and hasattr(mod, '__doc__'):
                self.argparse_args['description'] = mod.__doc__
        # setup main parser
        self.parser = argparse.ArgumentParser(
            formatter_class=self.formatter_class, **self.argparse_args)
        if self.error:
            # setup the error method if we have one
            setattr(
                self.parser, 'error', types.MethodType(self.error, self.parser))
        if self.add_output:
            # add the output options if we have the add_output true
            if isinstance(self.add_output, basestring):
                odefault = self.add_output
            else:
                odefault = None
            self.parser.add_argument(
                '-o', '--output', metavar="FILE", default=odefault,
                help="Output to file")
            self.parser.add_argument(
                '--encoding', default="utf-8", help="Encoding for output file.")
            self.parser.add_argument(
                '--write-mode', default=self.write_mode, help="Write mode")
        if self._cfg_factory:
            # if we have a config factory add the config options
            self.parser.add_argument(
                '-c', '--config', metavar="FILE", default=self.cfg_file,
                help="Configuration file")
        if self.auths:
            # if we have authorizations enabled add the auth options
            self.parser.add_argument(
                '--auth',
                help="Authorization phrase for special commands.")

        # let's exexcute plugins
        for plugin in ArgParseInator._plugins.values():
            plugin(self)

        if self.ap_args is not None:
            # if we have argment parser args we will add them to the main parser
            for aargs, akargs in self.ap_args:
                self.parser.add_argument(*aargs, **akargs)

        if len(self.commands) == 1 and self.never_single is False:
            # if we have only one command ad never_single is False
            # setup the command as the only command.
            func = six.next(six.itervalues(self.commands))
            # add the arguments to the main parser
            for args, kwargs in func.__arguments__:
                self.parser.add_argument(*args, **kwargs)
            # shortcut for the single command
            self._single = func
            if not self.parser.description:
                # replace the description if we dont' have one
                self.parser.description = func.__doc__ or self.parser.description
            else:
                # or add to the main description
                if func.__doc__:
                    self.parser.description += linesep + linesep + func.__doc__
            if not self.parser.epilog:
                # replace the description if we dont' have one
                self.parser.epilog = getattr(
                    func, "__epilog__", self.parser.epilog)
            else:
                # or add to the main description
                if hasattr(func, '__epilog__'):
                    self.parser.epilog += linesep + linesep + func.__epilog__
            utils.set_subcommands(func, self.parser)
        else:
            # if we have more than one command or we don't want a single command
            # set the single to None
            self._single = None
            # setup the subparsers
            self.subparsers = self.parser.add_subparsers(
                title=utils.COMMANDS_LIST_TITLE, dest='command',
                description=utils.COMMANDS_LIST_DESCRIPTION)
            # add all the commands
            for func in self.commands.values():
                parser = utils.get_parser(func, self.subparsers)
                utils.set_subcommands(func, parser)
        return self.parser
206488
def main(as_module=False):
    
    this_module = __package__
    args = sys.argv[1:]

    if as_module:
        if sys.version_info >= (2, 7):
            name = 'python -m ' + this_module.rsplit('.', 1)[0]
        else:
            name = 'python -m ' + this_module

        # This module is always executed as "python -m flask.run" and as such
        # we need to ensure that we restore the actual command line so that
        # the reloader can properly operate.
        sys.argv = ['-m', this_module] + sys.argv[1:]
    else:
        name = None

    cli.main(args=args, prog_name=name)
1190674
def run_python_script(package=None, module=None, args=[], p_args=[]):
    
    assert module is not None
    assert isinstance(args, (tuple, list)) and isinstance(p_args, (tuple, list))
    path = python_script_exists(package, module)
    run_program(sys.executable, p_args + [path] + args)
1357718
public function run(string $module, array $options = []) : int
    {
        $mc = new ModuleConfig(ConfigType::MENUS(), $module, null, ['cacheSkip' => true]);

        $schema = $mc->createSchema(['lint' => true]);
        $mc->setParser(new Parser($schema, ['lint' => true, 'validate' => true]));

        try {
            $mc->parse();
        } catch (InvalidArgumentException $e) {
            // We need errors and warnings irrelevant of the exception
            $this->errors = array_merge($this->errors, $mc->getErrors());
        }
        $this->warnings = array_merge($this->warnings, $mc->getWarnings());

        return count($this->errors);
    }
1158971
def run(self, conn, tmp, module_name, module_args, inject):
        '''  '''

        # load up options
        options = utils.parse_kv(module_args)
        source  = options.get('src', None)
        dest    = options.get('dest', None)

        if dest.endswith("/"):
            base = os.path.basename(source)
            dest = os.path.join(dest, base)

        if (source is None and not 'first_available_file' in inject) or dest is None:
            result=dict(failed=True, msg="src and dest are required")
            return ReturnData(conn=conn, result=result)

        # if we have first_available_file in our vars
        # look up the files and use the first one we find as src
        if 'first_available_file' in inject:
            found = False
            for fn in inject.get('first_available_file'):
                fn = utils.template(self.runner.basedir, fn, inject)
                fn = utils.path_dwim(self.runner.basedir, fn)
                if os.path.exists(fn):
                    source = fn
                    found = True
                    break
            if not found:
                results=dict(failed=True, msg="could not find src in first_available_file list")
                return ReturnData(conn=conn, result=results)
        else:
            source = utils.template(self.runner.basedir, source, inject)
            source = utils.path_dwim(self.runner.basedir, source)

        local_md5 = utils.md5(source)
        if local_md5 is None:
            result=dict(failed=True, msg="could not find src=%s" % source)
            return ReturnData(conn=conn, result=result)

        remote_md5 = self.runner._remote_md5(conn, tmp, dest)

        exec_rc = None
        if local_md5 != remote_md5:
            # transfer the file to a remote tmp location
            tmp_src = tmp + os.path.basename(source)
            conn.put_file(source, tmp_src)
            # fix file permissions when the copy is done as a different user
            if self.runner.sudo and self.runner.sudo_user != 'root':
                self.runner._low_level_exec_command(conn, "chmod a+r %s" % tmp_src, tmp)

            # run the copy module
            module_args = "%s src=%s" % (module_args, tmp_src)
            return self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject)

        else:
            # no need to transfer the file, already correct md5, but still need to call
            # the file module in case we want to change attributes

            tmp_src = tmp + os.path.basename(source)
            module_args = "%s src=%s" % (module_args, tmp_src)
            return self.runner._execute_module(conn, tmp, 'file', module_args, inject=inject)
102029
def run_from_argv(self, prog, subcommand, global_options, argv):
        
        self.prog_name = prog
        parser = self.create_parser(prog, subcommand)
        options, args = parser.parse_args(argv)
        self.global_options = global_options
        self.options = options
        self.args = args
        self.execute(args, options, global_options)
197125
def run(self, args=None):
        

        args = args or self.parser.parse_args()

        if args.debug:
            logging.basicConfig(level=logging.DEBUG)

        if args.version:
            print(version.VERSION)
            sys.exit(0)