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 receive_parameter(self) -> ParameterRecord | None:
      params_file_name = ""
      if self._multiphase in ("true", "True"):
          params_file_name = (
              "parameter_{}.cfg".format(self._param_index),
              "parameter.cfg",
          )[self._param_index == 0]
      else:
          if self._param_index > 0:
              return None
          elif self._param_index == 0:
              params_file_name = "parameter.cfg"
          else:
              raise AssertionError(
                  "self._param_index value ({}) should >=0".format(
                      self._param_index
                  )
              )
  
      params_filepath = os.path.join(self._sysdir, params_file_name)
      if not os.path.isfile(params_filepath):
          self._request_next_parameter()
      while not (
          os.path.isfile(params_filepath)
          and os.path.getsize(params_filepath) > 0
      ):
          time.sleep(3)
      params_file = open(params_filepath, "r")
      params = load(fp=params_file)
      self._param_index += 1
      assert isinstance(params, dict) and "parameters" in params
      return cast(ParameterRecord, params)
  
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 4 for calling the LocalLegacyTrialCommandChannel obj's underlying member method code with example usage: obj.receive_parameter() and returns: cast, None