docstr: Send command to Training Service.
  command: CommandType object.
  data: string payload.
  the message is sent synchronized.
docstr_tok: ["Send","command","to","Training","Service",".","command",":","CommandType","object",".","data",":","string","payload",".","the","message","is","sent","synchronized","."]
code: def send(self, command, data):
      """Send command to Training Service.
      command: CommandType object.
      data: string payload.
      the message is sent synchronized.
      """
      data["node"] = self.node_id
      data = json.dumps(data)
      data = data.encode("utf8")
      message = b"%b%014d%b" % (command.value, len(data), data)
      self.send_queue.put(message)
  
imports: import json
  import threading
  import time
  from abc import ABC, abstractmethod
  from queue import Empty, Queue
  from .log_utils import LogType, nni_log
  from .commands import CommandType
label_desc: Use image node_id 8 for calling the BaseChannel obj's underlying member method code with example usage: obj.send(command, data) without return types