code: def get_file_contents_text(
          filename: str = None, blob: bytes = None,
          config: TextProcessingConfig = _DEFAULT_CONFIG) -> str:
      
      binary_contents = get_file_contents(filename=filename, blob=blob)
      # 1. Try the encoding the user specified
      if config.encoding:
          try:
              return binary_contents.decode(config.encoding)
          except ValueError:  # of which UnicodeDecodeError is more specific
              # ... https://docs.python.org/3/library/codecs.html
              pass
      # 2. Try the system encoding
      sysdef = sys.getdefaultencoding()
      if sysdef != config.encoding:
          try:
              return binary_contents.decode(sysdef)
          except ValueError:
              pass
      # 3. Try the best guess from chardet
      #    http://chardet.readthedocs.io/en/latest/usage.html
      if chardet:
          guess = chardet.detect(binary_contents)
          if guess['encoding']:
              return binary_contents.decode(guess['encoding'])
      raise ValueError("Unknown encoding ({})".format(
          "filename={}".format(repr(filename)) if filename else "blob"))
docs: Returns the string contents of a file, or of a BLOB.