code: def update():
      try:
          expr = sy.sympify(text.value, dict(x=xs))
      except Exception as exception:
          errbox.text = str(exception)
      else:
          errbox.text = ""
      x, fy, ty = taylor(
          expr, xs, slider.value, (-2 * sy.pi, 2 * sy.pi), 200
      )
  
      p.title.text = (
          f"Taylor (n={slider.value}) expansion comparison for: {expr}"
      )
      legend.items[0].label = value(f"{expr}")
      legend.items[1].label = value(f"taylor({expr})")
      source.data = dict(x=x, fy=fy, ty=ty)
  
file_path: bokeh/examples/server/app/taylor.py
imports: import numpy
  import sympy
  from bokeh.core.properties import value
  from bokeh.io import curdoc
  from bokeh.layouts import column
  from bokeh.models import ColumnDataSource, Legend, LegendItem, PreText, Slider, TextInput
  from bokeh.plotting import figure
label_desc: Use image node_id 2 for calling a global function with example usage: update() without return types