code: def test_rdps011_toggle_persistence2(dash_duo):
      app = dash.Dash(__name__)
      app.layout = html.Div(
          [
              dcc.Input(id="persistence-val", value=""),
              dcc.Input(id="persisted2", value="a", persistence=""),
              html.Div(id="out"),
          ]
      )
  
      # this is not a good way to set persistence, as it doesn't allow you to
      # get the right initial value. Much better is to update the whole component
      # as we do in the previous test case... but it shouldn't break this way.
      @app.callback(
          Output("persisted2", "persistence"),
          [Input("persistence-val", "value")],
      )
      def set_persistence(val):
          return val
  
      @app.callback(
          Output("out", "children"), [Input("persisted2", "value")]
      )
      def set_out(val):
          return val
  
      dash_duo.start_server(app)
  
      dash_duo.wait_for_text_to_equal("#out", "a")
  
      dash_duo.find_element("#persistence-val").send_keys("s")
      time.sleep(0.2)
      assert not dash_duo.get_logs()
      dash_duo.wait_for_text_to_equal("#out", "a")
      dash_duo.find_element("#persisted2").send_keys("pricot")
      dash_duo.wait_for_text_to_equal("#out", "apricot")
  
      dash_duo.find_element("#persistence-val").send_keys("2")
      dash_duo.wait_for_text_to_equal("#out", "a")
      dash_duo.find_element("#persisted2").send_keys("rtichoke")
      dash_duo.wait_for_text_to_equal("#out", "artichoke")
  
      # no persistence, still goes back to original value
      dash_duo.clear_input("#persistence-val")
      dash_duo.wait_for_text_to_equal("#out", "a")
  
      # apricot and artichoke saved
      dash_duo.find_element("#persistence-val").send_keys("s")
      dash_duo.wait_for_text_to_equal("#out", "apricot")
      dash_duo.find_element("#persistence-val").send_keys("2")
      assert not dash_duo.get_logs()
      dash_duo.wait_for_text_to_equal("#out", "artichoke")
  
imports: from multiprocessing import Value
  import pytest
  import time
  from selenium.webdriver.common.keys import Keys
  import dash
  from dash import Dash, Input, Output, State, MATCH, dcc, html, dash_table
  from dash_test_components import MyPersistedComponent
  from dash_test_components import MyPersistedComponentNested
label_desc: Use image node_id 17 for calling a global function with example usage: test_rdps011_toggle_persistence2(dash_duo) and returns: val, val