docstr: Returns the indices and column names of the categorical features in the regression model.
  
  Steps:
  1. Get the list of features used in the model. We keep the creation order of the different lags/features
      in create_lagged_data.
  2. Get the indices of the categorical features in the list of features.
docstr_tok: ["Returns","the","indices","and","column","names","of","the","categorical","features","in","the","regression","model",".","Steps",":","1",".","Get","the","list","of","features","used","in","the","model",".","We","keep","the","creation","order","of","the","different","lags\/features","in","create_lagged_data",".","2",".","Get","the","indices","of","the","categorical","features","in","the","list","of","features","."]
code: def _get_categorical_features(
      self,
      series: Union[List[TimeSeries], TimeSeries],
      past_covariates: Optional[
          Union[List[TimeSeries], TimeSeries]
      ] = None,
      future_covariates: Optional[
          Union[List[TimeSeries], TimeSeries]
      ] = None,
  ) -> Tuple[List[int], List[str]]:
      """
      Returns the indices and column names of the categorical features in the regression model.
  
      Steps:
      1. Get the list of features used in the model. We keep the creation order of the different lags/features
          in create_lagged_data.
      2. Get the indices of the categorical features in the list of features.
      """
  
      categorical_covariates = (
          (
              self.categorical_past_covariates
              if self.categorical_past_covariates
              else []
          )
          + (
              self.categorical_future_covariates
              if self.categorical_future_covariates
              else []
          )
          + (
              self.categorical_static_covariates
              if self.categorical_static_covariates
              else []
          )
      )
  
      if not categorical_covariates:
          return [], []
      else:
          target_ts = get_single_series(series)
          past_covs_ts = get_single_series(past_covariates)
          fut_covs_ts = get_single_series(future_covariates)
  
          # We keep the creation order of the different lags/features in create_lagged_data
          feature_list = (
              [
                  f"target_{component}_lag{lag}"
                  for lag in self.lags.get("target", [])
                  for component in target_ts.components
              ]
              + [
                  f"past_cov_{component}_lag{lag}"
                  for lag in self.lags.get("past", [])
                  for component in past_covs_ts.components
              ]
              + [
                  f"fut_cov_{component}_lag{lag}"
                  for lag in self.lags.get("future", [])
                  for component in fut_covs_ts.components
              ]
              + (
                  list(target_ts.static_covariates.columns)
                  if target_ts.has_static_covariates
                  # if isinstance(target_ts.static_covariates, pd.DataFrame)
                  else []
              )
          )
  
          indices = [
              i
              for i, col in enumerate(feature_list)
              for cat in categorical_covariates
              if cat and cat in col
          ]
          col_names = [feature_list[i] for i in indices]
  
          return indices, col_names
  
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 5 for calling the RegressionModelWithCategoricalCovariates obj's underlying member method code with example usage: obj._get_categorical_features(series, past_covariates, future_covariates) and returns: list,  list, indices,  col_names