code: async def event_wait(event: asyncio.Event, timeout=None):
      '''
      Wait on an an asyncio event with an optional timeout
  
      Returns:
          true if the event got set, None if timed out
      '''
      if timeout is None:
          await event.wait()
          return True
  
      try:
          await asyncio.wait_for(event.wait(), timeout)
      except asyncio.TimeoutError:
          return False
      return Truync def event_wait(event: asyncio.Event, timeout=None):
      '''
      Wait on an an asyncio event with an optional timeout
  
      Returns:
          true if the event got set, None if timed out
      '''
      if timeout is None:
          await event.wait()
          return True
  
      try:
          await asyncio.wait_for(event.wait(), timeout)
      except asyncio.TimeoutError:
          return False
      return True
docs: Wait on an an asyncio event with an optional timeout
  
      Returns:
          true if the event got set, None if timed out