code: def replace_file(filename, new_content):
      path = os.path.join(
          os.path.dirname(__file__), "hr_assets", filename
      )
      with open(path, "r+") as fp:
          sleep(1)  # ensure a new mod time
          old_content = fp.read()
          fp.truncate(0)
          fp.seek(0)
          fp.write(new_content)
  
      return path, old_content
  
imports: import os
  from time import sleep
  from dash.testing.wait import until
  from dash import Dash, Input, Output, html
  from dash.exceptions import PreventUpdate
label_desc: Use image node_id 1 for calling a global function with example usage: replace_file(filename, new_content) and returns: path,  old_content