def write(self, path=None, *args, **kwargs):
if path is None:<EOL><INDENT>print(self.format(*args, **kwargs))<EOL><DEDENT>else:<EOL><INDENT>with io.open(path, '<STR_LIT:w>', newline="<STR_LIT>") as f:<EOL><INDENT>f.write(self.format(*args, **kwargs))<EOL><DEDENT><DEDENT>
Perform formatting and write the formatted string to a file or stdout.

Optional arguments can be used to format the editor's contents. If no
file path is given, prints to standard output.

Args:
    path (str): Full file path (default None, prints to stdout)
    *args: Positional arguments to format the editor with
    **kwargs: Keyword arguments to format the editor with