code: def chars_to_dictionary(string):
      """Creates a dictionary char:integer for each unique character"""
      chars = set(string)
      # sorted tries to keep a consistent dictionary, if you run a second time for the same char set
      char_idx = {c: i for i, c in enumerate(sorted(chars))}
      return char_idx
  
imports: from __future__ import division, print_function, absolute_import
  import os
  import random
  import numpy
  from PIL import Image
  import pickle
  import csv
  import warnings
  import tensorflow.compat.v1
  from io import BytesIO
label_desc: Use image node_id 5 for calling a global function with example usage: chars_to_dictionary(string) and returns: char_idx