



"""simple docstring"""




import argparse
import datetime

def 		__snake_case		( SCREAMING_SNAKE_CASE__      :		str							)    ->  str:





     '''simple docstring'''

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

     _UpperCAmelCase     :      int														=       {0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0}

     # Validate
     if not 0 < len(SCREAMING_SNAKE_CASE__							) < 11:
          raise ValueError("Must be 10 characters long"							)

     # Get month
     _UpperCAmelCase     :      int														=       int(date_input[0] + date_input[1]							)
     # Validate
     if not 0 < m < 13:
          raise ValueError("Month must be between 1 - 12"							)

     _UpperCAmelCase     :      str														=       date_input[2]
     # Validate
     if sep_a not in ["-", "/"]:
          raise ValueError("Date separator must be '-' or '/'"							)

     # Get day
     _UpperCAmelCase     :      int														=       int(date_input[3] + date_input[4]							)
     # Validate
     if not 0 < d < 32:
          raise ValueError("Date must be between 1 - 31"							)

     # Get second separator
     _UpperCAmelCase     :      str														=       date_input[5]
     # Validate
     if sep_a not in ["-", "/"]:
          raise ValueError("Date separator must be '-' or '/'"							)

     # Get year
     _UpperCAmelCase     :      int														=       int(date_input[6] + date_input[7] + date_input[8] + date_input[9]							)
     # Arbitrary year range
     if not 45 < y < 8_500:
          raise ValueError(
              "Year out of range. There has to be some sort of limit...right?"							)

     # Get datetime obj for validation
     _UpperCAmelCase     :      Tuple														=       datetime.date(int(SCREAMING_SNAKE_CASE__							)		,    int(SCREAMING_SNAKE_CASE__							)		,    int(SCREAMING_SNAKE_CASE__							)							)

     # Start math
     if m <= 2:
          _UpperCAmelCase     :      int														=       y - 1
          _UpperCAmelCase     :      Optional[int]														=       m + 12
     # maths var
     _UpperCAmelCase     :      int														=       int(str(SCREAMING_SNAKE_CASE__							)[:2]							)
     _UpperCAmelCase     :      int														=       int(str(SCREAMING_SNAKE_CASE__							)[2:]							)
     _UpperCAmelCase     :      int														=       int(2.6 * m - 5.39							)
     _UpperCAmelCase     :      int														=       int(c / 4							)
     _UpperCAmelCase     :      int														=       int(k / 4							)
     _UpperCAmelCase     :      int														=       int(d + k							)
     _UpperCAmelCase     :      int														=       int(t + u + v + x							)
     _UpperCAmelCase     :      int														=       int(z - (2 * c)							)
     _UpperCAmelCase     :      int														=       round(w % 7							)
     # End math

     # Validate math
     if f != convert_datetime_days[dt_ck.weekday()]:
          raise AssertionError("The date was evaluated incorrectly. Contact developer."							)

     # Response
     _UpperCAmelCase     :      str														=       f'Your date {date_input}, is a {days[str(SCREAMING_SNAKE_CASE__							)]}!'
     return response


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 _lowerCAmelCase							:   Any				=				argparse.ArgumentParser(
     description=(
         "Find out what day of the week nearly any date is or was. Enter "
         "date as a string in the mm-dd-yyyy or mm/dd/yyyy format"
     )
 )
 parser.add_argument(
     "date_input", type=str, help="Date as a string (mm-dd-yyyy or mm/dd/yyyy)"
 )
 _lowerCAmelCase							:   Optional[Any]				=				parser.parse_args()
 zeller(args.date_input)





"""simple docstring"""




import json
from typing import TYPE_CHECKING, List, Optional, Tuple

from tokenizers import pre_tokenizers

from ...tokenization_utils_base import BatchEncoding
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_gpta import GPTaTokenizer


if TYPE_CHECKING:
 from transformers.pipelines.conversational import Conversation


_lowerCAmelCase							:   Any				=				logging.get_logger(__name__)

_lowerCAmelCase							:   Any				=				{"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"}

_lowerCAmelCase							:   List[str]				=				{
    "vocab_file": {
        "gpt2": "https://huggingface.co/gpt2/resolve/main/vocab.json",
        "gpt2-medium": "https://huggingface.co/gpt2-medium/resolve/main/vocab.json",
        "gpt2-large": "https://huggingface.co/gpt2-large/resolve/main/vocab.json",
        "gpt2-xl": "https://huggingface.co/gpt2-xl/resolve/main/vocab.json",
        "distilgpt2": "https://huggingface.co/distilgpt2/resolve/main/vocab.json",
    },
    "merges_file": {
        "gpt2": "https://huggingface.co/gpt2/resolve/main/merges.txt",
        "gpt2-medium": "https://huggingface.co/gpt2-medium/resolve/main/merges.txt",
        "gpt2-large": "https://huggingface.co/gpt2-large/resolve/main/merges.txt",
        "gpt2-xl": "https://huggingface.co/gpt2-xl/resolve/main/merges.txt",
        "distilgpt2": "https://huggingface.co/distilgpt2/resolve/main/merges.txt",
    },
    "tokenizer_file": {
        "gpt2": "https://huggingface.co/gpt2/resolve/main/tokenizer.json",
        "gpt2-medium": "https://huggingface.co/gpt2-medium/resolve/main/tokenizer.json",
        "gpt2-large": "https://huggingface.co/gpt2-large/resolve/main/tokenizer.json",
        "gpt2-xl": "https://huggingface.co/gpt2-xl/resolve/main/tokenizer.json",
        "distilgpt2": "https://huggingface.co/distilgpt2/resolve/main/tokenizer.json",
    },
}

_lowerCAmelCase							:   List[str]				=				{
    "gpt2": 10_24,
    "gpt2-medium": 10_24,
    "gpt2-large": 10_24,
    "gpt2-xl": 10_24,
    "distilgpt2": 10_24,
}






class       UpperCAmelCase_    (							_UpperCamelCase		):
      __SCREAMING_SNAKE_CASE		:  Optional[Any]						=					VOCAB_FILES_NAMES
      __SCREAMING_SNAKE_CASE		:  int						=					PRETRAINED_VOCAB_FILES_MAP
      __SCREAMING_SNAKE_CASE		:  Optional[int]						=					PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
      __SCREAMING_SNAKE_CASE		:  Optional[int]						=					['input_ids', 'attention_mask']
      __SCREAMING_SNAKE_CASE		:  Dict						=					GPTaTokenizer



      def __init__(	self	:      Optional[Any]	,      A	:      Optional[int]=None	,      A	:      List[Any]=None	,      A	:      Optional[int]=None	,      A	:      Optional[Any]="<|endoftext|>"	,      A	:      Union[str, Any]="<|endoftext|>"	,      A	:      Optional[Any]="<|endoftext|>"	,      A	:      Optional[Any]=False	,      **A	:      str	,      ):
           super().__init__(
               A	,      A	,      tokenizer_file=A	,      unk_token=A	,      bos_token=A	,      eos_token=A	,      add_prefix_space=A	,      **A	,      )

           _UpperCAmelCase     :      List[Any]														=       kwargs.pop("add_bos_token"	,      A		)

           _UpperCAmelCase     :      List[str]														=       json.loads(self.backend_tokenizer.pre_tokenizer.__getstate__()		)
           if pre_tok_state.get("add_prefix_space"	,      A		) != add_prefix_space:
                _UpperCAmelCase     :      Dict														=       getattr(A	,      pre_tok_state.pop("type"		)		)
                _UpperCAmelCase     :      Optional[Any]														=       add_prefix_space
                _UpperCAmelCase     :      Optional[Any]														=       pre_tok_class(**A		)

           _UpperCAmelCase     :      List[Any]														=       add_prefix_space



      def 		snake_case_   (	self	:      List[Any]	,      *A	:      List[Any]	,      **A	:      List[str]		):
           _UpperCAmelCase     :      Union[str, Any]														=       kwargs.get("is_split_into_words"	,      A		)
           assert self.add_prefix_space or not is_split_into_words, (
               f'You need to instantiate {self.__class__.__name__} with add_prefix_space=True '
               "to use it with pretokenized inputs."
           )

           return super()._batch_encode_plus(*A	,      **A		)



      def 		snake_case_   (	self	:      Optional[Any]	,      *A	:      List[Any]	,      **A	:      int		):
           _UpperCAmelCase     :      Union[str, Any]														=       kwargs.get("is_split_into_words"	,      A		)

           assert self.add_prefix_space or not is_split_into_words, (
               f'You need to instantiate {self.__class__.__name__} with add_prefix_space=True '
               "to use it with pretokenized inputs."
           )

           return super()._encode_plus(*A	,      **A		)



      def 		snake_case_   (	self	:      Optional[int]	,      A	:      str	,      A	:      Optional[str] = None		):
           _UpperCAmelCase     :      List[Any]														=       self._tokenizer.model.save(A	,      name=A		)
           return tuple(A		)



      def 		snake_case_   (	self	:      int	,      A	:      "Conversation"		):
           _UpperCAmelCase     :      List[str]														=       []
           for is_user, text in conversation.iter_texts():
                input_ids.extend(self.encode(A	,      add_special_tokens=A		) + [self.eos_token_id]		)

           if len(A		) > self.model_max_length:
                _UpperCAmelCase     :      Optional[int]														=       input_ids[-self.model_max_length :]
           return input_ids
