code: def get_targets(
      lgb_train: Union[lgb.Dataset, "RayDMatrix"],  # noqa: F821
      output_feature: BaseFeatureMixin,
      device: str,
      actor_rank: int = 0,
  ) -> Dict[str, torch.Tensor]:
      """Get the targets of the training data.
  
      Args:
          lgb_train: the training data.
          output_feature: the output feature.
          device: the device to store the targets on.
          actor_rank: (optional, only used for RayDMatrix) the rank of the actor to get the targets for.
  
      Returns:
          A dictionary mapping the output feature name to the targets.
      """
      is_regression = output_feature.type() == NUMBER
      if isinstance(lgb_train, lgb.Dataset):
          targets = lgb_train.get_label()
      else:
          targets = lgb_train.get_data(actor_rank, 1)[
              "label"
          ].to_numpy()
      targets = (
          targets.copy()
          if is_regression
          else targets.copy().astype(int)
      )
      # TODO (jeffkinnison): revert to use the requested device once torch device usage is standardized
      return {
          output_feature.feature_name: torch.from_numpy(targets).cpu()
      }
  
imports: from dataclasses import dataclass
  from typing import Callable, Dict, Tuple, Union
  import lightgbm
  import numpy
  import torch
  from lightgbm.callback import CallbackEnv
  from numpy import typing
  from ludwig.constants import NUMBER
  from ludwig.features.base_feature import BaseFeatureMixin, OutputFeature
  from ludwig.features.category_feature import CategoryOutputFeature
  from ludwig.models.base import BaseModel
label_desc: Use image node_id 10 for calling a global function with example usage: get_targets(lgb_train, output_feature, device, actor_rank) and returns: dict