def    __magic_name__(	__UpperCAmelCase		)    ->     int:



      '''simple docstring'''

      if number != int(__UpperCAmelCase		):
            raise ValueError('''factorial() only accepts integral values'''		)
      if number < 0:
            raise ValueError('''factorial() not defined for negative values'''		)
      _lowerCamelCase           =					1
      for i in range(1			,    number + 1		):
            value *= i
      return value
def    __magic_name__(	__UpperCAmelCase		)    ->     int:



      '''simple docstring'''

      if not isinstance(__UpperCAmelCase			,    __UpperCAmelCase		):
            raise ValueError('''factorial() only accepts integral values'''		)
      if n < 0:
            raise ValueError('''factorial() not defined for negative values'''		)
      return 1 if n == 0 or n == 1 else n * factorial(n - 1		)


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     snake_case__						      =			int(input('Enter a positive integer: ').strip() or 0)
     print(f'''factorial{n} is {factorial(n)}''')
import argparse

from transformers import CanineConfig, CanineModel, CanineTokenizer, load_tf_weights_in_canine
from transformers.utils import logging


logging.set_verbosity_info()
def    __magic_name__(	__UpperCAmelCase			,    __UpperCAmelCase		)    ->     Tuple:



      '''simple docstring'''

      _lowerCamelCase           =					CanineConfig()
      _lowerCamelCase           =					CanineModel(__UpperCAmelCase		)
      model.eval()

      print(F'Building PyTorch model from configuration: {config}'		)

      # Load weights from tf checkpoint
      load_tf_weights_in_canine(__UpperCAmelCase			,    __UpperCAmelCase			,    __UpperCAmelCase		)

      # Save pytorch-model (weights and configuration)
      print(F'Save PyTorch model to {pytorch_dump_path}'		)
      model.save_pretrained(__UpperCAmelCase		)

      # Save tokenizer files
      _lowerCamelCase           =					CanineTokenizer()
      print(F'Save tokenizer files to {pytorch_dump_path}'		)
      tokenizer.save_pretrained(__UpperCAmelCase		)


if __name__ == "__main__":
     snake_case__						      =			argparse.ArgumentParser()
     # Required parameters
     parser.add_argument(
         '--tf_checkpoint_path',
         default=None,
         type=str,
         required=True,
         help='Path to the TensorFlow checkpoint. Should end with model.ckpt',
     )
     parser.add_argument(
         '--pytorch_dump_path',
         default=None,
         type=str,
         required=True,
         help='Path to a folder where the PyTorch model will be placed.',
     )
     snake_case__						      =			parser.parse_args()
     convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.pytorch_dump_path)