code: def purge_networks_from_memory():
      while (
          len(networks_in_memory) > shared.opts.lora_in_memory_limit
          and len(networks_in_memory) > 0
      ):
          name = next(iter(networks_in_memory))
          networks_in_memory.pop(name, None)
  
      devices.torch_gc()
  
imports: import logging
  import os
  import re
  import lora_patches
  import network
  import network_lora
  import network_glora
  import network_hada
  import network_ia3
  import network_lokr
  import network_full
  import network_norm
  import network_oft
  import torch
  from typing import Union
  from modules import shared, devices, sd_models, errors, scripts, sd_hijack
  import modules.textual_inversion.textual_inversion
  from lora_logger import logger
label_desc: Use image node_id 4 for calling a global function with example usage: purge_networks_from_memory() without return types