Get arguments and call the execution function
166353
def main():
    
    prog = sys.argv[0]

    arg_parser = create_parser(prog)

    opts = parse_cmdline(arg_parser)

    print('Parameters: server=%s\n username=%s\n namespace=%s\n'
          ' classname=%s\n max_pull_size=%s\n use_pull=%s' %
          (opts.server, opts.user, opts.namespace, opts.classname,
           opts.max_object_count, opts.usepull))

    # call method to connect to the server
    conn = WBEMConnection(opts.server, (opts.user, opts.password),
                          default_namespace=opts.namespace,
                          no_verification=True,
                          use_pull_operations=opts.usepull)

    #Call method to create iterator
    instances = []
    try:
        iter_instances = conn.IterEnumerateInstances(
            opts.classname,
            MaxObjectCount=opts.max_object_count)

        # generate instances with
        for instance in iter_instances:
            print(' %s %s' % (type(instances), type(instance)))
            instances.append(instance)
            print('\npath=%s\n%s' % (instance.path, instance.tomof()))

    # handle exceptions
    except CIMError as ce:
        print('Operation Failed: CIMError: code=%s, Description=%s' %
              (ce.status_code_name, ce.status_description))
        sys.exit(1)
    except Error as err:
        print ("Operation failed: %s" % err)
        sys.exit(1)

    inst_paths = [inst.path for inst in instances]

    paths = []
    try:
        iter_paths = conn.IterEnumerateInstancePaths(
            opts.classname,
            MaxObjectCount=opts.max_object_count)

        # generate instances with
        for path in iter_paths:
            print('path=%s' % path)
            paths.append(path)

        if len(paths) != len(paths):
            print('Error path and enum response sizes different enum=%s path=%s'
                  % (len(paths), len(paths)))
        for path in paths:
            found = False
            for inst_path in inst_paths:                
                if path == inst_path:
                    found = True
                    break
                else:
                    print('No match \n%s\n%s' %(path, inst_path))
            if not found:
                print('Path %s not found in insts' % path)
    # handle exceptions
    except CIMError as ce:
        print('Operation Failed: CIMError: code=%s, Description=%s' %
              (ce.status_code_name, ce.status_description))
        sys.exit(1)
    except Error as err:
        print ("Operation failed: %s" % err)
        sys.exit(1)

    return 0
655378
function getCall() {
  var result = _.trim(_.get(/\*\/\s*(?:function\s+)?([^\s(]+)\s*\(/.exec(this.entry), 1));
  if (!result) {
    result = _.trim(_.get(/\*\/\s*(.*?)[:=,]/.exec(this.entry), 1));
    result = /['"]$/.test(result)
      ? _.trim(result, '"\'')
      : result.split('.').pop().split(/^(?:const|let|var) /).pop();
  }
  var name = getValue(this, 'name') || result;
  if (!this.isFunction()) {
    return name;
  }
  var params = this.getParams();
  result = _.castArray(result);

  // Compile the function call syntax.
  _.each(params, function(param) {
    var paramValue = param[1],
        parentParam = _.get(/\w+(?=\.[\w.]+)/.exec(paramValue), 0);

    var parentIndex = parentParam == null ? -1 : _.findIndex(params, function(param) {
      return _.trim(param[1], '[]').split(/\s*=/)[0] == parentParam;
    });

    // Skip params that are properties of other params (e.g. `options.leading`).
    if (_.get(params[parentIndex], 0) != 'Object') {
      result.push(paramValue);
    }
  });

  // Format the function call.
  return name + '(' + result.slice(1).join(', ') + ')';
}
853813
def execute_cmd(cmd, **kwargs):
    
    yield '$ {}\n'.format(' '.join(cmd))
    kwargs['stdout'] = subprocess.PIPE
    kwargs['stderr'] = subprocess.STDOUT

    proc = subprocess.Popen(cmd, **kwargs)

    # Capture output for logging.
    # Each line will be yielded as text.
    # This should behave the same as .readline(), but splits on `\r` OR `\n`,
    # not just `\n`.
    buf = []
    def flush():
        line = b''.join(buf).decode('utf8', 'replace')
        buf[:] = []
        return line

    c_last = ''
    try:
        for c in iter(partial(proc.stdout.read, 1), b''):
            if c_last == b'\r' and buf and c != b'\n':
                yield flush()
            buf.append(c)
            if c == b'\n':
                yield flush()
            c_last = c
    finally:
        ret = proc.wait()
        if ret != 0:
            raise subprocess.CalledProcessError(ret, cmd)
59566
def _execute_cmd(plugin, args='', run_type='cmd.retcode'):
    '''
    
    '''
    data = {}

    all_plugins = list_plugins()
    if plugin in all_plugins:
        data = __salt__[run_type](
                '{0}{1} {2}'.format(PLUGINDIR, plugin, args),
                python_shell=False)

    return data
280601
def call(*args, &block)
      tuples =
        if hooks?
          prepared =
            if curried?
              apply_hooks(before_hooks, *(curry_args + args))
            else
              apply_hooks(before_hooks, *args)
            end

          result = prepared ? execute(prepared, &block) : execute(&block)

          if curried?
            if args.size > 0
              apply_hooks(after_hooks, result, *args)
            elsif curry_args.size > 1
              apply_hooks(after_hooks, result, curry_args[1])
            else
              apply_hooks(after_hooks, result)
            end
          else
            apply_hooks(after_hooks, result, *args[1..args.size-1])
          end
        else
          execute(*(curry_args + args), &block)
        end

      if one?
        tuples.first
      else
        tuples
      end
    end
996926
def Execute(self, *params, **kw):
        """"""
        fp = self.__expandparamstodict(params, kw)
        return self._get_subfolder('execute/', GPExecutionResult, fp)
509098
function injectArguments (funcs, task, args) {
  function getArgument (index) {
    return args[index]
  }

  /**
   * Inject arguments.
   */

  function inject (taskKey) {
    var funcName = task[taskKey]

    if (funcName === 'arguments') {
      funcs[funcName] = function getArguments () { return args }
    } else {
      var arg = regexArgument.exec(funcName)

      if (arg) {
        funcs[funcName] = getArgument.bind(null, arg[1])
      }
    }
  }

  Object.keys(task)
    .forEach(inject)
}
574635
def run(self, args=(), env={}):
        

        # the following will call self._get_exec_binary
        return self._exec(self.binary, args=args, env=env)
943333
def execute_command(self, cmd, params=None, callback=None, raw=False):
        '''
        
        '''
        def execute_with_callbacks(cmd, params=None, callback=None, raw=False):
            code, params = self.send_command(cmd, params, raw)
            if callback:
                callback(code, params)
            return code, params

        if self.daemon:
            t = Thread(target=execute_with_callbacks,
                    args=(cmd, ), kwargs={'params':params, 'callback':callback, 'raw':raw})
            t.daemon = True
            t.start()
        else:
            return execute_with_callbacks(cmd, params, callback, raw)
1310598
def run(self, *args, **kwargs) -> Callable:
        
        return self.fn(*args, **kwargs) if args or kwargs else self.fn
379011
def _Execute(statements, context, callback, trace):
    
    # Every time we call _Execute, increase this depth
    if trace:
        trace.exec_depth += 1
    for i, statement in enumerate(statements):
        if isinstance(statement, six.string_types):
            callback(statement)
        else:
            # In the case of a substitution, args is a pair (name, formatters).
            # In the case of a section, it's a _Section instance.
            try:
                func, args = statement
                func(args, context, callback, trace)
            except UndefinedVariable as e:
                # Show context for statements
                start = max(0, i - 3)
                end = i + 3
                e.near = statements[start:end]
                e.trace = trace  # Attach caller's trace (could be None)
                raise
1231502
def arguments(self):
        
        length = conf.lib.clang_CompileCommand_getNumArgs(self.cmd)
        for i in xrange(length):
            yield str(conf.lib.clang_CompileCommand_getArg(self.cmd, i))
688005
def call(target, *args, &block)
      case object
      when Symbol
        target.public_send(object.to_sym, *args, &block)
      when String
        string = args.empty? ? "-> { #{object} }" : "-> { #{object}(*#{args}) }"
        value  = eval(string)
        target.instance_exec(&value)
      when ::Proc
        object.arity.zero? ? object.call : object.call(target, *args)
      else
        raise ArgumentError, "Unknown callable #{object}"
      end
    end
134561
function(url, args, options) {
            return Requests._execute(url, options, {
                method: "GET",
                params: args
            });
        }
324963
def run_func(func, *args, **kwargs):
    """"""
    ray.init()

    func = ray.remote(func)

    # NOTE: kwargs not allowed for now
    result = ray.get(func.remote(*args))

    # Inspect the stack to get calling example
    caller = inspect.stack()[1][3]
    print("%s: %s" % (caller, str(result)))

    return result
833305
def _call_event(self, event_name, cmd, pargs, kwargs, **kws):
        
        def get_result_params(res):
            """return the right list of params"""
            if not isinstance(res, (list, tuple)):
                return res, pargs, kwargs
            elif len(res) == 2:
                return res, pargs, kwargs
            return res[0], (pargs[0], ) + tuple(res[1]), kwargs
        if hasattr(cmd, event_name):
            return get_result_params(
                getattr(cmd, event_name)(pargs[0], *pargs[1:], **kwargs))
        elif hasattr(cmd.__cls__, event_name):
            return get_result_params(
                getattr(cmd.__cls__, event_name)(
                    pargs[0], cmd.__cmd_name__ or cmd.__name__, *pargs[1:],
                    **kwargs))
        return None, pargs, kwargs
696908
function(){
    var args = Array.prototype.slice.apply(arguments);
    this.commands.execute.apply(this.commands, args);
  }