<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def aggregate_series(self, *args, **kwargs) -> InfoArray: """Aggregates time series data based on the actual |FluxSequence.aggregation_ext| attribute of |IOSequence| subclasses. We prepare some nodes and elements with the help of method |prepare_io_example_1| and select a 1-dimensional flux sequence of type |lland_fluxes.NKor| as an example: If no |FluxSequence.aggregation_ext| is `none`, the original time series values are returned: 'none' InfoArray([[ 24., 25., 26.], [ 27., 28., 29.], [ 30., 31., 32.], [ 33., 34., 35.]]) If no |FluxSequence.aggregation_ext| is `mean`, function |IOSequence.aggregate_series| is called: InfoArray([ 25., 28., 31., 34.]) In case the state of the sequence is invalid: Traceback (most recent call last):
 RuntimeError: Unknown aggregation mode `nonexistent` for \ sequence `nkor` of element `element3`. The following technical test confirms that all potential positional and keyword arguments are passed properly: """

        mode = self.aggregation_ext
        if mode == 'none':
            return self.series
        elif mode == 'mean':
            return self.average_series(*args, **kwargs)
        else:
            raise RuntimeError(
                'Unknown aggregation mode `%s` for sequence %s.'
                % (mode, objecttools.devicephrase(self)))