code: def transceive(self, data, timeout=0.1, retries=2):
          
          log.debug(">> {0} ({1:f}s)".format(hexlify(data), timeout))
  
          if not self.target:
              # Sometimes we have to (re)sense the target during
              # communication. If that failed (tag gone) then any
              # further attempt to transceive() is the same as
              # "unrecoverable timeout error".
              raise Type2TagCommandError(nfc.tag.TIMEOUT_ERROR)
  
          started = time.time()
          for retry in range(1 + retries):
              try:
                  data = self.clf.exchange(data, timeout)
                  break
              except nfc.clf.CommunicationError as error:
                  reason = error.__class__.__name__
                  log.debug("%s after %d retries" % (reason, retry))
          else:
              if type(error) is nfc.clf.TimeoutError:
                  raise Type2TagCommandError(nfc.tag.TIMEOUT_ERROR)
              if type(error) is nfc.clf.TransmissionError:
                  raise Type2TagCommandError(nfc.tag.RECEIVE_ERROR)
              if type(error) is nfc.clf.ProtocolError:
                  raise Type2TagCommandError(nfc.tag.PROTOCOL_ERROR)
              raise RuntimeError("unexpected " + repr(error))
  
          elapsed = time.time() - started
          log.debug("<< {0} ({1:f}s)".format(hexlify(data), elapsed))
          return data
docs: Send a Type 2 Tag command and receive the response.
  
          :meth:`transceive` is a type 2 tag specific wrapper around the
          :meth:`nfc.ContactlessFrontend.exchange` method. It can be
          used to send custom commands as a sequence of *data* bytes to
          the tag and receive the response data bytes. If *timeout*
          seconds pass without a response, the operation is aborted and
          :exc:`~nfc.tag.TagCommandError` raised with the TIMEOUT_ERROR
          error code.
  
          Command execution errors raise :exc:`Type2TagCommandError`.