class_docstr: Represents a path which behaves like a string.
class_docstr_tok: ["Represents","a","path","which","behaves","like","a","string","."]
docstr: Writes the given `text` to the file.
docstr_tok: ["Writes","the","given","`","text","`","to","the","file","."]
code: def write_text(
      self, text: str, encoding: str = "utf-8", **kwargs: Any
  ) -> None:
      """
      Writes the given `text` to the file.
      """
      with open(self, "w", encoding=encoding, **kwargs) as f:
          f.write(text)
  
imports: from __future__ import annotations
  import os
  import shutil
  import sys
  import warnings
  from typing import IO, TYPE_CHECKING, Any, Callable
  from sphinx.deprecation import RemovedInSphinx90Warning
label_desc: Use image node_id 16 for calling the path obj's underlying member method code with example usage: obj.write_text(text, encoding) without return types