code: def _historical_forecasts_check_kwargs(
      hfc_args: Set[str],
      name_kwargs: str,
      dict_kwargs: Dict[str, Any],
  ) -> Dict[str, Any]:
      """
      Return the kwargs dict without the arguments unsupported by the model method.
  
      Raise a warning if some argument are not supported and an exception if some arguments interfere with
      historical_forecasts logic.
      """
      invalid_args = set(dict_kwargs).intersection(hfc_args)
      if len(invalid_args) > 0:
          raise_log(
              ValueError(
                  f"The following parameters cannot be passed in `{name_kwargs}`: {invalid_args}. "
                  f"Make sure to pass them explicitly to the function/method."
              ),
              logger,
          )
      return dict_kwargs
  
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 3 for calling a global function with example usage: _historical_forecasts_check_kwargs(hfc_args, name_kwargs, dict_kwargs) and returns: dict_kwargs