code: def generate(json_path):
      if not os.path.isdir(json_path):
          os.mkdir(json_path)
      with open(json_path + "guides_by_category.json", "w+") as f:
          json.dump(
              {
                  "guides_by_category": guides_by_category,
              },
              f,
          )
      for guide in guides:
          with open(json_path + guide["name"] + ".json", "w+") as f:
              json.dump({"guide": guide}, f)
      with open(json_path + "guide_names.json", "w+") as f:
          json.dump(
              {"guide_names": guide_names, "guide_urls": guide_urls}, f
          )
  
imports: import json
  import os
  import re
label_desc: Use image node_id 2 for calling a global function with example usage: generate(json_path) without return types