
def 						UpperCAmelCase			(	a_		,   a_						)		->	str:







				"""simple docstring"""



				__A   			= [[] for _ in range(a_						)]
				__A   			= key - 1

				if key <= 0:
								raise ValueError("Height of grid can't be 0 or negative"						)
				if key == 1 or len(a_						) <= key:
								return input_string

				for position, character in enumerate(a_						):
								__A   			= position % (lowest * 2)  # puts it in bounds
								__A   			= min(a_		,   lowest * 2 - num						)  # creates zigzag pattern
								temp_grid[num].append(a_						)
				__A   			= ["".join(a_						) for row in temp_grid]
				__A   			= "".join(a_						)

				return output_string


def 						UpperCAmelCase			(	a_		,   a_						)		->	str:







				"""simple docstring"""



				__A   			= []
				__A   			= key - 1

				if key <= 0:
								raise ValueError("Height of grid can't be 0 or negative"						)
				if key == 1:
								return input_string

				__A   			= [[] for _ in range(a_						)]  # generates template
				for position in range(len(a_						)						):
								__A   			= position % (lowest * 2)  # puts it in bounds
								__A   			= min(a_		,   lowest * 2 - num						)  # creates zigzag pattern
								temp_grid[num].append("*"						)

				__A   			= 0
				for row in temp_grid:  # fills in the characters
								__A   			= input_string[counter : counter + len(a_						)]
								grid.append(list(a_						)						)
								counter += len(a_						)

				__A   			= ""  # reads as zigzag
				for position in range(len(a_						)						):
								__A   			= position % (lowest * 2)  # puts it in bounds
								__A   			= min(a_		,   lowest * 2 - num						)  # creates zigzag pattern
								output_string += grid[num][0]
								grid[num].pop(0						)
				return output_string


def 						UpperCAmelCase			(	a_						)		->	dict[int, str]:







				"""simple docstring"""



				__A   			= {}
				for key_guess in range(1		,   len(a_						)						):  # tries every key
								__A   			= decrypt(a_		,   a_						)
				return results


if __name__ == "__main__":
					import doctest

					doctest.testmod()

from typing import TYPE_CHECKING

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


UpperCamelCase  							=						{
    '''configuration_electra''': ['''ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ElectraConfig''', '''ElectraOnnxConfig'''],
    '''tokenization_electra''': ['''ElectraTokenizer'''],
}

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

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase  							=						[
          '''ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''ElectraForCausalLM''',
          '''ElectraForMaskedLM''',
          '''ElectraForMultipleChoice''',
          '''ElectraForPreTraining''',
          '''ElectraForQuestionAnswering''',
          '''ElectraForSequenceClassification''',
          '''ElectraForTokenClassification''',
          '''ElectraModel''',
          '''ElectraPreTrainedModel''',
          '''load_tf_weights_in_electra''',
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase  							=						[
          '''TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''TFElectraForMaskedLM''',
          '''TFElectraForMultipleChoice''',
          '''TFElectraForPreTraining''',
          '''TFElectraForQuestionAnswering''',
          '''TFElectraForSequenceClassification''',
          '''TFElectraForTokenClassification''',
          '''TFElectraModel''',
          '''TFElectraPreTrainedModel''',
      ]

try:
      if not is_flax_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase  							=						[
          '''FlaxElectraForCausalLM''',
          '''FlaxElectraForMaskedLM''',
          '''FlaxElectraForMultipleChoice''',
          '''FlaxElectraForPreTraining''',
          '''FlaxElectraForQuestionAnswering''',
          '''FlaxElectraForSequenceClassification''',
          '''FlaxElectraForTokenClassification''',
          '''FlaxElectraModel''',
          '''FlaxElectraPreTrainedModel''',
      ]


if TYPE_CHECKING:
      from .configuration_electra import ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ElectraConfig, ElectraOnnxConfig
      from .tokenization_electra import ElectraTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_electra_fast import ElectraTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_electra import (
                ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
                ElectraForCausalLM,
                ElectraForMaskedLM,
                ElectraForMultipleChoice,
                ElectraForPreTraining,
                ElectraForQuestionAnswering,
                ElectraForSequenceClassification,
                ElectraForTokenClassification,
                ElectraModel,
                ElectraPreTrainedModel,
                load_tf_weights_in_electra,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_electra import (
                TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFElectraForMaskedLM,
                TFElectraForMultipleChoice,
                TFElectraForPreTraining,
                TFElectraForQuestionAnswering,
                TFElectraForSequenceClassification,
                TFElectraForTokenClassification,
                TFElectraModel,
                TFElectraPreTrainedModel,
            )

      try:
            if not is_flax_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_flax_electra import (
                FlaxElectraForCausalLM,
                FlaxElectraForMaskedLM,
                FlaxElectraForMultipleChoice,
                FlaxElectraForPreTraining,
                FlaxElectraForQuestionAnswering,
                FlaxElectraForSequenceClassification,
                FlaxElectraForTokenClassification,
                FlaxElectraModel,
                FlaxElectraPreTrainedModel,
            )

else:
      import sys

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



