code: def check_stacked_overfitting_from_leaderboard(
      leaderboard: pd.DataFrame,
  ) -> bool:
      """
      Determine if stacked overfitting occurred given a leaderboard from `predictor.leaderboard(test_data)`.
  
      Returns False if there is no model that could have been affected by stacked overfitting in the leaderboard (e.g., no L2 model exists).
  
      Parameters
      ----------
      leaderboard : pd.DataFrame
          A leaderboard produced by `predictor.leaderboard(test_data)`.
          The leaderboard needs to contain `score_val`, `score_test`, and `model` as columns.
  
      Returns
      -------
      Bool that is True if stacked overfitting occurred, otherwise False.
      """
      (
          best_non_affected_model,
          best_affected_model,
          affected_models_exist,
      ) = get_best_val_models(leaderboard=leaderboard)
  
      if not affected_models_exist:
          return False
  
      return _check_stacked_overfitting_for_models(
          best_non_affected_model=best_non_affected_model,
          best_affected_model=best_affected_model,
          leaderboard=leaderboard,
      )
  
imports: import logging
  from typing import List, Tuple
  import pandas
label_desc: Use image node_id 4 for calling a global function with example usage: check_stacked_overfitting_from_leaderboard(leaderboard) and returns: _check_stacked_overfitting_for_models, False