code: def test_fastai_autolog_logs_expected_data(
      fastai_random_tabular_data_run, fit_variant
  ):
      # pylint: disable=unused-argument
      model, run = fastai_random_tabular_data_run
      data = run.data
  
      # Testing metrics are logged
      assert "train_loss" in data.metrics
      assert "valid_loss" in data.metrics
  
      for o in model.metrics:
          assert o.name in data.metrics
  
      # Testing explicitly passed parameters are logged correctly
      if fit_variant != "fine_tune":
          assert "n_epoch" in data.params
          assert data.params["n_epoch"] == str(NUM_EPOCHS)
      else:
          assert "epochs" in data.params
          assert data.params["epochs"] == str(NUM_EPOCHS - 1)
  
      # Testing unwanted parameters are not logged
      assert "cbs" not in data.params
      assert "callbacks" not in data.params
      assert "learn" not in data.params
  
      # Testing optimizer parameters are logged
      assert "opt_func" in data.params
      assert data.params["opt_func"] == "Adam"
      assert "wd" in data.params
      assert "sqr_mom" in data.params
      if fit_variant == "fit_one_cycle":
          for param in ["lr", "mom"]:
              for stat in ["min", "max", "init", "final"]:
                  assert param + "_" + stat in data.params
      elif fit_variant == "fine_tune":
          freeze_prefix = "freeze_"
          assert freeze_prefix + "wd" in data.params
          assert freeze_prefix + "sqr_mom" in data.params
          assert freeze_prefix + "epochs" in data.params
          assert data.params[freeze_prefix + "epochs"] == str(1)
          for prefix in [freeze_prefix, ""]:
              for param in ["lr", "mom"]:
                  for stat in ["min", "max", "init", "final"]:
                      assert prefix + param + "_" + stat in data.params
      else:
          assert "lr" in data.params
          assert "mom" in data.params
  
      # Testing model_summary.txt is saved
      client = MlflowClient()
      artifacts = client.list_artifacts(run.info.run_id)
      artifacts = (x.path for x in artifacts)
      assert "module_summary.txt" in artifacts
  
imports: import pickle
  from functools import partial
  from unittest.mock import patch
  import matplotlib
  import numpy
  import pandas
  import pytest
  from fastai.callback.all import EarlyStoppingCallback, SaveModelCallback
  from fastai.learner import Learner
  from fastai.optimizer import OptimWrapper
  from fastai.tabular.all import TabularDataLoaders
  from sklearn import datasets
  from torch import nn, optim
  import mlflow
  import mlflow.fastai
  from mlflow import MlflowClient
  from mlflow.fastai.callback import __MlflowFastaiCallback
  from mlflow.utils.autologging_utils import BatchMetricsLogger
label_desc: Use image node_id 9 for calling a global function with example usage: test_fastai_autolog_logs_expected_data(fastai_random_tabular_data_run, fit_variant) without return types