code: def stacked_overfitting_assert(
      lb,
      predictor,
      expected_stacked_overfitting_at_val,
      expected_stacked_overfitting_at_test,
  ):
      if expected_stacked_overfitting_at_val is not None:
          assert (
              predictor._stacked_overfitting_occurred
              == expected_stacked_overfitting_at_val
          ), "Expected stacked overfitting at val mismatch!"
  
      if expected_stacked_overfitting_at_test is not None:
          stacked_overfitting = (
              check_stacked_overfitting_from_leaderboard(lb)
          )
          assert (
              stacked_overfitting
              == expected_stacked_overfitting_at_test
          ), "Expected stacked overfitting at test mismatch!"
  
imports: import copy
  import os
  import shutil
  import uuid
  from contextlib import contextmanager
  from typing import List, Tuple
  import numpy
  import pandas
  import pytest
  from autogluon.common.utils.path_converter import PathConverter
  from autogluon.common.utils.resource_utils import ResourceManager
  from autogluon.core.constants import BINARY, MULTICLASS, REGRESSION
  from autogluon.core.data.label_cleaner import LabelCleaner
  from autogluon.core.models import AbstractModel, BaggedEnsembleModel
  from autogluon.core.stacked_overfitting.utils import check_stacked_overfitting_from_leaderboard
  from autogluon.core.utils import download, generate_train_test_split, infer_problem_type, unzip
  from autogluon.features.generators import AbstractFeatureGenerator, AutoMLPipelineFeatureGenerator
  from autogluon.tabular import TabularDataset, TabularPredictor
label_desc: Use image node_id 13 for calling a global function with example usage: stacked_overfitting_assert(lb, predictor, expected_stacked_overfitting_at_val, expected_stacked_overfitting_at_test) without return types