


"""simple docstring"""







import unittest

import numpy as np

from transformers import AlbertConfig, 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():
 import jax.numpy as jnp

 from transformers.models.albert.modeling_flax_albert import (
     FlaxAlbertForMaskedLM,
     FlaxAlbertForMultipleChoice,
     FlaxAlbertForPreTraining,
     FlaxAlbertForQuestionAnswering,
     FlaxAlbertForSequenceClassification,
     FlaxAlbertForTokenClassification,
     FlaxAlbertModel,
 )






class 						_A  (  unittest.TestCase  ):







    """simple docstring"""




    def __init__(					self				:    List[Any]				, __UpperCAmelCase				:    List[Any]				, __UpperCAmelCase				:    Optional[Any]=13				, __UpperCAmelCase				:    List[str]=7				, __UpperCAmelCase				:    Optional[int]=True				, __UpperCAmelCase				:    List[str]=True				, __UpperCAmelCase				:    List[Any]=True				, __UpperCAmelCase				:    List[str]=True				, __UpperCAmelCase				:    Optional[Any]=99				, __UpperCAmelCase				:    List[str]=32				, __UpperCAmelCase				:    List[Any]=5				, __UpperCAmelCase				:    Optional[int]=4				, __UpperCAmelCase				:    List[str]=37				, __UpperCAmelCase				:    List[Any]="gelu"				, __UpperCAmelCase				:    Any=0.1				, __UpperCAmelCase				:    Tuple=0.1				, __UpperCAmelCase				:    List[str]=512				, __UpperCAmelCase				:    List[str]=16				, __UpperCAmelCase				:    List[str]=2				, __UpperCAmelCase				:    int=0.02				, __UpperCAmelCase				:    Dict=4				, ):
      a						:		Any      							=			parent
      a						:		Any      							=			batch_size
      a						:		List[str]      							=			seq_length
      a						:		Optional[Any]      							=			is_training
      a						:		int      							=			use_attention_mask
      a						:		Optional[Any]      							=			use_token_type_ids
      a						:		Any      							=			use_labels
      a						:		Any      							=			vocab_size
      a						:		Any      							=			hidden_size
      a						:		Any      							=			num_hidden_layers
      a						:		Dict      							=			num_attention_heads
      a						:		str      							=			intermediate_size
      a						:		Any      							=			hidden_act
      a						:		str      							=			hidden_dropout_prob
      a						:		Union[str, Any]      							=			attention_probs_dropout_prob
      a						:		Tuple      							=			max_position_embeddings
      a						:		Dict      							=			type_vocab_size
      a						:		Dict      							=			type_sequence_label_size
      a						:		List[str]      							=			initializer_range
      a						:		List[Any]      							=			num_choices






    def 	__snake_case							(					self				:    str):
      a						:		Optional[int]      							=			ids_tensor([self.batch_size, self.seq_length]				, self.vocab_size)

      a						:		Any      							=			None
      if self.use_attention_mask:
        a						:		Any      							=			random_attention_mask([self.batch_size, self.seq_length])

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

      a						:		Union[str, Any]      							=			AlbertConfig(
          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=__UpperCAmelCase				, initializer_range=self.initializer_range				, )

      return config, input_ids, token_type_ids, attention_mask






    def 	__snake_case							(					self				:    Optional[int]):
      a						:		Any      							=			self.prepare_config_and_inputs()
      a							,		a							,		a							,		a						:		str      							=			config_and_inputs
      a						:		Any      							=			{"input_ids": input_ids, "token_type_ids": token_type_ids, "attention_mask": attention_mask}
      return config, inputs_dict






@require_flax
class 						_A  (  _a    ,unittest.TestCase  ):







    """simple docstring"""




    UpperCAmelCase       :							Union[str, Any]	=       (
        (
            FlaxAlbertModel,
            FlaxAlbertForPreTraining,
            FlaxAlbertForMaskedLM,
            FlaxAlbertForMultipleChoice,
            FlaxAlbertForQuestionAnswering,
            FlaxAlbertForSequenceClassification,
            FlaxAlbertForTokenClassification,
            FlaxAlbertForQuestionAnswering,
        )
        if is_flax_available()
        else ()
    )






    def 	__snake_case							(					self				:    str):
      a						:		List[Any]      							=			FlaxAlbertModelTester(self)






    @slow
    def 	__snake_case							(					self				:    Any):
      for model_class_name in self.all_model_classes:
        a						:		Dict      							=			model_class_name.from_pretrained("albert-base-v2")
        a						:		List[str]      							=			model(np.ones((1, 1)))
        self.assertIsNotNone(__UpperCAmelCase)






@require_flax
class 						_A  (  unittest.TestCase  ):







    """simple docstring"""




    @slow
    def 	__snake_case							(					self				:    int):
      a						:		Optional[Any]      							=			FlaxAlbertModel.from_pretrained("albert-base-v2")
      a						:		Tuple      							=			np.array([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 1588, 2]])
      a						:		Any      							=			np.array([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
      a						:		Tuple      							=			model(__UpperCAmelCase				, attention_mask=__UpperCAmelCase)[0]
      a						:		Optional[Any]      							=			(1, 11, 768)
      self.assertEqual(output.shape				, __UpperCAmelCase)
      a						:		Optional[Any]      							=			np.array(
          [[[-0.6_513, 1.5_035, -0.2_766], [-0.6_515, 1.5_046, -0.2_780], [-0.6_512, 1.5_049, -0.2_784]]])

      self.assertTrue(jnp.allclose(output[:, 1:4, 1:4]				, __UpperCAmelCase				, atol=1e-4))










"""simple docstring"""







def      lowercase			(				A_       )->      bool:
  '''simple docstring'''







  if not all(x.isalpha() for x in string       ):
    raise ValueError("String must only contain alphabetic characters."       )

  a						:		Tuple      							=			sorted(string.lower()       )
  return len(A_       ) == len(set(A_       )       )


if __name__ == "__main__":
 __lowercase    					=      input("""Enter a string """).strip()

 __lowercase    					=      is_isogram(input_str)
 print(f'''{input_str} is {'an' if isogram else 'not an'} isogram.''')






