code: def _checkpoint_artifact(
      model: "Booster", iteration: int, aliases: "List[str]"
  ) -> None:
      """Upload model checkpoint as W&B artifact."""
      # NOTE: type ignore required because wandb.run is improperly inferred as None type
      model_name = f"model_{wandb.run.id}"  # type: ignore
      model_path = Path(wandb.run.dir) / f"model_ckpt_{iteration}.txt"  # type: ignore
  
      model.save_model(model_path, num_iteration=iteration)
  
      model_artifact = wandb.Artifact(name=model_name, type="model")
      model_artifact.add_file(str(model_path))
      wandb.log_artifact(model_artifact, aliases=aliases)
  
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 2 for calling a global function with example usage: _checkpoint_artifact(model, iteration, aliases) without return types