def read_env(path=None, recurse=True, stream=None, verbose=False, override=False):
        """Read a .env file into os.environ.

        If .env is not found in the directory from which this method is called,
        the default behavior is to recurse up the directory tree until a .env
        file is found. If you do not wish to recurse up the tree, you may pass
        False as a second positional argument.
        """
        # By default, start search from the same file this function is called
        if path is None:
            frame = inspect.currentframe().f_back
            caller_dir = os.path.dirname(frame.f_code.co_filename)
            start = os.path.join(os.path.abspath(caller_dir))
        else:
            start = path
        if recurse:
            for dirname in _walk_to_root(start):
                check_path = os.path.join(dirname, ".env")
                if os.path.exists(check_path):
                    return load_dotenv(
                        check_path, stream=stream, verbose=verbose, override=override
                    )
        else:
            if path is None:
                start = os.path.join(start, ".env")
            return load_dotenv(start, stream=stream, verbose=verbose, override=override)