code: def build_kde(s, hist_labels, selected_col):
      try:
          kde = sts.gaussian_kde(s)
          kde_data = kde.pdf(hist_labels)
          kde_data = [json_float(k, precision=12) for k in kde_data]
          code = [
              "import scipy.stats as sts",
              "kde = sts.gaussian_kde(s['{}'])".format(selected_col),
              "kde_data = kde.pdf(np.linspace(labels.min(), labels.max()))",
          ]
          return kde_data, code
      except np.linalg.LinAlgError:
          return None, []
  
imports: import numpy
  import pandas
  import plotly.express
  import plotly.graph_objs
  import pprint
  import scipy.stats
  import time
  import dtale.global_state
  import dtale.pandas_util
  from dtale.code_export import build_code_export, build_final_chart_code
  from dtale.column_builders import clean, clean_code
  from dtale.describe import load_describe
  from dtale.query import build_query, load_filterable_data
  from dtale.utils import apply, classify_type, find_dtype, find_dtype_formatter, find_selected_column, get_bool_arg, get_int_arg, get_str_arg, grid_columns, grid_formatter, json_float, json_timestamp, make_list
label_desc: Use image node_id 4 for calling a global function with example usage: build_kde(s, hist_labels, selected_col) and returns: kde_data,  code, None,  list