code: def create_trend_graphs(top_n):
      header_h = gd["reports"][2]
      header_c = gd["reports"][3]
      phrases = gd.values[:, 9]  # all trends
      imp_change = gd.values[:, 10]
      data_h, data_c = {}, {}
      text_h, text_c = [], []
      hot, cold = 0, 0  # counters for each list
      plot_h = figure(plot_width=600, plot_height=400, title=header_h)
      plot_c = figure(plot_width=600, plot_height=400, title=header_c)
      for i in range(len(phrases)):
          if hot == top_n and cold == top_n:
              break
          phrase = phrases[i]
          change = float(imp_change[i])
          if phrase in white_list:
              phrase = cut_phrase(phrase)
              if change > 0:
                  if hot < top_n:
                      data_h[phrase] = change
                      text_h.append("+" + str(("%.1f" % change)) + "%")
                      hot += 1
              elif cold < top_n:
                  data_c[phrase] = change
                  text_c.append(str(("%.1f" % change)) + "%")
                  cold += 1
      if len(data_h.keys()) > 0:
          phrases_h = sorted(data_h, key=data_h.get)
          changes_h = sorted(data_h.values())
          source = ColumnDataSource(
              dict(y=phrases_h, x=changes_h, text=text_h[::-1])
          )
          title = header_h
          plot_h = figure(
              plot_width=600,
              plot_height=400,
              tools="save",
              title=title,
              x_range=ranges.Range1d(start=0, end=max(changes_h) + 20),
              y_range=source.data["y"],
              tooltips="@y<br>change: @x",
          )
          labels = LabelSet(
              x="x",
              y="y",
              text="text",
              level="glyph",
              x_offset=5,
              y_offset=0,
              source=source,
              render_mode="canvas",
              text_color="#1d6d34",
          )
          plot_h.hbar(
              source=source,
              right="x",
              y="y",
              left=0,
              height=0.5,
              color="#1d6d34",
          )
          plot_h.add_layout(labels)
          plot_h.xaxis.visible = False
      if len(data_c.keys()) > 0:
          phrases_c = sorted(data_c, key=data_c.get)
          changes_c = sorted(data_c.values())
          source = ColumnDataSource(
              dict(
                  y=phrases_c[::-1],
                  x=changes_c[::-1],
                  text=text_c[::-1],
              )
          )
          plot_c = figure(
              plot_width=600,
              plot_height=400,
              tools="save",
              title=header_c,
              x_range=ranges.Range1d(start=min(changes_c) - 10, end=20),
              y_range=source.data["y"],
              tooltips="@y<br>change: @x",
          )
          labels = LabelSet(
              x=0,
              y="y",
              text="text",
              level="glyph",
              x_offset=5,
              y_offset=0,
              source=source,
              render_mode="canvas",
              text_color="#912605",
          )
          plot_c.hbar(
              source=source,
              right="x",
              y="y",
              left=0,
              height=0.5,
              color="#912605",
          )
          plot_c.add_layout(labels)
          plot_c.xaxis.visible = False
  
      return [plot_h, plot_c]
  
imports: import csv
  import logging
  import time
  from os import path
  from os.path import isfile
  import pandas
  from bokeh.io import curdoc
  from bokeh.layouts import column, layout, WidgetBox
  from bokeh.models import ColumnDataSource, Div, Row, ranges, LabelSet, CDSView, IndexFilter
  from bokeh.models.widgets import DataTable, TableColumn, RadioGroup, Dropdown, Tabs, Panel, TextInput, Button, Slider
  from bokeh.plotting import figure
  from trend_analysis import analyze
  from nlp_architect import LIBRARY_OUT
label_desc: Use image node_id 18 for calling a global function with example usage: create_trend_graphs(top_n) and returns: list