Processes command results.
554169
def _process_data(self, obj):
        """"""
        assert len(self._waiters) > 0, (type(obj), obj)
        waiter, encoding, cb = self._waiters.popleft()
        if isinstance(obj, RedisError):
            if isinstance(obj, ReplyError):
                if obj.args[0].startswith('READONLY'):
                    obj = ReadOnlyError(obj.args[0])
            _set_exception(waiter, obj)
            if self._in_transaction is not None:
                self._transaction_error = obj
        else:
            if encoding is not None:
                try:
                    obj = decode(obj, encoding)
                except Exception as exc:
                    _set_exception(waiter, exc)
                    return
            if cb is not None:
                try:
                    obj = cb(obj)
                except Exception as exc:
                    _set_exception(waiter, exc)
                    return
            _set_result(waiter, obj)
            if self._in_transaction is not None:
                self._in_transaction.append((encoding, cb))
156698
function handleResults(results) {
    ctrl.matches = results;
    ctrl.hidden  = shouldHide();

    // If loading is in progress, then we'll end the progress. This is needed for example,
    // when the `clear` button was clicked, because there we always show the loading process, to prevent flashing.
    if (ctrl.loading) setLoading(false);

    if ($scope.selectOnMatch) selectItemOnMatch();

    positionDropdown();
    reportMessages(true, ReportType.Count);
  }
868010
def process_results(self, results=None, **value):
        """"""
        for res in results:
            if 'mask' in res:
                res['mask'] = utils.IrcString(res['mask'])
            value['success'] = res.pop('retcode', None) != '486'
            value.update(res)
        return value
1290270
def run():
    """"""
    args = parse()
    build_results = [build(p) for p in glob.iglob(glob_path)]

    if not args['publish']:
        return

    for entry in build_results:
        publish(entry)
1032774
def process_command_response(self, command, response):
        
        if response.startswith(b"Unknown command."):
            raise UnknownCommandError(command)
        if response == b"Permission denied.\n":
            raise PermissionError(command)
        if response == b"No such backend.\n":
            raise UnknownServerError(command)

        response = response.decode()
        return response.rstrip("\n")
39176
private void processResultHandlers(RHI resultHandlerInput) {
        for (ResultHandler<RHI> resultHandler : resultHandlers) {
            resultHandler.handleResult(resultHandlerInput);
        }
    }
287177
def _ProcessCommandSource(self, source):
    """"""
    action = standard.ExecuteCommandFromClient
    request = rdf_client_action.ExecuteRequest(
        cmd=source.base_source.attributes["cmd"],
        args=source.base_source.attributes["args"],
    )
    yield action, request
1010835
protected function process()
    {

        // clean-up the repositories etc. to free memory
        $this->getCustomerAddressBunchProcessor()->cleanUp();

        // temporary persist the last customer address entity ID
        $this->setLastEntityId($this->getValue(ColumnKeys::ENTITY_ID));
    }
478283
def process_result_value(self, value: Optional[str],
                             dialect: Dialect) -> List[str]:
        """"""
        retval = self._dbstr_to_strlist(value)
        return retval
14149
private void processCommand(List<String> command) throws Exception {
        processBuilder.command(command);
        Process p = processBuilder.start();
        checkReturnCode(p, processBuilder.command().toString(), 0);
    }
869790
private function postProcessResults($post_query, $results, $meta) {
        if(is_null($post_query)) {
            return $results;
        }

        $ret = [];
        switch($post_query[0]) {
            // Join up all results with a given key:value.
            case Token::C_TRANS:
                $key = $post_query[1];

                $ret_map = [];
                foreach($results as $result) {
                    if(!array_key_exists($key, $result)) {
                        continue;
                    }

                    $value = $result[$key];
                    if(!array_key_exists($value, $ret_map)) {
                        $ret_map[$value] = [];
                    }
                    $ret_map[$value] = array_merge($ret_map[$value], $result);
                }

                $ret = array_values($ret_map);
                break;
            default:
                throw new Exception('Unexpected command');
        }

        // If we wanted a count, generate it now.
        if($meta['count']) {
            $ret = ['count' => count($ret)];
        }

        return $ret;
    }
360172
def execute(self, return_results=True):
        '''
        
        '''
        if self.results:
            return self.results if return_results else None

        self.execute_raw()

        if self._raw_results_only:
            self.results = self.raw_results
        else:
            self.map_results()

        if return_results:
            return self.results
998229
def execute_return_success(cmd):
    '''
    
    '''

    ret = _run_all(cmd)

    if ret['retcode'] != 0 or 'not supported' in ret['stdout'].lower():
        msg = 'Command Failed: {0}\n'.format(cmd)
        msg += 'Return Code: {0}\n'.format(ret['retcode'])
        msg += 'Output: {0}\n'.format(ret['stdout'])
        msg += 'Error: {0}\n'.format(ret['stderr'])
        raise CommandExecutionError(msg)

    return True
198616
def execute_internal(_result)
      item = LogMessage.new
      parser = LogParser.new(@source, @sequence)
      sequences = {}
      # keep track of sequences, and when you complete one, then print out the 
      # entire thing at once.
      while parser.next(item)
        if item.kind?(ActionCommand::LOG_KIND_COMMAND_OUTPUT) && item.root?
          process_output(sequences, item)
        else
          process_other(sequences, item)
        end  
        item = LogMessage.new
      end
        
      # print out any incomplete sequences
      print_sequences(sequences)
    end
1355508
def _check_command_result(self):
        """"""
        if self.commandResult.startswith('/bin/bash'):
            raise UtilError('%s' % self.commandResult.split(' ', 1)[1])
        if self.commandResult.startswith('/bin/mv'):
            raise UtilError('%s' % self.commandResult.split(' ', 1)[1])
        if self.commandResult.startswith('/bin/ls'):
            raise UtilError('%s' % self.commandResult.split(' ', 1)[1])
        if self.commandResult.startswith('/bin/rm'):
            raise UtilError('%s' % self.commandResult.split(' ', 1)[1])
        if 'invalid option' in self.commandResult:
            raise UtilError('%s' % self.commandResult)
        if 'Invalid option' in self.commandResult:
            raise UtilError('%s' % self.commandResult)
        if 'usage: /usr/bin/get_dossier' in self.commandResult:
            raise UtilError('%s' % self.commandResult)
343710
def __process_results(results):
    
    if 'no match' in results and 'returning 0 elements' in results:
        return []

    result_list = []

    # Splts the result and cuts first and last dataset which are comments
    split = results.split(sep='\n\n')[1:-1]

    for entry in split:
        entry_dict = {}
        for value in entry.split('\n'):
            if len(value) < 1:
                continue
            (desc, val) = value.split(': ')
            entry_dict[desc.replace('-', '')] = val.strip(' ')
        result_list.append(entry_dict)
    return result_list
807766
private function exec()
    {
        $return_data = '';
        ob_start();
        try {
            $return_data = call_user_func_array($this->command, $this->args);
            $this->successful = true;
        } catch (\RuntimeException $e) {
            $this->successful = false;
        }
        $this->output = ob_get_clean() . (is_string($return_data) ? $return_data : '');

        $this->postRun();
    }