def METHOD_NAME(filename, index, fps, mode=None, n_failed=0, doc_transform=None):
    for ds, err in from_tar_file(
        filename,
        index,
        mk_uri,
        mode=mode,
        doc_transform=doc_transform,
        **ds_resolve_args,
    ):
        if ds is not None:
            try:
                if update:
                    index.datasets.update(ds, allowed_changes)
                else:
                    index.datasets.add(ds, with_lineage=auto_add_lineage)
            except Exception as e:  # pylint: disable=broad-except
                n_failed += 1
                report_error(str(e))
        else:
            n_failed += 1
            report_error(err)
        fps()
        if fps.every(10):
            print(".", end="", flush=True)
        if fps.every(100):
            print(" {} F:{:d}".format(str(fps), n_failed))
    return n_failed