code: def ToASCII(label):
      try:
          # Step 1: try ASCII
          label = label.encode("ascii")
      except UnicodeError:
          pass
      else:
          # Skip to step 3: UseSTD3ASCIIRules is false, so
          # Skip to step 8.
          if 0 < len(label) < 64:
              return label
          raise UnicodeError("label empty or too long")
  
      # Step 2: nameprep
      label = nameprep(label)
  
      # Step 3: UseSTD3ASCIIRules is false
      # Step 4: try ASCII
      try:
          label = label.encode("ascii")
      except UnicodeError:
          pass
      else:
          # Skip to step 8.
          if 0 < len(label) < 64:
              return label
          raise UnicodeError("label empty or too long")
  
      # Step 5: Check ACE prefix
      if label.startswith(sace_prefix):
          raise UnicodeError("Label starts with ACE prefix")
  
      # Step 6: Encode with PUNYCODE
      label = label.encode("punycode")
  
      # Step 7: Prepend ACE prefix
      label = ace_prefix + label
  
      # Step 8: Check size
      if 0 < len(label) < 64:
          return label
      raise UnicodeError("label empty or too long")
  
imports: import stringprep, re, codecs
  from unicodedata import ucd_3_2_0
label_desc: Use image node_id 2 for calling a global function with example usage: ToASCII(label) and returns: label, label, label