def open_file(filename, mode='<STR_LIT:r>', encoding=None, errors='<STR_LIT:strict>',<EOL>lazy=False, atomic=False):
if lazy:<EOL><INDENT>return LazyFile(filename, mode, encoding, errors, atomic=atomic)<EOL><DEDENT>f, should_close = open_stream(filename, mode, encoding, errors,<EOL>atomic=atomic)<EOL>if not should_close:<EOL><INDENT>f = KeepOpenFile(f)<EOL><DEDENT>return f<EOL>
This is similar to how the :class:`File` works but for manual
    usage.  Files are opened non lazy by default.  This can open regular
    files as well as stdin/stdout if ``'-'`` is passed.

    If stdin/stdout is returned the stream is wrapped so that the context
    manager will not close the stream accidentally.  This makes it possible
    to always use the function like this without having to worry to
    accidentally close a standard stream::

        with open_file(filename) as f:
            ...

    .. versionadded:: 3.0

    :param filename: the name of the file to open (or ``'-'`` for stdin/stdout).
    :param mode: the mode in which to open the file.
    :param encoding: the encoding to use.
    :param errors: the error handling for this file.
    :param lazy: can be flipped to true to open the file lazily.
    :param atomic: in atomic mode writes go into a temporary file and it's
                   moved on close.