<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def receive(self, timeout: float = None) -> Union[Message, None]: """ Receives a message for this behaviour. If timeout is not None it returns the message or "None" after timeout is done. Args: timeout (float):
 number of seconds until return Returns: spade.message.Message: a Message or None """

        if timeout:
            coro = self.queue.get()
            try:
                msg = await asyncio.wait_for(coro, timeout=timeout)
            except asyncio.TimeoutError:
                msg = None
        else:
            try:
                msg = self.queue.get_nowait()
            except asyncio.QueueEmpty:
                msg = None
        return msg