code: def fname_ext_ul_case(fname: str) -> str:
      """`fname` with ext changed to upper / lower case if file exists
  
      Check for existence of `fname`.  If it does exist, return unmodified.  If
      it doesn't, check for existence of `fname` with case changed from lower to
      upper, or upper to lower.  Return this modified `fname` if it exists.
      Otherwise return `fname` unmodified
  
      Parameters
      ----------
      fname : str
          filename.
  
      Returns
      -------
      mod_fname : str
          filename, maybe with extension of opposite case
      """
      if exists(fname):
          return fname
      froot, ext = splitext(fname)
      if ext == ext.lower():
          mod_fname = froot + ext.upper()
          if exists(mod_fname):
              return mod_fname
      elif ext == ext.upper():
          mod_fname = froot + ext.lower()
          if exists(mod_fname):
              return mod_fname
      return fname
  
imports: from __future__ import annotations
  import io
  import sys
  import typing
  import warnings
  from functools import reduce
  from operator import getitem, mul
  from os.path import exists, splitext
  import numpy
  from ._compression import COMPRESSED_FILE_LIKES
  from .casting import OK_FLOATS, shared_range
  from .externals.oset import OrderedSet
label_desc: Use image node_id 22 for calling a global function with example usage: fname_ext_ul_case(fname) and returns: fname, fname, mod_fname, mod_fname