





"""simple docstring"""
import os
import random
import sys

from . import cryptomath_module as cryptoMath  # noqa: N812
from . import rabin_miller as rabinMiller  # noqa: N812



def 					__lowerCamelCase       (							)      ->				None:
      print('''Making key files...'''							)
      make_key_files('''rsa'''			,       10_24							)
      print('''Key files generation successful.'''							)



def 					__lowerCamelCase       (							a_					:		int							)      ->				tuple[tuple[int, int], tuple[int, int]]:
      print('''Generating prime p...'''							)
      __SCREAMING_SNAKE_CASE       :Any		    =  rabinMiller.generate_large_prime(a_							)
      print('''Generating prime q...'''							)
      __SCREAMING_SNAKE_CASE       :Any		    =  rabinMiller.generate_large_prime(a_							)
      __SCREAMING_SNAKE_CASE       :List[str]		    =  p * q

      print('''Generating e that is relatively prime to (p - 1) * (q - 1)...'''							)
      while True:
            __SCREAMING_SNAKE_CASE       :Any		    =  random.randrange(2 ** (key_size - 1)			,       2 ** (key_size)							)
            if cryptoMath.gcd(a_			,       (p - 1) * (q - 1)							) == 1:
                  break

      print('''Calculating d that is mod inverse of e...'''							)
      __SCREAMING_SNAKE_CASE       :int		    =  cryptoMath.find_mod_inverse(a_			,       (p - 1) * (q - 1)							)

      __SCREAMING_SNAKE_CASE       :Optional[Any]		    =  (n, e)
      __SCREAMING_SNAKE_CASE       :Dict		    =  (n, d)
      return (public_key, private_key)



def 					__lowerCamelCase       (							a_					:		str			,       a_					:		int							)      ->				None:
      if os.path.exists(f'''{name}_pubkey.txt'''							) or os.path.exists(f'''{name}_privkey.txt'''							):
            print('''\nWARNING:'''							)
            print(
                f'''"{name}_pubkey.txt" or "{name}_privkey.txt" already exists. \n'''
                '''Use a different name or delete these files and re-run this program.'''							)
            sys.exit()

      __SCREAMING_SNAKE_CASE    ,__SCREAMING_SNAKE_CASE       :Optional[Any]		    =  generate_key(a_							)
      print(f'''\nWriting public key to file {name}_pubkey.txt...'''							)
      with open(f'''{name}_pubkey.txt'''			,       '''w'''							) as out_file:
            out_file.write(f'''{key_size},{public_key[0]},{public_key[1]}'''							)

      print(f'''Writing private key to file {name}_privkey.txt...'''							)
      with open(f'''{name}_privkey.txt'''			,       '''w'''							) as out_file:
            out_file.write(f'''{key_size},{private_key[0]},{private_key[1]}'''							)


if __name__ == "__main__":
  main()






"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCamelCase_       =		logging.get_logger(__name__)

lowerCamelCase_       =		{
    "google/vivit-b-16x2-kinetics400": (
        "https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json"
    ),
    # See all Vivit models at https://huggingface.co/models?filter=vivit
}






class  _SCREAMING_SNAKE_CASE(       A  ):
       SCREAMING_SNAKE_CASE_       :				Optional[Any]     						=  '''vivit'''




       def __init__(						self		,SCREAMING_SNAKE_CASE__=2_24		,SCREAMING_SNAKE_CASE__=32		,SCREAMING_SNAKE_CASE__=[2, 16, 16]		,SCREAMING_SNAKE_CASE__=3		,SCREAMING_SNAKE_CASE__=7_68		,SCREAMING_SNAKE_CASE__=12		,SCREAMING_SNAKE_CASE__=12		,SCREAMING_SNAKE_CASE__=30_72		,SCREAMING_SNAKE_CASE__="gelu_fast"		,SCREAMING_SNAKE_CASE__=0.0		,SCREAMING_SNAKE_CASE__=0.0		,SCREAMING_SNAKE_CASE__=0.0_2		,SCREAMING_SNAKE_CASE__=1E-06		,SCREAMING_SNAKE_CASE__=True		,**SCREAMING_SNAKE_CASE__		,)      ->				str:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE       :Optional[Any]		    =  hidden_size
             __SCREAMING_SNAKE_CASE       :List[str]		    =  num_hidden_layers
             __SCREAMING_SNAKE_CASE       :List[str]		    =  num_attention_heads
             __SCREAMING_SNAKE_CASE       :Any		    =  intermediate_size
             __SCREAMING_SNAKE_CASE       :Optional[Any]		    =  hidden_act
             __SCREAMING_SNAKE_CASE       :int		    =  hidden_dropout_prob
             __SCREAMING_SNAKE_CASE       :Union[str, Any]		    =  attention_probs_dropout_prob
             __SCREAMING_SNAKE_CASE       :Dict		    =  initializer_range
             __SCREAMING_SNAKE_CASE       :Dict		    =  layer_norm_eps

             __SCREAMING_SNAKE_CASE       :Any		    =  image_size
             __SCREAMING_SNAKE_CASE       :Any		    =  num_frames
             __SCREAMING_SNAKE_CASE       :Any		    =  tubelet_size
             __SCREAMING_SNAKE_CASE       :Tuple		    =  num_channels
             __SCREAMING_SNAKE_CASE       :List[str]		    =  qkv_bias

             super().__init__(**SCREAMING_SNAKE_CASE__							)