






"""simple docstring"""







import copy
import random

from transformers import CLIPTokenizer







class  lowerCamelCase__ (	snake_case			):






    def __init__(			self     ,*A     ,**A ):
          super().__init__(*A     ,**A )
          UpperCAmelCase          =	{}






    def     _UpperCamelCase							(			self     ,A     ,*A     ,**A ):
          UpperCAmelCase          =	super().add_tokens(A     ,*A     ,**A )
          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     _UpperCamelCase							(			self     ,A     ,*A     ,A=1     ,**A ):
          UpperCAmelCase          =	[]
          if num_vec_per_token == 1:
                self.try_adding_tokens(A     ,*A     ,**A )
                output.append(A )
          else:
                UpperCAmelCase          =	[]
                for i in range(A ):
                      UpperCAmelCase          =	placeholder_token + F'''_{i}'''
                      self.try_adding_tokens(A     ,*A     ,**A )
                      output.append(A )
        # 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''' )
          UpperCAmelCase          =	output






    def     _UpperCamelCase							(			self     ,A     ,A=False     ,A=1.0 ):
          if isinstance(A     ,A ):
                UpperCAmelCase          =	[]
                for i in range(len(A ) ):
                      output.append(self.replace_placeholder_tokens_in_text(text[i]     ,vector_shuffle=A ) )
                return output
          for placeholder_token in self.token_map:
                if placeholder_token in text:
                      UpperCAmelCase          =	self.token_map[placeholder_token]
                      UpperCAmelCase          =	tokens[: 1 + int(len(A ) * prop_tokens_to_load )]
                      if vector_shuffle:
                            UpperCAmelCase          =	copy.copy(A )
                            random.shuffle(A )
                      UpperCAmelCase          =	text.replace(A     ,""" """.join(A ) )
          return text






    def __call__(			self     ,A     ,*A     ,A=False     ,A=1.0     ,**A ):
          return super().__call__(
              self.replace_placeholder_tokens_in_text(
                  A     ,vector_shuffle=A     ,prop_tokens_to_load=A )     ,*A     ,**A     ,)






    def     _UpperCamelCase							(			self     ,A     ,*A     ,A=False     ,A=1.0     ,**A ):
          return super().encode(
              self.replace_placeholder_tokens_in_text(
                  A     ,vector_shuffle=A     ,prop_tokens_to_load=A )     ,*A     ,**A     ,)











"""simple docstring"""







_UpperCamelCase					      =  [4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
_UpperCamelCase					      =  [3, 7, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
_UpperCamelCase					      =  {
    0: """Sunday""",
    1: """Monday""",
    2: """Tuesday""",
    3: """Wednesday""",
    4: """Thursday""",
    5: """Friday""",
    6: """Saturday""",
}

def _a			(		_snake_case				,	_snake_case				,	_snake_case							):







      """simple docstring"""






      assert len(str(_snake_case							)							) > 2, "year should be in YYYY format"
      assert 1 <= month <= 12, "month should be between 1 to 12"
      assert 1 <= day <= 31, "day should be between 1 to 31"

      # Doomsday algorithm:
      UpperCAmelCase          =	year // 100
      UpperCAmelCase          =	(5 * (century % 4) + 2) % 7
      UpperCAmelCase          =	year % 100
      UpperCAmelCase          =	centurian % 12
      UpperCAmelCase          =	(
          (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
      ) % 7
      UpperCAmelCase          =	(
          DOOMSDAY_NOT_LEAP[month - 1]
          if (year % 4 != 0) or (centurian == 0 and (year % 400) == 0)
          else DOOMSDAY_LEAP[month - 1]
      )
      UpperCAmelCase          =	(dooms_day + day - day_anchor) % 7
      return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
  import doctest

  doctest.testmod()



