import copy
import random

from transformers import CLIPTokenizer




class        __snake_case	(					lowercase__    ):



      def __init__(						self   ,      *lowercase   ,      **lowercase)     ->      Dict:





        '''simple docstring'''





        super().__init__(*_UpperCamelCase   ,      **_UpperCamelCase)
        a__:					Optional[int]      							=     {}



      def   lowerCamelCase_       (						self   ,      lowercase   ,      *lowercase   ,      **lowercase)     ->      Any:





        '''simple docstring'''





        a__:					Dict      							=     super().add_tokens(_UpperCamelCase   ,      *_UpperCamelCase   ,      **_UpperCamelCase)
        if num_added_tokens == 0:
          raise ValueError(
              f'The tokenizer already contains the token {placeholder_token}. Please pass a different'
              ' `placeholder_token` that is not already in the tokenizer.')



      def   lowerCamelCase_       (						self   ,      lowercase   ,      *lowercase   ,      lowercase=1   ,      **lowercase)     ->      Any:





        '''simple docstring'''





        a__:					Any      							=     []
        if num_vec_per_token == 1:
          self.try_adding_tokens(_UpperCamelCase   ,      *_UpperCamelCase   ,      **_UpperCamelCase)
          output.append(_UpperCamelCase)
        else:
          a__:					List[Any]      							=     []
          for i in range(_UpperCamelCase):
            a__:					List[Any]      							=     placeholder_token + f'_{i}'
            self.try_adding_tokens(_UpperCamelCase   ,      *_UpperCamelCase   ,      **_UpperCamelCase)
            output.append(_UpperCamelCase)
        # handle cases where there is a new placeholder token that contains the current placeholder token but is larger
        for token in self.token_map:
          if token in placeholder_token:
            raise ValueError(
                f'The tokenizer already has placeholder token {token} that can get confused with'
                f' {placeholder_token}keep placeholder tokens independent')
        a__:					Optional[Any]      							=     output



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase=False   ,      lowercase=1.0)     ->      Dict:





        '''simple docstring'''





        if isinstance(_UpperCamelCase   ,      _UpperCamelCase):
          a__:					Optional[int]      							=     []
          for i in range(len(_UpperCamelCase)):
            output.append(self.replace_placeholder_tokens_in_text(text[i]   ,      vector_shuffle=_UpperCamelCase))
          return output
        for placeholder_token in self.token_map:
          if placeholder_token in text:
            a__:					Tuple      							=     self.token_map[placeholder_token]
            a__:					Union[str, Any]      							=     tokens[: 1 + int(len(_UpperCamelCase) * prop_tokens_to_load)]
            if vector_shuffle:
              a__:					Optional[Any]      							=     copy.copy(_UpperCamelCase)
              random.shuffle(_UpperCamelCase)
            a__:					List[str]      							=     text.replace(_UpperCamelCase   ,      ' '.join(_UpperCamelCase))
        return text



      def __call__(						self   ,      lowercase   ,      *lowercase   ,      lowercase=False   ,      lowercase=1.0   ,      **lowercase)     ->      List[Any]:





        '''simple docstring'''





        return super().__call__(
            self.replace_placeholder_tokens_in_text(
                _UpperCamelCase   ,      vector_shuffle=_UpperCamelCase   ,      prop_tokens_to_load=_UpperCamelCase)   ,      *_UpperCamelCase   ,      **_UpperCamelCase   ,      )



      def   lowerCamelCase_       (						self   ,      lowercase   ,      *lowercase   ,      lowercase=False   ,      lowercase=1.0   ,      **lowercase)     ->      Union[str, Any]:





        '''simple docstring'''





        return super().encode(
            self.replace_placeholder_tokens_in_text(
                _UpperCamelCase   ,      vector_shuffle=_UpperCamelCase   ,      prop_tokens_to_load=_UpperCamelCase)   ,      *_UpperCamelCase   ,      **_UpperCamelCase   ,      )



"""simple docstring"""
def 						__a       (     _SCREAMING_SNAKE_CASE       )     ->bool:
  return credit_card_number.startswith(('34', '35', '37', '4', '5', '6')       )







def 						__a       (     _SCREAMING_SNAKE_CASE       )     ->bool:
  a__:					Any      							=     credit_card_number
  a__:					Tuple      							=     0
  a__:					List[str]      							=     len(_SCREAMING_SNAKE_CASE       ) - 2
  for i in range(_SCREAMING_SNAKE_CASE		,					-1		,					-2       ):
    #  double the value of every second digit
    a__:					Tuple      							=     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
    a__:					Optional[Any]      							=     cc_number[:i] + str(_SCREAMING_SNAKE_CASE       ) + cc_number[i + 1 :]
    total += digit

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

  return total % 10 == 0







def 						__a       (     _SCREAMING_SNAKE_CASE       )     ->bool:
  a__:					Optional[int]      							=     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(_SCREAMING_SNAKE_CASE       ) <= 16:
    print(F'{error_message} of its length.'       )
    return False

  if not validate_initial_digits(_SCREAMING_SNAKE_CASE       ):
    print(F'{error_message} of its first two digits.'       )
    return False

  if not luhn_validation(_SCREAMING_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')


