code: def test_mobilenetv2_training(transfer_learning):
      models_dir = os.path.join(classification_dataset, "models")
      if os.path.isdir(models_dir):
          shutil.rmtree(models_dir)
  
      trainer = ClassificationModelTrainer()
      trainer.setModelTypeAsMobileNetV2()
      trainer.setDataDirectory(data_directory=classification_dataset)
      trainer.trainModel(
          num_experiments=1,
          batch_size=2,
          transfer_from_model=transfer_learning,
      )
  
      assert os.path.isdir(models_dir) == True
      assert (
          os.path.isfile(
              os.path.join(models_dir, "idenprof_model_classes.json")
          )
          == True
      )
      model_found = False
      for file in os.listdir(models_dir):
          if file.endswith(".pt"):
              model_found = True
      assert model_found == True
  
file_path: ImageAI/test/test_custom_classification_training.py
imports: import os, sys
  import cv2
  import shutil
  from PIL import Image
  import pytest
  from os.path import dirname
  from imageai.Classification.Custom import ClassificationModelTrainer, CustomImageClassification
label_desc: Use image node_id 4 for calling a global function with example usage: test_mobilenetv2_training(transfer_learning) without return types