






import argparse
from pathlib import Path

from transformers import AutoConfig, AutoTokenizer, RagConfig, RagSequenceForGeneration, RagTokenForGeneration






def      _snake_case     (__lowercase     ,   __lowercase     ,   __lowercase     ,   __lowercase     ,   __lowercase = None     ,   __lowercase = None     ,   __lowercase = None     ,   ):
   if config_name_or_path is None:
      UpperCamelCase_						=  'facebook/rag-token-base' if model_type == 'rag_token' else 'facebook/rag-sequence-base'

   if generator_tokenizer_name_or_path is None:
      UpperCamelCase_						=  generator_name_or_path

   if question_encoder_tokenizer_name_or_path is None:
      UpperCamelCase_						=  question_encoder_name_or_path

   UpperCamelCase_						=  RagTokenForGeneration if model_type == 'rag_token' else RagSequenceForGeneration

   # Save model.
   UpperCamelCase_						=  RagConfig.from_pretrained(__lowercase)
   UpperCamelCase_						=  AutoConfig.from_pretrained(__lowercase)
   UpperCamelCase_						=  AutoConfig.from_pretrained(__lowercase)

   UpperCamelCase_						=  gen_config
   UpperCamelCase_						=  question_encoder_config

   UpperCamelCase_						=  model_class.from_pretrained_question_encoder_generator(
       __lowercase     ,   __lowercase     ,   config=__lowercase)
   rag_model.save_pretrained(__lowercase)

   # Sanity check.
   model_class.from_pretrained(__lowercase)

   # Save tokenizers.
   UpperCamelCase_						=  AutoTokenizer.from_pretrained(__lowercase)
   gen_tokenizer.save_pretrained(dest_dir / 'generator_tokenizer/')
   UpperCamelCase_						=  AutoTokenizer.from_pretrained(__lowercase)
   question_encoder_tokenizer.save_pretrained(dest_dir / 'question_encoder_tokenizer/')


if __name__ == "__main__":
 snake_case__   :						Union[str, Any]													=   argparse.ArgumentParser()
 parser.add_argument(
     """--model_type""",
     choices=["""rag_sequence""", """rag_token"""],
     required=True,
     type=str,
     help="""RAG model type: rag_sequence, rag_token""",
 )
 parser.add_argument("""--dest""", type=str, required=True, help="""Path to the output checkpoint directory.""")
 parser.add_argument("""--generator_name_or_path""", type=str, required=True, help="""Generator model identifier""")
 parser.add_argument(
     """--question_encoder_name_or_path""", type=str, required=True, help="""Question encoder model identifier"""
 )

 parser.add_argument(
     """--generator_tokenizer_name_or_path""",
     type=str,
     help="""Generator tokenizer identifier, if not specified, resolves to ``generator_name_or_path``""",
 )
 parser.add_argument(
     """--question_encoder_tokenizer_name_or_path""",
     type=str,
     help="""Question encoder tokenizer identifier, if not specified, resolves to ``question_encoder_name_or_path``""",
 )
 parser.add_argument(
     """--config_name_or_path""",
     type=str,
     help=(
         """Identifier of the model config to use, if not provided, resolves to a base config for a given"""
         """ ``model_type``"""
     ),
 )

 snake_case__   :						int													=   parser.parse_args()

 snake_case__   :						str													=   Path(args.dest)
 dest_dir.mkdir(exist_ok=True)

 consolidate(
     args.model_type,
     args.generator_name_or_path,
     args.question_encoder_name_or_path,
     dest_dir,
     args.config_name_or_path,
     args.generator_tokenizer_name_or_path,
     args.question_encoder_tokenizer_name_or_path,
 )













import math
from datetime import datetime, timedelta






def      _snake_case     (__lowercase):
   UpperCamelCase_						=  year % 19
   UpperCamelCase_						=  year % 4
   UpperCamelCase_						=  year % 7
   UpperCamelCase_						=  math.floor(year / 100)
   UpperCamelCase_						=  math.floor((13 + 8 * leap_day_inhibits) / 25)
   UpperCamelCase_						=  leap_day_inhibits / 4
   UpperCamelCase_						=  (
       15 - lunar_orbit_correction + leap_day_inhibits - leap_day_reinstall_number
   ) % 30
   UpperCamelCase_						=  (4 + leap_day_inhibits - leap_day_reinstall_number) % 7

   # days to be added to March 21
   UpperCamelCase_						=  (19 * metonic_cycle + secular_moon_shift) % 30

   # PHM -> Paschal Full Moon
   UpperCamelCase_						=  (
       2 * julian_leap_year
       + 4 * non_leap_year
       + 6 * days_to_add
       + century_starting_point
   ) % 7

   if days_to_add == 29 and days_from_phm_to_sunday == 6:
      return datetime(__lowercase     ,   4     ,   19)
   elif days_to_add == 28 and days_from_phm_to_sunday == 6:
      return datetime(__lowercase     ,   4     ,   18)
   else:
      return datetime(__lowercase     ,   3     ,   22) + timedelta(
          days=int(days_to_add + days_from_phm_to_sunday))


if __name__ == "__main__":
 for year in (1_9_9_4, 2_0_0_0, 2_0_1_0, 2_0_2_1, 2_0_2_3):
  snake_case__   :						Dict													=   """will be""" if year > datetime.now().year else """was"""
  print(f'Easter in {year} {tense} {gauss_easter(year)}')





