



'''simple docstring'''


import pytest

from datasets.parallel import ParallelBackendConfig, parallel_backend
from datasets.utils.py_utils import map_nested

from .utils import require_dill_gt_0_3_2, require_joblibspark, require_not_windows







def      SCREAMING_SNAKE_CASE				(				lowercase_    :      List[str]						):  # picklable for multiprocessing
						return i + 1







@require_dill_gt_0_3_2
@require_joblibspark
@require_not_windows
def      SCREAMING_SNAKE_CASE				(				):
						with parallel_backend("""spark"""						):
												assert ParallelBackendConfig.backend_name == "spark"

						lowercase        =							[1, 2, 3]
						with pytest.raises(lowercase_						):
												with parallel_backend("""unsupported backend"""						):
																		map_nested(lowercase_ ,  lowercase_ ,  num_proc=2						)

						with pytest.raises(lowercase_						):
												with parallel_backend("""unsupported backend"""						):
																		map_nested(lowercase_ ,  lowercase_ ,  num_proc=-1						)







@require_dill_gt_0_3_2
@require_joblibspark
@require_not_windows
@pytest.mark.parametrize("""num_proc""" ,  [2, -1]						)
def      SCREAMING_SNAKE_CASE				(				lowercase_    :      Tuple						):
						lowercase        =							[1, 2]
						lowercase        =							{"""a""": 1, """b""": 2}
						lowercase        =							{"""a""": [1, 2], """b""": [3, 4]}
						lowercase        =							{"""a""": {"""1""": 1}, """b""": 2}
						lowercase        =							{"""a""": 1, """b""": 2, """c""": 3, """d""": 4}
						lowercase        =							[2, 3]
						lowercase        =							{"""a""": 2, """b""": 3}
						lowercase        =							{"""a""": [2, 3], """b""": [4, 5]}
						lowercase        =							{"""a""": {"""1""": 2}, """b""": 3}
						lowercase        =							{"""a""": 2, """b""": 3, """c""": 4, """d""": 5}

						with parallel_backend("""spark"""						):
												assert map_nested(lowercase_ ,  lowercase_ ,  num_proc=lowercase_						) == expected_map_nested_sa
												assert map_nested(lowercase_ ,  lowercase_ ,  num_proc=lowercase_						) == expected_map_nested_sa
												assert map_nested(lowercase_ ,  lowercase_ ,  num_proc=lowercase_						) == expected_map_nested_sa
												assert map_nested(lowercase_ ,  lowercase_ ,  num_proc=lowercase_						) == expected_map_nested_sa
												assert map_nested(lowercase_ ,  lowercase_ ,  num_proc=lowercase_						) == expected_map_nested_sa







'''simple docstring'''


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


lowercase_      :				Optional[Any]   					=    logging.get_logger(__name__)

lowercase_      :				int   					=    {
    '''bigcode/gpt_bigcode-santacoder''': '''https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json''',
}




class      __UpperCamelCase       (_UpperCAmelCase			):
	__A			  =					'''gpt_bigcode'''
	__A			  =					['''past_key_values''']
	__A			  =					{
	    '''hidden_size''': '''n_embd''',
	    '''max_position_embeddings''': '''n_positions''',
	    '''num_attention_heads''': '''n_head''',
	    '''num_hidden_layers''': '''n_layer''',
	}







	def __init__(    self ,				_lowerCAmelCase=5_0257 ,				_lowerCAmelCase=1024 ,				_lowerCAmelCase=768 ,				_lowerCAmelCase=12 ,				_lowerCAmelCase=12 ,				_lowerCAmelCase=None ,				_lowerCAmelCase="gelu_pytorch_tanh" ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=1E-5 ,				_lowerCAmelCase=0.02 ,				_lowerCAmelCase=True ,				_lowerCAmelCase=True ,				_lowerCAmelCase=5_0256 ,				_lowerCAmelCase=5_0256 ,				_lowerCAmelCase=True ,				_lowerCAmelCase=True ,				_lowerCAmelCase=True ,				**_lowerCAmelCase ,				)    ->    Optional[int]:
							'''simple docstring'''






							lowercase        =							vocab_size
							lowercase        =							n_positions
							lowercase        =							n_embd
							lowercase        =							n_layer
							lowercase        =							n_head
							lowercase        =							n_inner
							lowercase        =							activation_function
							lowercase        =							resid_pdrop
							lowercase        =							embd_pdrop
							lowercase        =							attn_pdrop
							lowercase        =							layer_norm_epsilon
							lowercase        =							initializer_range
							lowercase        =							scale_attn_weights
							lowercase        =							use_cache
							lowercase        =							attention_softmax_in_fpaa
							lowercase        =							scale_attention_softmax_in_fpaa
							lowercase        =							multi_query

							lowercase        =							bos_token_id
							lowercase        =							eos_token_id

							super().__init__(bos_token_id=_lowerCAmelCase ,				eos_token_id=_lowerCAmelCase ,				**_lowerCAmelCase						)


