





'''simple docstring'''

def    a__							(							lowercase   :	list )						->						bool:





     """simple docstring"""

     if not isinstance(lowercase,   lowercase ):
          raise ValueError('''Input series is not valid, valid series - [2, 4, 6]''' )
     if len(lowercase ) == 0:
          raise ValueError('''Input list must be a non empty list''' )
     if len(lowercase ) == 1:
          return True
     _UpperCamelCase							       =			series[1] - series[0]
     for index in range(len(lowercase ) - 1 ):
          if series[index + 1] - series[index] != common_diff:
               return False
     return True







def    a__							(							lowercase   :	list )						->						float:





     """simple docstring"""

     if not isinstance(lowercase,   lowercase ):
          raise ValueError('''Input series is not valid, valid series - [2, 4, 6]''' )
     if len(lowercase ) == 0:
          raise ValueError('''Input list must be a non empty list''' )
     _UpperCamelCase							       =			0
     for val in series:
          answer += val
     return answer / len(lowercase )


if __name__ == "__main__":
   import doctest

   doctest.testmod()








'''simple docstring'''



import argparse

from transformers import TaConfig, TaForConditionalGeneration, load_tf_weights_in_ta
from transformers.utils import logging


logging.set_verbosity_info()
def        UpperCAmelCase (    A	:					Optional[Any]       ,		A	:					Optional[int]       ,		A	:					int					):
							# Initialise PyTorch model
							SCREAMING_SNAKE_CASE       :   str         =      TaConfig.from_json_file(A					)
							print(F"""Building PyTorch model from configuration: {config}"""					)
							SCREAMING_SNAKE_CASE       :   Union[str, Any]         =      TaForConditionalGeneration(A					)

							# Load weights from tf checkpoint
							load_tf_weights_in_ta(A       ,		A       ,		A					)

							# Save pytorch-model
							print(F"""Save PyTorch model to {pytorch_dump_path}"""					)
							model.save_pretrained(A					)


if __name__ == "__main__":
							lowerCAmelCase_  :							Union[str, 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(
							    '--config_file',
							    default=None,
							    type=str,
							    required=True,
							    help=(
							        'The config json file corresponding to the pre-trained T5 model. \nThis specifies the model architecture.'
							    ),
							)
							parser.add_argument(
							    '--pytorch_dump_path', default=None, type=str, required=True, help='Path to the output PyTorch model.'
							)
							lowerCAmelCase_  :							Tuple             =    parser.parse_args()
							convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.config_file, args.pytorch_dump_path)




