Execute Fritz API command for device specified by AIN
497174
function executeCommand(sid, command, ain, options, path)
{
    path = path || '/webservices/homeautoswitch.lua?0=0';

    if (sid)
        path += '&sid=' + sid;
    if (command)
        path += '&switchcmd=' + command;
    if (ain)
        path += '&ain=' + ain;

    return httpRequest(path, {}, options);
}
1188312
function executeCommand(parameters) {
    // If a name has been provided, we create the project directory
    const specFilePath = path.join(process.cwd(), plugin.config.apisPath, parameters.apiIdentifier);
    return mkdirpAsync(specFilePath)
    .then(() => {
      const spec = {
        swagger: '2.0',
        info: {
          title: parameters.title,
          description: parameters.desc
        },
        schemes: ['https'],
        host: 'API_ID.execute-api.REGION.amazonaws.com',
        consume: parameters.consume,
        produce: parameters.produce,
        paths: {},
        definitions: {}
      };
      return fs.writeFileAsync(specFilePath + path.sep + 'spec.json', JSON.stringify(spec, null, 2));
    })
    .then(() => {
      const msg = '\n  The API "' + icli.format.info(parameters.apiIdentifier) + '" has been created\n\n'
              + '  Its Swagger specification is available in ' + icli.format.info(specFilePath + path.sep + 'spec.json') + '\n'
              + '  You can inspect it using the command ' + icli.format.cmd('myrmex inspect-api ' + parameters.apiIdentifier) + '\n';
      icli.print(msg);
    });
  }
609381
def _run_command(self, packet):
        
        create_temp_cli = self.client_states is None

        if create_temp_cli:
            # If this client doesn't have a CLI. Create a Fake CLI where the
            # window containing this pane, is the active one. (The CLI instance
            # will be removed before the render function is called, so it doesn't
            # hurt too much and makes the code easier.)
            pane_id = int(packet['pane_id'])
            self._create_app()
            with set_app(self.client_state.app):
                self.pymux.arrangement.set_active_window_from_pane_id(pane_id)

        with set_app(self.client_state.app):
            try:
                self.pymux.handle_command(packet['data'])
            finally:
                self._close_connection()
921261
def run_commands(commands,  # type: List[Union[str, List[str], Dict[str, Union[str, List[str]]]]]
                 directory,  # type: str
                 env=None  # type: Optional[Dict[str, Union[str, int]]]
                ):  # noqa
    # type: (...) -> None
    """"""
    if env is None:
        env = os.environ.copy()
    for step in commands:
        if isinstance(step, (list, six.string_types)):
            execution_dir = directory
            raw_command = step
        elif step.get('command'):  # dictionary
            execution_dir = os.path.join(directory,
                                         step.get('cwd')) if step.get('cwd') else directory  # noqa pylint: disable=line-too-long
            raw_command = step['command']
        else:
            raise AttributeError("Invalid command step: %s" % step)
        command_list = raw_command.split(' ') if isinstance(raw_command, six.string_types) else raw_command  # noqa pylint: disable=line-too-long
        if platform.system().lower() == 'windows':
            command_list = fix_windows_command_list(command_list)

        with change_dir(execution_dir):
            check_call(command_list, env=env)
52952
function(cmd, opts) {

    // Set the machine env
    env.setDockerEnv();

    // Run a provider command in a shell.
    log.info(format('Running: %j', cmd));
    return bin.sh([COMPOSE_EXECUTABLE].concat(cmd), opts);

  }
1242141
def devices(opts=[]):
    
    adb_full_cmd = [v.ADB_COMMAND_PREFIX, v.ADB_COMMAND_DEVICES, _convert_opts(opts)]
    return _exec_command(adb_full_cmd)
521902
def cli(ctx, project_dir):
    """"""

    exit_code = SCons(project_dir).sim()
    ctx.exit(exit_code)
1324786
function executeCommand(parameters) {
    if (parameters.colors === undefined) {
      parameters.colors = plugin.myrmex.getConfig('colors');
    }
    return plugin.findApi(parameters.apiIdentifier)
    .then(api => {
      return api.generateSpec(parameters.specVersion);
    })
    .then(jsonSpec => {
      let spec = JSON.stringify(jsonSpec, null, 2);
      if (parameters.colors) {
        spec = icli.highlight(spec, { json: true });
      }
      icli.print(spec);
      return Promise.resolve(jsonSpec);
    });
  }
920172
def run_command(self):
        """"""
        topics = get_topic_partition_metadata(self.cluster_config.broker_list)

        topics_with_wrong_rf = _find_topics_with_wrong_rp(
            topics,
            self.zk,
            self.args.default_min_isr,
        )

        errcode = status_code.OK if not topics_with_wrong_rf else status_code.CRITICAL
        out = _prepare_output(topics_with_wrong_rf, self.args.verbose)
        return errcode, out
897685
function executeApi(apiName, opts, extras){

  var emitter = new Emitter()
    , apiItem
    , token = opts.access_token
    , form, method, path
    , url
    ;
  
  if(/^(https?:\/\/|\/)/.test(apiName)){
    if(apiName.indexOf('/') === 0){
      url = api.HOST + apiName;
    }else{
      url = apiName;
    }
    extras = extras || {};
    method = extras.method;
    
  }else{
    apiItem = getApiItem(apiName);
    if(!apiItem){
      process.nextTick(function(){
        emitter.emit('error', 'no or not support api: ' + apiName);
      });
      return emitter;
    }
    
    path = apiItem.path;
    method = apiItem.method;
    
    url = api.HOST + api.PREPATH + path + '.json';
  }
  
  if(method == 'post'){
    form = opts;
    opts = {};
  }
  
  delete opts.access_token;
  
  request({
      url: url + '?access_token=' + token
    , method: method
    , qs: opts
    , form: form
  }, function(err, res, reply){
    if(err){
      emitter.emit('error', err);
    }else{
      try{
        reply = JSON.parse(reply);
        emitter.emit('success', reply);
      }catch(e){
        emitter.emit('error', reply);
      }
    }
  });
  
  return emitter;
}
108118
def run_index_cmd(name, cmd):
    """"""
    sys.stderr.write("Creating {} index...\n".format(name))
    # Create index
    p = sp.Popen(cmd, shell=True, stdout=sp.PIPE, stderr=sp.PIPE)
    stdout, stderr = p.communicate()
    if p.returncode != 0:
        sys.stderr.write("Index for {} failed\n".format(name))
        sys.stderr.write(stdout)
        sys.stderr.write(stderr)
1243759
def run_command(self, args=None, node_paths=None):
    """"""
    return command_gen(
      self.tool_installations,
      self.name,
      args=args,
      node_paths=node_paths
    )
1201560
def cli(env, identifier):
    """"""

    mgr = SoftLayer.HardwareManager(env.client)
    hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware')
    if not (env.skip_confirmations or
            formatting.confirm('This will power off the server with id %s and '
                               'reflash device firmware. Continue?' % hw_id)):
        raise exceptions.CLIAbort('Aborted.')

    mgr.reflash_firmware(hw_id)
923362
def get_devices(self):
        """"""
        devices = []
        for element in self.get_device_elements():
            device = FritzhomeDevice(self, node=element)
            devices.append(device)
        return devices
808395
def execute_code(self, lines, current_client=True, clear_variables=False):
        """"""
        sw = self.get_current_shellwidget()
        if sw is not None:
            if sw._reading:
                pass
            else:
                if not current_client:
                    # Clear console and reset namespace for
                    # dedicated clients
                    # See issue 5748
                    try:
                        sw.sig_prompt_ready.disconnect()
                    except TypeError:
                        pass
                    sw.reset_namespace(warning=False)
                elif current_client and clear_variables:
                    sw.reset_namespace(warning=False)
                # Needed to handle an error when kernel_client is none
                # See issue 6308
                try:
                    sw.execute(to_text_string(lines))
                except AttributeError:
                    pass
            self.activateWindow()
            self.get_current_client().get_control().setFocus()
718717
def cli(env, identifier, immediate, comment, reason):
    """"""

    mgr = SoftLayer.HardwareManager(env.client)
    hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware')

    if not (env.skip_confirmations or formatting.no_going_back(hw_id)):
        raise exceptions.CLIAbort('Aborted')

    mgr.cancel_hardware(hw_id, reason, comment, immediate)
54858
def cli(ctx, ftdi_enable, ftdi_disable, serial_enable, serial_disable):
    """"""

    exit_code = 0

    if ftdi_enable:   # pragma: no cover
        exit_code = Drivers().ftdi_enable()
    elif ftdi_disable:   # pragma: no cover
        exit_code = Drivers().ftdi_disable()
    elif serial_enable:   # pragma: no cover
        exit_code = Drivers().serial_enable()
    elif serial_disable:   # pragma: no cover
        exit_code = Drivers().serial_disable()
    else:
        click.secho(ctx.get_help())

    ctx.exit(exit_code)