code: def sort_timeseries(self, ascending=True):
          
          # the time series is sorted by default
          if ascending and self._sorted:
              return
  
          sortorder = 1
          if not ascending:
              sortorder = -1
              self._predefinedSorted = False
  
          self._timeseriesData.sort(key=lambda i: sortorder * i[0])
  
          self._sorted = ascending
  
          return self
docs: Sorts the data points within the TimeSeries according to their occurrence inline.
  
          :param boolean ascending: Determines if the TimeSeries will be ordered ascending or
              descending. If this is set to descending once, the ordered parameter defined in
              :py:meth:`TimeSeries.__init__` will be set to False FOREVER.
  
          :return:    Returns :py:obj:`self` for convenience.
          :rtype:     TimeSeries