code: def on_log(
      self, args, state, control, model=None, logs=None, **kwargs
  ):
      if not state.is_world_process_zero:
          return
  
      if not self._run:
          self.setup(args, state, model)
  
      for log_name, log_value in logs.items():
          context = {}
          prefix_set = {"train_", "eval_", "test_"}
          for prefix in prefix_set:
              if log_name.startswith(prefix):
                  log_name = log_name[len(prefix) :]
                  context = {"subset": prefix[:-1]}
                  if "_" in log_name:
                      sub_dataset = (
                          AimCallback.find_most_common_substring(
                              list(logs.keys())
                          ).split(prefix)[-1]
                      )
                      if sub_dataset != prefix.rstrip("_"):
                          log_name = log_name.split(sub_dataset)[
                              -1
                          ].lstrip("_")
                          context["sub_dataset"] = sub_dataset
                  break
          if not is_number(log_value):
              if not self._log_value_warned:
                  self._log_value_warned = True
                  logger.warning(
                      f"Trainer is attempting to log a value of "
                      f'"{log_value}" of type {type(log_value)} for key "{log_name}"'
                      f" as a metric which is not a supported value type."
                  )
              continue
  
          self._run.track(
              log_value,
              name=log_name,
              context=context,
              step=state.global_step,
              epoch=state.epoch,
          )
  
file_path: aim/aim/sdk/adapters/hugging_face.py
imports: from logging import getLogger
  from typing import Optional, List, Dict
  from difflib import SequenceMatcher
  from collections import defaultdict
  from aim.ext.resource.configs import DEFAULT_SYSTEM_TRACKING_INT
  from aim.sdk.num_utils import is_number
  from aim.sdk.run import Run
label_desc: Use image node_id 6 for calling the AimCallback obj's underlying member method code with example usage: obj.on_log(args, state, control, model, logs) without return types