code: def _check_optimizable_historical_forecasts_global_models(
      model,
      forecast_horizon: int,
      retrain: Union[bool, int, Callable[..., bool]],
      show_warnings: bool,
      allow_autoregression: bool,
  ) -> bool:
      """
      Historical forecast can be optimized only if `retrain=False`. If `allow_autoregression=False`, historical forecasts
      can be optimized only if `forecast_horizon <= model.output_chunk_length` (no auto-regression required).
      """
  
      retrain_off = (retrain is False) or (retrain == 0)
      is_autoregressive = forecast_horizon > model.output_chunk_length
      if retrain_off and (
          not is_autoregressive
          or (is_autoregressive and allow_autoregression)
      ):
          return True
  
      if show_warnings:
          if not retrain_off:
              logger.warning(
                  "`enable_optimization=True` is ignored because `retrain` is not `False` or `0`."
                  "To hide this warning, set `show_warnings=False` or `enable_optimization=False`."
              )
          if is_autoregressive:
              logger.warning(
                  "`enable_optimization=True` is ignored because `forecast_horizon > model.output_chunk_length`."
                  "To hide this warning, set `show_warnings=False` or `enable_optimization=False`."
              )
  
      return False
  
imports: from types import SimpleNamespace
  from typing import Any, Callable, Dict, Optional, Sequence, Set, Tuple, Union
  import inspect
  import numpy
  import pandas
  from numpy.typing import ArrayLike
  from darts.logging import get_logger, raise_if_not, raise_log
  from darts.timeseries import TimeSeries
  from darts.utils.timeseries_generation import generate_index
  from darts.utils.utils import series2seq
label_desc: Use image node_id 11 for calling a global function with example usage: _check_optimizable_historical_forecasts_global_models(model, forecast_horizon, retrain, show_warnings, allow_autoregression) and returns: False, True