






import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
 import torch

 from transformers import (
     OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST,
     OpenAIGPTConfig,
     OpenAIGPTDoubleHeadsModel,
     OpenAIGPTForSequenceClassification,
     OpenAIGPTLMHeadModel,
     OpenAIGPTModel,
 )





class 			__a  :







 def __init__(		self					:   str							,   SCREAMING_SNAKE_CASE					:   Dict							,   SCREAMING_SNAKE_CASE					:   List[Any]=13							,   SCREAMING_SNAKE_CASE					:   Any=7							,   SCREAMING_SNAKE_CASE					:   Dict=True							,   SCREAMING_SNAKE_CASE					:   List[str]=True							,   SCREAMING_SNAKE_CASE					:   Any=True							,   SCREAMING_SNAKE_CASE					:   Any=99							,   SCREAMING_SNAKE_CASE					:   Tuple=32							,   SCREAMING_SNAKE_CASE					:   Tuple=5							,   SCREAMING_SNAKE_CASE					:   Any=4							,   SCREAMING_SNAKE_CASE					:   Optional[int]=37							,   SCREAMING_SNAKE_CASE					:   Any="gelu"							,   SCREAMING_SNAKE_CASE					:   Tuple=0.1							,   SCREAMING_SNAKE_CASE					:   Dict=0.1							,   SCREAMING_SNAKE_CASE					:   Optional[Any]=5_12							,   SCREAMING_SNAKE_CASE					:   Optional[int]=16							,   SCREAMING_SNAKE_CASE					:   List[Any]=2							,   SCREAMING_SNAKE_CASE					:   Dict=0.0_2							,   SCREAMING_SNAKE_CASE					:   Tuple=3							,   SCREAMING_SNAKE_CASE					:   List[str]=4							,   SCREAMING_SNAKE_CASE					:   List[Any]=None							,   ):


      '''simple docstring'''






      UpperCamelCase__			:   List[Any]       				=  parent
      UpperCamelCase__			:   Optional[int]       				=  batch_size
      UpperCamelCase__			:   List[str]       				=  seq_length
      UpperCamelCase__			:   Union[str, Any]       				=  is_training
      UpperCamelCase__			:   Dict       				=  use_token_type_ids
      UpperCamelCase__			:   Optional[int]       				=  use_labels
      UpperCamelCase__			:   Tuple       				=  vocab_size
      UpperCamelCase__			:   List[Any]       				=  hidden_size
      UpperCamelCase__			:   Tuple       				=  num_hidden_layers
      UpperCamelCase__			:   Union[str, Any]       				=  num_attention_heads
      UpperCamelCase__			:   Optional[int]       				=  intermediate_size
      UpperCamelCase__			:   List[str]       				=  hidden_act
      UpperCamelCase__			:   Union[str, Any]       				=  hidden_dropout_prob
      UpperCamelCase__			:   Any       				=  attention_probs_dropout_prob
      UpperCamelCase__			:   List[Any]       				=  max_position_embeddings
      UpperCamelCase__			:   Optional[int]       				=  type_vocab_size
      UpperCamelCase__			:   Tuple       				=  type_sequence_label_size
      UpperCamelCase__			:   Dict       				=  initializer_range
      UpperCamelCase__			:   Optional[int]       				=  num_labels
      UpperCamelCase__			:   Tuple       				=  num_choices
      UpperCamelCase__			:   str       				=  scope
      UpperCamelCase__			:   Union[str, Any]       				=  self.vocab_size - 1







 def 					__lowercase					(		self					:   int						):


      '''simple docstring'''






      UpperCamelCase__			:   Optional[Any]       				=  ids_tensor([self.batch_size, self.seq_length]							,   self.vocab_size						)

      UpperCamelCase__			:   List[str]       				=  None
      if self.use_token_type_ids:
           UpperCamelCase__			:   Union[str, Any]       				=  ids_tensor([self.batch_size, self.seq_length]							,   self.type_vocab_size						)

      UpperCamelCase__			:   List[str]       				=  None
      UpperCamelCase__			:   str       				=  None
      UpperCamelCase__			:   int       				=  None
      if self.use_labels:
           UpperCamelCase__			:   Optional[Any]       				=  ids_tensor([self.batch_size]							,   self.type_sequence_label_size						)
           UpperCamelCase__			:   Any       				=  ids_tensor([self.batch_size, self.seq_length]							,   self.num_labels						)
           UpperCamelCase__			:   int       				=  ids_tensor([self.batch_size]							,   self.num_choices						)

      UpperCamelCase__			:   Dict       				=  OpenAIGPTConfig(
          vocab_size=self.vocab_size							,   n_embd=self.hidden_size							,   n_layer=self.num_hidden_layers							,   n_head=self.num_attention_heads							,   n_positions=self.max_position_embeddings							,   pad_token_id=self.pad_token_id							,   )

      UpperCamelCase__			:   Optional[Any]       				=  ids_tensor([self.num_hidden_layers, self.num_attention_heads]							,   2						)

      return (
          config,
          input_ids,
          head_mask,
          token_type_ids,
          sequence_labels,
          token_labels,
          choice_labels,
      )







 def 					__lowercase					(		self					:   List[Any]							,   SCREAMING_SNAKE_CASE					:   Union[str, Any]							,   SCREAMING_SNAKE_CASE					:   List[str]							,   SCREAMING_SNAKE_CASE					:   int							,   SCREAMING_SNAKE_CASE					:   Dict							,   *SCREAMING_SNAKE_CASE					:   Dict						):


      '''simple docstring'''






      UpperCamelCase__			:   Dict       				=  OpenAIGPTModel(config=SCREAMING_SNAKE_CASE						)
      model.to(SCREAMING_SNAKE_CASE						)
      model.eval()

      UpperCamelCase__			:   Union[str, Any]       				=  model(SCREAMING_SNAKE_CASE							,   token_type_ids=SCREAMING_SNAKE_CASE							,   head_mask=SCREAMING_SNAKE_CASE						)
      UpperCamelCase__			:   Union[str, Any]       				=  model(SCREAMING_SNAKE_CASE							,   token_type_ids=SCREAMING_SNAKE_CASE						)
      UpperCamelCase__			:   List[str]       				=  model(SCREAMING_SNAKE_CASE						)

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







 def 					__lowercase					(		self					:   Any							,   SCREAMING_SNAKE_CASE					:   Any							,   SCREAMING_SNAKE_CASE					:   Union[str, Any]							,   SCREAMING_SNAKE_CASE					:   List[str]							,   SCREAMING_SNAKE_CASE					:   Optional[Any]							,   *SCREAMING_SNAKE_CASE					:   Tuple						):


      '''simple docstring'''






      UpperCamelCase__			:   Optional[Any]       				=  OpenAIGPTLMHeadModel(SCREAMING_SNAKE_CASE						)
      model.to(SCREAMING_SNAKE_CASE						)
      model.eval()

      UpperCamelCase__			:   List[Any]       				=  model(SCREAMING_SNAKE_CASE							,   token_type_ids=SCREAMING_SNAKE_CASE							,   labels=SCREAMING_SNAKE_CASE						)
      self.parent.assertEqual(result.loss.shape							,   ()						)
      self.parent.assertEqual(result.logits.shape							,   (self.batch_size, self.seq_length, self.vocab_size)						)







 def 					__lowercase					(		self					:   List[str]							,   SCREAMING_SNAKE_CASE					:   int							,   SCREAMING_SNAKE_CASE					:   Any							,   SCREAMING_SNAKE_CASE					:   Dict							,   SCREAMING_SNAKE_CASE					:   Any							,   *SCREAMING_SNAKE_CASE					:   List[str]						):


      '''simple docstring'''






      UpperCamelCase__			:   str       				=  OpenAIGPTDoubleHeadsModel(SCREAMING_SNAKE_CASE						)
      model.to(SCREAMING_SNAKE_CASE						)
      model.eval()

      UpperCamelCase__			:   int       				=  model(SCREAMING_SNAKE_CASE							,   token_type_ids=SCREAMING_SNAKE_CASE							,   labels=SCREAMING_SNAKE_CASE						)
      self.parent.assertEqual(result.loss.shape							,   ()						)
      self.parent.assertEqual(result.logits.shape							,   (self.batch_size, self.seq_length, self.vocab_size)						)







 def 					__lowercase					(		self					:   str							,   SCREAMING_SNAKE_CASE					:   str							,   SCREAMING_SNAKE_CASE					:   List[str]							,   SCREAMING_SNAKE_CASE					:   Optional[Any]							,   SCREAMING_SNAKE_CASE					:   Union[str, Any]							,   *SCREAMING_SNAKE_CASE					:   Tuple						):


      '''simple docstring'''






      UpperCamelCase__			:   Union[str, Any]       				=  self.num_labels
      UpperCamelCase__			:   Optional[int]       				=  OpenAIGPTForSequenceClassification(SCREAMING_SNAKE_CASE						)
      model.to(SCREAMING_SNAKE_CASE						)
      model.eval()

      UpperCamelCase__			:   Tuple       				=  ids_tensor([self.batch_size]							,   self.type_sequence_label_size						)
      UpperCamelCase__			:   List[str]       				=  model(SCREAMING_SNAKE_CASE							,   token_type_ids=SCREAMING_SNAKE_CASE							,   labels=SCREAMING_SNAKE_CASE						)
      self.parent.assertEqual(result.logits.shape							,   (self.batch_size, self.num_labels)						)







 def 					__lowercase					(		self					:   Dict						):


      '''simple docstring'''






      UpperCamelCase__			:   Any       				=  self.prepare_config_and_inputs()
      (
          (
          UpperCamelCase__
      )				,     (
          UpperCamelCase__
      )				,     (
          UpperCamelCase__
      )				,     (
          UpperCamelCase__
      )				,     (
          UpperCamelCase__
      )				,     (
          UpperCamelCase__
      )				,     (
          UpperCamelCase__
      )				,     
      )			:   Optional[Any]       				=  config_and_inputs
      UpperCamelCase__			:   Any       				=  {
          "input_ids": input_ids,
          "token_type_ids": token_type_ids,
          "head_mask": head_mask,
      }

      return config, inputs_dict







@require_torch
class 			__a  (    A__       ,   A__       ,   A__       ,   unittest.TestCase       ):
 _lowerCAmelCase       :       Any        = (
     (OpenAIGPTModel, OpenAIGPTLMHeadModel, OpenAIGPTDoubleHeadsModel, OpenAIGPTForSequenceClassification)
     if is_torch_available()
     else ()
 )
 _lowerCAmelCase       :       Tuple        = (
     (OpenAIGPTLMHeadModel,) if is_torch_available() else ()
 )  # TODO (PVP): Add Double HeadsModel when generate() function is changed accordingly
 _lowerCAmelCase       :       Any        = (
     {
         '''feature-extraction''': OpenAIGPTModel,
         '''text-classification''': OpenAIGPTForSequenceClassification,
         '''text-generation''': OpenAIGPTLMHeadModel,
         '''zero-shot''': OpenAIGPTForSequenceClassification,
     }
     if is_torch_available()
     else {}
 )







 def 					__lowercase					(		self					:   Optional[int]							,   SCREAMING_SNAKE_CASE					:   Union[str, Any]							,   SCREAMING_SNAKE_CASE					:   Optional[Any]							,   SCREAMING_SNAKE_CASE					:   List[Any]							,   SCREAMING_SNAKE_CASE					:   int							,   SCREAMING_SNAKE_CASE					:   Union[str, Any]						):


      '''simple docstring'''






      if pipeline_test_casse_name == "ZeroShotClassificationPipelineTests":
           # Get `tokenizer does not have a padding token` error for both fast/slow tokenizers.
           # `OpenAIGPTConfig` was never used in pipeline tests, either because of a missing checkpoint or because a
           # tiny config could not be created.
           return True

      return False







 def 					__lowercase					(		self					:   List[Any]							,   SCREAMING_SNAKE_CASE					:   List[str]							,   SCREAMING_SNAKE_CASE					:   List[str]							,   SCREAMING_SNAKE_CASE					:   Tuple=False						):


      '''simple docstring'''






      UpperCamelCase__			:   Optional[Any]       				=  super()._prepare_for_class(SCREAMING_SNAKE_CASE							,   SCREAMING_SNAKE_CASE							,   return_labels=SCREAMING_SNAKE_CASE						)

      if return_labels:
           if model_class.__name__ == "OpenAIGPTDoubleHeadsModel":
                UpperCamelCase__			:   int       				=  torch.zeros(
                    (self.model_tester.batch_size, self.model_tester.num_choices, self.model_tester.seq_length)							,   dtype=torch.long							,   device=SCREAMING_SNAKE_CASE							,   )
                UpperCamelCase__			:   str       				=  inputs_dict["labels"]
                UpperCamelCase__			:   List[Any]       				=  inputs_dict["labels"]
                UpperCamelCase__			:   Optional[Any]       				=  torch.zeros(
                    (self.model_tester.batch_size, self.model_tester.num_choices)							,   dtype=torch.long							,   device=SCREAMING_SNAKE_CASE							,   )
                UpperCamelCase__			:   Optional[int]       				=  torch.zeros(
                    self.model_tester.batch_size							,   dtype=torch.long							,   device=SCREAMING_SNAKE_CASE						)
      return inputs_dict







 def 					__lowercase					(		self					:   str						):


      '''simple docstring'''






      UpperCamelCase__			:   List[Any]       				=  OpenAIGPTModelTester(self						)
      UpperCamelCase__			:   Optional[Any]       				=  ConfigTester(self							,   config_class=SCREAMING_SNAKE_CASE							,   n_embd=37						)







 def 					__lowercase					(		self					:   Optional[int]						):


      '''simple docstring'''






      self.config_tester.run_common_tests()







 def 					__lowercase					(		self					:   Optional[Any]						):


      '''simple docstring'''






      UpperCamelCase__			:   Optional[Any]       				=  self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_openai_gpt_model(*SCREAMING_SNAKE_CASE						)







 def 					__lowercase					(		self					:   List[str]						):


      '''simple docstring'''






      UpperCamelCase__			:   Optional[int]       				=  self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_lm_head_model(*SCREAMING_SNAKE_CASE						)







 def 					__lowercase					(		self					:   Optional[Any]						):


      '''simple docstring'''






      UpperCamelCase__			:   Tuple       				=  self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_double_lm_head_model(*SCREAMING_SNAKE_CASE						)







 def 					__lowercase					(		self					:   List[Any]						):


      '''simple docstring'''






      UpperCamelCase__			:   List[Any]       				=  self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_openai_gpt_for_sequence_classification(*SCREAMING_SNAKE_CASE						)







 @slow
 def 					__lowercase					(		self					:   Union[str, Any]						):


      '''simple docstring'''






      for model_name in OPENAI_GPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
           UpperCamelCase__			:   Dict       				=  OpenAIGPTModel.from_pretrained(SCREAMING_SNAKE_CASE						)
           self.assertIsNotNone(SCREAMING_SNAKE_CASE						)







@require_torch
class 			__a  (    unittest.TestCase       ):







 @slow
 def 					__lowercase					(		self					:   int						):


      '''simple docstring'''






      UpperCamelCase__			:   List[Any]       				=  OpenAIGPTLMHeadModel.from_pretrained("openai-gpt"						)
      model.to(SCREAMING_SNAKE_CASE						)
      UpperCamelCase__			:   List[Any]       				=  torch.tensor([[4_81, 47_35, 5_44]]							,   dtype=torch.long							,   device=SCREAMING_SNAKE_CASE						)  # the president is
      UpperCamelCase__			:   Union[str, Any]       				=  [
          4_81,
          47_35,
          5_44,
          2_46,
          9_63,
          8_70,
          7_62,
          2_39,
          2_44,
          4_04_77,
          2_44,
          2_49,
          7_19,
          8_81,
          4_87,
          5_44,
          2_40,
          2_44,
          6_03,
          4_81,
      ]  # the president is a very good man. " \n " i\'m sure he is, " said the

      UpperCamelCase__			:   int       				=  model.generate(SCREAMING_SNAKE_CASE							,   do_sample=SCREAMING_SNAKE_CASE						)
      self.assertListEqual(output_ids[0].tolist()							,   SCREAMING_SNAKE_CASE						)







import os
import tempfile
from functools import partial
from unittest import TestCase
from unittest.mock import patch

import datasets
import datasets.config

from .utils import require_beam





class 			__a  (    datasets.BeamBasedBuilder       ):







 def 					__lowercase					(		self					:   List[str]						):


      '''simple docstring'''






      return datasets.DatasetInfo(
          features=datasets.Features({"content": datasets.Value("string"						)}						)							,   supervised_keys=SCREAMING_SNAKE_CASE							,   )







 def 					__lowercase					(		self					:   List[Any]							,   SCREAMING_SNAKE_CASE					:   Optional[int]							,   SCREAMING_SNAKE_CASE					:   Any						):


      '''simple docstring'''






      return [datasets.SplitGenerator(name=datasets.Split.TRAIN							,   gen_kwargs={"examples": get_test_dummy_examples()}						)]







 def 					__lowercase					(		self					:   List[Any]							,   SCREAMING_SNAKE_CASE					:   Tuple							,   SCREAMING_SNAKE_CASE					:   int						):


      '''simple docstring'''






      import apache_beam as beam

      return pipeline | "Load Examples" >> beam.Create(SCREAMING_SNAKE_CASE						)







class 			__a  (    datasets.BeamBasedBuilder       ):







 def 					__lowercase					(		self					:   Any						):


      '''simple docstring'''






      return datasets.DatasetInfo(
          features=datasets.Features({"a": datasets.Sequence({"b": datasets.Value("string"						)}						)}						)							,   supervised_keys=SCREAMING_SNAKE_CASE							,   )







 def 					__lowercase					(		self					:   Any							,   SCREAMING_SNAKE_CASE					:   Tuple							,   SCREAMING_SNAKE_CASE					:   List[Any]						):


      '''simple docstring'''






      return [
          datasets.SplitGenerator(name=datasets.Split.TRAIN							,   gen_kwargs={"examples": get_test_nested_examples()}						)
      ]







 def 					__lowercase					(		self					:   List[Any]							,   SCREAMING_SNAKE_CASE					:   Tuple							,   SCREAMING_SNAKE_CASE					:   Any						):


      '''simple docstring'''






      import apache_beam as beam

      return pipeline | "Load Examples" >> beam.Create(SCREAMING_SNAKE_CASE						)







def 		SCREAMING_SNAKE_CASE							(					) ->	List[str]:
     return [(i, {"content": content}) for i, content in enumerate(["foo", "bar", "foobar"]			)]







def 		SCREAMING_SNAKE_CASE							(					) ->	Optional[Any]:
     return [(i, {"a": {"b": [content]}}) for i, content in enumerate(["foo", "bar", "foobar"]			)]





class 			__a  (    A__       ):







 @require_beam
 def 					__lowercase					(		self					:   Optional[int]						):


      '''simple docstring'''






      UpperCamelCase__			:   int       				=  len(get_test_dummy_examples()						)
      with tempfile.TemporaryDirectory() as tmp_cache_dir:
           UpperCamelCase__			:   List[Any]       				=  DummyBeamDataset(cache_dir=SCREAMING_SNAKE_CASE							,   beam_runner="DirectRunner"						)
           builder.download_and_prepare()
           self.assertTrue(
               os.path.exists(
                   os.path.join(SCREAMING_SNAKE_CASE							,   builder.name							,   "default"							,   "0.0.0"							,   F'{builder.name}-train.arrow'						)						)						)
           self.assertDictEqual(builder.info.features							,   datasets.Features({"content": datasets.Value("string"						)}						)						)
           UpperCamelCase__			:   Optional[Any]       				=  builder.as_dataset()
           self.assertEqual(dset["train"].num_rows							,   SCREAMING_SNAKE_CASE						)
           self.assertEqual(dset["train"].info.splits["train"].num_examples							,   SCREAMING_SNAKE_CASE						)
           self.assertDictEqual(dset["train"][0]							,   get_test_dummy_examples()[0][1]						)
           self.assertDictEqual(
               dset["train"][expected_num_examples - 1]							,   get_test_dummy_examples()[expected_num_examples - 1][1]						)
           self.assertTrue(
               os.path.exists(os.path.join(SCREAMING_SNAKE_CASE							,   builder.name							,   "default"							,   "0.0.0"							,   "dataset_info.json"						)						)						)
           del dset







 @require_beam
 def 					__lowercase					(		self					:   Any						):


      '''simple docstring'''






      import apache_beam as beam

      UpperCamelCase__			:   Any       				=  beam.io.parquetio.WriteToParquet

      UpperCamelCase__			:   Tuple       				=  len(get_test_dummy_examples()						)
      with tempfile.TemporaryDirectory() as tmp_cache_dir:
           UpperCamelCase__			:   str       				=  DummyBeamDataset(cache_dir=SCREAMING_SNAKE_CASE							,   beam_runner="DirectRunner"						)
           with patch("apache_beam.io.parquetio.WriteToParquet"						) as write_parquet_mock:
                UpperCamelCase__			:   Optional[Any]       				=  partial(SCREAMING_SNAKE_CASE							,   num_shards=2						)
                builder.download_and_prepare()
           self.assertTrue(
               os.path.exists(
                   os.path.join(
                       SCREAMING_SNAKE_CASE							,   builder.name							,   "default"							,   "0.0.0"							,   F'{builder.name}-train-00000-of-00002.arrow'						)						)						)
           self.assertTrue(
               os.path.exists(
                   os.path.join(
                       SCREAMING_SNAKE_CASE							,   builder.name							,   "default"							,   "0.0.0"							,   F'{builder.name}-train-00000-of-00002.arrow'						)						)						)
           self.assertDictEqual(builder.info.features							,   datasets.Features({"content": datasets.Value("string"						)}						)						)
           UpperCamelCase__			:   List[Any]       				=  builder.as_dataset()
           self.assertEqual(dset["train"].num_rows							,   SCREAMING_SNAKE_CASE						)
           self.assertEqual(dset["train"].info.splits["train"].num_examples							,   SCREAMING_SNAKE_CASE						)
           # Order is not preserved when sharding, so we just check that all the elements are there
           self.assertListEqual(sorted(dset["train"]["content"]						)							,   sorted(["foo", "bar", "foobar"]						)						)
           self.assertTrue(
               os.path.exists(os.path.join(SCREAMING_SNAKE_CASE							,   builder.name							,   "default"							,   "0.0.0"							,   "dataset_info.json"						)						)						)
           del dset







 @require_beam
 def 					__lowercase					(		self					:   List[Any]						):


      '''simple docstring'''






      with tempfile.TemporaryDirectory() as tmp_cache_dir:
           UpperCamelCase__			:   int       				=  DummyBeamDataset(cache_dir=SCREAMING_SNAKE_CASE						)
           self.assertRaises(datasets.builder.MissingBeamOptions							,   builder.download_and_prepare						)







 @require_beam
 def 					__lowercase					(		self					:   List[Any]						):


      '''simple docstring'''






      UpperCamelCase__			:   List[Any]       				=  len(get_test_nested_examples()						)
      with tempfile.TemporaryDirectory() as tmp_cache_dir:
           UpperCamelCase__			:   Any       				=  NestedBeamDataset(cache_dir=SCREAMING_SNAKE_CASE							,   beam_runner="DirectRunner"						)
           builder.download_and_prepare()
           self.assertTrue(
               os.path.exists(
                   os.path.join(SCREAMING_SNAKE_CASE							,   builder.name							,   "default"							,   "0.0.0"							,   F'{builder.name}-train.arrow'						)						)						)
           self.assertDictEqual(
               builder.info.features							,   datasets.Features({"a": datasets.Sequence({"b": datasets.Value("string"						)}						)}						)						)
           UpperCamelCase__			:   List[Any]       				=  builder.as_dataset()
           self.assertEqual(dset["train"].num_rows							,   SCREAMING_SNAKE_CASE						)
           self.assertEqual(dset["train"].info.splits["train"].num_examples							,   SCREAMING_SNAKE_CASE						)
           self.assertDictEqual(dset["train"][0]							,   get_test_nested_examples()[0][1]						)
           self.assertDictEqual(
               dset["train"][expected_num_examples - 1]							,   get_test_nested_examples()[expected_num_examples - 1][1]						)
           self.assertTrue(
               os.path.exists(os.path.join(SCREAMING_SNAKE_CASE							,   builder.name							,   "default"							,   "0.0.0"							,   "dataset_info.json"						)						)						)
           del dset