async def METHOD_NAME(contents: str, func: Callable[[str], Awaitable[None]], dir: PathLike | None = None, suffix: str = '') -> None:
    '''
    '''
    async def with_file_object(f: IO[bytes]) -> None:
        f.write(contents.encode("UTF-8"))
        f.flush()
        # Windows will get mad if we try to rename it without closing,
        # and some users of with_file_contents want to rename it.
        f.close()
        await func(f.name)
    await with_temporary_file_async(with_file_object, dir=dir, suffix=suffix)