code: 
  
  
  '''simple docstring'''
  
  
  
  import unittest
  
  import numpy as np
  
  from transformers import ElectraConfig, is_flax_available
  from transformers.testing_utils import require_flax, slow
  
  from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, random_attention_mask
  
  
  if is_flax_available():
        from transformers.models.electra.modeling_flax_electra import (
            FlaxElectraForCausalLM,
            FlaxElectraForMaskedLM,
            FlaxElectraForMultipleChoice,
            FlaxElectraForPreTraining,
            FlaxElectraForQuestionAnswering,
            FlaxElectraForSequenceClassification,
            FlaxElectraForTokenClassification,
            FlaxElectraModel,
        )
  
  
  
  
  
  class      UpperCAmelCase_						(unittest.TestCase						):
  
  
  
  
  
      """simple docstring"""
  
  
  
  
  
  
      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_=True    ,  SCREAMING_SNAKE_CASE_=True    ,  SCREAMING_SNAKE_CASE_=99    ,  SCREAMING_SNAKE_CASE_=24    ,  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_=4    ,  )       ->  Union[str, Any]:
           __lowerCamelCase     :			List[str]              =	parent
           __lowerCamelCase     :			Optional[int]              =	batch_size
           __lowerCamelCase     :			List[str]              =	seq_length
           __lowerCamelCase     :			List[Any]              =	is_training
           __lowerCamelCase     :			int              =	use_attention_mask
           __lowerCamelCase     :			str              =	use_token_type_ids
           __lowerCamelCase     :			List[Any]              =	use_labels
           __lowerCamelCase     :			Union[str, Any]              =	vocab_size
           __lowerCamelCase     :			str              =	hidden_size
           __lowerCamelCase     :			Dict              =	embedding_size
           __lowerCamelCase     :			Optional[int]              =	num_hidden_layers
           __lowerCamelCase     :			Any              =	num_attention_heads
           __lowerCamelCase     :			Optional[int]              =	intermediate_size
           __lowerCamelCase     :			int              =	hidden_act
           __lowerCamelCase     :			List[str]              =	hidden_dropout_prob
           __lowerCamelCase     :			List[Any]              =	attention_probs_dropout_prob
           __lowerCamelCase     :			List[Any]              =	max_position_embeddings
           __lowerCamelCase     :			int              =	type_vocab_size
           __lowerCamelCase     :			Any              =	type_sequence_label_size
           __lowerCamelCase     :			int              =	initializer_range
           __lowerCamelCase     :			Optional[Any]              =	num_choices
  
  
  
  
  
  
  
      def    lowercase_       (							self			)       ->  Tuple:
           __lowerCamelCase     :			Optional[Any]              =	ids_tensor([self.batch_size, self.seq_length]    ,  self.vocab_size			)
  
           __lowerCamelCase     :			Any              =	None
           if self.use_attention_mask:
                __lowerCamelCase     :			int              =	random_attention_mask([self.batch_size, self.seq_length]			)
  
           __lowerCamelCase     :			Optional[int]              =	None
           if self.use_token_type_ids:
                __lowerCamelCase     :			Optional[Any]              =	ids_tensor([self.batch_size, self.seq_length]    ,  self.type_vocab_size			)
  
           __lowerCamelCase     :			int              =	ElectraConfig(
               vocab_size=self.vocab_size    ,  hidden_size=self.hidden_size    ,  embedding_size=self.embedding_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 config, input_ids, token_type_ids, attention_mask
  
  
  
  
  
  
  
      def    lowercase_       (							self			)       ->  Optional[int]:
           __lowerCamelCase     :			Optional[Any]              =	self.prepare_config_and_inputs()
           __lowerCamelCase       , __lowerCamelCase       , __lowerCamelCase       , __lowerCamelCase     :			Any              =	config_and_inputs
           __lowerCamelCase     :			Tuple              =	{'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': attention_mask}
           return config, inputs_dict
  
  
  
  
  
  
  
  @require_flax
  class      UpperCAmelCase_						(_UpperCAmelCase      ,	unittest.TestCase						):
  
  
  
  
  
      """simple docstring"""
  
  
  
  
  
  
      lowerCamelCase						:      int							  =    True
  
      lowerCamelCase						:      Any							  =    (
          (
              FlaxElectraModel,
              FlaxElectraForCausalLM,
              FlaxElectraForMaskedLM,
              FlaxElectraForPreTraining,
              FlaxElectraForTokenClassification,
              FlaxElectraForQuestionAnswering,
              FlaxElectraForMultipleChoice,
              FlaxElectraForSequenceClassification,
          )
          if is_flax_available()
          else ()
      )
  
  
  
  
  
  
  
      def    lowercase_       (							self			)       ->  List[Any]:
           __lowerCamelCase     :			Any              =	FlaxElectraModelTester(self			)
  
  
  
  
  
  
  
      @slow
      def    lowercase_       (							self			)       ->  Optional[int]:
           for model_class_name in self.all_model_classes:
                if model_class_name == FlaxElectraForMaskedLM:
                     __lowerCamelCase     :			List[Any]              =	model_class_name.from_pretrained('google/electra-small-generator'			)
                else:
                     __lowerCamelCase     :			Optional[Any]              =	model_class_name.from_pretrained('google/electra-small-discriminator'			)
                __lowerCamelCase     :			Optional[int]              =	model(np.ones((1, 1)			)			)
                self.assertIsNotNone(SCREAMING_SNAKE_CASE_			)
  
  
  
  
  
  
  
style_context: 
  
  
  '''simple docstring'''
  
  
  
  from typing import TYPE_CHECKING
  
  from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available
  
  
  A__	:      List[str]				=						{
      """configuration_flaubert""": ["""FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """FlaubertConfig""", """FlaubertOnnxConfig"""],
      """tokenization_flaubert""": ["""FlaubertTokenizer"""],
  }
  
  try:
        if not is_torch_available():
              raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
        pass
  else:
        A__	:      int				=						[
            """FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
            """FlaubertForMultipleChoice""",
            """FlaubertForQuestionAnswering""",
            """FlaubertForQuestionAnsweringSimple""",
            """FlaubertForSequenceClassification""",
            """FlaubertForTokenClassification""",
            """FlaubertModel""",
            """FlaubertWithLMHeadModel""",
            """FlaubertPreTrainedModel""",
        ]
  
  try:
        if not is_tf_available():
              raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
        pass
  else:
        A__	:      int				=						[
            """TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
            """TFFlaubertForMultipleChoice""",
            """TFFlaubertForQuestionAnsweringSimple""",
            """TFFlaubertForSequenceClassification""",
            """TFFlaubertForTokenClassification""",
            """TFFlaubertModel""",
            """TFFlaubertPreTrainedModel""",
            """TFFlaubertWithLMHeadModel""",
        ]
  
  
  if TYPE_CHECKING:
        from .configuration_flaubert import FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, FlaubertConfig, FlaubertOnnxConfig
        from .tokenization_flaubert import FlaubertTokenizer
  
        try:
              if not is_torch_available():
                    raise OptionalDependencyNotAvailable()
        except OptionalDependencyNotAvailable:
              pass
        else:
              from .modeling_flaubert import (
                  FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  FlaubertForMultipleChoice,
                  FlaubertForQuestionAnswering,
                  FlaubertForQuestionAnsweringSimple,
                  FlaubertForSequenceClassification,
                  FlaubertForTokenClassification,
                  FlaubertModel,
                  FlaubertPreTrainedModel,
                  FlaubertWithLMHeadModel,
              )
  
        try:
              if not is_tf_available():
                    raise OptionalDependencyNotAvailable()
        except OptionalDependencyNotAvailable:
              pass
        else:
              from .modeling_tf_flaubert import (
                  TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  TFFlaubertForMultipleChoice,
                  TFFlaubertForQuestionAnsweringSimple,
                  TFFlaubertForSequenceClassification,
                  TFFlaubertForTokenClassification,
                  TFFlaubertModel,
                  TFFlaubertPreTrainedModel,
                  TFFlaubertWithLMHeadModel,
              )
  
  else:
        import sys
  
        A__	:      Tuple				=						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
  
  
  
  
  
  
  