Get arguments and call the execution function
18470
def main():
    

    if len(sys.argv) < 6:
        print("Usage: %s server_url username password namespace' \
              ' classname" %  sys.argv[0])
        print('Using internal defaults')
        server_url = SERVER_URL
        namespace = TEST_NAMESPACE
        username = USERNAME
        password = PASSWORD
        classname = TEST_CLASS
    else:
        print('Get from input')
        server_url = sys.argv[1]
        namespace = sys.argv[2]
        username = sys.argv[3]
        password = sys.argv[4]
        classname = sys.argv[5]

    # create the credentials tuple for WBEMConnection
    creds = (username, password)

    # call the method to execute the request and display results
    execute_request(server_url, creds, namespace, classname)

    return 0
1211228
def call(self):
        """"""
        assert self.satisfied, self
        LOG.debug('call %s.%s', self.func.__module__, self.func.__qualname__)
        kwargs = {arg.name: arg.read() for arg in self.args}
        out_value = self.func(**kwargs)
        if self.writeto is None:
            writeto = set()
        elif isinstance(self.writeto, Variable):
            self.writeto.write(out_value)
            writeto = {self.writeto}
        else:
            # A variable can be written multiple times, but we only
            # return a unique set of variables.
            for var, value in zip(self.writeto, out_value):
                var.write(value)
            writeto = set(self.writeto)
        self._release()  # Only call _release() on normal exit.
        return writeto
159653
def do_execute(self):
        
        formatstr = str(self.resolve_option("format"))
        expanded = self.storagehandler.expand(formatstr)
        self._output.append(Token(expanded))
        return None
718278
def do_execute(self):
        
        if self.storagehandler is None:
            return "No storage handler available!"
        expr = str(self.resolve_option("expression")).replace(
            "{X}", str(self.storagehandler.storage[str(self.resolve_option("storage_name"))]))
        expr = self.storagehandler.expand(expr)
        self.storagehandler.storage[self.resolve_option("storage_name")] = eval(expr)
        self._output.append(self.input)
        return None
1113109
def call(self, cmd, **kwargs):
        """"""
        if isinstance(cmd, basestring):
            cmd = cmd.split()
        self.log.info('Running %s', cmd)
        p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE, **kwargs)
        out, err = p.communicate()
        if out:
            self.log.info(out)
        if err:
            if p.returncode == 0:
                self.log.info(err)
            else:
                self.log.error(err)
        if p.returncode != 0:
            self.log.error('returncode = %d' % p.returncode)
            raise Exception
        return out, err, p.returncode
541012
def _execute(self):
        
        for call in (self.prepare, self.process, self.on_finish):
            self.logger.debug('Invoking %r', call)
            result = call()
            if concurrent.is_future(result):
                yield result
353698
def call_ext_prog(self, prog, timeout=300, stderr=True,
                      chroot=True, runat=None):
        
        return self.get_command_output(prog, timeout=timeout, stderr=stderr,
                                       chroot=chroot, runat=runat)
1263550
def run_command(self, args):
        
        parsed_args = self.parser.parse_args(args)
        if hasattr(parsed_args, 'func'):
            parsed_args.func(parsed_args)
        else:
            self.parser.print_help()
928736
def execute(self):
        
        # Preprocess options to extract --settings and --pythonpath.
        # These options could affect the commands that are available, so they
        # must be processed early.
        parser = NewOptionParser(prog=self.prog_name,
                             usage=self.usage_info,
#                             version=self.get_version(),
                             formatter = NewFormatter(),
                             add_help_option = False,
                             option_list=self.option_list)
        
        if not self.global_options:
            global_options, args = parser.parse_args(self.argv)
            handle_default_options(global_options)
            args = args[1:]
        else:
            global_options = self.global_options
            args = self.argv
    
        def print_help(global_options):
            parser.print_help()
            sys.stderr.write(self.print_help_info(global_options) + '\n')
            sys.exit(0)
            
        if len(args) == 0:
            if global_options.version:
                print(self.get_version())
                sys.exit(1)
            else:
                print_help(global_options)
                sys.ext(1)
    
        try:
            subcommand = args[0]
        except IndexError:
            subcommand = 'help' # Display help if no arguments were given.
    
        if subcommand == 'help':
            if len(args) > 1:
                command = self.fetch_command(global_options, args[1])
                if issubclass(command, CommandManager):
                    cmd = command(['help'], None, '%s %s' % (self.prog_name, args[1]), global_options=global_options)
                    cmd.execute()
                else:
                    command().print_help(self.prog_name, args[1])
                sys.exit(1)
            else:
                print_help(global_options)
        if global_options.help:
            print_help(global_options)
        else:
            command = self.fetch_command(global_options, subcommand)
            if issubclass(command, CommandManager):
                cmd = command(args[1:], None, '%s %s' % (self.prog_name, subcommand), global_options=global_options)
                cmd.execute()
            else:
                cmd = command()
                cmd.run_from_argv(self.prog_name, subcommand, global_options, args[1:])
484452
def call(self, params, _context, **kwargs):
        ''''''

        assert len(params) == self.paramCount
        # using setattr because '=' is not allowed inside of lambdas
        return evaluate_impl(self.body, params).then(lambda value: setattr(_context.results, 'value', value))
1164520
function exec (func, context, args) {
	switch (args.length) {
		case 0: func.call(context); break;
		case 1: func.call(context, args[0]); break;
		case 2: func.call(context, args[0], args[1]); break;
		case 3: func.call(context, args[0], args[1], args[2]); break;
		case 4: func.call(context, args[0], args[1], args[2], args[3]); break;
		default: func.apply(context, args); break;
	}
}
234444
def execute(self):
        
        if self.args and self.argument(0) == "help":
            self.error(self.usage() + "\n\n" + self.help())
            return False

        return True
1006778
def execute(self, *args, **kwargs):
        
        args = self.parser.parse_args(*args, **kwargs)
        self.process(args)
1158538
def executescript(self, *args, **kwargs):
        

        with self:
            self._cursor.executescript(*args, **kwargs)
933870
def call_program(self, name, *arguments):
        
        verbosity = self.options.get("verbosity", 1)
        with self.devnull as null:
            try:
                subprocess.check_call((name,) + tuple(arguments), 
                    stdout=null if verbosity == 0 else self.stdout,
                    stderr=null if verbosity == 0 else self.stderr)
            except subprocess.CalledProcessError as error:
                raise management.CommandError(
                    "{name:s} failed with exit code {code:d}".format(
                        name=name, code=error.returncode))
        return 0
128919
def do_execute(self):
        
        for s in self.resolve_option("strings"):
            self._output.append(Token(s))
        return None
570293
def run_cmd(call, cmd, *, echo=True, **kwargs):
    """"""
    if echo:
        print('$> ' + ' '.join(map(pipes.quote, cmd)))
    return call(cmd, **kwargs)