def receive_request(self, request):
        """

        :type request: Request
        :param request: the incoming request
        :rtype : Transaction
        """
        logger.debug("receive_request - " + str(request))
        try:
            host, port = request.source
        except __HOLE__:
            return
        key_mid = hash(str(host) + str(port) + str(request.mid))
        key_token = hash(str(host) + str(port) + str(request.token))

        if key_mid in self._transactions.keys():
            # Duplicated
            self._transactions[key_mid].request.duplicated = True
            transaction = self._transactions[key_mid]
        else:
            request.timestamp = time.time()
            transaction = Transaction(request=request, timestamp=request.timestamp)
            with transaction:
                self._transactions[key_mid] = transaction
                self._transactions_token[key_token] = transaction
        return transaction
dataset/ETHPy150Open Tanganelli/CoAPthon/coapthon/layers/messagelayer.py/MessageLayer.receive_request