class_docstr: Aim Logger: logs metrics in Aim format.
  
  Aim is an open-source, self-hosted ML experiment tracking tool.
  It's good at tracking lots (thousands) of training runs, and it allows you to
  compare them with a performant and well-designed UI.
  
  Source: https://github.com/aimhubio/aim
  
  Args:
      repo: Aim repository directory or a `Repo` object that the Run object will
          log results to. If not provided, a default repo will be set up in the
          experiment directory (one level above trial directories).
      experiment: Sets the `experiment` property of each Run object, which is the
          experiment name associated with it. Can be used later to query
          runs/sequences.
          If not provided, the default will be the Tune experiment name set
          by `RunConfig(name=...)`.
      metrics: List of metric names (out of the metrics reported by Tune) to
          track in Aim. If no metric are specified, log everything that
          is reported.
      aim_run_kwargs: Additional arguments that will be passed when creating the
          individual `Run` objects for each trial. For the full list of arguments,
          please see the Aim documentation:
          https://aimstack.readthedocs.io/en/latest/refs/sdk.html
code: def log_trial_result(
      self, iteration: int, trial: "Trial", result: Dict
  ):
      tmp_result = result.copy()
  
      step = (
          result.get(TIMESTEPS_TOTAL, None)
          or result[TRAINING_ITERATION]
      )
  
      for k in [
          "config",
          "pid",
          "timestamp",
          TIME_TOTAL_S,
          TRAINING_ITERATION,
      ]:
          tmp_result.pop(k, None)  # not useful to log these
  
      # `context` and `epoch` are special keys that users can report,
      # which are treated as special aim metrics/configurations.
      context = tmp_result.pop("context", None)
      epoch = tmp_result.pop("epoch", None)
  
      trial_run = self._trial_to_run[trial]
      path = ["ray", "tune"]
  
      flat_result = flatten_dict(tmp_result, delimiter="/")
      valid_result = {}
  
      for attr, value in flat_result.items():
          if self._metrics and attr not in self._metrics:
              continue
  
          full_attr = "/".join(path + [attr])
          if isinstance(value, tuple(VALID_SUMMARY_TYPES)) and not (
              np.isnan(value) or np.isinf(value)
          ):
              valid_result[attr] = value
              trial_run.track(
                  value=value,
                  name=full_attr,
                  epoch=epoch,
                  step=step,
                  context=context,
              )
          elif (
              isinstance(value, (list, tuple, set)) and len(value) > 0
          ) or (isinstance(value, np.ndarray) and value.size > 0):
              valid_result[attr] = value
  
file_path: ray/python/ray/tune/logger/aim.py
imports: import logging
  import numpy
  from typing import TYPE_CHECKING, Dict, Optional, List, Union
  from ray.air.constants import TRAINING_ITERATION
  from ray.tune.logger.logger import LoggerCallback
  from ray.tune.result import TIME_TOTAL_S, TIMESTEPS_TOTAL
  from ray.tune.utils import flatten_dict
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 4 for calling the AimLoggerCallback obj's underlying member method code with example usage: obj.log_trial_result(iteration, trial, result) without return types