def METHOD_NAME(doc_stream, index, logger=None, transform=None, **kwargs):
    """
    Stream of yaml documents to a stream of Dataset results.
    Stream[(path, bytes|str)] -> Stream[(Dataset, None)|(None, error_message)]
    :param doc_stream: sequence of (uri, doc: byges|string)
    :param on_error: Callback uri, doc -> None
    :param logger:  Logger object for printing errors or None
    :param transform: dict -> dict if supplied also apply further transform on parsed document
    :param kwargs: passed on to from_metadata_stream
    """
    def on_parse_error(uri, doc):
        # pylint: disable=unused-argument
        if logger is not None:
            logger.error(f"Failed to parse: {uri}")
        else:
            print(f"Failed to parse: {uri}", file=sys.stderr)
    metadata_stream = parse_doc_stream(
        doc_stream, on_error=on_parse_error, transform=transform
    )
    return from_metadata_stream(metadata_stream, index, **kwargs)