docstr: Write metrics to given path. This is intended to be used with
  the Node expoerter textfile collector.
  
  Args:
      path: path to write the metrics to. This file must end
          with '.prom' for the textfile collector to process it.
docstr_tok: ["Write","metrics","to","given","path",".","This","is","intended","to","be","used","with","the","Node","expoerter","textfile","collector",".","Args",":","path",":","path","to","write","the","metrics","to",".","This","file","must","end","with","'.prom","'","for","the","textfile","collector","to","process","it","."]
code: def write_to_textfile(self, path: str) -> None:
      """
      Write metrics to given path. This is intended to be used with
      the Node expoerter textfile collector.
  
      Args:
          path: path to write the metrics to. This file must end
              with '.prom' for the textfile collector to process it.
      """
      self.prometheus_client.write_to_textfile(
          path, registry=self.registry
      )
  
imports: from __future__ import annotations
  import logging
  import os
  import sys
  import typing
  from functools import partial
  from typing import TYPE_CHECKING
label_desc: Use image node_id 7 for calling the PrometheusClient obj's underlying member method code with example usage: obj.write_to_textfile(path) without return types