code: def row_selected_callback(indices, old, new):
      logger.info("row selected callback")
      global clear_flag, all_selected_phrases
      if not clear_flag and expand_table_source.data != empty_table:
          logger.info(
              "row selected callback. old indices=%s. new indices=%s",
              str(old),
              str(new),
          )
          # sync phrases lists:
          old_phrases = [
              expand_table_source.data["res"][p] for p in old
          ]
          new_phrases = [
              expand_table_source.data["res"][p] for p in new
          ]
          logger.info(
              "selected_expand was updated: old=%s ,new=%s",
              str(old_phrases),
              str(new_phrases),
          )
          # phrase was de-selected from expand list:
          for o in old_phrases:
              if o not in new_phrases and (
                  vocab is not None
                  and vocab_dict[o] in phrases_list.value
              ):
                  logger.info("removing %s from vocab selected", o)
                  phrases_list.value.remove(vocab_dict[o])
                  break
          # new phrase was selected from expand list:
          for n in new_phrases:
              if n not in old_phrases and (
                  vocab is not None
                  and vocab_dict[n] in phrases_list.options
                  and vocab_dict[n] not in phrases_list.value
              ):
                  phrases_list.value.append(vocab_dict[n])
                  break
          update_all_selected_phrases()
          seed_input_box.value = get_selected_phrases_for_seed()
  
imports: import socket
  import pickle
  import logging
  import re
  from os.path import dirname, join
  from bokeh.layouts import column, layout
  from bokeh.models import ColumnDataSource, Div, Row, CustomJS
  from bokeh.models.widgets import Button, DataTable, TableColumn, CheckboxGroup, MultiSelect
  from bokeh.models.widgets.inputs import TextInput
  from bokeh.io import curdoc
  from settings import grouping, expand_host, expand_port
label_desc: Use image node_id 3 for calling a global function with example usage: row_selected_callback(indices, old, new) without return types