code: def get_app(mode, data=df, page_count=None):
      app = dash.Dash(__name__)
  
      if page_count is None:
          page_count = math.ceil(len(data) / PAGE_SIZE)
  
      app.layout = DataTable(
          id="table",
          columns=[{"name": i, "id": i} for i in rawDf.columns],
          data=data if mode == "native" else data[0:PAGE_SIZE],
          editable=True,
          fixed_columns={"headers": True},
          fixed_rows={"headers": True},
          page_action=mode,
          page_count=page_count,
          page_size=PAGE_SIZE,
          row_deletable=True,
          row_selectable=True,
      )
  
      if mode == "custom":
  
          @app.callback(
              [Output("table", "data")],
              [
                  Input("table", "page_current"),
                  Input("table", "page_size"),
              ],
          )
          def update_table(page_current, page_size):
              if page_current is None or page_size is None:
                  raise PreventUpdate
  
              return (
                  data[
                      page_current
                      * page_size : (page_current + 1)
                      * page_size
                  ],
              )
  
      return app
  
imports: import dash
  from dash import Input, Output, html, dcc
  from dash.exceptions import PreventUpdate
  from dash.dash_table import DataTable
  import pytest
  from selenium.webdriver.common.keys import Keys
  import math
  import pandas
label_desc: Use image node_id 1 for calling a global function with example usage: get_app(mode, data, page_count) and returns: app, data