def scan(stream, Loader=Loader):
    """
    Scan a YAML stream and produce scanning tokens.
    """
    loader = Loader(stream)
    try:
        while loader.check_token():
            yield loader.get_token()
    finally:
        loader.dispose()

    Scan a YAML stream and produce scanning tokens.
    
metadrive/render_pipeline/rplibs/yaml/yaml_py3/__init__.py