'''simple docstring'''





def 	lowerCAmelCase_				(					snake_case_       : str			)    ->      bool:


     '''simple docstring'''




     return credit_card_number.startswith(("34", "35", "37", "4", "5", "6")			)





def 	lowerCAmelCase_				(					snake_case_       : str			)    ->      bool:


     '''simple docstring'''




     UpperCAmelCase_           =   credit_card_number
     UpperCAmelCase_           =   0
     UpperCAmelCase_           =   len(snake_case_			) - 2
     for i in range(snake_case_					,    -1					,    -2			):
          #  double the value of every second digit
          UpperCAmelCase_           =   int(cc_number[i]			)
          digit *= 2
          # If doubling of a number results in a two digit number
          # i.e greater than 9(e.g., 6 × 2 = 12),
          # then add the digits of the product (e.g., 12: 1 + 2 = 3, 15: 1 + 5 = 6),
          # to get a single digit number.
          if digit > 9:
               digit %= 10
               digit += 1
          UpperCAmelCase_           =   cc_number[:i] + str(snake_case_			) + cc_number[i + 1 :]
          total += digit

     # Sum up the remaining digits
     for i in range(len(snake_case_			) - 1					,    -1					,    -2			):
          total += int(cc_number[i]			)

     return total % 10 == 0





def 	lowerCAmelCase_				(					snake_case_       : str			)    ->      bool:


     '''simple docstring'''




     UpperCAmelCase_           =   f"""{credit_card_number} is an invalid credit card number because"""
     if not credit_card_number.isdigit():
          print(f"""{error_message} it has nonnumerical characters."""			)
          return False

     if not 13 <= len(snake_case_			) <= 16:
          print(f"""{error_message} of its length."""			)
          return False

     if not validate_initial_digits(snake_case_			):
          print(f"""{error_message} of its first two digits."""			)
          return False

     if not luhn_validation(snake_case_			):
          print(f"""{error_message} it fails the Luhn check."""			)
          return False

     print(f"""{credit_card_number} is a valid credit card number."""			)
     return True


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    validate_credit_card_number('4111111111111111')
    validate_credit_card_number('32323')





'''simple docstring'''





from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE_:     Dict  =logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_:     Tuple  ={}




class        __A      ( UpperCamelCase__	):
    a__       :						int          =  """llama"""
    a__       :						Any          =  ["""past_key_values"""]



    def __init__(self    :    List[str]   ,			__a    :    List[str]=32000   ,			__a    :    Tuple=4096   ,			__a    :    List[Any]=11008   ,			__a    :    Dict=32   ,			__a    :    Tuple=32   ,			__a    :    Any=None   ,			__a    :    Any="silu"   ,			__a    :    List[Any]=2048   ,			__a    :    List[Any]=0.02   ,			__a    :    str=1E-6   ,			__a    :    Optional[Any]=True   ,			__a    :    Union[str, Any]=0   ,			__a    :    Any=1   ,			__a    :    Dict=2   ,			__a    :    Dict=1   ,			__a    :    str=False   ,			__a    :    str=None   ,			**__a    :    Optional[Any]   ,			):
         UpperCAmelCase_           =   vocab_size
         UpperCAmelCase_           =   max_position_embeddings
         UpperCAmelCase_           =   hidden_size
         UpperCAmelCase_           =   intermediate_size
         UpperCAmelCase_           =   num_hidden_layers
         UpperCAmelCase_           =   num_attention_heads

         # for backward compatibility
         if num_key_value_heads is None:
              UpperCAmelCase_           =   num_attention_heads

         UpperCAmelCase_           =   num_key_value_heads
         UpperCAmelCase_           =   hidden_act
         UpperCAmelCase_           =   initializer_range
         UpperCAmelCase_           =   rms_norm_eps
         UpperCAmelCase_           =   pretraining_tp
         UpperCAmelCase_           =   use_cache
         UpperCAmelCase_           =   rope_scaling
         self._rope_scaling_validation()

         super().__init__(
             pad_token_id=__a   ,			bos_token_id=__a   ,			eos_token_id=__a   ,			tie_word_embeddings=__a   ,			**__a   ,			)






    def 					_lowercase						(self    :    List[str] ):
         if self.rope_scaling is None:
              return

         if not isinstance(self.rope_scaling   ,			__a ) or len(self.rope_scaling ) != 2:
              raise ValueError(
                  "`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, "
                  f"""got {self.rope_scaling}""" )
         UpperCAmelCase_           =   self.rope_scaling.get("type"   ,			__a )
         UpperCAmelCase_           =   self.rope_scaling.get("factor"   ,			__a )
         if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
              raise ValueError(
                  f"""`rope_scaling`'s name field must be one of ['linear', 'dynamic'], got {rope_scaling_type}""" )
         if rope_scaling_factor is None or not isinstance(__a   ,			__a ) or rope_scaling_factor <= 1.0:
              raise ValueError(f"""`rope_scaling`'s factor field must be an float > 1, got {rope_scaling_factor}""" )




