code: def test_resume_training(optimizer, tmp_path):
      (
          input_features,
          output_features,
      ) = synthetic_test_data.get_feature_configs()
      config = {
          "input_features": input_features,
          "output_features": output_features,
          "combiner": {"type": "concat"},
          TRAINER: {
              "epochs": 2,
              "batch_size": 16,
              "optimizer": {"type": optimizer},
          },
      }
  
      # create sub-directory to store results
      results_dir = tmp_path / "results"
      results_dir.mkdir()
  
      generated_data = synthetic_test_data.get_generated_data()
      _, _, _, _, output_dir1 = experiment_cli(
          config,
          training_set=generated_data.train_df,
          validation_set=generated_data.validation_df,
          test_set=generated_data.test_df,
      )
  
      config[TRAINER]["epochs"] = 5
  
      experiment_cli(
          config,
          training_set=generated_data.train_df,
          validation_set=generated_data.validation_df,
          test_set=generated_data.test_df,
          model_resume_path=output_dir1,
      )
  
      _, _, _, _, output_dir2 = experiment_cli(
          config,
          training_set=generated_data.train_df,
          validation_set=generated_data.validation_df,
          test_set=generated_data.test_df,
      )
  
      # compare learning curves with and without resuming
      ts1 = load_json(
          os.path.join(output_dir1, "training_statistics.json")
      )
      ts2 = load_json(
          os.path.join(output_dir2, "training_statistics.json")
      )
      print("ts1", ts1)
      print("ts2", ts2)
      assert (
          ts1[TRAINING]["combined"]["loss"]
          == ts2[TRAINING]["combined"]["loss"]
      )
  
      # compare predictions with and without resuming
      y_pred1 = np.load(os.path.join(output_dir1, "y_predictions.npy"))
      y_pred2 = np.load(os.path.join(output_dir2, "y_predictions.npy"))
      print("y_pred1", y_pred1)
      print("y_pred2", y_pred2)
      assert np.all(np.isclose(y_pred1, y_pred2))
  
imports: import json
  import logging
  import os.path
  import re
  import numpy
  import pandas
  import pytest
  import torch
  from ludwig import globals
  from ludwig.api import LudwigModel
  from ludwig.backend import LOCAL_BACKEND
  from ludwig.constants import BATCH_SIZE, CATEGORY, DEFAULTS, EPOCHS, INPUT_FEATURES, OUTPUT_FEATURES, PREPROCESSING, TRAINER, TRAINING
  from ludwig.contribs.mlflow import MlflowCallback
  from ludwig.experiment import experiment_cli
  from ludwig.features.number_feature import numeric_transformation_registry
  from ludwig.globals import DESCRIPTION_FILE_NAME, TRAINING_PREPROC_FILE_NAME
  from ludwig.schema.optimizers import optimizer_registry
  from ludwig.utils.data_utils import load_json, replace_file_extension
  from ludwig.utils.misc_utils import get_from_registry
  from ludwig.utils.package_utils import LazyLoader
  from tests.integration_tests import synthetic_test_data
  from tests.integration_tests.utils import category_feature, generate_data, LocalTestBackend
label_desc: Use image node_id 3 for calling a global function with example usage: test_resume_training(optimizer, tmp_path) without return types