f"One or several metadata{metadata_ext} were found, but not in the same directory or in a parent directory of {downloaded_file_or_dir}."
                            )
                    else:
                        sample_metadata = {}
                    if add_labels:
                        sample_label = {"label": os.path.basename(os.path.dirname(original_file))}
                    else:
                        sample_label = {}
                    yield (
                        file_idx,
                        {
                            **sample_empty_metadata,
                            self.BASE_COLUMN_NAME: downloaded_file_or_dir,
                            **sample_metadata,
                            **sample_label,
                        },
                    )
                    file_idx += 1
            else:
                for downloaded_dir_file in downloaded_file_or_dir: