code: def api_networks(_: gr.Blocks, app: FastAPI):
      @app.get("/sdapi/v1/loras")
      async def get_loras():
          return [
              create_lora_json(obj)
              for obj in networks.available_networks.values()
          ]
  
      @app.post("/sdapi/v1/refresh-loras")
      async def refresh_loras():
          return networks.list_available_networks()
  
file_path: stable-diffusion-webui/extensions-builtin/Lora/scripts/lora_script.py
imports: import re
  import gradio
  from fastapi import FastAPI
  import network
  import networks
  import lora
  import lora_patches
  import extra_networks_lora
  import ui_extra_networks_lora
  from modules import script_callbacks, ui_extra_networks, extra_networks, shared
label_desc: Use image node_id 4 for calling a global function with example usage: api_networks(_, app) and returns: unknown, networks