code: def get_dataset(src, name, distribution):
      df = src[src.airport == name].copy()
      del df["airport"]
      df["date"] = pd.to_datetime(df.date)
      # timedelta here instead of pd.DateOffset to avoid pandas bug < 0.18 (Pandas issue #11925)
      df["left"] = df.date - datetime.timedelta(days=0.5)
      df["right"] = df.date + datetime.timedelta(days=0.5)
      df = df.set_index(["date"])
      df.sort_index(inplace=True)
      if distribution == "Smoothed":
          window, order = 51, 3
          for key in STATISTICS:
              df[key] = savgol_filter(df[key], window, order)
  
      return ColumnDataSource(data=df)
  
file_path: bokeh/examples/server/app/weather/main.py
imports: import datetime
  from os.path import dirname, join
  import pandas
  from scipy.signal import savgol_filter
  from bokeh.io import curdoc
  from bokeh.layouts import column, row
  from bokeh.models import ColumnDataSource, DataRange1d, Select
  from bokeh.palettes import Blues4
  from bokeh.plotting import figure
label_desc: Use image node_id 1 for calling a global function with example usage: get_dataset(src, name, distribution) and returns: ColumnDataSource