





from unittest.mock import patch

import datasets
from datasets import Dataset





def  __UpperCamelCase   (     )			->List[str]:
					lowerCamelCase__      =							Dataset.from_dict({"col_1": [3, 2, 0, 1]})

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

										mock_tqdm.reset_mock()

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








import enum
import inspect
import warnings
from functools import wraps
from typing import Callable, Optional

from .logging import get_logger


A_        =  set()
A_        =  get_logger(__name__)





def  __UpperCamelCase   (     a = None)			->str:

					def decorator(a):
										global _emitted_deprecation_warnings

										if inspect.isclass(a):
															lowerCamelCase__      =							deprecated_class_or_function.__init__
															lowerCamelCase__      =							deprecated_class_or_function.__name__
										else:
															lowerCamelCase__      =							deprecated_class_or_function
															lowerCamelCase__      =							deprecated_function.__name__
															# Support deprecating __init__ class method: class name instead
															lowerCamelCase__      =							name if name != "__init__" else deprecated_function.__qualname__.split(".")[-2]

										lowerCamelCase__      =							(
										    f"{name} is deprecated and will be removed in the next major version of datasets." + f" {help_message}"
										    if help_message
										    else ""
										)

										@wraps(a)
										def wrapper(*a,  **a):
															lowerCamelCase__      =							hash(a)
															if func_hash not in _emitted_deprecation_warnings:
																				warnings.warn(a,  category=a,  stacklevel=2)
																				_emitted_deprecation_warnings.add(a)
															return deprecated_function(*a,  **a)

										lowerCamelCase__      =							"deprecated"

										if inspect.isclass(a):
															lowerCamelCase__      =							wrapper
															return deprecated_class_or_function
										else:
															return wrapper

					return decorator

class SCREAMING_SNAKE_CASE_			(       enum.EnumMeta ):





					"""simple docstring"""


					def __getattribute__(			cls						,	_lowerCAmelCase						):
										lowerCamelCase__      =							super().__getattribute__(_lowerCAmelCase						)
										if isinstance(_lowerCAmelCase						,	enum.Enum						) and obj._on_access:
															obj._on_access()
										return obj





					def __getitem__(			cls						,	_lowerCAmelCase						):
										lowerCamelCase__      =							super().__getitem__(_lowerCAmelCase						)
										if member._on_access:
															member._on_access()
										return member






					def __call__(			cls						,	_lowerCAmelCase						,	_lowerCAmelCase=None						,	*, _lowerCAmelCase=None						,	_lowerCAmelCase=None						,	_lowerCAmelCase=None						,	_lowerCAmelCase=1						):
										lowerCamelCase__      =							super().__call__(_lowerCAmelCase						,	_lowerCAmelCase						,	module=_lowerCAmelCase						,	qualname=_lowerCAmelCase						,	type=_lowerCAmelCase						,	start=_lowerCAmelCase						)
										if isinstance(_lowerCAmelCase						,	enum.Enum						) and obj._on_access:
															obj._on_access()
										return obj

class SCREAMING_SNAKE_CASE_			(       enum.Enum				,							metaclass=lowercase_ ):





					"""simple docstring"""


					def __new__(			cls						,	_lowerCAmelCase						):
										lowerCamelCase__      =							object.__new__(cls						)
										lowerCamelCase__      =							value
										lowerCamelCase__      =							member.deprecate
										return member





					@property
					def        __magic_name__			(			self						):
										return ""






					def        __magic_name__			(			self						):
										lowerCamelCase__      =							F" {self.help_message}" if self.help_message else ""
										warnings.warn(
										    F"'{self.__objclass__.__name__}' is deprecated and will be removed in the next major version of datasets."
										    + help_message						,	_lowerCAmelCase						,	stacklevel=3						,	)

