
import math
import unittest

from transformers import BioGptConfig, 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, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
     import torch

     from transformers import (
         BioGptForCausalLM,
         BioGptForSequenceClassification,
         BioGptForTokenClassification,
         BioGptModel,
         BioGptTokenizer,
     )
     from transformers.models.biogpt.modeling_biogpt import BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST



class       _snake_case   :


 def __init__(					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_=13					,  SCREAMING_SNAKE_CASE_=7					,  SCREAMING_SNAKE_CASE_=True					,  SCREAMING_SNAKE_CASE_=True					,  SCREAMING_SNAKE_CASE_=False					,  SCREAMING_SNAKE_CASE_=True					,  SCREAMING_SNAKE_CASE_=99					,  SCREAMING_SNAKE_CASE_=32					,  SCREAMING_SNAKE_CASE_=5					,  SCREAMING_SNAKE_CASE_=4					,  SCREAMING_SNAKE_CASE_=37					,  SCREAMING_SNAKE_CASE_="gelu"					,  SCREAMING_SNAKE_CASE_=0.1					,  SCREAMING_SNAKE_CASE_=0.1					,  SCREAMING_SNAKE_CASE_=5_12					,  SCREAMING_SNAKE_CASE_=16					,  SCREAMING_SNAKE_CASE_=2					,  SCREAMING_SNAKE_CASE_=0.0_2					,  SCREAMING_SNAKE_CASE_=3					,  SCREAMING_SNAKE_CASE_=4					,  SCREAMING_SNAKE_CASE_=None					,  ):


   '''simple docstring'''




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


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   int    		=      ids_tensor([self.batch_size, self.seq_length]					,  self.vocab_size)

   lowercase__  :   List[str]    		=      None
   if self.use_input_mask:
     lowercase__  :   int    		=      random_attention_mask([self.batch_size, self.seq_length])

   lowercase__  :   Optional[int]    		=      None
   if self.use_token_type_ids:
     lowercase__  :   List[str]    		=      ids_tensor([self.batch_size, self.seq_length]					,  self.type_vocab_size)

   lowercase__  :   int    		=      None
   lowercase__  :   int    		=      None
   lowercase__  :   Dict    		=      None
   if self.use_labels:
     lowercase__  :   Tuple    		=      ids_tensor([self.batch_size]					,  self.type_sequence_label_size)
     lowercase__  :   Optional[int]    		=      ids_tensor([self.batch_size, self.seq_length]					,  self.num_labels)
     lowercase__  :   Union[str, Any]    		=      ids_tensor([self.batch_size]					,  self.num_choices)

   lowercase__  :   Any    		=      self.get_config()

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


 def      lowercase__     (					self):


   '''simple docstring'''




   return BioGptConfig(
       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					,  is_decoder=__a					,  initializer_range=self.initializer_range					,  )


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   lowercase__  :   Tuple    		=      BioGptModel(config=__a)
   model.to(__a)
   model.eval()
   lowercase__  :   Optional[Any]    		=      model(__a					,  attention_mask=__a)
   lowercase__  :   Any    		=      model(__a)
   self.parent.assertEqual(result.last_hidden_state.shape					,  (self.batch_size, self.seq_length, self.hidden_size))


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  ):


   '''simple docstring'''




   lowercase__  :   Dict    		=      BioGptForCausalLM(config=__a)
   model.to(__a)
   model.eval()
   lowercase__  :   List[Any]    		=      model(__a					,  attention_mask=__a					,  token_type_ids=__a					,  labels=__a)
   self.parent.assertEqual(result.logits.shape					,  (self.batch_size, self.seq_length, self.vocab_size))


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  *SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   lowercase__  :   Optional[int]    		=      BioGptModel(config=__a)
   model.to(__a)
   model.eval()

   # create attention mask
   lowercase__  :   Dict    		=      torch.ones(input_ids.shape					,  dtype=torch.long					,  device=__a)
   lowercase__  :   str    		=      self.seq_length // 2
   lowercase__  :   int    		=      0

   # first forward pass
   lowercase__  :   List[Any]    		=      model(__a					,  attention_mask=__a).to_tuple()

   # create hypothetical next token and extent to next_input_ids
   lowercase__  :   int    		=      ids_tensor((self.batch_size, 1)					,  config.vocab_size)

   # change a random masked slice from input_ids
   lowercase__  :   Any    		=      ids_tensor((1,)					,  __a).item() + 1
   lowercase__  :   int    		=      ids_tensor((self.batch_size, 1)					,  config.vocab_size).squeeze(-1)
   lowercase__  :   Tuple    		=      random_other_next_tokens

   # append to next input_ids and attn_mask
   lowercase__  :   int    		=      torch.cat([input_ids, next_tokens]					,  dim=-1)
   lowercase__  :   int    		=      torch.cat(
       [attn_mask, torch.ones((attn_mask.shape[0], 1)					,  dtype=torch.long					,  device=__a)]					,  dim=1					,  )

   # get two different outputs
   lowercase__  :   Union[str, Any]    		=      model(__a					,  attention_mask=__a)["""last_hidden_state"""]
   lowercase__  :   Tuple    		=      model(__a					,  past_key_values=__a					,  attention_mask=__a)["""last_hidden_state"""]

   # select random slice
   lowercase__  :   Dict    		=      ids_tensor((1,)					,  output_from_past.shape[-1]).item()
   lowercase__  :   Dict    		=      output_from_no_past[:, -1, random_slice_idx].detach()
   lowercase__  :   Tuple    		=      output_from_past[:, 0, random_slice_idx].detach()

   # test that outputs are equal for slice
   self.parent.assertTrue(torch.allclose(__a					,  __a					,  atol=1E-3))


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  *SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   lowercase__  :   str    		=      BioGptModel(config=__a).to(__a).eval()

   lowercase__  :   Tuple    		=      torch.ones(input_ids.shape					,  dtype=torch.long					,  device=__a)

   # first forward pass
   lowercase__  :   List[str]    		=      model(__a					,  attention_mask=__a					,  use_cache=__a)

   lowercase__  :   Optional[Any]    		=      outputs.to_tuple()

   # create hypothetical multiple next token and extent to next_input_ids
   lowercase__  :   Dict    		=      ids_tensor((self.batch_size, 3)					,  config.vocab_size)
   lowercase__  :   Optional[int]    		=      ids_tensor((self.batch_size, 3)					,  2)

   # append to next input_ids and
   lowercase__  :   Tuple    		=      torch.cat([input_ids, next_tokens]					,  dim=-1)
   lowercase__  :   Tuple    		=      torch.cat([attention_mask, next_attn_mask]					,  dim=-1)

   lowercase__  :   int    		=      model(__a					,  attention_mask=__a)["""last_hidden_state"""]
   lowercase__  :   Optional[Any]    		=      model(__a					,  attention_mask=__a					,  past_key_values=__a)[
       """last_hidden_state"""
   ]

   # select random slice
   lowercase__  :   Tuple    		=      ids_tensor((1,)					,  output_from_past.shape[-1]).item()
   lowercase__  :   List[Any]    		=      output_from_no_past[:, -3:, random_slice_idx].detach()
   lowercase__  :   List[Any]    		=      output_from_past[:, :, random_slice_idx].detach()

   self.parent.assertTrue(output_from_past_slice.shape[1] == next_tokens.shape[1])

   # test that outputs are equal for slice
   self.parent.assertTrue(torch.allclose(__a					,  __a					,  atol=1E-3))


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  *SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_=False):


   '''simple docstring'''




   lowercase__  :   Dict    		=      BioGptForCausalLM(__a)
   model.to(__a)
   if gradient_checkpointing:
     model.gradient_checkpointing_enable()

   lowercase__  :   Optional[int]    		=      model(__a					,  labels=__a)
   self.parent.assertEqual(result.loss.shape					,  ())
   self.parent.assertEqual(result.logits.shape					,  (self.batch_size, self.seq_length, self.vocab_size))
   result.loss.backward()


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  *SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   lowercase__  :   List[str]    		=      BioGptModel(__a)
   lowercase__  :   Any    		=      model.config.initializer_range / math.sqrt(2 * model.config.num_hidden_layers)
   for key in model.state_dict().keys():
     if "c_proj" in key and "weight" in key:
       self.parent.assertLessEqual(abs(torch.std(model.state_dict()[key]) - model_std)					,  0.0_0_1)
       self.parent.assertLessEqual(abs(torch.mean(model.state_dict()[key]) - 0.0)					,  0.0_1)


 def      lowercase__     (					self					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  SCREAMING_SNAKE_CASE_					,  *SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   lowercase__  :   str    		=      self.num_labels
   lowercase__  :   str    		=      BioGptForTokenClassification(__a)
   model.to(__a)
   model.eval()
   lowercase__  :   List[str]    		=      model(__a					,  attention_mask=__a					,  token_type_ids=__a)
   self.parent.assertEqual(result.logits.shape					,  (self.batch_size, self.seq_length, self.num_labels))



 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Optional[Any]    		=      self.prepare_config_and_inputs()
   (
       lowercase__			
   )  :   int    		=      config_and_inputs
   lowercase__  :   List[str]    		=      {"""input_ids""": input_ids, """attention_mask""": input_mask}
   return config, inputs_dict



@require_torch
class       _snake_case   (	__lowercase  ,						__lowercase  ,						__lowercase  ,						unittest.TestCase							):
 __lowerCAmelCase  :     List[Any]        =			(
     (BioGptModel, BioGptForCausalLM, BioGptForSequenceClassification, BioGptForTokenClassification)
     if is_torch_available()
     else ()
 )
 __lowerCAmelCase  :     Union[str, Any]        =			(BioGptForCausalLM,) if is_torch_available() else ()
 __lowerCAmelCase  :     Dict        =			(
     {
         '''feature-extraction''': BioGptModel,
         '''text-classification''': BioGptForSequenceClassification,
         '''text-generation''': BioGptForCausalLM,
         '''token-classification''': BioGptForTokenClassification,
         '''zero-shot''': BioGptForSequenceClassification,
     }
     if is_torch_available()
     else {}
 )
 __lowerCAmelCase  :     List[Any]        =			False


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Any    		=      BioGptModelTester(self)
   lowercase__  :   List[Any]    		=      ConfigTester(self					,  config_class=__a					,  hidden_size=37)


 def      lowercase__     (					self):


   '''simple docstring'''




   self.config_tester.run_common_tests()


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Tuple    		=      self.model_tester.prepare_config_and_inputs()
   self.model_tester.create_and_check_model(*__a)


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Tuple    		=      self.model_tester.prepare_config_and_inputs()
   for type in ["absolute", "relative_key", "relative_key_query"]:
     lowercase__  :   Optional[Any]    		=      type
     self.model_tester.create_and_check_model(*__a)


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   List[Any]    		=      self.model_tester.prepare_config_and_inputs()
   self.model_tester.create_and_check_biogpt_model_attention_mask_past(*__a)


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Dict    		=      self.model_tester.prepare_config_and_inputs()
   self.model_tester.create_and_check_forward_and_backwards(*__a					,  gradient_checkpointing=__a)


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Optional[Any]    		=      self.model_tester.prepare_config_and_inputs()
   self.model_tester.create_and_check_biogpt_model_past_large_inputs(*__a)


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Optional[Any]    		=      self.model_tester.prepare_config_and_inputs()
   self.model_tester.create_and_check_biogpt_weight_initialization(*__a)


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Tuple    		=      self.model_tester.prepare_config_and_inputs()
   self.model_tester.create_and_check_biogpt_for_token_classification(*__a)


 @slow
 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Union[str, Any]    		=      BioGptForCausalLM.from_pretrained("""microsoft/biogpt""")
   model.to(__a)
   lowercase__  :   Optional[Any]    		=      BioGptTokenizer.from_pretrained("""microsoft/biogpt""")

   lowercase__  :   Optional[int]    		=      """left"""

   # Define PAD Token = EOS Token = 50256
   lowercase__  :   List[str]    		=      tokenizer.eos_token
   lowercase__  :   str    		=      model.config.eos_token_id

   # use different length sentences to test batching
   lowercase__  :   int    		=      [
       """Hello, my dog is a little""",
       """Today, I""",
   ]

   lowercase__  :   Union[str, Any]    		=      tokenizer(__a					,  return_tensors="""pt"""					,  padding=__a)
   lowercase__  :   Any    		=      inputs["""input_ids"""].to(__a)

   lowercase__  :   Any    		=      model.generate(
       input_ids=__a					,  attention_mask=inputs["""attention_mask"""].to(__a)					,  )

   lowercase__  :   str    		=      tokenizer(sentences[0]					,  return_tensors="""pt""").input_ids.to(__a)
   lowercase__  :   List[Any]    		=      model.generate(input_ids=__a)

   lowercase__  :   List[Any]    		=      inputs_non_padded.shape[-1] - inputs["""attention_mask"""][-1].long().sum().cpu().item()
   lowercase__  :   List[Any]    		=      tokenizer(sentences[1]					,  return_tensors="""pt""").input_ids.to(__a)
   lowercase__  :   Dict    		=      model.generate(input_ids=__a					,  max_length=model.config.max_length - num_paddings)

   lowercase__  :   List[Any]    		=      tokenizer.batch_decode(__a					,  skip_special_tokens=__a)
   lowercase__  :   List[Any]    		=      tokenizer.decode(output_non_padded[0]					,  skip_special_tokens=__a)
   lowercase__  :   List[str]    		=      tokenizer.decode(output_padded[0]					,  skip_special_tokens=__a)

   lowercase__  :   Optional[Any]    		=      [
       """Hello, my dog is a little bit bigger than a little bit.""",
       """Today, I have a good idea of how to use the information""",
   ]
   self.assertListEqual(__a					,  __a)
   self.assertListEqual(__a					,  [non_padded_sentence, padded_sentence])


 @slow
 def      lowercase__     (					self):


   '''simple docstring'''




   for model_name in BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
     lowercase__  :   Optional[Any]    		=      BioGptModel.from_pretrained(__a)
     self.assertIsNotNone(__a)


 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Optional[int]    		=      self.model_tester.prepare_config_and_inputs_for_common()
   lowercase__  :   List[str]    		=      3
   lowercase__  :   Dict    		=      input_dict["""input_ids"""]
   lowercase__  :   str    		=      input_ids.ne(1).to(__a)
   lowercase__  :   List[Any]    		=      ids_tensor([self.model_tester.batch_size]					,  self.model_tester.type_sequence_label_size)
   lowercase__  :   Tuple    		=      BioGptForSequenceClassification(__a)
   model.to(__a)
   model.eval()
   lowercase__  :   List[str]    		=      model(__a					,  attention_mask=__a					,  labels=__a)
   self.assertEqual(result.logits.shape					,  (self.model_tester.batch_size, self.model_tester.num_labels))



 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Any    		=      self.model_tester.prepare_config_and_inputs_for_common()
   lowercase__  :   Dict    		=      3
   lowercase__  :   Optional[Any]    		=      """multi_label_classification"""
   lowercase__  :   Optional[Any]    		=      input_dict["""input_ids"""]
   lowercase__  :   Any    		=      input_ids.ne(1).to(__a)
   lowercase__  :   Optional[Any]    		=      ids_tensor(
       [self.model_tester.batch_size, config.num_labels]					,  self.model_tester.type_sequence_label_size).to(torch.float)
   lowercase__  :   List[Any]    		=      BioGptForSequenceClassification(__a)
   model.to(__a)
   model.eval()
   lowercase__  :   Optional[int]    		=      model(__a					,  attention_mask=__a					,  labels=__a)
   self.assertEqual(result.logits.shape					,  (self.model_tester.batch_size, self.model_tester.num_labels))



@require_torch
class       _snake_case   (	unittest.TestCase							):


 @slow
 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   Dict    		=      BioGptForCausalLM.from_pretrained("""microsoft/biogpt""")
   lowercase__  :   List[str]    		=      torch.tensor([[2, 48_05, 9, 6_56, 21]])
   lowercase__  :   Optional[int]    		=      model(__a)[0]

   lowercase__  :   int    		=      4_23_84

   lowercase__  :   Dict    		=      torch.Size((1, 5, vocab_size))
   self.assertEqual(output.shape					,  __a)

   lowercase__  :   int    		=      torch.tensor(
       [[[-9.5_2_3_6, -9.8_9_1_8, 1_0.4_5_5_7], [-1_1.0_4_6_9, -9.6_4_2_3, 8.1_0_2_2], [-8.8_6_6_4, -7.8_8_2_6, 5.5_3_2_5]]])

   self.assertTrue(torch.allclose(output[:, :3, :3]					,  __a					,  atol=1E-4))



 @slow
 def      lowercase__     (					self):


   '''simple docstring'''




   lowercase__  :   str    		=      BioGptTokenizer.from_pretrained("""microsoft/biogpt""")
   lowercase__  :   int    		=      BioGptForCausalLM.from_pretrained("""microsoft/biogpt""")
   model.to(__a)

   torch.manual_seed(0)
   lowercase__  :   Dict    		=      tokenizer("""COVID-19 is"""					,  return_tensors="""pt""").to(__a)
   lowercase__  :   str    		=      model.generate(
       **__a					,  min_length=1_00					,  max_length=10_24					,  num_beams=5					,  early_stopping=__a					,  )
   lowercase__  :   int    		=      tokenizer.decode(output_ids[0]					,  skip_special_tokens=__a)

   lowercase__  :   Dict    		=      (
       """COVID-19 is a global pandemic caused by severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), the"""
       """ causative agent of coronavirus disease 2019 (COVID-19), which has spread to more than 200 countries and"""
       """ territories, including the United States (US), Canada, Australia, New Zealand, the United Kingdom (UK),"""
       """ and the United States of America (USA), as of March 11, 2020, with more than 800,000 confirmed cases and"""
       """ more than 800,000 deaths."""
   )
   self.assertEqual(__a					,  __a)








from ..utils import DummyObject, requires_backends



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     Any        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     Any        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     Union[str, Any]        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     int        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     Optional[Any]        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     Tuple        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     List[str]        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     Union[str, Any]        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     Optional[Any]        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     Dict        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     Optional[Any]        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     Optional[Any]        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



class       _snake_case   (	metaclass=UpperCAmelCase_							):
 __lowerCAmelCase  :     List[Any]        =			['flax']


 def __init__(					self					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(self					,  ["""flax"""])


 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])



 @classmethod
 def      lowercase__     (					cls					,  *SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_):


   '''simple docstring'''




   requires_backends(cls					,  ["""flax"""])






