'Changes a circuit\'s purpose. Currently, two purposes are recognized...
* general
* controller
:param str circuit_id: id of the circuit whose purpose is to be changed
:param str purpose: purpose (either \'general\' or \'controller\')
:raises: :class:`stem.InvalidArguments` if the circuit doesn\'t exist or if the purpose was invalid'

def repurpose_circuit(self, circuit_id, purpose):

    response = self.msg(('SETCIRCUITPURPOSE    %s    purpose=%s' % (circuit_id, purpose)))
    stem.response.convert('SINGLELINE', response)
    if (not response.is_ok()):
        if (response.code == '552'):
            raise stem.InvalidRequest(response.code, response.message)
        else:
            raise stem.ProtocolError(('SETCIRCUITPURPOSE    returned    unexpected    response    code:    %s' % response.code))
