






'''simple docstring'''
import argparse
import datetime





def 	_a(					UpperCamelCase__			:  str							):




      '''simple docstring'''






      SCREAMING_SNAKE_CASE__       :			int													={
          '''0''': '''Sunday''',
          '''1''': '''Monday''',
          '''2''': '''Tuesday''',
          '''3''': '''Wednesday''',
          '''4''': '''Thursday''',
          '''5''': '''Friday''',
          '''6''': '''Saturday''',
      }

      SCREAMING_SNAKE_CASE__       :			Union[str, Any]													={0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0}

      # Validate
      if not 0 < len(UpperCamelCase__							) < 1_1:
            raise ValueError('''Must be 10 characters long'''							)

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

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

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

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

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

      # Get datetime obj for validation
      SCREAMING_SNAKE_CASE__       :			Any													=datetime.date(int(UpperCamelCase__							),		int(UpperCamelCase__							),		int(UpperCamelCase__							)							)

      # Start math
      if m <= 2:
            SCREAMING_SNAKE_CASE__       :			List[Any]													=y - 1
            SCREAMING_SNAKE_CASE__       :			List[Any]													=m + 1_2
      # maths var
      SCREAMING_SNAKE_CASE__       :			int													=int(str(UpperCamelCase__							)[:2]							)
      SCREAMING_SNAKE_CASE__       :			int													=int(str(UpperCamelCase__							)[2:]							)
      SCREAMING_SNAKE_CASE__       :			int													=int(2.6 * m - 5.3_9							)
      SCREAMING_SNAKE_CASE__       :			int													=int(c / 4							)
      SCREAMING_SNAKE_CASE__       :			int													=int(k / 4							)
      SCREAMING_SNAKE_CASE__       :			int													=int(d + k							)
      SCREAMING_SNAKE_CASE__       :			int													=int(t + u + v + x							)
      SCREAMING_SNAKE_CASE__       :			int													=int(z - (2 * c)							)
      SCREAMING_SNAKE_CASE__       :			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
      SCREAMING_SNAKE_CASE__       :			str													=f"Your date {date_input}, is a {days[str(UpperCamelCase__							)]}!"
      return response


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  a_					=	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)'
  )
  a_					=	parser.parse_args()
  zeller(args.date_input)







'''simple docstring'''
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import torch

from ..models.auto import AutoModelForSequenceClassification, AutoTokenizer
from .base import PipelineTool






class        __SCREAMING_SNAKE_CASE (     lowerCamelCase			):
 snake_case_												=							"""facebook/bart-large-mnli"""
 snake_case_												=							(
     """This is a tool that classifies an English text using provided labels. It takes two inputs: `text`, which """
     """should be the text to classify, and `labels`, which should be the list of labels to use for classification. """
     """It returns the most likely label in the list of provided `labels` for the input text."""
 )
 snake_case_												=							"""text_classifier"""
 snake_case_												=							AutoTokenizer
 snake_case_												=							AutoModelForSequenceClassification

 snake_case_												=							["""text""", ["""text"""]]
 snake_case_												=							["""text"""]




 def        __magic_name__		( self		:							Any )		->  Any:
       super().setup()
       SCREAMING_SNAKE_CASE__       :			int													=self.model.config
       SCREAMING_SNAKE_CASE__       :			int													=-1
       for idx, label in config.idalabel.items():
             if label.lower().startswith('''entail''' ):
                   SCREAMING_SNAKE_CASE__       :			Any													=int(__lowercase )
       if self.entailment_id == -1:
             raise ValueError('''Could not determine the entailment ID from the model config, please pass it at init.''' )




 def        __magic_name__		( self		:							str   , __lowercase		:							Any   , __lowercase		:							Optional[Any] )		->  Optional[Any]:
       SCREAMING_SNAKE_CASE__       :			Dict													=labels
       return self.pre_processor(
           [text] * len(__lowercase )   , [F"This example is {label}" for label in labels]   , return_tensors='''pt'''   , padding='''max_length'''   , )




 def        __magic_name__		( self		:							List[Any]   , __lowercase		:							str )		->  List[Any]:
       SCREAMING_SNAKE_CASE__       :			int													=outputs.logits
       SCREAMING_SNAKE_CASE__       :			Any													=torch.argmax(logits[:, 2] ).item()
       return self._labels[label_id]