
from __future__ import annotations

import os
import tempfile
import unittest

from transformers import ConvBertConfig, is_tf_available
from transformers.testing_utils import require_tf, slow

from ...test_configuration_common import ConfigTester
from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_tf_available():
						import tensorflow as tf

						from transformers import (
						    TFConvBertForMaskedLM,
						    TFConvBertForMultipleChoice,
						    TFConvBertForQuestionAnswering,
						    TFConvBertForSequenceClassification,
						    TFConvBertForTokenClassification,
						    TFConvBertModel,
						)


class 	UpperCAmelCase_ :
	"""simple docstring"""

	def __init__(     self:     Any							,   _UpperCAmelCase:     Optional[int]							,   _UpperCAmelCase:     Any=13							,   _UpperCAmelCase:     Dict=7							,   _UpperCAmelCase:     str=True							,   _UpperCAmelCase:     Tuple=True							,   _UpperCAmelCase:     List[str]=True							,   _UpperCAmelCase:     Union[str, Any]=True							,   _UpperCAmelCase:     str=99							,   _UpperCAmelCase:     str=32							,   _UpperCAmelCase:     List[str]=2							,   _UpperCAmelCase:     List[Any]=4							,   _UpperCAmelCase:     Any=37							,   _UpperCAmelCase:     int="gelu"							,   _UpperCAmelCase:     Optional[int]=0.1							,   _UpperCAmelCase:     Optional[int]=0.1							,   _UpperCAmelCase:     Tuple=512							,   _UpperCAmelCase:     int=16							,   _UpperCAmelCase:     Union[str, Any]=2							,   _UpperCAmelCase:     int=0.0_2							,   _UpperCAmelCase:     Union[str, Any]=3							,   _UpperCAmelCase:     int=4							,   _UpperCAmelCase:     List[Any]=None							,   ):
								_lowerCAmelCase :Tuple      	=						parent
								_lowerCAmelCase :List[Any]      	=						13
								_lowerCAmelCase :List[Any]      	=						7
								_lowerCAmelCase :Any      	=						True
								_lowerCAmelCase :Any      	=						True
								_lowerCAmelCase :Optional[Any]      	=						True
								_lowerCAmelCase :int      	=						True
								_lowerCAmelCase :Tuple      	=						99
								_lowerCAmelCase :Optional[int]      	=						384
								_lowerCAmelCase :List[str]      	=						2
								_lowerCAmelCase :str      	=						4
								_lowerCAmelCase :Union[str, Any]      	=						37
								_lowerCAmelCase :Union[str, Any]      	=						'gelu'
								_lowerCAmelCase :Optional[int]      	=						0.1
								_lowerCAmelCase :int      	=						0.1
								_lowerCAmelCase :Union[str, Any]      	=						512
								_lowerCAmelCase :Union[str, Any]      	=						16
								_lowerCAmelCase :Optional[int]      	=						2
								_lowerCAmelCase :List[Any]      	=						0.0_2
								_lowerCAmelCase :Optional[int]      	=						3
								_lowerCAmelCase :Optional[int]      	=						4
								_lowerCAmelCase :Optional[Any]      	=						128
								_lowerCAmelCase :Dict      	=						2
								_lowerCAmelCase :Union[str, Any]      	=						9
								_lowerCAmelCase :Optional[int]      	=						1
								_lowerCAmelCase :List[Any]      	=						None







	def       SCREAMING_SNAKE_CASE__     (     self:     Optional[Any]			):
								_lowerCAmelCase :Dict      	=						ids_tensor([self.batch_size, self.seq_length]							,   self.vocab_size			)

								_lowerCAmelCase :Optional[int]      	=						None
								if self.use_input_mask:
															_lowerCAmelCase :int      	=						random_attention_mask([self.batch_size, self.seq_length]			)

								_lowerCAmelCase :Tuple      	=						None
								if self.use_token_type_ids:
															_lowerCAmelCase :List[str]      	=						ids_tensor([self.batch_size, self.seq_length]							,   self.type_vocab_size			)

								_lowerCAmelCase :List[Any]      	=						None
								_lowerCAmelCase :str      	=						None
								_lowerCAmelCase :str      	=						None
								if self.use_labels:
															_lowerCAmelCase :Union[str, Any]      	=						ids_tensor([self.batch_size]							,   self.type_sequence_label_size			)
															_lowerCAmelCase :List[Any]      	=						ids_tensor([self.batch_size, self.seq_length]							,   self.num_labels			)
															_lowerCAmelCase :Tuple      	=						ids_tensor([self.batch_size]							,   self.num_choices			)

								_lowerCAmelCase :Union[str, Any]      	=						ConvBertConfig(
								    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							,   return_dict=snake_case_							,   )

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







	def       SCREAMING_SNAKE_CASE__     (     self:     int							,   _UpperCAmelCase:     Dict							,   _UpperCAmelCase:     Any							,   _UpperCAmelCase:     Union[str, Any]							,   _UpperCAmelCase:     Optional[int]							,   _UpperCAmelCase:     Any							,   _UpperCAmelCase:     int							,   _UpperCAmelCase:     Union[str, Any]			):
								_lowerCAmelCase :Optional[Any]      	=						TFConvBertModel(config=snake_case_			)
								_lowerCAmelCase :Tuple      	=						{'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}

								_lowerCAmelCase :Optional[int]      	=						[input_ids, input_mask]
								_lowerCAmelCase :int      	=						model(snake_case_			)

								_lowerCAmelCase :Dict      	=						model(snake_case_			)

								self.parent.assertEqual(result.last_hidden_state.shape							,   (self.batch_size, self.seq_length, self.hidden_size)			)







	def       SCREAMING_SNAKE_CASE__     (     self:     List[str]							,   _UpperCAmelCase:     Optional[int]							,   _UpperCAmelCase:     Optional[Any]							,   _UpperCAmelCase:     Tuple							,   _UpperCAmelCase:     Dict							,   _UpperCAmelCase:     List[str]							,   _UpperCAmelCase:     List[Any]							,   _UpperCAmelCase:     List[Any]			):
								_lowerCAmelCase :str      	=						TFConvBertForMaskedLM(config=snake_case_			)
								_lowerCAmelCase :List[Any]      	=						{
								    'input_ids': input_ids,
								    'attention_mask': input_mask,
								    'token_type_ids': token_type_ids,
								}
								_lowerCAmelCase :Any      	=						model(snake_case_			)
								self.parent.assertEqual(result.logits.shape							,   (self.batch_size, self.seq_length, self.vocab_size)			)







	def       SCREAMING_SNAKE_CASE__     (     self:     str							,   _UpperCAmelCase:     Any							,   _UpperCAmelCase:     Union[str, Any]							,   _UpperCAmelCase:     int							,   _UpperCAmelCase:     List[str]							,   _UpperCAmelCase:     int							,   _UpperCAmelCase:     Tuple							,   _UpperCAmelCase:     Any			):
								_lowerCAmelCase :Optional[Any]      	=						self.num_labels
								_lowerCAmelCase :List[str]      	=						TFConvBertForSequenceClassification(config=snake_case_			)
								_lowerCAmelCase :Any      	=						{
								    'input_ids': input_ids,
								    'attention_mask': input_mask,
								    'token_type_ids': token_type_ids,
								}

								_lowerCAmelCase :List[str]      	=						model(snake_case_			)
								self.parent.assertEqual(result.logits.shape							,   (self.batch_size, self.num_labels)			)







	def       SCREAMING_SNAKE_CASE__     (     self:     List[str]							,   _UpperCAmelCase:     List[Any]							,   _UpperCAmelCase:     Optional[Any]							,   _UpperCAmelCase:     List[Any]							,   _UpperCAmelCase:     int							,   _UpperCAmelCase:     Union[str, Any]							,   _UpperCAmelCase:     Any							,   _UpperCAmelCase:     int			):
								_lowerCAmelCase :Optional[Any]      	=						self.num_choices
								_lowerCAmelCase :Optional[int]      	=						TFConvBertForMultipleChoice(config=snake_case_			)
								_lowerCAmelCase :Optional[Any]      	=						tf.tile(tf.expand_dims(snake_case_							,   1			)							,   (1, self.num_choices, 1)			)
								_lowerCAmelCase :Optional[int]      	=						tf.tile(tf.expand_dims(snake_case_							,   1			)							,   (1, self.num_choices, 1)			)
								_lowerCAmelCase :List[Any]      	=						tf.tile(tf.expand_dims(snake_case_							,   1			)							,   (1, self.num_choices, 1)			)
								_lowerCAmelCase :Optional[Any]      	=						{
								    'input_ids': multiple_choice_inputs_ids,
								    'attention_mask': multiple_choice_input_mask,
								    'token_type_ids': multiple_choice_token_type_ids,
								}
								_lowerCAmelCase :List[str]      	=						model(snake_case_			)
								self.parent.assertEqual(result.logits.shape							,   (self.batch_size, self.num_choices)			)







	def       SCREAMING_SNAKE_CASE__     (     self:     Dict							,   _UpperCAmelCase:     Optional[int]							,   _UpperCAmelCase:     Union[str, Any]							,   _UpperCAmelCase:     Optional[Any]							,   _UpperCAmelCase:     int							,   _UpperCAmelCase:     Optional[Any]							,   _UpperCAmelCase:     Union[str, Any]							,   _UpperCAmelCase:     Dict			):
								_lowerCAmelCase :Dict      	=						self.num_labels
								_lowerCAmelCase :Tuple      	=						TFConvBertForTokenClassification(config=snake_case_			)
								_lowerCAmelCase :str      	=						{
								    'input_ids': input_ids,
								    'attention_mask': input_mask,
								    'token_type_ids': token_type_ids,
								}
								_lowerCAmelCase :Any      	=						model(snake_case_			)
								self.parent.assertEqual(result.logits.shape							,   (self.batch_size, self.seq_length, self.num_labels)			)







	def       SCREAMING_SNAKE_CASE__     (     self:     List[Any]							,   _UpperCAmelCase:     Optional[Any]							,   _UpperCAmelCase:     Tuple							,   _UpperCAmelCase:     Optional[int]							,   _UpperCAmelCase:     List[str]							,   _UpperCAmelCase:     Any							,   _UpperCAmelCase:     Tuple							,   _UpperCAmelCase:     List[Any]			):
								_lowerCAmelCase :Union[str, Any]      	=						TFConvBertForQuestionAnswering(config=snake_case_			)
								_lowerCAmelCase :Union[str, Any]      	=						{
								    'input_ids': input_ids,
								    'attention_mask': input_mask,
								    'token_type_ids': token_type_ids,
								}

								_lowerCAmelCase :List[str]      	=						model(snake_case_			)
								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       SCREAMING_SNAKE_CASE__     (     self:     Optional[Any]			):
								_lowerCAmelCase :Tuple      	=						self.prepare_config_and_inputs()
								(
								    (
								    _lowerCAmelCase						
								)	,  (
								    _lowerCAmelCase						
								)	,  (
								    _lowerCAmelCase						
								)	,  (
								    _lowerCAmelCase						
								)	,  (
								    _lowerCAmelCase						
								)	,  (
								    _lowerCAmelCase						
								)	,  (
								    _lowerCAmelCase						
								)	,  						
								) :Union[str, Any]      	=						config_and_inputs
								_lowerCAmelCase :Dict      	=						{'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
								return config, inputs_dict





@require_tf
class 	UpperCAmelCase_ (snake_case__			,  snake_case__			,  unittest.TestCase							):
	"""simple docstring"""

	lowerCamelCase     :       Union[str, Any]            =			(
	    (
	        TFConvBertModel,
	        TFConvBertForMaskedLM,
	        TFConvBertForQuestionAnswering,
	        TFConvBertForSequenceClassification,
	        TFConvBertForTokenClassification,
	        TFConvBertForMultipleChoice,
	    )
	    if is_tf_available()
	    else ()
	)
	lowerCamelCase     :       Dict            =			(
	    {
	        'feature-extraction': TFConvBertModel,
	        'fill-mask': TFConvBertForMaskedLM,
	        'question-answering': TFConvBertForQuestionAnswering,
	        'text-classification': TFConvBertForSequenceClassification,
	        'token-classification': TFConvBertForTokenClassification,
	        'zero-shot': TFConvBertForSequenceClassification,
	    }
	    if is_tf_available()
	    else {}
	)
	lowerCamelCase     :       Dict            =			False
	lowerCamelCase     :       List[str]            =			False
	lowerCamelCase     :       str            =			False







	def       SCREAMING_SNAKE_CASE__     (     self:     Tuple			):
								_lowerCAmelCase :List[str]      	=						TFConvBertModelTester(self			)
								_lowerCAmelCase :Dict      	=						ConfigTester(self							,   config_class=snake_case_							,   hidden_size=37			)







	def       SCREAMING_SNAKE_CASE__     (     self:     Dict			):
								self.config_tester.run_common_tests()







	def       SCREAMING_SNAKE_CASE__     (     self:     Union[str, Any]			):
								_lowerCAmelCase :Optional[int]      	=						self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_model(*snake_case_			)







	def       SCREAMING_SNAKE_CASE__     (     self:     Optional[int]			):
								_lowerCAmelCase :Dict      	=						self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_masked_lm(*snake_case_			)







	def       SCREAMING_SNAKE_CASE__     (     self:     Optional[Any]			):
								_lowerCAmelCase :str      	=						self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_multiple_choice(*snake_case_			)







	def       SCREAMING_SNAKE_CASE__     (     self:     Dict			):
								_lowerCAmelCase :Any      	=						self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_question_answering(*snake_case_			)







	def       SCREAMING_SNAKE_CASE__     (     self:     List[Any]			):
								_lowerCAmelCase :int      	=						self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_sequence_classification(*snake_case_			)







	def       SCREAMING_SNAKE_CASE__     (     self:     Optional[Any]			):
								_lowerCAmelCase :List[str]      	=						self.model_tester.prepare_config_and_inputs()
								self.model_tester.create_and_check_for_token_classification(*snake_case_			)







	@slow
	def       SCREAMING_SNAKE_CASE__     (     self:     Any			):
								_lowerCAmelCase	,  _lowerCAmelCase :str      	=						self.model_tester.prepare_config_and_inputs_for_common()
								_lowerCAmelCase :Optional[Any]      	=						True
								_lowerCAmelCase :List[str]      	=						True

								if hasattr(snake_case_							,   'use_cache'			):
															_lowerCAmelCase :str      	=						True

								_lowerCAmelCase :Dict      	=						getattr(self.model_tester							,   'encoder_seq_length'							,   self.model_tester.seq_length			)
								_lowerCAmelCase :List[str]      	=						getattr(self.model_tester							,   'key_length'							,   snake_case_			)

								for model_class in self.all_model_classes:
															_lowerCAmelCase :Optional[int]      	=						self._prepare_for_class(snake_case_							,   snake_case_			)
															_lowerCAmelCase :int      	=						model_class(snake_case_			)
															_lowerCAmelCase :int      	=						len(model(snake_case_			)			)

															with tempfile.TemporaryDirectory() as tmpdirname:
																						model.save_pretrained(snake_case_							,   saved_model=snake_case_			)
																						_lowerCAmelCase :Union[str, Any]      	=						os.path.join(snake_case_							,   'saved_model'							,   '1'			)
																						_lowerCAmelCase :Tuple      	=						tf.keras.models.load_model(snake_case_			)
																						_lowerCAmelCase :Any      	=						model(snake_case_			)

																						if self.is_encoder_decoder:
																													_lowerCAmelCase :Optional[int]      	=						outputs['encoder_hidden_states']
																													_lowerCAmelCase :Dict      	=						outputs['encoder_attentions']
																						else:
																													_lowerCAmelCase :str      	=						outputs['hidden_states']
																													_lowerCAmelCase :Optional[int]      	=						outputs['attentions']

																						self.assertEqual(len(snake_case_			)							,   snake_case_			)

																						_lowerCAmelCase :Optional[int]      	=						getattr(
																						    self.model_tester							,   'expected_num_hidden_layers'							,   self.model_tester.num_hidden_layers + 1			)

																						self.assertEqual(len(snake_case_			)							,   snake_case_			)
																						self.assertListEqual(
																						    list(output_hidden_states[0].shape[-2:]			)							,   [self.model_tester.seq_length, self.model_tester.hidden_size]							,   )

																						self.assertEqual(len(snake_case_			)							,   self.model_tester.num_hidden_layers			)
																						self.assertListEqual(
																						    list(output_attentions[0].shape[-3:]			)							,   [self.model_tester.num_attention_heads / 2, encoder_seq_length, encoder_key_length]							,   )







	@slow
	def       SCREAMING_SNAKE_CASE__     (     self:     Dict			):
								_lowerCAmelCase :Tuple      	=						TFConvBertModel.from_pretrained('YituTech/conv-bert-base'			)
								self.assertIsNotNone(snake_case_			)







	def       SCREAMING_SNAKE_CASE__     (     self:     str			):
								_lowerCAmelCase	,  _lowerCAmelCase :Optional[int]      	=						self.model_tester.prepare_config_and_inputs_for_common()
								_lowerCAmelCase :Optional[Any]      	=						True
								_lowerCAmelCase :int      	=						getattr(self.model_tester							,   'decoder_seq_length'							,   self.model_tester.seq_length			)
								_lowerCAmelCase :List[str]      	=						getattr(self.model_tester							,   'encoder_seq_length'							,   self.model_tester.seq_length			)
								_lowerCAmelCase :Union[str, Any]      	=						getattr(self.model_tester							,   'key_length'							,   snake_case_			)
								_lowerCAmelCase :List[str]      	=						getattr(self.model_tester							,   'key_length'							,   snake_case_			)

								def check_decoder_attentions_output(_UpperCAmelCase:     Union[str, Any]			):
															_lowerCAmelCase :List[str]      	=						len(snake_case_			)
															self.assertEqual(out_len % 2							,   0			)
															_lowerCAmelCase :Union[str, Any]      	=						outputs.decoder_attentions
															self.assertEqual(len(snake_case_			)							,   self.model_tester.num_hidden_layers			)
															self.assertListEqual(
															    list(decoder_attentions[0].shape[-3:]			)							,   [self.model_tester.num_attention_heads / 2, decoder_seq_length, decoder_key_length]							,   )

								def check_encoder_attentions_output(_UpperCAmelCase:     List[Any]			):
															_lowerCAmelCase :Dict      	=						[
															    t.numpy() for t in (outputs.encoder_attentions if config.is_encoder_decoder else outputs.attentions)
															]
															self.assertEqual(len(snake_case_			)							,   self.model_tester.num_hidden_layers			)
															self.assertListEqual(
															    list(attentions[0].shape[-3:]			)							,   [self.model_tester.num_attention_heads / 2, encoder_seq_length, encoder_key_length]							,   )

								for model_class in self.all_model_classes:
															_lowerCAmelCase :Dict      	=						True
															_lowerCAmelCase :List[Any]      	=						False
															_lowerCAmelCase :str      	=						model_class(snake_case_			)
															_lowerCAmelCase :Union[str, Any]      	=						model(self._prepare_for_class(snake_case_							,   snake_case_			)			)
															_lowerCAmelCase :Union[str, Any]      	=						len(snake_case_			)
															self.assertEqual(config.output_hidden_states							,   snake_case_			)
															check_encoder_attentions_output(snake_case_			)

															if self.is_encoder_decoder:
																						_lowerCAmelCase :int      	=						model_class(snake_case_			)
																						_lowerCAmelCase :List[str]      	=						model(self._prepare_for_class(snake_case_							,   snake_case_			)			)
																						self.assertEqual(config.output_hidden_states							,   snake_case_			)
																						check_decoder_attentions_output(snake_case_			)

															# Check that output attentions can also be changed via the config
															del inputs_dict["output_attentions"]
															_lowerCAmelCase :List[str]      	=						True
															_lowerCAmelCase :List[str]      	=						model_class(snake_case_			)
															_lowerCAmelCase :List[str]      	=						model(self._prepare_for_class(snake_case_							,   snake_case_			)			)
															self.assertEqual(config.output_hidden_states							,   snake_case_			)
															check_encoder_attentions_output(snake_case_			)

															# Check attention is always last and order is fine
															_lowerCAmelCase :Optional[int]      	=						True
															_lowerCAmelCase :Tuple      	=						True
															_lowerCAmelCase :Dict      	=						model_class(snake_case_			)
															_lowerCAmelCase :List[Any]      	=						model(self._prepare_for_class(snake_case_							,   snake_case_			)			)

															self.assertEqual(out_len + (2 if self.is_encoder_decoder else 1)							,   len(snake_case_			)			)
															self.assertEqual(model.config.output_hidden_states							,   snake_case_			)
															check_encoder_attentions_output(snake_case_			)





@require_tf
class 	UpperCAmelCase_ (unittest.TestCase							):
	"""simple docstring"""

	@slow
	def       SCREAMING_SNAKE_CASE__     (     self:     str			):
								_lowerCAmelCase :List[str]      	=						TFConvBertModel.from_pretrained('YituTech/conv-bert-base'			)
								_lowerCAmelCase :Any      	=						tf.constant([[0, 1, 2, 3, 4, 5]]			)
								_lowerCAmelCase :Union[str, Any]      	=						model(snake_case_			)[0]

								_lowerCAmelCase :Optional[Any]      	=						[1, 6, 768]
								self.assertEqual(output.shape							,   snake_case_			)

								_lowerCAmelCase :Tuple      	=						tf.constant(
								    [
								        [
								            [-0.0_3_4_7_5_4_9_3, -0.4_6_8_6_0_3_4, -0.3_0_6_3_8_8_3_2],
								            [0.2_2_6_3_7_2_4_8, -0.2_6_9_8_8_6_4_6, -0.7_4_2_3_4_2_4],
								            [0.1_0_3_2_4_8_6_8, -0.4_5_0_1_3_5_0_8, -0.5_8_2_8_0_7_8_4],
								        ]
								    ]			)
								tf.debugging.assert_near(output[:, :3, :3]							,   snake_case_							,   atol=1e-4			)




import pytest


lowercase_													=      '''__dummy_dataset1__'''

lowercase_													=      '''
import json
import os

import datasets


REPO_URL = "https://huggingface.co/datasets/albertvillanova/tests-raw-jsonl/resolve/main/"
URLS = {"train": REPO_URL + "wikiann-bn-train.jsonl", "validation": REPO_URL + "wikiann-bn-validation.jsonl"}


class __DummyDataset1__(datasets.GeneratorBasedBuilder):

    def _info(self):
        features = datasets.Features(
            {
                "tokens": datasets.Sequence(datasets.Value("string")),
                "ner_tags": datasets.Sequence(
                    datasets.features.ClassLabel(
                        names=[
                            "O",
                            "B-PER",
                            "I-PER",
                            "B-ORG",
                            "I-ORG",
                            "B-LOC",
                            "I-LOC",
                        ]
                    )
                ),
                "langs": datasets.Sequence(datasets.Value("string")),
                "spans": datasets.Sequence(datasets.Value("string")),
            }
        )
        return datasets.DatasetInfo(features=features)

    def _split_generators(self, dl_manager):
        dl_path = dl_manager.download(URLS)
        return [
            datasets.SplitGenerator(datasets.Split.TRAIN, gen_kwargs={"filepath": dl_path["train"]}),
            datasets.SplitGenerator(datasets.Split.VALIDATION, gen_kwargs={"filepath": dl_path["validation"]}),
        ]

    def _generate_examples(self, filepath):
        with open(filepath, "r", encoding="utf-8") as f:
            for i, line in enumerate(f):
                yield i, json.loads(line)
'''






@pytest.fixture
def        __lowerCAmelCase		(	)	->    Any:
					return DATASET_LOADING_SCRIPT_NAME






@pytest.fixture
def        __lowerCAmelCase		(	)	->    Union[str, Any]:
					return DATASET_LOADING_SCRIPT_CODE






@pytest.fixture
def        __lowerCAmelCase		(	__lowerCamelCase						:     Optional[Any]					, __lowerCamelCase						:     Tuple					, __lowerCamelCase						:     str						)	->    List[str]:
					__lowerCAmelCase						 =dataset_loading_script_name
					__lowerCAmelCase						 =tmp_path / """datasets""" / script_name
					script_dir.mkdir(parents=__lowerCamelCase						)
					__lowerCAmelCase						 =script_dir / f"""{script_name}.py"""
					with open(__lowerCamelCase					, """w"""						) as f:
										f.write(__lowerCamelCase						)
					return str(__lowerCamelCase						)




