Sends a raw line to the server.

        :param command: line to send.
        :type command: unicode
173607
def _send(self, command):
        
        command = command.encode('utf-8')
        log.debug('>> ' + command)
        self.conn.oqueue.put(command)
91683
@Override
    public String sendCommandStr(String command) {
        String str = null;
        try {
            str = sendCommand2(command);
        } catch (Exception ex) {
            logger.error("Could not run command " + command, ex);
        }
        return str;
    }
684044
def send_command_response(self, source: list, command: str, *args, **kwargs):
        
        args = json.dumps(args).encode('utf8')
        kwargs = json.dumps(kwargs).encode('utf8')
        frame = (*source, b'', command.encode('utf8'), args, kwargs)
        self.add_callback(self.command_socket.send_multipart, frame)
895447
def send(self, command):
        
        # The POLL command requests data from the last-seen fixes on all active GPS devices.
        # Devices must previously have been activated by ?WATCH to be pollable.
        try:
            self.streamSock.send(bytes(command, encoding='utf-8'))
        except TypeError:
            self.streamSock.send(command)  # 2.7 chokes on 'bytes' and 'encoding='
        except (OSError, IOError) as error:  # MOE, LEAVE THIS ALONE!...for now.
            sys.stderr.write('\nGPS3 send command fail with {}\n'.format(error))
533884
def send(self, load, tries=None, timeout=None, raw=False):  # pylint: disable=unused-argument
        '''
        
        '''
        if 'cmd' not in load:
            log.error('Malformed request, no cmd: %s', load)
            return {}
        cmd = load['cmd'].lstrip('_')
        if cmd in self.cmd_stub:
            return self.cmd_stub[cmd]
        if not hasattr(self.fs, cmd):
            log.error('Malformed request, invalid cmd: %s', load)
            return {}
        return getattr(self.fs, cmd)(load)
464157
async def rawmsg(self, command, *args, **kwargs):
        
        message = str(self._create_message(command, *args, **kwargs))
        await self._send(message)
1154215
def send(self, command, *, log=True):
        '''
        
        '''
        with self.sequence_number_mutex:
            self.sequence_number += 1
            packed = command._pack(self.sequence_number)
            self.send_bytes(packed, log=log)
1134127
def send_command_response(self,
                              source: list,
                              command: str,
                              *args,
                              **kwargs):
        
        args = _json.dumps(args).encode('utf8')
        kwargs = _json.dumps(kwargs).encode('utf8')
        if isinstance(source, list):
            frame = (*source, b'', command.encode('utf8'), args, kwargs)
        else:
            frame = (b'', command.encode('utf8'), args, kwargs)
        if self._run_control_loop:
            self.add_callback(self.command_socket.send_multipart, frame)
        else:
            self.command_socket.send_multipart(frame)
1243801
def SendCommand(self, Command):
        
        try:
            self._Api.send_command(Command)
        except SkypeAPIError:
            self.ResetCache()
            raise
894151
def cmd(send, msg, _):
    
    try:
        answer = subprocess.check_output(['wtf', msg], stderr=subprocess.STDOUT)
        send(answer.decode().strip().replace('\n', ' or ').replace('fuck', 'fsck'))
    except subprocess.CalledProcessError as ex:
        send(ex.output.decode().rstrip().splitlines()[0])
597512
def encode(cls, command):
        

        args = []
        for arg in command.args:
            if not isinstance(arg, str):
                arg = str(arg)

            if "," in arg or arg.startswith(" ") or arg.endswith(" ") or arg.startswith("hex:"):
                arg = "hex:{}".format(hexlify(arg.encode('utf-8')).decode('utf-8'))

            args.append(arg)

        argstr = ""

        if len(args) > 0:
            argstr = " {" + ",".join(args) + "}"

        return command.name + argstr
254590
public void send(Command command) {
    logger.finest(command.toString());
    byte[] payload = command.toByteArray();
    int totalSize = payload.length + 1; // increment 1 for message type

    ByteBuffer outMessageSize = encodeMessageSize(totalSize);

    // create the message
    ByteBuffer buffer = ByteBuffer.allocateDirect(prefix.length
                                                  + outMessageSize.position() + 1 + payload.length);
    buffer.put(prefix, 0, prefix.length);
    outMessageSize.flip();
    buffer.put(outMessageSize);
    buffer.put((byte) 1);
    buffer.put(payload);

    // Log what is being sent.
    logger.finest("SEND: " + command);

    requests.add(buffer);
    monitor.modify(socketChannel, this, SelectionKey.OP_READ | SelectionKey.OP_WRITE);
  }
1112082
def issue_command(self, cmd, *args):
    
    self._writeline(cmd)
    self._writeline(str(len(args)))
    for arg in args:
      arg = str(arg)
      self._writeline(str(len(arg)))
      self._sock.sendall(arg.encode("utf-8"))

    return self._read_response()
364248
def sendline(self, cmd):
        '''
        
        '''
        self.conn.sendline(cmd, self.linesep)

        # saw_prompt = False
        ret_stdout = []
        ret_stderr = []
        while self.conn.has_unread_data:
            stdout, stderr = self.conn.recv()

            if stdout:
                ret_stdout.append(stdout)
            if stderr:
                log.debug('Error while executing command.')
                ret_stderr.append(stderr)

            if stdout and self.prompt_re.search(stdout):
                break

        return ''.join(ret_stdout), ''.join(ret_stderr)
115496
def copy(string, cmd=copy_cmd, stdin=PIPE):
    
    Popen(cmd, stdin=stdin).communicate(string.encode('utf-8'))
623215
def send(self, data):
        
        try:
            proc = subprocess.Popen(self.cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        except OSError as exc:
            raise URLError("Calling %r failed (%s)!" % (' '.join(self.cmd), exc))
        else:
            stdout, stderr = proc.communicate(data)
            if proc.returncode:
                raise URLError("Calling %r failed with RC=%d!\n%s" % (
                   ' '.join(self.cmd), proc.returncode, stderr,
                ))
            yield stdout
1234491
def command(self, command, arg=None):
        
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

        try:
            sock.connect((self.host, self.port))
            payload = {"command": command}
            if arg is not None:
                # Parameter must be converted to basestring (no int)
                payload.update({'parameter': unicode(arg)})

            sock.send(json.dumps(payload))
            received = self._receive(sock)
        finally:
            sock.shutdown(socket.SHUT_RDWR)
            sock.close()

        return json.loads(received[:-1])