code: def report_trial_state(self, trial_id, trial_state):
      # type: (str, dict) -> ()
      if self._summary is None or not self.task:
          return
  
      trial = {}
      for k, v in (
          trial_state.get("metrics", {}).get("metrics", {}).items()
      ):
          m = "metric/{}".format(k)
          observations = trial_state["metrics"]["metrics"][k].get(
              "observations"
          )
          if observations:
              observations = observations[-1].get("value")
          if observations:
              trial[m] = observations[-1]
      for k, v in (
          trial_state.get("hyperparameters", {})
          .get("values", {})
          .items()
      ):
          m = "values/{}".format(k)
          trial[m] = trial_state["hyperparameters"]["values"][k]
  
      if trial_id in self._summary.index:
          columns = set(list(self._summary) + list(trial.keys()))
          if len(columns) != self._summary.columns.size:
              self._summary = self._summary.reindex(
                  set(list(self._summary) + list(trial.keys())), axis=1
              )
          self._summary.loc[trial_id, :] = pd.DataFrame(
              trial, index=[trial_id]
          ).loc[trial_id, :]
      else:
          self._summary = self._summary.append(
              pd.DataFrame(trial, index=[trial_id]), sort=False
          )
  
      self._summary.index.name = "trial id"
      self._summary = self._summary.reindex(
          columns=sorted(self._summary.columns)
      )
      self.task.get_logger().report_table(
          "summary", "trial", 0, table_plot=self._summary
      )
  
file_path: clearml/clearml/external/kerastuner.py
imports: from typing import Optional
  from ..task import Task
label_desc: Use image node_id 4 for calling the ClearmlTunerLogger obj's underlying member method code with example usage: obj.report_trial_state(trial_id, trial_state) without return types