



"""simple docstring"""
import argparse
import os

import torch

from transformers import (
    XLNetConfig,
    XLNetForQuestionAnswering,
    XLNetForSequenceClassification,
    XLNetLMHeadModel,
    load_tf_weights_in_xlnet,
)
from transformers.utils import CONFIG_NAME, WEIGHTS_NAME, logging


A:     Dict										=	{
    "cola": 2,
    "mnli": 3,
    "mrpc": 2,
    "sst-2": 2,
    "sts-b": 1,
    "qqp": 2,
    "qnli": 2,
    "rte": 2,
    "wnli": 2,
}


logging.set_verbosity_info()

def    _snake_case		(		UpperCamelCase		:	Union[str, Any]    ,	UpperCamelCase		:	Any    ,	UpperCamelCase		:	Tuple    ,	UpperCamelCase		:	List[str]=None		):
 # Initialise PyTorch model
 UpperCAmelCase			:      List[Any]			=			XLNetConfig.from_json_file(UpperCamelCase		)

 UpperCAmelCase			:      List[Any]			=			finetuning_task.lower() if finetuning_task is not None else """"""
 if finetuning_task in GLUE_TASKS_NUM_LABELS:
  print(F"Building PyTorch XLNetForSequenceClassification model from configuration: {config}"		)
  UpperCAmelCase			:      str			=			finetuning_task
  UpperCAmelCase			:      List[Any]			=			GLUE_TASKS_NUM_LABELS[finetuning_task]
  UpperCAmelCase			:      Optional[Any]			=			XLNetForSequenceClassification(UpperCamelCase		)
 elif "squad" in finetuning_task:
  UpperCAmelCase			:      str			=			finetuning_task
  UpperCAmelCase			:      Dict			=			XLNetForQuestionAnswering(UpperCamelCase		)
 else:
  UpperCAmelCase			:      Optional[int]			=			XLNetLMHeadModel(UpperCamelCase		)

 # Load weights from tf checkpoint
 load_tf_weights_in_xlnet(UpperCamelCase    ,	UpperCamelCase    ,	UpperCamelCase		)

 # Save pytorch-model
 UpperCAmelCase			:      Optional[int]			=			os.path.join(UpperCamelCase    ,	UpperCamelCase		)
 UpperCAmelCase			:      Dict			=			os.path.join(UpperCamelCase    ,	UpperCamelCase		)
 print(F"Save PyTorch model to {os.path.abspath(UpperCamelCase		)}"		)
 torch.save(model.state_dict()    ,	UpperCamelCase		)
 print(F"Save configuration file to {os.path.abspath(UpperCamelCase		)}"		)
 with open(UpperCamelCase    ,	"""w"""    ,	encoding="""utf-8"""		) as f:
  f.write(config.to_json_string()		)


if __name__ == "__main__":
      A:     List[Any]										=	argparse.ArgumentParser()
      # Required parameters
      parser.add_argument(
          "--tf_checkpoint_path", default=None, type=str, required=True, help="Path to the TensorFlow checkpoint path."
      )
      parser.add_argument(
          "--xlnet_config_file",
          default=None,
          type=str,
          required=True,
          help=(
              "The config json file corresponding to the pre-trained XLNet model. \n"
              "This specifies the model architecture."
          ),
      )
      parser.add_argument(
          "--pytorch_dump_folder_path",
          default=None,
          type=str,
          required=True,
          help="Path to the folder to store the PyTorch model or dataset/vocab.",
      )
      parser.add_argument(
          "--finetuning_task",
          default=None,
          type=str,
          help="Name of a task on which the XLNet TensorFlow model was fine-tuned",
      )
      A:     List[Any]										=	parser.parse_args()
      print(args)

      convert_xlnet_checkpoint_to_pytorch(
          args.tf_checkpoint_path, args.xlnet_config_file, args.pytorch_dump_folder_path, args.finetuning_task
      )





"""simple docstring"""
import math
from datetime import datetime, timedelta

def    _snake_case		(		UpperCamelCase		:	int		):
 UpperCAmelCase			:      Any			=			year % 19
 UpperCAmelCase			:      Any			=			year % 4
 UpperCAmelCase			:      str			=			year % 7
 UpperCAmelCase			:      Union[str, Any]			=			math.floor(year / 100		)
 UpperCAmelCase			:      Optional[Any]			=			math.floor((13 + 8 * leap_day_inhibits) / 25		)
 UpperCAmelCase			:      int			=			leap_day_inhibits / 4
 UpperCAmelCase			:      int			=			(
     15 - lunar_orbit_correction + leap_day_inhibits - leap_day_reinstall_number
 ) % 30
 UpperCAmelCase			:      Tuple			=			(4 + leap_day_inhibits - leap_day_reinstall_number) % 7

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

 # PHM -> Paschal Full Moon
 UpperCAmelCase			:      Tuple			=			(
     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(UpperCamelCase    ,	4    ,	19		)
 elif days_to_add == 28 and days_from_phm_to_sunday == 6:
  return datetime(UpperCamelCase    ,	4    ,	18		)
 else:
  return datetime(UpperCamelCase    ,	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):
            A:     Any										=	"will be" if year > datetime.now().year else "was"
            print(f"""Easter in {year} {tense} {gauss_easter(year)}""")
