'''simple docstring'''

import inspect
import unittest
import warnings

from transformers import DeiTConfig
from transformers.models.auto import get_values
from transformers.testing_utils import (
    require_accelerate,
    require_torch,
    require_torch_gpu,
    require_vision,
    slow,
    torch_device,
)
from transformers.utils import cached_property, is_torch_available, is_vision_available

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


if is_torch_available():
 import torch
 from torch import nn

 from transformers import (
     MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
     MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING,
     MODEL_MAPPING,
     DeiTForImageClassification,
     DeiTForImageClassificationWithTeacher,
     DeiTForMaskedImageModeling,
     DeiTModel,
 )
 from transformers.models.deit.modeling_deit import DEIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
 from PIL import Image

 from transformers import DeiTImageProcessor







class 							_lowercase	:


 '''simple docstring'''






 def __init__( self  :      Optional[int] ,			SCREAMING_SNAKE_CASE__  :      Union[str, Any] ,			SCREAMING_SNAKE_CASE__  :      Optional[Any]=13 ,			SCREAMING_SNAKE_CASE__  :      Optional[int]=30 ,			SCREAMING_SNAKE_CASE__  :      Optional[Any]=2 ,			SCREAMING_SNAKE_CASE__  :      str=3 ,			SCREAMING_SNAKE_CASE__  :      Tuple=True ,			SCREAMING_SNAKE_CASE__  :      Dict=True ,			SCREAMING_SNAKE_CASE__  :      int=32 ,			SCREAMING_SNAKE_CASE__  :      Optional[int]=5 ,			SCREAMING_SNAKE_CASE__  :      List[Any]=4 ,			SCREAMING_SNAKE_CASE__  :      Optional[int]=37 ,			SCREAMING_SNAKE_CASE__  :      int="gelu" ,			SCREAMING_SNAKE_CASE__  :      int=0.1 ,			SCREAMING_SNAKE_CASE__  :      Optional[int]=0.1 ,			SCREAMING_SNAKE_CASE__  :      List[str]=10 ,			SCREAMING_SNAKE_CASE__  :      Optional[Any]=0.0_2 ,			SCREAMING_SNAKE_CASE__  :      int=3 ,			SCREAMING_SNAKE_CASE__  :      List[Any]=None ,			SCREAMING_SNAKE_CASE__  :      List[Any]=2 ,			)    ->       List[Any]:
  __lowerCAmelCase											=		parent
  __lowerCAmelCase											=		batch_size
  __lowerCAmelCase											=		image_size
  __lowerCAmelCase											=		patch_size
  __lowerCAmelCase											=		num_channels
  __lowerCAmelCase											=		is_training
  __lowerCAmelCase											=		use_labels
  __lowerCAmelCase											=		hidden_size
  __lowerCAmelCase											=		num_hidden_layers
  __lowerCAmelCase											=		num_attention_heads
  __lowerCAmelCase											=		intermediate_size
  __lowerCAmelCase											=		hidden_act
  __lowerCAmelCase											=		hidden_dropout_prob
  __lowerCAmelCase											=		attention_probs_dropout_prob
  __lowerCAmelCase											=		type_sequence_label_size
  __lowerCAmelCase											=		initializer_range
  __lowerCAmelCase											=		scope
  __lowerCAmelCase											=		encoder_stride

  # in DeiT, the seq length equals the number of patches + 2 (we add 2 for the [CLS] and distilation tokens)
  __lowerCAmelCase											=		(image_size // patch_size) ** 2
  __lowerCAmelCase											=		num_patches + 2
 def a   ( self  :      str				)    ->       Dict:
  __lowerCAmelCase											=		floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]				)

  __lowerCAmelCase											=		None
  if self.use_labels:
   __lowerCAmelCase											=		ids_tensor([self.batch_size] ,			self.type_sequence_label_size				)

  __lowerCAmelCase											=		self.get_config()

  return config, pixel_values, labels
 def a   ( self  :      List[Any]				)    ->       Any:
  return DeiTConfig(
      image_size=self.image_size ,			patch_size=self.patch_size ,			num_channels=self.num_channels ,			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 ,			is_decoder=snake_case__ ,			initializer_range=self.initializer_range ,			encoder_stride=self.encoder_stride ,			)
 def a   ( self  :      Optional[Any] ,			SCREAMING_SNAKE_CASE__  :      List[str] ,			SCREAMING_SNAKE_CASE__  :      Optional[Any] ,			SCREAMING_SNAKE_CASE__  :      Tuple				)    ->       List[Any]:
  __lowerCAmelCase											=		DeiTModel(config=snake_case__				)
  model.to(snake_case__				)
  model.eval()
  __lowerCAmelCase											=		model(snake_case__				)
  self.parent.assertEqual(result.last_hidden_state.shape ,			(self.batch_size, self.seq_length, self.hidden_size)				)
 def a   ( self  :      int ,			SCREAMING_SNAKE_CASE__  :      Dict ,			SCREAMING_SNAKE_CASE__  :      str ,			SCREAMING_SNAKE_CASE__  :      List[Any]				)    ->       List[Any]:
  __lowerCAmelCase											=		DeiTForMaskedImageModeling(config=snake_case__				)
  model.to(snake_case__				)
  model.eval()
  __lowerCAmelCase											=		model(snake_case__				)
  self.parent.assertEqual(
      result.reconstruction.shape ,			(self.batch_size, self.num_channels, self.image_size, self.image_size)				)

  # test greyscale images
  __lowerCAmelCase											=		1
  __lowerCAmelCase											=		DeiTForMaskedImageModeling(snake_case__				)
  model.to(snake_case__				)
  model.eval()

  __lowerCAmelCase											=		floats_tensor([self.batch_size, 1, self.image_size, self.image_size]				)
  __lowerCAmelCase											=		model(snake_case__				)
  self.parent.assertEqual(result.reconstruction.shape ,			(self.batch_size, 1, self.image_size, self.image_size)				)
 def a   ( self  :      List[Any] ,			SCREAMING_SNAKE_CASE__  :      Optional[int] ,			SCREAMING_SNAKE_CASE__  :      Dict ,			SCREAMING_SNAKE_CASE__  :      str				)    ->       Dict:
  __lowerCAmelCase											=		self.type_sequence_label_size
  __lowerCAmelCase											=		DeiTForImageClassification(snake_case__				)
  model.to(snake_case__				)
  model.eval()
  __lowerCAmelCase											=		model(snake_case__ ,			labels=snake_case__				)
  self.parent.assertEqual(result.logits.shape ,			(self.batch_size, self.type_sequence_label_size)				)

  # test greyscale images
  __lowerCAmelCase											=		1
  __lowerCAmelCase											=		DeiTForImageClassification(snake_case__				)
  model.to(snake_case__				)
  model.eval()

  __lowerCAmelCase											=		floats_tensor([self.batch_size, 1, self.image_size, self.image_size]				)
  __lowerCAmelCase											=		model(snake_case__ ,			labels=snake_case__				)
  self.parent.assertEqual(result.logits.shape ,			(self.batch_size, self.type_sequence_label_size)				)





 def a   ( self  :      Any				)    ->       Tuple:
  __lowerCAmelCase											=		self.prepare_config_and_inputs()
  (
      (
      __lowerCAmelCase						
  )				,			(
      __lowerCAmelCase						
  )				,			(
      __lowerCAmelCase						
  )				,									
  )											=		config_and_inputs
  __lowerCAmelCase											=		{"""pixel_values""": pixel_values}
  return config, inputs_dict







@require_torch
class 							_lowercase	(							UpperCAmelCase__    ,				UpperCAmelCase__    ,				unittest.TestCase     ):


 '''simple docstring'''






 _SCREAMING_SNAKE_CASE	:			int       =   (
     (
         DeiTModel,
         DeiTForImageClassification,
         DeiTForImageClassificationWithTeacher,
         DeiTForMaskedImageModeling,
     )
     if is_torch_available()
     else ()
 )
 _SCREAMING_SNAKE_CASE	:			Tuple       =   (
     {
         """feature-extraction""": DeiTModel,
         """image-classification""": (DeiTForImageClassification, DeiTForImageClassificationWithTeacher),
     }
     if is_torch_available()
     else {}
 )

 _SCREAMING_SNAKE_CASE	:			Optional[Any]       =   False
 _SCREAMING_SNAKE_CASE	:			List[str]       =   False
 _SCREAMING_SNAKE_CASE	:			str       =   False
 def a   ( self  :      List[str]				)    ->       List[str]:
  __lowerCAmelCase											=		DeiTModelTester(self				)
  __lowerCAmelCase											=		ConfigTester(self ,			config_class=snake_case__ ,			has_text_modality=snake_case__ ,			hidden_size=37				)
 def a   ( self  :      List[Any]				)    ->       Dict:
  self.config_tester.run_common_tests()
 @unittest.skip(reason="""DeiT does not use inputs_embeds"""				)
 def a   ( self  :      Union[str, Any]				)    ->       List[str]:
  pass
 def a   ( self  :      Optional[Any]				)    ->       str:
  __lowerCAmelCase				,			__lowerCAmelCase											=		self.model_tester.prepare_config_and_inputs_for_common()

  for model_class in self.all_model_classes:
   __lowerCAmelCase											=		model_class(snake_case__				)
   self.assertIsInstance(model.get_input_embeddings() ,			(nn.Module)				)
   __lowerCAmelCase											=		model.get_output_embeddings()
   self.assertTrue(x is None or isinstance(snake_case__ ,			nn.Linear				)				)
 def a   ( self  :      List[Any]				)    ->       Tuple:
  __lowerCAmelCase				,			__lowerCAmelCase											=		self.model_tester.prepare_config_and_inputs_for_common()

  for model_class in self.all_model_classes:
   __lowerCAmelCase											=		model_class(snake_case__				)
   __lowerCAmelCase											=		inspect.signature(model.forward				)
   # signature.parameters is an OrderedDict => so arg_names order is deterministic
   __lowerCAmelCase											=		[*signature.parameters.keys()]

   __lowerCAmelCase											=		["""pixel_values"""]
   self.assertListEqual(arg_names[:1] ,			snake_case__				)
 def a   ( self  :      Dict				)    ->       Tuple:
  __lowerCAmelCase											=		self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_model(*snake_case__				)
 def a   ( self  :      Tuple				)    ->       Optional[int]:
  __lowerCAmelCase											=		self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_for_masked_image_modeling(*snake_case__				)
 def a   ( self  :      Optional[int]				)    ->       int:
  __lowerCAmelCase											=		self.model_tester.prepare_config_and_inputs()
  self.model_tester.create_and_check_for_image_classification(*snake_case__				)
 def a   ( self  :      str ,			SCREAMING_SNAKE_CASE__  :      int ,			SCREAMING_SNAKE_CASE__  :      Optional[Any] ,			SCREAMING_SNAKE_CASE__  :      str=False				)    ->       Union[str, Any]:
  __lowerCAmelCase											=		super()._prepare_for_class(snake_case__ ,			snake_case__ ,			return_labels=snake_case__				)

  if return_labels:
   if model_class.__name__ == "DeiTForImageClassificationWithTeacher":
    del inputs_dict["labels"]

  return inputs_dict
 def a   ( self  :      int				)    ->       int:






  if not self.model_tester.is_training:
   return

  __lowerCAmelCase				,			__lowerCAmelCase											=		self.model_tester.prepare_config_and_inputs_for_common()
  __lowerCAmelCase											=		True

  for model_class in self.all_model_classes:
   # DeiTForImageClassificationWithTeacher supports inference-only
   if (
       model_class in get_values(snake_case__				)
       or model_class.__name__ == "DeiTForImageClassificationWithTeacher"
   ):
    continue
   __lowerCAmelCase											=		model_class(snake_case__				)
   model.to(snake_case__				)
   model.train()
   __lowerCAmelCase											=		self._prepare_for_class(snake_case__ ,			snake_case__ ,			return_labels=snake_case__				)
   __lowerCAmelCase											=		model(**snake_case__				).loss
   loss.backward()
 def a   ( self  :      Tuple				)    ->       str:
  __lowerCAmelCase				,			__lowerCAmelCase											=		self.model_tester.prepare_config_and_inputs_for_common()
  if not self.model_tester.is_training:
   return

  __lowerCAmelCase											=		False
  __lowerCAmelCase											=		True

  for model_class in self.all_model_classes:
   if model_class in get_values(snake_case__				) or not model_class.supports_gradient_checkpointing:
    continue
   # DeiTForImageClassificationWithTeacher supports inference-only
   if model_class.__name__ == "DeiTForImageClassificationWithTeacher":
    continue
   __lowerCAmelCase											=		model_class(snake_case__				)
   model.gradient_checkpointing_enable()
   model.to(snake_case__				)
   model.train()
   __lowerCAmelCase											=		self._prepare_for_class(snake_case__ ,			snake_case__ ,			return_labels=snake_case__				)
   __lowerCAmelCase											=		model(**snake_case__				).loss
   loss.backward()
 def a   ( self  :      str				)    ->       str:
  __lowerCAmelCase				,			__lowerCAmelCase											=		self.model_tester.prepare_config_and_inputs_for_common()

  __lowerCAmelCase											=		[
      {"""title""": """multi_label_classification""", """num_labels""": 2, """dtype""": torch.float},
      {"""title""": """single_label_classification""", """num_labels""": 1, """dtype""": torch.long},
      {"""title""": """regression""", """num_labels""": 1, """dtype""": torch.float},
  ]

  for model_class in self.all_model_classes:
   if (
       model_class
       not in [
           *get_values(snake_case__				),
           *get_values(snake_case__				),
       ]
       or model_class.__name__ == "DeiTForImageClassificationWithTeacher"
   ):
    continue

   for problem_type in problem_types:
    with self.subTest(msg=f"""Testing {model_class} with {problem_type["title"]}"""				):
     __lowerCAmelCase											=		problem_type["""title"""]
     __lowerCAmelCase											=		problem_type["""num_labels"""]

     __lowerCAmelCase											=		model_class(snake_case__				)
     model.to(snake_case__				)
     model.train()

     __lowerCAmelCase											=		self._prepare_for_class(snake_case__ ,			snake_case__ ,			return_labels=snake_case__				)

     if problem_type["num_labels"] > 1:
      __lowerCAmelCase											=		inputs["""labels"""].unsqueeze(1				).repeat(1 ,			problem_type["""num_labels"""]				)

     __lowerCAmelCase											=		inputs["""labels"""].to(problem_type["""dtype"""]				)

     # This tests that we do not trigger the warning form PyTorch "Using a target size that is different
     # to the input size. This will likely lead to incorrect results due to broadcasting. Please ensure
     # they have the same size." which is a symptom something in wrong for the regression problem.
     # See https://github.com/huggingface/transformers/issues/11780
     with warnings.catch_warnings(record=snake_case__				) as warning_list:
      __lowerCAmelCase											=		model(**snake_case__				).loss
     for w in warning_list:
      if "Using a target size that is different to the input size" in str(w.message				):
       raise ValueError(
           f"""Something is going wrong in the regression problem: intercepted {w.message}"""				)

     loss.backward()





 @slow
 def a   ( self  :      int				)    ->       Dict:






  for model_name in DEIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
   __lowerCAmelCase											=		DeiTModel.from_pretrained(snake_case__				)
   self.assertIsNotNone(snake_case__				)







def 	UpperCamelCase_		(   )   ->	str:






 '''simple docstring'''

 __lowerCAmelCase											=		Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png""" )
 return image







@require_torch
@require_vision
class 							_lowercase	(							unittest.TestCase     ):


 '''simple docstring'''






 @cached_property
 def a   ( self  :      Any				)    ->       Optional[int]:
  return (
      DeiTImageProcessor.from_pretrained("""facebook/deit-base-distilled-patch16-224"""				)
      if is_vision_available()
      else None
  )
 @slow
 def a   ( self  :      Union[str, Any]				)    ->       int:
  __lowerCAmelCase											=		DeiTForImageClassificationWithTeacher.from_pretrained("""facebook/deit-base-distilled-patch16-224"""				).to(
      snake_case__				)

  __lowerCAmelCase											=		self.default_image_processor
  __lowerCAmelCase											=		prepare_img()
  __lowerCAmelCase											=		image_processor(images=snake_case__ ,			return_tensors="""pt"""				).to(snake_case__				)

  # forward pass
  with torch.no_grad():
   __lowerCAmelCase											=		model(**snake_case__				)

  # verify the logits
  __lowerCAmelCase											=		torch.Size((1, 10_00)				)
  self.assertEqual(outputs.logits.shape ,			snake_case__				)

  __lowerCAmelCase											=		torch.tensor([-1.0_2_6_6, 0.1_9_1_2, -1.2_8_6_1]				).to(snake_case__				)

  self.assertTrue(torch.allclose(outputs.logits[0, :3] ,			snake_case__ ,			atol=1e-4				)				)





 @slow
 @require_accelerate
 @require_torch_gpu
 def a   ( self  :      Tuple				)    ->       int:
  __lowerCAmelCase											=		DeiTModel.from_pretrained(
      """facebook/deit-base-distilled-patch16-224""" ,			torch_dtype=torch.floataa ,			device_map="""auto"""				)
  __lowerCAmelCase											=		self.default_image_processor

  __lowerCAmelCase											=		prepare_img()
  __lowerCAmelCase											=		image_processor(images=snake_case__ ,			return_tensors="""pt"""				)
  __lowerCAmelCase											=		inputs.pixel_values.to(snake_case__				)

  # forward pass to make sure inference works in fp16
  with torch.no_grad():
   __lowerCAmelCase											=		model(snake_case__				)









import json
import os
import shutil
import tempfile
from unittest import TestCase

from transformers import BartTokenizer, BartTokenizerFast, DPRQuestionEncoderTokenizer, DPRQuestionEncoderTokenizerFast
from transformers.models.bart.configuration_bart import BartConfig
from transformers.models.bert.tokenization_bert import VOCAB_FILES_NAMES as DPR_VOCAB_FILES_NAMES
from transformers.models.dpr.configuration_dpr import DPRConfig
from transformers.models.roberta.tokenization_roberta import VOCAB_FILES_NAMES as BART_VOCAB_FILES_NAMES
from transformers.testing_utils import require_faiss, require_tokenizers, require_torch, slow
from transformers.utils import is_datasets_available, is_faiss_available, is_torch_available


if is_torch_available() and is_datasets_available() and is_faiss_available():
      from transformers.models.rag.configuration_rag import RagConfig
      from transformers.models.rag.tokenization_rag import RagTokenizer




@require_faiss
@require_torch
class   UpperCamelCase			(  SCREAMING_SNAKE_CASE ):

    def UpperCamelCase      (      self			:   List[Any]     ):

     """simple docstring"""






     SCREAMING_SNAKE_CASE		    =      tempfile.mkdtemp()
     SCREAMING_SNAKE_CASE		    =      8

     # DPR tok
     SCREAMING_SNAKE_CASE		    =      [
         '[UNK]',
         '[CLS]',
         '[SEP]',
         '[PAD]',
         '[MASK]',
         'want',
         '##want',
         '##ed',
         'wa',
         'un',
         'runn',
         '##ing',
         ',',
         'low',
         'lowest',
     ]
     SCREAMING_SNAKE_CASE		    =      os.path.join(self.tmpdirname				,     'dpr_tokenizer'     )
     os.makedirs(snake_case__				,     exist_ok=snake_case__     )
     SCREAMING_SNAKE_CASE		    =      os.path.join(snake_case__				,     DPR_VOCAB_FILES_NAMES['vocab_file']     )
     with open(self.vocab_file				,     'w'				,     encoding='utf-8'     ) as vocab_writer:
      vocab_writer.write(''.join([x + '\n' for x in vocab_tokens]     )     )

     # BART tok
     SCREAMING_SNAKE_CASE		    =      [
         'l',
         'o',
         'w',
         'e',
         'r',
         's',
         't',
         'i',
         'd',
         'n',
         '\u0120',
         '\u0120l',
         '\u0120n',
         '\u0120lo',
         '\u0120low',
         'er',
         '\u0120lowest',
         '\u0120newer',
         '\u0120wider',
         '<unk>',
     ]
     SCREAMING_SNAKE_CASE		    =      dict(zip(snake_case__				,     range(len(snake_case__     )     )     )     )
     SCREAMING_SNAKE_CASE		    =      ['#version: 0.2', '\u0120 l', '\u0120l o', '\u0120lo w', 'e r', '']
     SCREAMING_SNAKE_CASE		    =      {'unk_token': '<unk>'}

     SCREAMING_SNAKE_CASE		    =      os.path.join(self.tmpdirname				,     'bart_tokenizer'     )
     os.makedirs(snake_case__				,     exist_ok=snake_case__     )
     SCREAMING_SNAKE_CASE		    =      os.path.join(snake_case__				,     BART_VOCAB_FILES_NAMES['vocab_file']     )
     SCREAMING_SNAKE_CASE		    =      os.path.join(snake_case__				,     BART_VOCAB_FILES_NAMES['merges_file']     )
     with open(self.vocab_file				,     'w'				,     encoding='utf-8'     ) as fp:
      fp.write(json.dumps(snake_case__     ) + '\n'     )
     with open(self.merges_file				,     'w'				,     encoding='utf-8'     ) as fp:
      fp.write('\n'.join(snake_case__     )     )

    def UpperCamelCase      (      self			:   Optional[Any]     ):

     """simple docstring"""






     return DPRQuestionEncoderTokenizer.from_pretrained(os.path.join(self.tmpdirname				,     'dpr_tokenizer'     )     )

    def UpperCamelCase      (      self			:   Optional[int]     ):

     """simple docstring"""






     return BartTokenizer.from_pretrained(os.path.join(self.tmpdirname				,     'bart_tokenizer'     )     )

    def UpperCamelCase      (      self			:   Tuple     ):

     """simple docstring"""






     shutil.rmtree(self.tmpdirname     )

    @require_tokenizers
    def UpperCamelCase      (      self			:   Optional[int]     ):

     """simple docstring"""






     SCREAMING_SNAKE_CASE		    =      os.path.join(self.tmpdirname				,     'rag_tokenizer'     )
     SCREAMING_SNAKE_CASE		    =      RagConfig(question_encoder=DPRConfig().to_dict()				,     generator=BartConfig().to_dict()     )
     SCREAMING_SNAKE_CASE		    =      RagTokenizer(question_encoder=self.get_dpr_tokenizer()				,     generator=self.get_bart_tokenizer()     )
     rag_config.save_pretrained(snake_case__     )
     rag_tokenizer.save_pretrained(snake_case__     )
     SCREAMING_SNAKE_CASE		    =      RagTokenizer.from_pretrained(snake_case__				,     config=snake_case__     )
     self.assertIsInstance(new_rag_tokenizer.question_encoder				,     snake_case__     )
     self.assertEqual(new_rag_tokenizer.question_encoder.get_vocab()				,     rag_tokenizer.question_encoder.get_vocab()     )
     self.assertIsInstance(new_rag_tokenizer.generator				,     snake_case__     )
     self.assertEqual(new_rag_tokenizer.generator.get_vocab()				,     rag_tokenizer.generator.get_vocab()     )

    @slow
    def UpperCamelCase      (      self			:   List[Any]     ):

     """simple docstring"""






     SCREAMING_SNAKE_CASE		    =      RagTokenizer.from_pretrained('facebook/rag-token-nq'     )
     SCREAMING_SNAKE_CASE		    =      [
         'who got the first nobel prize in physics',
         'when is the next deadpool movie being released',
         'which mode is used for short wave broadcast service',
         'who is the owner of reading football club',
         'when is the next scandal episode coming out',
         'when is the last time the philadelphia won the superbowl',
         'what is the most current adobe flash player version',
         'how many episodes are there in dragon ball z',
         'what is the first step in the evolution of the eye',
         'where is gall bladder situated in human body',
         'what is the main mineral in lithium batteries',
         'who is the president of usa right now',
         'where do the greasers live in the outsiders',
         'panda is a national animal of which country',
         'what is the name of manchester united stadium',
     ]
     SCREAMING_SNAKE_CASE		    =      tokenizer(snake_case__     )
     self.assertIsNotNone(snake_case__     )




    @slow
    def UpperCamelCase      (      self			:   str     ):

     """simple docstring"""






     SCREAMING_SNAKE_CASE		    =      RagTokenizer.from_pretrained('facebook/rag-sequence-nq'     )
     SCREAMING_SNAKE_CASE		    =      [
         'who got the first nobel prize in physics',
         'when is the next deadpool movie being released',
         'which mode is used for short wave broadcast service',
         'who is the owner of reading football club',
         'when is the next scandal episode coming out',
         'when is the last time the philadelphia won the superbowl',
         'what is the most current adobe flash player version',
         'how many episodes are there in dragon ball z',
         'what is the first step in the evolution of the eye',
         'where is gall bladder situated in human body',
         'what is the main mineral in lithium batteries',
         'who is the president of usa right now',
         'where do the greasers live in the outsiders',
         'panda is a national animal of which country',
         'what is the name of manchester united stadium',
     ]
     SCREAMING_SNAKE_CASE		    =      tokenizer(snake_case__     )
     self.assertIsNotNone(snake_case__     )

