code: def receive():
      """Receive a command from Training Service.
      Returns a tuple of command (CommandType) and payload (str)
      """
      header = _in_file.read(16)
      _logger.debug("Received command, header: [%s]", header)
      if header is None or len(header) < 16:
          # Pipe EOF encountered
          _logger.debug("Pipe EOF encountered")
          return None, None
      length = int(header[2:])
      data = _in_file.read(length)
      command = CommandType(header[:2].decode())
      data = data.decode("utf8")
      _logger.debug("Received command, data: [%s]", data)
      return command, data
  
file_path: nni/nni/runtime/tuner_command_channel/legacy.py
imports: import logging
  import os
  import threading
  from .command_type import CommandType
label_desc: Use image node_id 5 for calling a global function with example usage: receive() and returns: command,  data, None,  None