input: Write a python function to create a server that accepts connections and receives messages, and a client that connects to the server and sends a message.
  assert run_server_and_client() == 'Hello, this is client!'
  assert run_server_and_client() == 'Test message'
  assert run_server_and_client() == 'Another message'
output: import socket
  import threading
  
  def run_server_and_client():
      def server():
          s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          s.bind(('localhost', 12345))
          s.listen(1)
          conn, addr = s.accept()
          with conn:
              message = conn.recv(1024).decode('utf-8')
          s.close()
          return message
  
      def client(message):
          s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          s.connect(('localhost', 12345))
          s.sendall(message.encode('utf-8'))
          s.close()
  
      # Start server in a thread
      server_thread = threading.Thread(target=server)
      server_thread.start()
  
      # Ensure the server has time to start up
      import time
      time.sleep(1)
  
      # Send message from client
      message = 'Hello, this is client!'
      client(message)
  
      # Wait for the server thread to finish
      server_thread.join()
      return message