

def _send_command(self, command):
    'Send a command to the server\n\n        Parameters\n        ----------\n        command : str\n            The command to send.\n\n        Returns\n        -------\n        resp : str\n            The response from the server.\n        '
    logger.debug(('Sending command: %s' % command))
    command += '\n'
    begin._cmd_sock.sendall(command.encode('utf-8'))
    (buf, chunk, begin) = ([], '', time.time())
    while True:
        if (buf and ((time.time() - begin) > self._timeout)):
            break
        elif ((time.time() - begin) > (self._timeout * 2)):
            break
        try:
            chunk = self._cmd_sock.recv(8192)
            if chunk:
                buf.append(chunk)
                begin = time.time()
            else:
                time.sleep(0.1)
        except:
            pass
    return ''.join(buf)

dataset/ETHPy150Open mne-tools/mne-python/mne/realtime/client.py RtClient._send_command/VarMisuse@29/115 `self`->`begin`