



'''simple docstring'''






from ...configuration_utils import PretrainedConfig
from ...utils import logging


A_				:					Any							=      logging.get_logger(__name__)

A_				:					Optional[int]							=      {
    """uw-madison/nystromformer-512""": """https://huggingface.co/uw-madison/nystromformer-512/resolve/main/config.json""",
    # See all Nystromformer models at https://huggingface.co/models?filter=nystromformer
}



class 				lowercase			(    _lowerCamelCase							):


 """simple docstring"""


 UpperCAmelCase		      =    """nystromformer"""







 def __init__(				self    ,a_=30_000    ,a_=768    ,a_=12    ,a_=12    ,a_=3_072    ,a_="gelu_new"    ,a_=0.1    ,a_=0.1    ,a_=510    ,a_=2    ,a_=64    ,a_=64    ,a_=65    ,a_=False    ,a_=0.02    ,a_=1E-5    ,a_=1    ,a_=0    ,a_=2    ,**a_    ,)						->  Tuple:
        _UpperCAmelCase    :		List[Any]     	=					vocab_size
        _UpperCAmelCase    :		Any     	=					max_position_embeddings
        _UpperCAmelCase    :		Optional[int]     	=					hidden_size
        _UpperCAmelCase    :		Dict     	=					num_hidden_layers
        _UpperCAmelCase    :		List[str]     	=					num_attention_heads
        _UpperCAmelCase    :		Tuple     	=					intermediate_size
        _UpperCAmelCase    :		Union[str, Any]     	=					hidden_act
        _UpperCAmelCase    :		Tuple     	=					hidden_dropout_prob
        _UpperCAmelCase    :		Dict     	=					attention_probs_dropout_prob
        _UpperCAmelCase    :		int     	=					initializer_range
        _UpperCAmelCase    :		Optional[Any]     	=					type_vocab_size
        _UpperCAmelCase    :		Optional[Any]     	=					segment_means_seq_len
        _UpperCAmelCase    :		Optional[int]     	=					num_landmarks
        _UpperCAmelCase    :		List[str]     	=					conv_kernel_size
        _UpperCAmelCase    :		Optional[int]     	=					inv_coeff_init_option
        _UpperCAmelCase    :		Optional[int]     	=					layer_norm_eps
        super().__init__(pad_token_id=a_    ,bos_token_id=a_    ,eos_token_id=a_    ,**a_				)








'''simple docstring'''






from unittest.mock import patch

import datasets
from datasets import Dataset




def        snake_case_   (	)->						str:





       '''simple docstring'''


       _UpperCAmelCase    :		Tuple     	=					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()



