code: def test_dtps011_memory_persistence(dash_dcc):
      app = Dash(__name__)
      app.layout = html.Div(
          [
              html.Button(id="switch", children="Switch"),
              html.Div(id="out"),
          ]
      )
  
      @app.callback(
          Output("out", "children"), [Input("switch", "n_clicks")]
      )
      def cb(clicks):
          if clicks is None:
              return no_update
          if clicks % 2 == 1:
              return [
                  dcc.DatePickerSingle(
                      id="dps-memory",
                      min_date_allowed=datetime(2010, 1, 1),
                      max_date_allowed=datetime(2099, 12, 31),
                      initial_visible_month=datetime.today().date()
                      - timedelta(days=1),
                      persistence=True,
                      persistence_type="memory",
                      day_size=47,
                  ),
                  dcc.DatePickerSingle(
                      id="dps-none",
                      min_date_allowed=datetime(2010, 1, 1),
                      max_date_allowed=datetime(2099, 12, 31),
                      initial_visible_month=datetime.today().date()
                      - timedelta(days=1),
                      day_size=47,
                  ),
              ]
          else:
              return "switched"
  
      dash_dcc.start_server(app)
  
      switch = dash_dcc.find_element("#switch")
      switch.click()
  
      memorized = dash_dcc.select_date_single("dps-memory", day="4")
      amnesiaed = dash_dcc.select_date_single("dps-none", day="11")
  
      switch.click()
      assert dash_dcc.wait_for_text_to_equal("#out", "switched")
      switch.click()
      assert (
          dash_dcc.find_element("#dps-memory input").get_attribute(
              "value"
          )
          == memorized
      )
      switched = dash_dcc.find_element("#dps-none input").get_attribute(
          "value"
      )
      assert switched != amnesiaed and switched == ""
  
      assert dash_dcc.get_logs() == []
  
file_path: dash/components/dash-core-components/tests/integration/calendar/test_date_picker_single.py
imports: from datetime import datetime, timedelta
  import pandas
  import time
  import pytest
  import werkzeug
  from dash import Dash, Input, Output, html, dcc, no_update
label_desc: Use image node_id 3 for calling a global function with example usage: test_dtps011_memory_persistence(dash_dcc) and returns: no_update, list, str