import unittest

from transformers import AlbertConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
							import torch

							from transformers import (
							    MODEL_FOR_PRETRAINING_MAPPING,
							    AlbertForMaskedLM,
							    AlbertForMultipleChoice,
							    AlbertForPreTraining,
							    AlbertForQuestionAnswering,
							    AlbertForSequenceClassification,
							    AlbertForTokenClassification,
							    AlbertModel,
							)
							from transformers.models.albert.modeling_albert import ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST


class   lowercase      :




							def __init__(  self				:   Optional[int]		,							_UpperCamelCase				:   Optional[Any]		,							_UpperCamelCase				:   Optional[int]=13		,							_UpperCamelCase				:   str=7		,							_UpperCamelCase				:   Union[str, Any]=True		,							_UpperCamelCase				:   str=True		,							_UpperCamelCase				:   Optional[int]=True		,							_UpperCamelCase				:   Tuple=True		,							_UpperCamelCase				:   Dict=99		,							_UpperCamelCase				:   Optional[Any]=16		,							_UpperCamelCase				:   Union[str, Any]=36		,							_UpperCamelCase				:   Optional[int]=6		,							_UpperCamelCase				:   Dict=6		,							_UpperCamelCase				:   Dict=6		,							_UpperCamelCase				:   List[str]=37		,							_UpperCamelCase				:   Optional[int]="gelu"		,							_UpperCamelCase				:   List[Any]=0.1		,							_UpperCamelCase				:   Any=0.1		,							_UpperCamelCase				:   List[str]=512		,							_UpperCamelCase				:   List[Any]=16		,							_UpperCamelCase				:   Any=2		,							_UpperCamelCase				:   List[str]=0.0_2		,							_UpperCamelCase				:   str=3		,							_UpperCamelCase				:   str=4		,							_UpperCamelCase				:   List[str]=None		,							)   ->			str:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    parent
												SCREAMING_SNAKE_CASE           =    batch_size
												SCREAMING_SNAKE_CASE           =    seq_length
												SCREAMING_SNAKE_CASE           =    is_training
												SCREAMING_SNAKE_CASE           =    use_input_mask
												SCREAMING_SNAKE_CASE           =    use_token_type_ids
												SCREAMING_SNAKE_CASE           =    use_labels
												SCREAMING_SNAKE_CASE           =    vocab_size
												SCREAMING_SNAKE_CASE           =    embedding_size
												SCREAMING_SNAKE_CASE           =    hidden_size
												SCREAMING_SNAKE_CASE           =    num_hidden_layers
												SCREAMING_SNAKE_CASE           =    num_hidden_groups
												SCREAMING_SNAKE_CASE           =    num_attention_heads
												SCREAMING_SNAKE_CASE           =    intermediate_size
												SCREAMING_SNAKE_CASE           =    hidden_act
												SCREAMING_SNAKE_CASE           =    hidden_dropout_prob
												SCREAMING_SNAKE_CASE           =    attention_probs_dropout_prob
												SCREAMING_SNAKE_CASE           =    max_position_embeddings
												SCREAMING_SNAKE_CASE           =    type_vocab_size
												SCREAMING_SNAKE_CASE           =    type_sequence_label_size
												SCREAMING_SNAKE_CASE           =    initializer_range
												SCREAMING_SNAKE_CASE           =    num_labels
												SCREAMING_SNAKE_CASE           =    num_choices
												SCREAMING_SNAKE_CASE           =    scope




							def 		__snake_case(  self				:   List[Any] )   ->			str:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    ids_tensor([self.batch_size, self.seq_length]		,							self.vocab_size )

												SCREAMING_SNAKE_CASE           =    None
												if self.use_input_mask:
																	SCREAMING_SNAKE_CASE           =    random_attention_mask([self.batch_size, self.seq_length] )

												SCREAMING_SNAKE_CASE           =    None
												if self.use_token_type_ids:
																	SCREAMING_SNAKE_CASE           =    ids_tensor([self.batch_size, self.seq_length]		,							self.type_vocab_size )

												SCREAMING_SNAKE_CASE           =    None
												SCREAMING_SNAKE_CASE           =    None
												SCREAMING_SNAKE_CASE           =    None
												if self.use_labels:
																	SCREAMING_SNAKE_CASE           =    ids_tensor([self.batch_size]		,							self.type_sequence_label_size )
																	SCREAMING_SNAKE_CASE           =    ids_tensor([self.batch_size, self.seq_length]		,							self.num_labels )
																	SCREAMING_SNAKE_CASE           =    ids_tensor([self.batch_size]		,							self.num_choices )

												SCREAMING_SNAKE_CASE           =    self.get_config()

												return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels




							def 		__snake_case(  self				:   int )   ->			List[str]:



												'''simple docstring'''

												return AlbertConfig(
												    vocab_size=self.vocab_size		,							hidden_size=self.hidden_size		,							num_hidden_layers=self.num_hidden_layers		,							num_attention_heads=self.num_attention_heads		,							intermediate_size=self.intermediate_size		,							hidden_act=self.hidden_act		,							hidden_dropout_prob=self.hidden_dropout_prob		,							attention_probs_dropout_prob=self.attention_probs_dropout_prob		,							max_position_embeddings=self.max_position_embeddings		,							type_vocab_size=self.type_vocab_size		,							initializer_range=self.initializer_range		,							num_hidden_groups=self.num_hidden_groups		,							)




							def 		__snake_case(  self				:   Optional[int]		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   Dict		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Tuple		,							_UpperCamelCase				:   Tuple )   ->			Union[str, Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertModel(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							token_type_ids=_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase )
												self.parent.assertEqual(result.last_hidden_state.shape		,							(self.batch_size, self.seq_length, self.hidden_size) )
												self.parent.assertEqual(result.pooler_output.shape		,							(self.batch_size, self.hidden_size) )




							def 		__snake_case(  self				:   List[Any]		,							_UpperCamelCase				:   int		,							_UpperCamelCase				:   List[str]		,							_UpperCamelCase				:   Union[str, Any]		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   Union[str, Any]		,							_UpperCamelCase				:   Union[str, Any]		,							_UpperCamelCase				:   int )   ->			int:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertForPreTraining(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(
												    _UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							labels=_UpperCamelCase		,							sentence_order_label=_UpperCamelCase		,							)
												self.parent.assertEqual(result.prediction_logits.shape		,							(self.batch_size, self.seq_length, self.vocab_size) )
												self.parent.assertEqual(result.sop_logits.shape		,							(self.batch_size, config.num_labels) )




							def 		__snake_case(  self				:   List[Any]		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   int		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   Optional[Any] )   ->			List[Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertForMaskedLM(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							labels=_UpperCamelCase )
												self.parent.assertEqual(result.logits.shape		,							(self.batch_size, self.seq_length, self.vocab_size) )




							def 		__snake_case(  self				:   Union[str, Any]		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   List[str]		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   Tuple		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   int )   ->			Optional[Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertForQuestionAnswering(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(
												    _UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							start_positions=_UpperCamelCase		,							end_positions=_UpperCamelCase		,							)
												self.parent.assertEqual(result.start_logits.shape		,							(self.batch_size, self.seq_length) )
												self.parent.assertEqual(result.end_logits.shape		,							(self.batch_size, self.seq_length) )




							def 		__snake_case(  self				:   Any		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Dict		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   Dict		,							_UpperCamelCase				:   List[str]		,							_UpperCamelCase				:   Dict		,							_UpperCamelCase				:   Optional[Any] )   ->			List[Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.num_labels
												SCREAMING_SNAKE_CASE           =    AlbertForSequenceClassification(_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							labels=_UpperCamelCase )
												self.parent.assertEqual(result.logits.shape		,							(self.batch_size, self.num_labels) )




							def 		__snake_case(  self				:   Optional[Any]		,							_UpperCamelCase				:   Tuple		,							_UpperCamelCase				:   Tuple		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   List[str]		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   str )   ->			Any:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.num_labels
												SCREAMING_SNAKE_CASE           =    AlbertForTokenClassification(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							labels=_UpperCamelCase )
												self.parent.assertEqual(result.logits.shape		,							(self.batch_size, self.seq_length, self.num_labels) )




							def 		__snake_case(  self				:   str		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   List[Any]		,							_UpperCamelCase				:   Tuple		,							_UpperCamelCase				:   Any		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   List[str] )   ->			str:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.num_choices
												SCREAMING_SNAKE_CASE           =    AlbertForMultipleChoice(config=_UpperCamelCase )
												model.to(_UpperCamelCase )
												model.eval()
												SCREAMING_SNAKE_CASE           =    input_ids.unsqueeze(1 ).expand(-1		,							self.num_choices		,							-1 ).contiguous()
												SCREAMING_SNAKE_CASE           =    token_type_ids.unsqueeze(1 ).expand(-1		,							self.num_choices		,							-1 ).contiguous()
												SCREAMING_SNAKE_CASE           =    input_mask.unsqueeze(1 ).expand(-1		,							self.num_choices		,							-1 ).contiguous()
												SCREAMING_SNAKE_CASE           =    model(
												    _UpperCamelCase		,							attention_mask=_UpperCamelCase		,							token_type_ids=_UpperCamelCase		,							labels=_UpperCamelCase		,							)
												self.parent.assertEqual(result.logits.shape		,							(self.batch_size, self.num_choices) )





							def 		__snake_case(  self				:   Dict )   ->			int:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.prepare_config_and_inputs()
												(
												    (
												    SCREAMING_SNAKE_CASE
												)     ,				(
												    SCREAMING_SNAKE_CASE
												)     ,				(
												    SCREAMING_SNAKE_CASE
												)     ,				(
												    SCREAMING_SNAKE_CASE
												)     ,				(
												    SCREAMING_SNAKE_CASE
												)     ,				(
												    SCREAMING_SNAKE_CASE
												)     ,				(
												    SCREAMING_SNAKE_CASE
												)     ,				
												)           =    config_and_inputs
												SCREAMING_SNAKE_CASE           =    {"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": input_mask}
												return config, inputs_dict



@require_torch
class   lowercase      (       a			,    a			,    unittest.TestCase       ):
							lowercase__  :    Tuple									=							(
							    (
							        AlbertModel,
							        AlbertForPreTraining,
							        AlbertForMaskedLM,
							        AlbertForMultipleChoice,
							        AlbertForSequenceClassification,
							        AlbertForTokenClassification,
							        AlbertForQuestionAnswering,
							    )
							    if is_torch_available()
							    else ()
							)
							lowercase__  :    str									=							(
							    {
							        """feature-extraction""": AlbertModel,
							        """fill-mask""": AlbertForMaskedLM,
							        """question-answering""": AlbertForQuestionAnswering,
							        """text-classification""": AlbertForSequenceClassification,
							        """token-classification""": AlbertForTokenClassification,
							        """zero-shot""": AlbertForSequenceClassification,
							    }
							    if is_torch_available()
							    else {}
							)
							lowercase__  :    str									=							True




							def 		__snake_case(  self				:   Any		,							_UpperCamelCase				:   Optional[int]		,							_UpperCamelCase				:   str		,							_UpperCamelCase				:   str=False )   ->			Optional[int]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    super()._prepare_for_class(_UpperCamelCase		,							_UpperCamelCase		,							return_labels=_UpperCamelCase )

												if return_labels:
																	if model_class in get_values(_UpperCamelCase ):
																						SCREAMING_SNAKE_CASE           =    torch.zeros(
																						    (self.model_tester.batch_size, self.model_tester.seq_length)		,							dtype=torch.long		,							device=_UpperCamelCase )
																						SCREAMING_SNAKE_CASE           =    torch.zeros(
																						    self.model_tester.batch_size		,							dtype=torch.long		,							device=_UpperCamelCase )
												return inputs_dict




							def 		__snake_case(  self				:   Optional[int] )   ->			Any:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertModelTester(self )
												SCREAMING_SNAKE_CASE           =    ConfigTester(self		,							config_class=_UpperCamelCase		,							hidden_size=37 )




							def 		__snake_case(  self				:   List[Any] )   ->			Optional[int]:



												'''simple docstring'''

												self.config_tester.run_common_tests()




							def 		__snake_case(  self				:   List[str] )   ->			Optional[int]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_model(*_UpperCamelCase )




							def 		__snake_case(  self				:   Union[str, Any] )   ->			int:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_pretraining(*_UpperCamelCase )




							def 		__snake_case(  self				:   List[str] )   ->			Dict:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_masked_lm(*_UpperCamelCase )




							def 		__snake_case(  self				:   str )   ->			Tuple:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_multiple_choice(*_UpperCamelCase )




							def 		__snake_case(  self				:   Dict )   ->			List[Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_question_answering(*_UpperCamelCase )




							def 		__snake_case(  self				:   Tuple )   ->			Union[str, Any]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												self.model_tester.create_and_check_for_sequence_classification(*_UpperCamelCase )




							def 		__snake_case(  self				:   int )   ->			Optional[int]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    self.model_tester.prepare_config_and_inputs()
												for type in ["absolute", "relative_key", "relative_key_query"]:
																	SCREAMING_SNAKE_CASE           =    type
																	self.model_tester.create_and_check_model(*_UpperCamelCase )





							@slow
							def 		__snake_case(  self				:   List[str] )   ->			str:



												'''simple docstring'''

												for model_name in ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																	SCREAMING_SNAKE_CASE           =    AlbertModel.from_pretrained(_UpperCamelCase )
																	self.assertIsNotNone(_UpperCamelCase )



@require_torch
class   lowercase      (       unittest.TestCase       ):




							@slow
							def 		__snake_case(  self				:   Any )   ->			List[str]:



												'''simple docstring'''

												SCREAMING_SNAKE_CASE           =    AlbertModel.from_pretrained("albert-base-v2" )
												SCREAMING_SNAKE_CASE           =    torch.tensor([[0, 345, 232, 328, 740, 140, 1_695, 69, 6_078, 1_588, 2]] )
												SCREAMING_SNAKE_CASE           =    torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]] )
												with torch.no_grad():
																	SCREAMING_SNAKE_CASE           =    model(_UpperCamelCase		,							attention_mask=_UpperCamelCase )[0]
												SCREAMING_SNAKE_CASE           =    torch.Size((1, 11, 768) )
												self.assertEqual(output.shape		,							_UpperCamelCase )
												SCREAMING_SNAKE_CASE           =    torch.tensor(
												    [[[-0.6_5_1_3, 1.5_0_3_5, -0.2_7_6_6], [-0.6_5_1_5, 1.5_0_4_6, -0.2_7_8_0], [-0.6_5_1_2, 1.5_0_4_9, -0.2_7_8_4]]] )

												self.assertTrue(torch.allclose(output[:, 1:4, 1:4]		,							_UpperCamelCase		,							atol=1e-4 ) )





import contextlib
from multiprocessing import Pool, RLock

from tqdm.auto import tqdm

from ..utils import experimental, logging


_lowerCamelCase   :				Union[str, Any]     			=						logging.get_logger(__name__)


class   lowercase      :
							lowercase__  :    str									=							None





@experimental
def 		__lowerCamelCase							(UpperCAmelCase__       :							Any ,	UpperCAmelCase__       :							int ,	UpperCAmelCase__       :							Optional[int] ,	UpperCAmelCase__       :							List[Any] ,	UpperCAmelCase__       :							Union[str, Any] ,	UpperCAmelCase__       :							List[str] ,	UpperCAmelCase__       :							Any					):
					if ParallelBackendConfig.backend_name is None:
										return _map_with_multiprocessing_pool(
										    UpperCAmelCase__ ,	UpperCAmelCase__ ,	UpperCAmelCase__ ,	UpperCAmelCase__ ,	UpperCAmelCase__ ,	UpperCAmelCase__ ,	UpperCAmelCase__					)

					return _map_with_joblib(UpperCAmelCase__ ,	UpperCAmelCase__ ,	UpperCAmelCase__ ,	UpperCAmelCase__ ,	UpperCAmelCase__ ,	UpperCAmelCase__ ,	UpperCAmelCase__					)





def 		__lowerCamelCase							(UpperCAmelCase__       :							Optional[Any] ,	UpperCAmelCase__       :							List[Any] ,	UpperCAmelCase__       :							int ,	UpperCAmelCase__       :							Union[str, Any] ,	UpperCAmelCase__       :							Any ,	UpperCAmelCase__       :							int ,	UpperCAmelCase__       :							Optional[Any]					):
					SCREAMING_SNAKE_CASE           =    num_proc if num_proc <= len(UpperCAmelCase__					) else len(UpperCAmelCase__					)
					SCREAMING_SNAKE_CASE           =    []  # We organize the splits ourselve (contiguous splits)
					for index in range(UpperCAmelCase__					):
										SCREAMING_SNAKE_CASE           =    len(UpperCAmelCase__					) // num_proc
										SCREAMING_SNAKE_CASE           =    len(UpperCAmelCase__					) % num_proc
										SCREAMING_SNAKE_CASE           =    div * index + min(UpperCAmelCase__ ,	UpperCAmelCase__					)
										SCREAMING_SNAKE_CASE           =    start + div + (1 if index < mod else 0)
										split_kwds.append((function, iterable[start:end], types, index, disable_tqdm, desc)					)

					if len(UpperCAmelCase__					) != sum(len(i[1]					) for i in split_kwds					):
										raise ValueError(
										    F"Error dividing inputs iterable among processes. "
										    F"Total number of objects {len(UpperCAmelCase__					)}, "
										    F"length: {sum(len(i[1]					) for i in split_kwds					)}"					)

					logger.info(
					    F"Spawning {num_proc} processes for {len(UpperCAmelCase__					)} objects in slices of {[len(i[1]					) for i in split_kwds]}"					)
					SCREAMING_SNAKE_CASE     ,				SCREAMING_SNAKE_CASE           =    None, None
					if not disable_tqdm:
										SCREAMING_SNAKE_CASE     ,				SCREAMING_SNAKE_CASE           =    (RLock(),), tqdm.set_lock
					with Pool(UpperCAmelCase__ ,	initargs=UpperCAmelCase__ ,	initializer=UpperCAmelCase__					) as pool:
										SCREAMING_SNAKE_CASE           =    pool.map(UpperCAmelCase__ ,	UpperCAmelCase__					)
					logger.info(F"Finished {num_proc} processes"					)
					SCREAMING_SNAKE_CASE           =    [obj for proc_res in mapped for obj in proc_res]
					logger.info(F"Unpacked {len(UpperCAmelCase__					)} objects"					)

					return mapped





def 		__lowerCamelCase							(UpperCAmelCase__       :							Tuple ,	UpperCAmelCase__       :							Dict ,	UpperCAmelCase__       :							Any ,	UpperCAmelCase__       :							Optional[int] ,	UpperCAmelCase__       :							Tuple ,	UpperCAmelCase__       :							Tuple ,	UpperCAmelCase__       :							Any					):
					# progress bar is not yet supported for _map_with_joblib, because tqdm couldn't accurately be applied to joblib,
					# and it requires monkey-patching joblib internal classes which is subject to change
					import joblib

					with joblib.parallel_backend(ParallelBackendConfig.backend_name ,	n_jobs=UpperCAmelCase__					):
										return joblib.Parallel()(
										    joblib.delayed(UpperCAmelCase__					)((function, obj, types, None, True, None)					) for obj in iterable					)





@experimental
@contextlib.contextmanager
def 		__lowerCamelCase							(UpperCAmelCase__       :							str					):
					SCREAMING_SNAKE_CASE           =    backend_name

					if backend_name == "spark":
										from joblibspark import register_spark

										register_spark()

										# TODO: call create_cache_and_write_probe if "download" in steps
										# TODO: raise NotImplementedError when Dataset.map etc is called

					try:
										yield
					finally:
										SCREAMING_SNAKE_CASE           =    None




