docstr: Checks that the categorical covariates are valid. Specifically, checks that the categorical covariates
  of the model are a subset of all covariates.
  
  Parameters
  ----------
  series
      TimeSeries or Sequence[TimeSeries] object containing the target values.
  past_covariates
      Optionally, a series or sequence of series specifying past-observed covariates
  future_covariates
      Optionally, a series or sequence of series specifying future-known covariates
docstr_tok: ["Checks","that","the","categorical","covariates","are","valid",".","Specifically",",","checks","that","the","categorical","covariates","of","the","model","are","a","subset","of","all","covariates",".","Parameters","--","--","--","--","--","series","TimeSeries","or","Sequence","[","TimeSeries","]","object","containing","the","target","values",".","past_covariates","Optionally",",","a","series","or","sequence","of","series","specifying","past-observed","covariates","future_covariates","Optionally",",","a","series","or","sequence","of","series","specifying","future-known","covariates"]
code: def _validate_categorical_covariates(
      self,
      series: Union[TimeSeries, Sequence[TimeSeries]],
      past_covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
      future_covariates: Optional[
          Union[TimeSeries, Sequence[TimeSeries]]
      ] = None,
  ) -> None:
      """
      Checks that the categorical covariates are valid. Specifically, checks that the categorical covariates
      of the model are a subset of all covariates.
  
      Parameters
      ----------
      series
          TimeSeries or Sequence[TimeSeries] object containing the target values.
      past_covariates
          Optionally, a series or sequence of series specifying past-observed covariates
      future_covariates
          Optionally, a series or sequence of series specifying future-known covariates
      """
      for categorical_covariates, covariates, cov_type in zip(
          [
              self.categorical_past_covariates,
              self.categorical_future_covariates,
          ],
          [past_covariates, future_covariates],
          ["past_covariates", "future_covariates"],
      ):
          if categorical_covariates:
              if not covariates:
                  raise_log(
                      ValueError(
                          f"`categorical_{cov_type}` were declared at model creation but no "
                          f"`{cov_type}` are passed to the `fit()` call."
                      ),
                  )
              s = get_single_series(covariates)
              if not set(categorical_covariates).issubset(
                  set(s.components)
              ):
                  raise_log(
                      ValueError(
                          f"Some `categorical_{cov_type}` components "
                          f"({set(categorical_covariates) - set(s.components)}) "
                          f"declared at model creation are not present in the `{cov_type}` "
                          f"passed to the `fit()` call."
                      )
                  )
      if self.categorical_static_covariates:
          s = get_single_series(series)
          covariates = s.static_covariates
          if not s.has_static_covariates:
              raise_log(
                  ValueError(
                      "`categorical_static_covariates` were declared at model creation but `series`"
                      "passed to the `fit()` call does not contain `static_covariates`."
                  ),
              )
          if not set(self.categorical_static_covariates).issubset(
              set(covariates.columns)
          ):
              raise_log(
                  ValueError(
                      f"Some `categorical_static_covariates` components "
                      f"({set(self.categorical_static_covariates) - set(covariates.columns)}) "
                      f"declared at model creation are not present in the series' `static_covariates` "
                      f"passed to the `fit()` call."
                  )
              )
  
imports: from collections import OrderedDict
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  import pandas
  from sklearn.linear_model import LinearRegression
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from darts.models.forecasting.forecasting_model import GlobalForecastingModel
  from darts.timeseries import TimeSeries
  from darts.utils.data.tabularization import add_static_covariates_to_lagged_data, create_lagged_component_names, create_lagged_training_data
  from darts.utils.historical_forecasts import _check_optimizable_historical_forecasts_global_models, _optimized_historical_forecasts_all_points, _optimized_historical_forecasts_last_points_only, _process_historical_forecast_input
  from darts.utils.multioutput import MultiOutputRegressor
  from darts.utils.utils import _check_quantiles, get_single_series, seq2series, series2seq
label_desc: Use image node_id 4 for calling the RegressionModelWithCategoricalCovariates obj's underlying member method code with example usage: obj._validate_categorical_covariates(series, past_covariates, future_covariates) without return types