code: def _define_metric(data: str, metric_name: str) -> None:
      """Capture model performance at the best step.
  
      instead of the last step, of training in your `wandb.summary`
      """
      if "loss" in str.lower(metric_name):
          wandb.define_metric(f"{data}_{metric_name}", summary="min")
      elif str.lower(metric_name) in MINIMIZE_METRICS:
          wandb.define_metric(f"{data}_{metric_name}", summary="min")
      elif str.lower(metric_name) in MAXIMIZE_METRICS:
          wandb.define_metric(f"{data}_{metric_name}", summary="max")
  
file_path: wandb/wandb/integration/lightgbm/__init__.py
imports: from pathlib import Path
  from typing import TYPE_CHECKING, Callable
  import lightgbm
  from lightgbm import Booster
  import wandb
  from wandb.sdk.lib import telemetry
label_desc: Use image node_id 1 for calling a global function with example usage: _define_metric(data, metric_name) without return types