'Sends a signal to the Tor client.
:param stem.Signal signal: type of signal to be sent
:raises: :class:`stem.InvalidArguments` if signal provided wasn\'t recognized'

def signal(self, signal):

    response = self.msg(('SIGNAL    %s' % signal))
    stem.response.convert('SINGLELINE', response)
    if response.is_ok():
        if (signal == stem.Signal.NEWNYM):
            self._last_newnym = time.time()
    else:
        if (response.code == '552'):
            raise stem.InvalidArguments(response.code, response.message, [signal])
        raise stem.ProtocolError(('SIGNAL    response    contained    unrecognized    status    code:    %s' % response.code))
