code: def _prepare_batch(
      df: pd.DataFrame,
      features: List[FeatureConfigDict],
      metadata: TrainingSetMetadataDict,
  ) -> Dict[str, np.ndarray]:
      batch = {}
      for feature in features:
          c = feature[PROC_COLUMN]
          if df[c].values.dtype == "object":
              # Ensure columns stacked instead of turned into np.array([np.array, ...], dtype=object) objects
              batch[c] = np.stack(df[c].values)
          else:
              batch[c] = df[c].to_numpy()
  
      for feature in features:
          c = feature[PROC_COLUMN]
          reshape = metadata.get(feature[NAME], {}).get("reshape")
          if reshape is not None:
              batch[c] = batch[c].reshape((-1, *reshape))
  
      return batch
  
imports: from typing import Callable, Dict, List
  import numpy
  import pandas
  import torch
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import ENCODER_OUTPUT, MODEL_ECD, NAME, PROC_COLUMN, TYPE
  from ludwig.features.feature_registries import get_input_type_registry
  from ludwig.features.feature_utils import LudwigFeatureDict
  from ludwig.models.base import BaseModel
  from ludwig.schema.features.base import BaseInputFeatureConfig, FeatureCollection
  from ludwig.schema.features.utils import get_input_feature_cls
  from ludwig.types import FeatureConfigDict, TrainingSetMetadataDict
  from ludwig.utils.batch_size_tuner import BatchSizeEvaluator
  from ludwig.utils.dataframe_utils import from_numpy_dataset
  from ludwig.utils.misc_utils import get_from_registry
  from ludwig.utils.torch_utils import get_torch_device, LudwigModule
label_desc: Use image node_id 3 for calling a global function with example usage: _prepare_batch(df, features, metadata) and returns: batch