code: def insert_in_file(markdown_text, file_path):
      """Save module page.
  
      Either insert content into existing page,
      or create page otherwise."""
      if file_path.exists():
          template = file_path.read_text(encoding="utf-8")
          if "{{autogenerated}}" not in template:
              raise RuntimeError(
                  f"Template found for {file_path} but missing "
                  f"{{autogenerated}} tag."
              )
          markdown_text = template.replace(
              "{{autogenerated}}", markdown_text
          )
          print(
              "...inserting autogenerated content into template:",
              file_path,
          )
      else:
          print(
              "...creating new page with autogenerated content:",
              file_path,
          )
      os.makedirs(file_path.parent, exist_ok=True)
      file_path.write_text(markdown_text, encoding="utf-8")
  
file_path: autokeras/docs/keras_autodoc/utils.py
imports: import importlib
  import inspect
  import os
  import re
label_desc: Use image node_id 2 for calling a global function with example usage: insert_in_file(markdown_text, file_path) without return types