

import argparse

from transformers import ConvBertConfig, ConvBertModel, TFConvBertModel, load_tf_weights_in_convbert
from transformers.utils import logging


logging.set_verbosity_info()





def  _snake_case		(snake_case_					:     List[Any]    ,       snake_case_					:     Tuple    ,       snake_case_					:     Union[str, Any]  )							->		Any:
  __UpperCAmelCase	:  List[Any]		=     ConvBertConfig.from_json_file(snake_case_  )
  __UpperCAmelCase	:  Optional[int]		=     ConvBertModel(snake_case_  )

  __UpperCAmelCase	:  List[Any]		=     load_tf_weights_in_convbert(snake_case_    ,       snake_case_    ,       snake_case_  )
  model.save_pretrained(snake_case_  )

  __UpperCAmelCase	:  int		=     TFConvBertModel.from_pretrained(snake_case_    ,       from_pt=snake_case_  )
  tf_model.save_pretrained(snake_case_  )


if __name__ == "__main__":
      _SCREAMING_SNAKE_CASE							 =			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(
          '''--convbert_config_file''',
          default=None,
          type=str,
          required=True,
          help=(
              '''The config json file corresponding to the pre-trained ConvBERT model. \n'''
              '''This specifies the model architecture.'''
          ),
      )
      parser.add_argument(
          '''--pytorch_dump_path''', default=None, type=str, required=True, help='''Path to the output PyTorch model.'''
      )
      _SCREAMING_SNAKE_CASE							 =			parser.parse_args()
      convert_orig_tfa_checkpoint_to_pytorch(args.tf_checkpoint_path, args.convbert_config_file, args.pytorch_dump_path)








from __future__ import annotations





def  _snake_case		(snake_case_					:     int  )							->		int | None:
  for r in range(1    ,       snake_case_  ):
    __UpperCAmelCase	:  List[str]		=     []
    for x in range(n - 1  ):
      __UpperCAmelCase	:  Union[str, Any]		=     pow(snake_case_    ,       snake_case_    ,       snake_case_  )
      if val in li:
        break
      li.append(snake_case_  )
    else:
      return r
  return None


if __name__ == "__main__":
      _SCREAMING_SNAKE_CASE							 =			int(input('''Enter a prime number q: '''))
      _SCREAMING_SNAKE_CASE							 =			find_primitive(q)
      if a is None:
            print(F'''Cannot find the primitive for the value: {a!r}''')
      else:
            _SCREAMING_SNAKE_CASE							 =			int(input('''Enter private key of A: '''))
            _SCREAMING_SNAKE_CASE							 =			pow(a, a_private, q)
            _SCREAMING_SNAKE_CASE							 =			int(input('''Enter private key of B: '''))
            _SCREAMING_SNAKE_CASE							 =			pow(a, b_private, q)

            _SCREAMING_SNAKE_CASE							 =			pow(b_public, a_private, q)
            _SCREAMING_SNAKE_CASE							 =			pow(a_public, b_private, q)

            print('''The key value generated by A is: ''', a_secret)
            print('''The key value generated by B is: ''', b_secret)





