<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def role_from_transfer_task(transfer_task: TransferTask) -> str: """Return the role and type for the transfer. Throws an exception on error"""

    if isinstance(transfer_task, InitiatorTask):
        return 'initiator'
    if isinstance(transfer_task, MediatorTask):
        return 'mediator'
    if isinstance(transfer_task, TargetTask):
        return 'target'

    raise ValueError('Argument to role_from_transfer_task is not a TransferTask')