code: def deactivate(p, extra_network_data):
      """call deactivate for extra networks in extra_network_data in specified order, then call
      deactivate for all remaining registered networks"""
  
      data = lookup_extra_networks(extra_network_data)
  
      for extra_network in data:
          try:
              extra_network.deactivate(p)
          except Exception as e:
              errors.display(
                  e, f"deactivating extra network {extra_network.name}"
              )
  
      for (
          extra_network_name,
          extra_network,
      ) in extra_network_registry.items():
          if extra_network in data:
              continue
  
          try:
              extra_network.deactivate(p)
          except Exception as e:
              errors.display(
                  e,
                  f"deactivating unmentioned extra network {extra_network_name}",
              )
  
imports: import json
  import os
  import re
  import logging
  from collections import defaultdict
  from modules import errors
label_desc: Use image node_id 7 for calling a global function with example usage: deactivate(p, extra_network_data) without return types