class_docstr: source of buffered demonstration data 
class_docstr_tok: ["source","of","buffered","demonstration","data"]
docstr: return all data acquired since last get_data call 
docstr_tok: ["return","all","data","acquired","since","last","get_data","call"]
code: def get_data(self, timestamp, max_length=6000):
      """return all data acquired since last get_data call"""
      next_idx = int((timestamp - self.start_time) * self.rate)
      if next_idx - self.sample_idx > max_length:
          self.sample_idx = next_idx - max_length  # catch up if needed
      # create some mildly intersting data:
      sample_phases = np.arange(
          self.sample_idx, next_idx, dtype=np.float64
      )
      self.sample_idx = next_idx
  
      sample_phase_pos = sample_phases / (self.period * self.rate)
      sample_phase_pos %= 1.0
      if self.neg_period is None:
          return sample_phase_pos**4
      sample_phase_neg = sample_phases / (self.neg_period * self.rate)
      sample_phase_neg %= 1.0
      return sample_phase_pos**4 - sample_phase_neg**4
  
file_path: pyqtgraph/pyqtgraph/examples/ColorGradientPlots.py
imports: import time
  import numpy
  import pyqtgraph
  from pyqtgraph.Qt import QtCore, mkQApp
label_desc: Use image node_id 3 for calling the DataSource obj's underlying member method code with example usage: obj.get_data(timestamp, max_length) and returns: unknown, unknown