code: def create_backup(old, backup=None):
      if isinstance(old, str):
          filename = old
      else:
          filename = getattr(old, "name", None)
      if not filename:
          return None
      if not backup or backup is True:
          backup = f"{filename}.bak"
      try:
          shutil.copyfile(filename, backup)
      except FileNotFoundError as exc:
          if exc.filename != filename:
              raise  # re-raise
          backup = None
      return backup
  
imports: import fnmatch
  import glob
  import os
  import os.path
  import shutil
  import stat
  from .iterutil import iter_many
label_desc: Use image node_id 1 for calling a global function with example usage: create_backup(old, backup) and returns: backup, None