
'''simple docstring'''





from unittest.mock import patch

import datasets
from datasets import Dataset





def 							snake_case				(		)->      Optional[int]:







      """simple docstring"""
      __A													=      Dataset.from_dict({'col_1': [3, 2, 0, 1]}						)

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

            mock_tqdm.reset_mock()

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











'''simple docstring'''



import pytest

from datasets.utils.version import Version


@pytest.mark.parametrize(
    '''other, expected_equality'''   ,				[
        (Version('''1.0.0'''			), True),
        ('''1.0.0''', True),
        (Version('''2.0.0'''			), False),
        ('''2.0.0''', False),
        ('''1''', False),
        ('''a''', False),
        (1, False),
        (None, False),
    ]   ,				)
def 							__UpperCAmelCase				(				UpperCamelCase__				:Optional[int]   ,				UpperCamelCase__				:int			)		->						List[str]:
				snake_case__      :   Optional[int]      =    Version('''1.0.0'''			)
				assert (version == other) is expected_equality
				assert (version != other) is not expected_equality
				assert (hash(UpperCamelCase__			) == hash(UpperCamelCase__			)) is expected_equality




