input: Write a python function to add messages received from a WebSocket to a list and verify the contents.
  assert asyncio.run(send_and_receive_messages(["hello", "world"])) == ["hello", "world"]
  assert asyncio.run(send_and_receive_messages(["foo", "bar", "baz"])) == ["foo", "bar", "baz"]
  assert asyncio.run(send_and_receive_messages([])) == []
output: import asyncio
  import websockets
  
  async def send_and_receive_messages(messages):
      uri = "ws://example.com/socket"
      received_messages = []
  
      async with websockets.connect(uri) as websocket:
          for message in messages:
              await websocket.send(message)
              response = await websocket.recv()
              received_messages.append(response)
  
      return received_messages