code: def send_request_to_server(request):
      sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      try:
          # Connect to server and send data
          sock.connect((expand_host, expand_port))
          logger.info("sending request")
          req_packet = pickle.dumps(request)
          # sock.sendall(bytes(request + "\n", "utf-8"))
          sock.sendall(req_packet)
          # Receive data from the server and shut down
          data = b""
          ctr = 0
          while True:
              packet = sock.recv(134217728)
              logger.info(
                  "%s. received: %s", str(ctr), str(len(packet))
              )
              ctr += 1
              if not packet:
                  break
              data += packet
              logger.info("got response, uncompressing")
          received = pickle.loads(data)
          # logger.info("Received: {}".format(received))
          return received
      except EOFError:
          logger.info("No data received")
      finally:
          sock.close()
  
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 2 for calling a global function with example usage: send_request_to_server(request) and returns: received