docs: def safe_add_file(filename, app):
      """
      Adds files to builder resources only, if the given filename was not already registered.
      Needed mainly for tests to avoid multiple registration of the same file and therefore also multiple execution
      of e.g. a javascript file during page load.
  
      :param filename: filename to remove
      :param app: app object
      :return: None
      """
      data_file = filename
      static_data_file = os.path.join("_static", data_file)
  
      if data_file.split(".")[-1] == "js":
          if hasattr(app.builder, "script_files") and static_data_file not in app.builder.script_files:
              app.add_javascript(data_file)
      elif data_file.split(".")[-1] == "css":
          if hasattr(app.builder, "css_files") and static_data_file not in app.builder.css_files:
              app.add_stylesheet(data_file)
      else:
          raise NotImplementedError("File type {} not support by save_add_file".format(data_file.split(".")[-1]))