
def  lowerCamelCase__ (  a__     :     str   )						->		str:
       UpperCamelCase_											=				''''''
       for ch in key:
              if ch == " " or ch not in key_no_dups and ch.isalpha():
                     key_no_dups += ch
       return key_no_dups




def  lowerCamelCase__ (  a__     :     str   )						->		dict[str, str]:
       UpperCamelCase_											=				[chr(i + 65   ) for i in range(26   )]
       # Remove duplicate characters from key
       UpperCamelCase_											=				remove_duplicates(key.upper()   )
       UpperCamelCase_											=				len(__UpperCAmelCase   )
       # First fill cipher with key characters
       UpperCamelCase_											=				{alphabet[i]: char for i, char in enumerate(__UpperCAmelCase   )}
       # Then map remaining characters in alphabet to
       # the alphabet from the beginning
       for i in range(len(__UpperCAmelCase   )		,					26   ):
              UpperCamelCase_											=				alphabet[i - offset]
              # Ensure we are not mapping letters to letters previously mapped
              while char in key:
                     offset -= 1
                     UpperCamelCase_											=				alphabet[i - offset]
              UpperCamelCase_											=				char
       return cipher_alphabet




def  lowerCamelCase__ (  a__     :     str		,					a__     :     dict[str, str]   )						->		str:
       return "".join(cipher_map.get(__UpperCAmelCase		,					__UpperCAmelCase   ) for ch in message.upper()   )




def  lowerCamelCase__ (  a__     :     str		,					a__     :     dict[str, str]   )						->		str:
       UpperCamelCase_											=				{v: k for k, v in cipher_map.items()}
       return "".join(rev_cipher_map.get(__UpperCAmelCase		,					__UpperCAmelCase   ) for ch in message.upper()   )




def  lowerCamelCase__ (  )						->		None:
       UpperCamelCase_											=				input("""Enter message to encode or decode: """   ).strip()
       UpperCamelCase_											=				input("""Enter keyword: """   ).strip()
       UpperCamelCase_											=				input("""Encipher or decipher? E/D:"""   ).strip()[0].lower()
       try:
              UpperCamelCase_											=				{'''e''': encipher, '''d''': decipher}[option]
       except KeyError:
              raise KeyError("""invalid input option"""   )
       UpperCamelCase_											=				create_cipher_map(__UpperCAmelCase   )
       print(func(__UpperCAmelCase		,					__UpperCAmelCase   )   )


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      main()










from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCAmelCase_     							= {
    'configuration_convbert': ['CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'ConvBertConfig', 'ConvBertOnnxConfig'],
    'tokenization_convbert': ['ConvBertTokenizer'],
}

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_     							= ['ConvBertTokenizerFast']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_     							= [
      'CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
      'ConvBertForMaskedLM',
      'ConvBertForMultipleChoice',
      'ConvBertForQuestionAnswering',
      'ConvBertForSequenceClassification',
      'ConvBertForTokenClassification',
      'ConvBertLayer',
      'ConvBertModel',
      'ConvBertPreTrainedModel',
      'load_tf_weights_in_convbert',
  ]


try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase_     							= [
      'TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST',
      'TFConvBertForMaskedLM',
      'TFConvBertForMultipleChoice',
      'TFConvBertForQuestionAnswering',
      'TFConvBertForSequenceClassification',
      'TFConvBertForTokenClassification',
      'TFConvBertLayer',
      'TFConvBertModel',
      'TFConvBertPreTrainedModel',
  ]


if TYPE_CHECKING:
  from .configuration_convbert import CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvBertConfig, ConvBertOnnxConfig
  from .tokenization_convbert import ConvBertTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_convbert_fast import ConvBertTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_convbert import (
        CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        ConvBertForMaskedLM,
        ConvBertForMultipleChoice,
        ConvBertForQuestionAnswering,
        ConvBertForSequenceClassification,
        ConvBertForTokenClassification,
        ConvBertLayer,
        ConvBertModel,
        ConvBertPreTrainedModel,
        load_tf_weights_in_convbert,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_convbert import (
        TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFConvBertForMaskedLM,
        TFConvBertForMultipleChoice,
        TFConvBertForQuestionAnswering,
        TFConvBertForSequenceClassification,
        TFConvBertForTokenClassification,
        TFConvBertLayer,
        TFConvBertModel,
        TFConvBertPreTrainedModel,
    )


else:
  import sys

  UpperCAmelCase_     							= _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

