code: def curtailment(self):
          
          if self._curtailment is not None:
              return self._curtailment
          elif isinstance(self.grid.network.timeseries._curtailment,
                          pd.DataFrame):
              if isinstance(self.grid.network.timeseries.curtailment.
                                    columns, pd.MultiIndex):
                  if self.weather_cell_id:
                      try:
                          return self.grid.network.timeseries.curtailment[
                              self.type, self.weather_cell_id]
                      except KeyError:
                          logger.exception("No curtailment time series for type "
                                           "{} and weather cell ID {} "
                                           "given.".format(self.type,
                                                           self.weather_cell_id))
                          raise
                  else:
                      logger.exception("No weather cell ID provided for "
                                       "fluctuating generator {}.".format(
                          repr(self)))
                      raise KeyError
              else:
                  try:
                      return self.grid.network.timeseries.curtailment[self.type]
                  except KeyError:
                      logger.exception("No curtailment time series for type "
                                       "{} given.".format(self.type))
                      raise
          else:
              return None
docs: Parameters
          ----------
          curtailment_ts : :pandas:`pandas.Series<series>`
              See class definition for details.
  
          Returns
          -------
          :pandas:`pandas.Series<series>`
              If self._curtailment is set it returns that. Otherwise, if
              curtailment in :class:`~.grid.network.TimeSeries` for the
              corresponding technology type (and if given, weather cell ID)
              is set this is returned.