code: def get_user_metadata(filename):
      if filename is None:
          return {}
  
      basename, ext = os.path.splitext(filename)
      metadata_filename = basename + ".json"
  
      metadata = {}
      try:
          if os.path.isfile(metadata_filename):
              with open(
                  metadata_filename, "r", encoding="utf8"
              ) as file:
                  metadata = json.load(file)
      except Exception as e:
          errors.display(
              e,
              f"reading extra network user metadata from {metadata_filename}",
          )
  
      return metadata
  
imports: import json
  import os
  import re
  import logging
  from collections import defaultdict
  from modules import errors
label_desc: Use image node_id 10 for calling a global function with example usage: get_user_metadata(filename) and returns: metadata, dict