class_docstr: Command channel based on a local file system.
  This is the legacy implementation before NNI v3.0.
class_docstr_tok: ["Command","channel","based","on","a","local","file","system",".","This","is","the","legacy","implementation","before","NNI","v3.0","."]
code: def _send(self, string) -> None:
      if self._nni_platform != "local" or self._reuse_mode in (
          "true",
          "True",
      ):
          assert len(string) < 1000000, "Metric too long"
          print("NNISDK_MEb'%s'" % (string), flush=True)
      else:
          data = (string + "\n").encode("utf8")
          assert len(data) < 1000000, "Metric too long"
          self._metric_file.write(b"ME%06d%b" % (len(data), data))
          self._metric_file.flush()
          if sys.platform == "win32":
              file = open(self._metric_file.name)
              file.close()
          else:
              subprocess.run(
                  ["touch", self._metric_file.name], check=True
              )
  
file_path: nni/nni/runtime/trial_command_channel/local_legacy.py
imports: from __future__ import annotations
  import os
  import sys
  import time
  import subprocess
  from typing import cast
  from typing_extensions import Literal
  from nni.common import dump, load
  from nni.typehint import TrialMetric
  from .base import TrialCommandChannel, ParameterRecord
  from ..env_vars import trial_env_vars
label_desc: Use image node_id 2 for calling the LocalLegacyTrialCommandChannel obj's underlying member method code with example usage: obj._send(string) without return types