class_docstr: An abstract base class for generating synthetic time series data.
  Generates a 1-dimensional grid x(0), x(1), ..., x(n-1), where x(i) = x0 + i * step.
  Then generates a time series y(0), y(1), ..., y(n-1), where y(i) = f(x(i)) + noise.
class_docstr_tok: ["An","abstract","base","class","for","generating","synthetic","time","series","data",".","Generates","a","1-dimensional","grid","x","(","0",")",",","x","(","1",")",",","...",",","x","(","n-1",")",",","where","x","(","i",")","=","x0","+","i","*","step",".","Then","generates","a","time","series","y","(","0",")",",","y","(","1",")",",","...",",","y","(","n-1",")",",","where","y","(","i",")","=","f","(","x","(","i",")",")","+","noise","."]
docstr: Generates synthetic time series data according and returns it as a list or as a
  TimeSeries object.
docstr_tok: ["Generates","synthetic","time","series","data","according","and","returns","it","as","a","list","or","as","a","TimeSeries","object","."]
code: def generate(self, return_ts=True) -> Union[List[float], TimeSeries]:
      """
      Generates synthetic time series data according and returns it as a list or as a
      TimeSeries object.
      """
      vals = self._generate()
      if return_ts:
          assert self.t0 is not None and self.tdelta is not None
          times = pd.date_range(
              self.t0, periods=self.n, freq=self.tdelta
          )
          return UnivariateTimeSeries(times, vals, self.name).to_ts()
  
      return vals
  
imports: import numpy
  import pandas
  from operator import add
  from functools import reduce
  from typing import Callable, List, Union
  from merlion.utils.time_series import UnivariateTimeSeries, TimeSeries
label_desc: Use image node_id 10 for calling the TimeSeriesGenerator obj's underlying member method code with example usage: obj.generate(return_ts) and returns: vals, UnivariateTimeSeries