code: def _init():
      global _server
  
      # launch a server that connects websocket to stdio
      script = (
          Path(__file__).parent / "helper/websocket_server.py"
      ).resolve()
      _server = Popen(
          [sys.executable, str(script)],
          stdin=PIPE,
          stdout=PIPE,
          encoding="utf_8",
      )
      time.sleep(0.1)
  
      # if a test fails, make sure to stop the server
      atexit.register(lambda: _server is None or _server.terminate())
  
      return int(_server.stdout.readline().strip())
  
file_path: nni/test/ut/sdk/test_ws_channel.py
imports: import atexit
  from dataclasses import dataclass
  import importlib
  import json
  import os
  from pathlib import Path
  from subprocess import Popen, PIPE
  import sys
  import time
  from nni.runtime.command_channel.websocket import WsChannelClient
label_desc: Use image node_id 5 for calling a global function with example usage: _init() and returns: int