code: def userNameToFileName(userName, existing=[], prefix="", suffix=""):
      """Converts from a user name to a file name.
  
      Takes care to avoid illegal characters, reserved file names, ambiguity between
      upper- and lower-case characters, and clashes with existing files.
  
      Args:
              userName (str): The input file name.
              existing: A case-insensitive list of all existing file names.
              prefix: Prefix to be prepended to the file name.
              suffix: Suffix to be appended to the file name.
  
      Returns:
              A suitable filename.
  
      Raises:
              NameTranslationError: If no suitable name could be generated.
  
      Examples::
  
              >>> userNameToFileName("a") == "a"
              True
              >>> userNameToFileName("A") == "A_"
              True
              >>> userNameToFileName("AE") == "A_E_"
              True
              >>> userNameToFileName("Ae") == "A_e"
              True
              >>> userNameToFileName("ae") == "ae"
              True
              >>> userNameToFileName("aE") == "aE_"
              True
              >>> userNameToFileName("a.alt") == "a.alt"
              True
              >>> userNameToFileName("A.alt") == "A_.alt"
              True
              >>> userNameToFileName("A.Alt") == "A_.A_lt"
              True
              >>> userNameToFileName("A.aLt") == "A_.aL_t"
              True
              >>> userNameToFileName(u"A.alT") == "A_.alT_"
              True
              >>> userNameToFileName("T_H") == "T__H_"
              True
              >>> userNameToFileName("T_h") == "T__h"
              True
              >>> userNameToFileName("t_h") == "t_h"
              True
              >>> userNameToFileName("F_F_I") == "F__F__I_"
              True
              >>> userNameToFileName("f_f_i") == "f_f_i"
              True
              >>> userNameToFileName("Aacute_V.swash") == "A_acute_V_.swash"
              True
              >>> userNameToFileName(".notdef") == "_notdef"
              True
              >>> userNameToFileName("con") == "_con"
              True
              >>> userNameToFileName("CON") == "C_O_N_"
              True
              >>> userNameToFileName("con.alt") == "_con.alt"
              True
              >>> userNameToFileName("alt.con") == "alt._con"
              True
      """
      # the incoming name must be a str
      if not isinstance(userName, str):
          raise ValueError("The value for userName must be a string.")
      # establish the prefix and suffix lengths
      prefixLength = len(prefix)
      suffixLength = len(suffix)
      # replace an initial period with an _
      # if no prefix is to be added
      if not prefix and userName[0] == ".":
          userName = "_" + userName[1:]
      # filter the user name
      filteredUserName = []
      for character in userName:
          # replace illegal characters with _
          if character in illegalCharacters:
              character = "_"
          # add _ to all non-lower characters
          elif character != character.lower():
              character += "_"
          filteredUserName.append(character)
      userName = "".join(filteredUserName)
      # clip to 255
      sliceLength = maxFileNameLength - prefixLength - suffixLength
      userName = userName[:sliceLength]
      # test for illegal files names
      parts = []
      for part in userName.split("."):
          if part.lower() in reservedFileNames:
              part = "_" + part
          parts.append(part)
      userName = ".".join(parts)
      # test for clash
      fullName = prefix + userName + suffix
      if fullName.lower() in existing:
          fullName = handleClash1(userName, existing, prefix, suffix)
      # finished
      return fullName
  
label_desc: Use image node_id 1 for calling a global function with example usage: userNameToFileName(userName, existing, prefix, suffix) and returns: fullName