code: def stream():
      x, xdot = update()
      dict_ = dict(x=x, xdot=xdot)
      cds0.stream(dict_, rollover=rollover)
      if n % timesteps_per_period == 0:
          cds1.stream(dict(x=x[-1:], xdot=xdot[-1:]))
  
file_path: bokeh/examples/server/app/duffing_oscillator.py
imports: import numpy
  from bokeh.layouts import column, row
  from bokeh.models import ColumnDataSource, Div, Paragraph, Range1d, Slider
  from bokeh.plotting import curdoc, figure
label_desc: Use image node_id 4 for calling a global function with example usage: stream() without return types