code: def test_get_final_steps_per_checkpoint():
      # steps_per_checkpoint and checkpoints_per_epoch cannot both be specified.
      with pytest.raises(Exception):
          trainer_utils.get_final_steps_per_checkpoint(
              steps_per_epoch=1024,
              steps_per_checkpoint=1,
              checkpoints_per_epoch=1,
          )
  
      assert (
          trainer_utils.get_final_steps_per_checkpoint(
              steps_per_epoch=1024, steps_per_checkpoint=100
          )
          == 100
      )
      assert (
          trainer_utils.get_final_steps_per_checkpoint(
              steps_per_epoch=1024, steps_per_checkpoint=2048
          )
          == 1024
      )
      assert (
          trainer_utils.get_final_steps_per_checkpoint(
              steps_per_epoch=1024, checkpoints_per_epoch=2
          )
          == 512
      )
      assert (
          trainer_utils.get_final_steps_per_checkpoint(
              steps_per_epoch=1024, checkpoints_per_epoch=2.5
          )
          == 409
      )
      assert (
          trainer_utils.get_final_steps_per_checkpoint(
              steps_per_epoch=1024, checkpoints_per_epoch=0.5
          )
          == 1024
      )
      assert (
          trainer_utils.get_final_steps_per_checkpoint(
              steps_per_epoch=1024
          )
          == 1024
      )
      assert (
          trainer_utils.get_final_steps_per_checkpoint(
              steps_per_epoch=1024,
              steps_per_checkpoint=0,
              checkpoints_per_epoch=0,
          )
          == 1024
      )
  
file_path: ludwig/tests/ludwig/utils/test_trainer_utils.py
imports: from collections import OrderedDict
  from typing import Union
  import pytest
  from ludwig.constants import AUTO, BATCH_SIZE, COMBINED, LOSS
  from ludwig.features.category_feature import CategoryOutputFeature
  from ludwig.features.feature_utils import LudwigFeatureDict
  from ludwig.schema.features.category_feature import ECDCategoryOutputFeatureConfig
  from ludwig.schema.trainer import ECDTrainerConfig
  from ludwig.schema.utils import load_config_with_kwargs
  from ludwig.utils import trainer_utils
  from ludwig.utils.metric_utils import TrainerMetric
label_desc: Use image node_id 6 for calling a global function with example usage: test_get_final_steps_per_checkpoint() without return types