def _sync_docs(
        cls, collection_name, sample_ids, hard=False, include_frames=False
    ):
        """Syncs the backing documents for all in-memory samples in the
        collection according to the following rules:

        -   Documents whose IDs are in ``sample_ids`` are reloaded
        -   Documents whose IDs are not in ``sample_ids`` are reset
        """
        if collection_name not in cls._instances:
            return

        samples = cls._instances[collection_name]

        sample_ids = set(str(_id) for _id in sample_ids)
        reset_ids = set()
        for sample in samples.values():
            if sample.id in sample_ids:
                sample.reload(hard=hard, include_frames=include_frames)
            else:
                reset_ids.add(sample.id)
                sample._reset_backing_doc()

        for sample_id in reset_ids:
            samples.pop(sample_id, None)
Syncs the backing documents for all in-memory samples in the
        collection according to the following rules:

        -   Documents whose IDs are in ``sample_ids`` are reloaded
        -   Documents whose IDs are not in ``sample_ids`` are reset
        
fiftyone/core/singletons.py