






def     snake_case   (UpperCAmelCase__      ,       UpperCAmelCase__    )			->							str:
  UpperCamelCase_:   list[list[str]]        =							[[] for _ in range(UpperCAmelCase__    )]
  UpperCamelCase_:   Optional[Any]        =							key - 1

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

  for position, character in enumerate(UpperCAmelCase__    ):
    UpperCamelCase_:   int        =							position % (lowest * 2)  # puts it in bounds
    UpperCamelCase_:   int        =							min(UpperCAmelCase__      ,       lowest * 2 - num    )  # creates zigzag pattern
    temp_grid[num].append(UpperCAmelCase__    )
  UpperCamelCase_:   str        =							[''.join(UpperCAmelCase__    ) for row in temp_grid]
  UpperCamelCase_:   Dict        =							''.join(UpperCAmelCase__    )

  return output_string

def     snake_case   (UpperCAmelCase__      ,       UpperCAmelCase__    )			->							str:
  UpperCamelCase_:   str        =							[]
  UpperCamelCase_:   Union[str, Any]        =							key - 1

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

  UpperCamelCase_:   list[list[str]]        =							[[] for _ in range(UpperCAmelCase__    )]  # generates template
  for position in range(len(UpperCAmelCase__    )    ):
    UpperCamelCase_:   Tuple        =							position % (lowest * 2)  # puts it in bounds
    UpperCamelCase_:   List[Any]        =							min(UpperCAmelCase__      ,       lowest * 2 - num    )  # creates zigzag pattern
    temp_grid[num].append('*'    )

  UpperCamelCase_:   Optional[int]        =							0
  for row in temp_grid:  # fills in the characters
    UpperCamelCase_:   List[str]        =							input_string[counter : counter + len(UpperCAmelCase__    )]
    grid.append(list(UpperCAmelCase__    )    )
    counter += len(UpperCAmelCase__    )

  UpperCamelCase_:   Optional[int]        =							''  # reads as zigzag
  for position in range(len(UpperCAmelCase__    )    ):
    UpperCamelCase_:   int        =							position % (lowest * 2)  # puts it in bounds
    UpperCamelCase_:   Tuple        =							min(UpperCAmelCase__      ,       lowest * 2 - num    )  # creates zigzag pattern
    output_string += grid[num][0]
    grid[num].pop(0    )
  return output_string

def     snake_case   (UpperCAmelCase__    )			->							dict[int, str]:
  UpperCamelCase_:   int        =							{}
  for key_guess in range(1      ,       len(UpperCAmelCase__    )    ):  # tries every key
    UpperCamelCase_:   str        =							decrypt(UpperCAmelCase__      ,       UpperCAmelCase__    )
  return results


if __name__ == "__main__":
   import doctest

   doctest.testmod()

"""simple docstring"""






from typing import TYPE_CHECKING

from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__SCREAMING_SNAKE_CASE							=     {
    'configuration_mctct': ['MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MCTCTConfig'],
    'feature_extraction_mctct': ['MCTCTFeatureExtractor'],
    'processing_mctct': ['MCTCTProcessor'],
}


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __SCREAMING_SNAKE_CASE							=     [
     'MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST',
     'MCTCTForCTC',
     'MCTCTModel',
     'MCTCTPreTrainedModel',
 ]


if TYPE_CHECKING:
 from .configuration_mctct import MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP, MCTCTConfig
 from .feature_extraction_mctct import MCTCTFeatureExtractor
 from .processing_mctct import MCTCTProcessor

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_mctct import MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST, MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel

else:
 import sys

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