def write(self, line: Optional[str], source: Optional[str]) -> None:
    'Write the line either to the output file or stdout.\n\n        This handles deciding whether to write to a file or print to standard\n        out for subclasses. Override this if you want behaviour that differs\n        from the default.\n\n        :param str line:\n            The formatted string to print or write.\n        :param str source:\n            The source code that has been formatted and associated with the\n            line of output.\n        '
    if line:
        self._write(line)
    if source:
        self._write(source)
Write the line either to the output file or stdout.

This handles deciding whether to write to a file or print to standard
out for subclasses. Override this if you want behaviour that differs
from the default.

:param str line:
    The formatted string to print or write.
:param str source:
    The source code that has been formatted and associated with the
    line of output.
def write(self, line: Optional[str], source: Optional[str]) -> None:
    'Write the line either to the output file or stdout.\n\n        This handles deciding whether to write to a file or print to standard\n        out for subclasses. Override this if you want behaviour that differs\n        from the default.\n\n        :param str line:\n            The formatted string to print or write.\n        :param str source:\n            The source code that has been formatted and associated with the\n            line of output.\n        '
    if line:
        self._write(line)
    if source:
        self._write(source)