

def      snake_case_				(__A					:						float					)      ->     float:

   if edge <= 0 or not isinstance(__A ,       __A					):
      raise ValueError("""Length must be a positive."""					)
   return 3 * ((2_5 + 1_0 * (5 ** (1 / 2))) ** (1 / 2)) * (edge**2)





def      snake_case_				(__A					:						float					)      ->     float:

   if edge <= 0 or not isinstance(__A ,       __A					):
      raise ValueError("""Length must be a positive."""					)
   return ((1_5 + (7 * (5 ** (1 / 2)))) / 4) * (edge**3)


if __name__ == "__main__":
   import doctest

   doctest.testmod()





import unittest

import numpy as np

from transformers import BertConfig, is_flax_available
from transformers.testing_utils import require_flax, slow

from ...test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor, ids_tensor, random_attention_mask


if is_flax_available():
   from transformers.models.bert.modeling_flax_bert import (
       FlaxBertForMaskedLM,
       FlaxBertForMultipleChoice,
       FlaxBertForNextSentencePrediction,
       FlaxBertForPreTraining,
       FlaxBertForQuestionAnswering,
       FlaxBertForSequenceClassification,
       FlaxBertForTokenClassification,
       FlaxBertModel,
   )



class SCREAMING_SNAKE_CASE     (  unittest.TestCase			):
  """simple docstring"""






  def __init__(      self			:   Tuple	,							lowerCAmelCase			:   Tuple	,							lowerCAmelCase			:   str=13	,							lowerCAmelCase			:   Optional[Any]=7	,							lowerCAmelCase			:   Optional[Any]=True	,							lowerCAmelCase			:   Any=True	,							lowerCAmelCase			:   str=True	,							lowerCAmelCase			:   Optional[Any]=True	,							lowerCAmelCase			:   Dict=99	,							lowerCAmelCase			:   Any=32	,							lowerCAmelCase			:   int=5	,							lowerCAmelCase			:   Tuple=4	,							lowerCAmelCase			:   Optional[Any]=37	,							lowerCAmelCase			:   str="gelu"	,							lowerCAmelCase			:   str=0.1	,							lowerCAmelCase			:   str=0.1	,							lowerCAmelCase			:   Any=5_12	,							lowerCAmelCase			:   Optional[Any]=16	,							lowerCAmelCase			:   Dict=2	,							lowerCAmelCase			:   Tuple=0.02	,							lowerCAmelCase			:   Optional[int]=4	,							)							->     List[Any]:






     """simple docstring"""







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







  def 	SCREAMING_SNAKE_CASE   (      self			:   Optional[int]   )							->     Dict:






     """simple docstring"""







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

     __lowerCAmelCase  :      Dict    =						None
     if self.use_attention_mask:
        __lowerCAmelCase  :      Optional[int]    =						random_attention_mask([self.batch_size, self.seq_length]   )

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

     __lowerCAmelCase  :      List[str]    =						BertConfig(
         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=lowerCAmelCase	,							initializer_range=self.initializer_range	,							)

     return config, input_ids, token_type_ids, attention_mask







  def 	SCREAMING_SNAKE_CASE   (      self			:   List[Any]   )							->     Optional[Any]:






     """simple docstring"""







     __lowerCAmelCase  :      Any    =						self.prepare_config_and_inputs()
     __lowerCAmelCase   ,__lowerCAmelCase   ,__lowerCAmelCase   ,__lowerCAmelCase  :      List[str]    =						config_and_inputs
     __lowerCAmelCase  :      Any    =						{"""input_ids""": input_ids, """token_type_ids""": token_type_ids, """attention_mask""": attention_mask}
     return config, inputs_dict







  def 	SCREAMING_SNAKE_CASE   (      self			:   Union[str, Any]   )							->     Tuple:






     """simple docstring"""







     __lowerCAmelCase  :      List[str]    =						self.prepare_config_and_inputs()
     __lowerCAmelCase   ,__lowerCAmelCase   ,__lowerCAmelCase   ,__lowerCAmelCase  :      Dict    =						config_and_inputs

     __lowerCAmelCase  :      Any    =						True
     __lowerCAmelCase  :      str    =						floats_tensor([self.batch_size, self.seq_length, self.hidden_size]   )
     __lowerCAmelCase  :      int    =						ids_tensor([self.batch_size, self.seq_length]	,							vocab_size=2   )

     return (
         config,
         input_ids,
         attention_mask,
         encoder_hidden_states,
         encoder_attention_mask,
     )






@require_flax
class SCREAMING_SNAKE_CASE     (  a_       ,							unittest.TestCase			):
  """simple docstring"""






  lowerCamelCase   :      int										=True

  lowerCamelCase   :      Any										=(
      (
          FlaxBertModel,
          FlaxBertForPreTraining,
          FlaxBertForMaskedLM,
          FlaxBertForMultipleChoice,
          FlaxBertForQuestionAnswering,
          FlaxBertForNextSentencePrediction,
          FlaxBertForSequenceClassification,
          FlaxBertForTokenClassification,
          FlaxBertForQuestionAnswering,
      )
      if is_flax_available()
      else ()
  )







  def 	SCREAMING_SNAKE_CASE   (      self			:   str   )							->     Union[str, Any]:






     """simple docstring"""







     __lowerCAmelCase  :      Union[str, Any]    =						FlaxBertModelTester(self   )







  @slow
  def 	SCREAMING_SNAKE_CASE   (      self			:   Dict   )							->     Dict:






     """simple docstring"""







     __lowerCAmelCase  :      int    =						FlaxBertModel.from_pretrained("""bert-base-cased"""   )
     __lowerCAmelCase  :      str    =						model(np.ones((1, 1)   )   )
     self.assertIsNotNone(lowerCAmelCase   )


