(  # noqa
        self, path: PATH_TYPES, text: bool = True, encoding: str = "utf-8"
    )
Yield a file context to iterate over. If text is true, open the file with
        'rb' mode specified.
Yield a file context to iterate over. If text is true, open the file with
        'rb' mode specified.
Yield a file context to iterate over . If text is true open the file with rb mode specified .
def open_file(  # noqa
        self, path: PATH_TYPES, text: bool = True, encoding: str = "utf-8"
    ) -> Generator[IO, None, None]:
        """Yield a file context to iterate over. If text is true, open the file with
        'rb' mode specified."""
        mode = "r" if text else "rb"
        kwargs: Dict[str, str] = {}
        if text:
            kwargs["encoding"] = encoding
        with open(path, mode=mode, **kwargs) as fh:  # type: ignore
            yield fh
def open_file ( # noqa self , path : PATH_TYPES , text : bool = True , encoding : str = "utf-8" ) -> Generator [ IO , None , None ] : mode = "r" if text else "rb" kwargs : Dict [ str , str ] = { } if text : kwargs [ "encoding" ] = encoding with open ( path , mode = mode , * * kwargs ) as fh : # type: ignore yield fh