code: def create_server_socket(ctx, heartbeat_timeout=False):
      """Create a server socket with a random port (support raising timeout exception).
  
      Args:
          ctx(zmq.Context()): context of zmq
          heartbeat_timeout(bool): whether to set the timeout(HEARTBEAT_RCVTIMEO_S) for
                 receiving operation on the server socket. (The default value is False)
  
      Returns:
          socket(zmq.Context().socket): socket of the server.
          port(int): port of the server socket.
      """
      socket = ctx.socket(zmq.REP)
      if heartbeat_timeout:
          socket.setsockopt(
              zmq.RCVTIMEO, remote_constants.HEARTBEAT_RCVTIMEO_S * 1000
          )
      socket.linger = 0
      port = socket.bind_to_random_port(addr="tcp://*")
      return socket, port
  
imports: import zmq
  from parl.remote import remote_constants
label_desc: Use image node_id 1 for calling a global function with example usage: create_server_socket(ctx, heartbeat_timeout) and returns: socket,  port