code: def _ensure_unicode(text):
      
      if isinstance(text, six.binary_type):
          return text.decode(sys.getfilesystemencoding(), 'replace')
      else:
          return text
docs: Ensures the text passed in becomes unicode
      Args:
          text (str|unicode)
      Returns:
          unicode