old_contents: """
  String/unicode helper functions
  """
  
  def safe_unicode(obj, *args):
      """ return the unicode representation of obj """
      try:
          return unicode(obj, *args)  # pylint:disable=undefined-variable
      except UnicodeDecodeError:
          # obj is byte string
          ascii_text = str(obj).encode('string_escape')
          return unicode(ascii_text)  # pylint:disable=undefined-variable
  
  def safe_str(obj):
      """ return the byte string representation of obj """
      try:
          return str(obj)
      except UnicodeEncodeError:
          # obj is unicode
          return unicode(obj).encode('unicode_escape')  # pylint:disable=undefined-variable
  
new_contents: """
  String/unicode helper functions
  """
  
  def safe_unicode(obj, *args):
      """ return the unicode representation of obj """
      try:
          return unicode(obj, *args)  # noqa for undefined-variable
      except UnicodeDecodeError:
          # obj is byte string
          ascii_text = str(obj).encode('string_escape')
          return unicode(ascii_text)  # noqa for undefined-variable
  
  def safe_str(obj):
      """ return the byte string representation of obj """
      try:
          return str(obj)
      except UnicodeEncodeError:
          # obj is unicode
          return unicode(obj).encode('unicode_escape')  # noqa for undefined-variable
  
subject: Disable error-checking that assumes Python 3 for these Python 2 helpers, landscape.io style