




from typing import List

import datasets
from datasets.tasks import ImageClassification

from ..folder_based_builder import folder_based_builder


_UpperCAmelCase						:    List[Any]      =  datasets.utils.logging.get_logger(__name__)




class  __lowerCAmelCase							(				folder_based_builder.FolderBasedBuilderConfig):
       _a			       =    None
       _a			       =    None







class  __lowerCAmelCase							(				folder_based_builder.FolderBasedBuilder):
       _a			       =    datasets.Image()
       _a			       =    '''image'''
       _a			       =    ImageFolderConfig
       _a			       =    42  # definition at the bottom of the script
       _a			       =    ImageClassification(image_column='''image'''   ,			label_column='''label''')







_UpperCAmelCase						:    Any      =  [
    ".blp",
    ".bmp",
    ".dib",
    ".bufr",
    ".cur",
    ".pcx",
    ".dcx",
    ".dds",
    ".ps",
    ".eps",
    ".fit",
    ".fits",
    ".fli",
    ".flc",
    ".ftc",
    ".ftu",
    ".gbr",
    ".gif",
    ".grib",
    ".h5",
    ".hdf",
    ".png",
    ".apng",
    ".jp2",
    ".j2k",
    ".jpc",
    ".jpf",
    ".jpx",
    ".j2c",
    ".icns",
    ".ico",
    ".im",
    ".iim",
    ".tif",
    ".tiff",
    ".jfif",
    ".jpe",
    ".jpg",
    ".jpeg",
    ".mpg",
    ".mpeg",
    ".msp",
    ".pcd",
    ".pxr",
    ".pbm",
    ".pgm",
    ".ppm",
    ".pnm",
    ".psd",
    ".bw",
    ".rgb",
    ".rgba",
    ".sgi",
    ".ras",
    ".tga",
    ".icb",
    ".vda",
    ".vst",
    ".webp",
    ".wmf",
    ".emf",
    ".xbm",
    ".xpm",
]
_UpperCAmelCase						:    Optional[Any]      =  IMAGE_EXTENSIONS









from unittest.mock import patch

import datasets
from datasets import Dataset



def    UpperCAmelCase__	(  ):
  lowercase     :Any   						=    Dataset.from_dict({"col_1": [3, 2, 0, 1]} )

  with patch("tqdm.auto.tqdm" ) as mock_tqdm:
    datasets.disable_progress_bar()
    dset.map(lambda lowerCamelCase : {"col_2": x["col_1"] + 1} )
    mock_tqdm.assert_not_called()

    mock_tqdm.reset_mock()

    datasets.enable_progress_bar()
    dset.map(lambda lowerCamelCase : {"col_2": x["col_1"] + 1} )
    mock_tqdm.assert_called()



