code: def _add_capacities_to_df(self, df: pd.DataFrame) -> pd.DataFrame:
      dates = df["ds"]
      try:
          df["cap"] = (
              self._cap(dates) if callable(self._cap) else self._cap
          )
          df["floor"] = (
              self._floor(dates)
              if callable(self._floor)
              else self._floor
          )
      except ValueError as e:
          raise_if(
              "does not match length of index" in str(e),
              "Callables supplied to `Prophet.set_capacity` as `cap` or `floor` "
              "arguments have to return Sequences of identical length as their "
              " input argument Sequence!",
              logger,
          )
          raise
      return df
  
imports: import logging
  import re
  from typing import Callable, List, Optional, Sequence, Union
  import numpy
  import pandas
  import prophet
  from darts.logging import execute_and_suppress_output, get_logger, raise_if, raise_log
  from darts.models.forecasting.forecasting_model import FutureCovariatesLocalForecastingModel
  from darts.timeseries import TimeSeries
label_desc: Use image node_id 4 for calling the Prophet obj's underlying member method code with example usage: obj._add_capacities_to_df(df) and returns: df