code: def printable_text(text):
      """Returns text encoded in a way suitable for print or `tf.logging`."""
  
      # These functions want `str` for both Python2 and Python3, but in one case
      # it's a Unicode string and in the other it's a byte string.
      if six.PY3:
          if isinstance(text, str):
              return text
          elif isinstance(text, bytes):
              return text.decode("utf-8", "ignore")
          else:
              raise ValueError(
                  "Unsupported string type: %s" % (type(text))
              )
      elif six.PY2:
          if isinstance(text, str):
              return text
          elif isinstance(text, unicode):
              return text.encode("utf-8")
          else:
              raise ValueError(
                  "Unsupported string type: %s" % (type(text))
              )
      else:
          raise ValueError("Not running on Python2 or Python 3?")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import re
  import unicodedata
  import six
  import numpy
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: printable_text(text) and returns: text, text, text, text