def load_all(stream, Loader=Loader):
    """
    Parse all YAML documents in a stream
    and produce corresponding Python objects.
    """
    loader = Loader(stream)
    try:
        while loader.check_data():
            yield loader.get_data()
    finally:
        loader.dispose()

    Parse all YAML documents in a stream
    and produce corresponding Python objects.
    
metadrive/render_pipeline/rplibs/yaml/yaml_py3/__init__.py