code: def role_from_transfer_task(transfer_task: TransferTask) -> str:
      
      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')
docs: Return the role and type for the transfer. Throws an exception on error