



import unicodedata
from dataclasses import dataclass
from typing import Optional, Union

import numpy as np

from transformers.data.data_collator import DataCollatorMixin
from transformers.file_utils import PaddingStrategy
from transformers.tokenization_utils_base import PreTrainedTokenizerBase






def  lowerCamelCase_	(      lowerCAmelCase__	:	List[Any]			,	lowerCAmelCase__	:	Dict			,	lowerCAmelCase__	:	List[str]			,	lowerCAmelCase__	:	List[str]				)       ->							Union[str, Any]:

							'''simple docstring'''






							if isinstance(lowerCAmelCase__			,	lowerCAmelCase__				):
														A      						=    np.full((len(lowerCAmelCase__				), sequence_length, 2)			,	lowerCAmelCase__				)
							else:
														A      						=    np.full((len(lowerCAmelCase__				), sequence_length)			,	lowerCAmelCase__				)

							for i, tensor in enumerate(lowerCAmelCase__				):
														if padding_side == "right":
																					if isinstance(lowerCAmelCase__			,	lowerCAmelCase__				):
																												A      						=    tensor[:sequence_length]
																					else:
																												A      						=    tensor[:sequence_length]
														else:
																					if isinstance(lowerCAmelCase__			,	lowerCAmelCase__				):
																												A      						=    tensor[:sequence_length]
																					else:
																												A      						=    tensor[:sequence_length]

							return out_tensor.tolist()






def  lowerCamelCase_	(      lowerCAmelCase__	:	int				)       ->							str:

							'''simple docstring'''






							A      						=    ord(lowerCAmelCase__				)
							if (cp >= 33 and cp <= 47) or (cp >= 58 and cp <= 64) or (cp >= 91 and cp <= 96) or (cp >= 123 and cp <= 126):
														return True
							A      						=    unicodedata.category(lowerCAmelCase__				)
							if cat.startswith('P'				):
														return True
							return False



@dataclass
class        lowerCAmelCase__					(  _lowerCamelCase       ):
				A_   :     PreTrainedTokenizerBase
				A_   :     Union[bool, str, PaddingStrategy]								=     True
				A_   :     Optional[int]								=     None
				A_   :     Optional[int]								=     None
				A_   :     int								=     -1_0_0
				A_   :     str								=     "pt"


				def __UpperCamelCase						(							self      :  int						, __UpperCamelCase      :  Optional[Any]       )		->     int:
											import torch

											A      						=    'label' if 'label' in features[0].keys() else 'labels'
											A      						=    [feature[label_name] for feature in features] if label_name in features[0].keys() else None
											A      						=    self.tokenizer.pad(
											    __UpperCamelCase						, padding=self.padding						, max_length=self.max_length						, pad_to_multiple_of=self.pad_to_multiple_of						, return_tensors='pt' if labels is None else None						, )

											if labels is None:
																		return batch

											A      						=    torch.tensor(batch['entity_ids']       ).shape[1]
											A      						=    self.tokenizer.padding_side
											if padding_side == "right":
																		A      						=    [
																		    list(__UpperCamelCase       ) + [self.label_pad_token_id] * (sequence_length - len(__UpperCamelCase       )) for label in labels
																		]
											else:
																		A      						=    [
																		    [self.label_pad_token_id] * (sequence_length - len(__UpperCamelCase       )) + list(__UpperCamelCase       ) for label in labels
																		]

											A      						=    [feature['ner_tags'] for feature in features]
											A      						=    padding_tensor(__UpperCamelCase						, -1						, __UpperCamelCase						, __UpperCamelCase       )
											A      						=    [feature['original_entity_spans'] for feature in features]
											A      						=    padding_tensor(__UpperCamelCase						, (-1, -1)						, __UpperCamelCase						, __UpperCamelCase       )
											A      						=    {k: torch.tensor(__UpperCamelCase						, dtype=torch.intaa       ) for k, v in batch.items()}

											return batch





'''simple docstring'''







def 						_A      ( ):






   '''simple docstring'''







   A__       =     [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

   A__       =     6
   A__       =     1
   A__       =     1901

   A__       =     0

   while year < 2001:
      day += 7

      if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
         if day > days_per_month[month - 1] and month != 2:
            month += 1
            A__       =     day - days_per_month[month - 2]
         elif day > 29 and month == 2:
            month += 1
            A__       =     day - 29
      else:
         if day > days_per_month[month - 1]:
            month += 1
            A__       =     day - days_per_month[month - 2]

      if month > 12:
         year += 1
         A__       =     1

      if year < 2001 and day == 1:
         sundays += 1
   return sundays


if __name__ == "__main__":
    print(solution())


