code: def add_dash(server):
      """
      Adds dash support to main D-Tale Flask process.
  
      :param server: main D-Tale Flask process
      :type server: :class:`flask:flask.Flask`
      :return: server with dash added
      :rtype: :class:`flask:flask.Flask`
      """
  
      dash_app = DtaleDash(
          server=server,
          routes_pathname_prefix="/dtale/charts/",
          eager_loading=True,
      )
  
      # Since we're adding callbacks to elements that don't exist in the app.layout,
      # Dash will raise an exception to warn us that we might be
      # doing something wrong.
      # In this case, we're adding the elements through a callback, so we can ignore
      # the exception.
      dash_app.config.suppress_callback_exceptions = True
      dash_app.layout = html.Div(
          [
              dcc.Location(id="url", refresh=False),
              html.Div(id="popup-content"),
          ]
      )
      dash_app.scripts.config.serve_locally = True
      dash_app.css.config.serve_locally = True
  
      init_callbacks(dash_app)
  
      def _handle_error(error):
          """Replace the default handler with one that does not print anything"""
          import dtale.app as dtale_app
  
          if dtale_app.USE_COLAB:
              raise ValueError(
                  "Currently executing in google colab which does not handle dash.PreventUpdate 204s"
              )
          return "", 204
  
      dash_app.server.errorhandler(DtalePreventUpdate)(_handle_error)
  
      return dash_app.server
  
imports: import json
  from logging import getLogger
  import dash
  from dash.dependencies import Input, Output, State
  from six import PY3
  from dtale.dash_application import dcc, html
  import dtale.dash_application.custom_geojson
  import dtale.dash_application.drilldown_modal
  from dtale.dash_application.exceptions import DtalePreventUpdate
  import dtale.dash_application.extended_aggregations
  import dtale.dash_application.saved_charts
  import dtale.dash_application.lock_zoom
  import dtale.global_state
  from dtale.charts.utils import MAX_GROUPS, ZAXIS_CHARTS, NON_EXT_AGGREGATION, build_final_cols
  from dtale.code_export import build_final_chart_code
  from dtale.dash_application.charts import build_chart, chart_url_params, valid_chart
  from dtale.dash_application.layout.layout import animate_styles, bar_input_style, base_layout, build_group_val_options, build_input_options, build_loc_mode_hover_children, build_map_options, build_candlestick_options, build_mapbox_style_options, build_pareto_options, build_proj_hover_children, build_slider_counts, build_label_value_options, charts_layout, colorscale_input_style, collapse_btn_text, get_yaxis_type_tabs, lock_zoom_style, main_inputs_and_group_val_display, show_chart_per_group, show_chart_per_y, get_group_types, show_input_handler, show_yaxis_ranges, bootstrap_checkbox_prop, get_num_cols
  from dtale.dash_application.layout.utils import show_style
  from dtale.dash_application.utils import get_data_id
  from dtale.translations import text
  from dtale.query import handle_predefined, run_query
  from dtale.utils import dict_merge, is_app_root_defined, make_list
label_desc: Use image node_id 1 for calling a global function with example usage: add_dash(server) and returns: dash_app, str,  int