code: def generate_app(
      ctx,
      options,
      url_base_pathname=None,
      requests_pathname_prefix=None,
      routes_pathname_prefix=None,
  ):
      # If we are passed a single explanation as a scalar, generate mini app.
      if not isinstance(ctx, list):
          new_item = _expand_ctx_item(ctx)
          app = generate_app_mini(
              new_item,
              url_base_pathname=url_base_pathname,
              requests_pathname_prefix=requests_pathname_prefix,
              routes_pathname_prefix=routes_pathname_prefix,
          )
          return app
  
      app = generate_app_full(
          requests_pathname_prefix=requests_pathname_prefix,
          routes_pathname_prefix=routes_pathname_prefix,
      )
      new_ctx = []
      # Provide indexes for selecting in dashboard. This is required.
  
      for item in ctx:
          new_item = _expand_ctx_item(item)
          new_ctx.append(new_item)
  
      # Determine if we share tables for each explanation type.
      new_options = options.copy()
      share_tables = new_options["share_tables"]
      supported_types = ["data", "perf", "global", "local"]
      _log.debug("PRE shared_tables: {0}".format(share_tables))
      if share_tables is None:
          # TODO: Revisit when we support custom tabs from users.
          shared_frames = {
              supported_type: True for supported_type in supported_types
          }
          first_dfs = {}
          for expl, df in new_ctx:
              expl_type = expl.explanation_type
              if first_dfs.get(expl_type, None) is None:
                  first_dfs[expl_type] = df
  
              if df is None or not df.equals(first_dfs[expl_type]):
                  shared_frames[expl_type] = False
      elif share_tables is True:
          shared_frames = {
              supported_type: True for supported_type in supported_types
          }
      elif share_tables is False:
          shared_frames = {
              supported_type: False
              for supported_type in supported_types
          }
      elif isinstance(share_tables, dict):
          shared_frames = share_tables
      else:  # pragma: no cover
          raise Exception(
              "share_tables option must be True|False|None or dict."
          )
  
      new_options["share_tables"] = shared_frames
      _log.debug("POST shared_tables: {0}".format(shared_frames))
  
      app.ctx = new_ctx
      app.options = new_options
      return app
  
file_path: interpret/python/interpret-core/interpret/visual/_udash.py
imports: import dash
  from dash import html
  from dash import dcc
  from dash import dash_table
  import dash_cytoscape
  from dash.dependencies import Input, Output
  import dash.development.base_component
  from pandas.core.generic import NDFrame
  from plotly import graph_objs
  import logging
label_desc: Use image node_id 6 for calling a global function with example usage: generate_app(ctx, options, url_base_pathname, requests_pathname_prefix, routes_pathname_prefix) and returns: app, app