code: def create_custom_trends_graph():
      header = gd["reports"][4]
      phrases = gd.values[:, 9]
      imp_change = gd.values[:, 10]
      phrases_h, changes_h = [], []
      phrases_c, changes_c = [], []
      text_h, text_c = [], []
      custom_count = 0
      for i in range(len(phrases)):
          phrase = phrases[i]
          change = float(imp_change[i])
          if phrase in custom_nps:
              if custom_count > 30:
                  logger.warning(
                      "too many custom phrases (>30). Showing partial list"
                  )
                  break
              phrase = cut_phrase(phrase)
              if change > 0:
                  phrases_h.append(phrase)
                  changes_h.append(change)
                  text_h.append("+" + str(("%.1f" % change)) + "%")
              else:
                  phrases_c.append(phrase)
                  changes_c.append(change)
                  text_c.append(str(("%.1f" % change)) + "%")
              custom_count += 1
  
      changes = changes_h + changes_c
      text = text_h + text_c
      trends = phrases_h + phrases_c
      colors = []
  
      if len(changes_h) > 0:
          for i in range(len(changes_h)):
              colors.append("#1d6d34")
      if len(changes_c) > 0:
          for i in range(len(changes_c)):
              colors.append("#912605")
      if len(changes) < 10:  # pad with 10 blanks
          changes += [0] * (10 - len(changes))
          text += " " * (10 - len(text))
          trends += [
              str((10 - len(trends)) - i)
              for i in range(0, (10 - len(trends)))
          ]
          colors += ["white"] * (10 - len(colors))
  
      source = ColumnDataSource(
          dict(
              y=trends[::-1],
              x=changes[::-1],
              colors=colors[::-1],
              text=text[::-1],
          )
      )
  
      plot = figure(
          title=header,
          plot_width=600,
          plot_height=400,
          tools="save",
          x_range=ranges.Range1d(
              start=min(changes) - 10, end=max(changes) + 20
          ),
          y_range=source.data["y"],
          tooltips="@y<br>change: @x",
      )
      labels = LabelSet(
          x=max(changes) + 5,
          y="y",
          text="text",
          level="glyph",
          x_offset=0,
          y_offset=-10,
          source=source,
          render_mode="canvas",
      )
  
      plot.hbar(
          source=source,
          right="x",
          y="y",
          left=0,
          height=0.5,
          color="colors",
      )
      plot.add_layout(labels)
  
      return plot
  
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 17 for calling a global function with example usage: create_custom_trends_graph() and returns: plot