




def    UpperCAmelCase_				( __UpperCAmelCase		:      str     ,     __UpperCAmelCase		:      int				)   ->					str:
      SCREAMING_SNAKE_CASE_      		=     [[] for _ in range(__UpperCAmelCase				)]
      SCREAMING_SNAKE_CASE_      		=     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				):
            SCREAMING_SNAKE_CASE_      		=     position % (lowest * 2)  # puts it in bounds
            SCREAMING_SNAKE_CASE_      		=     min(__UpperCAmelCase     ,     lowest * 2 - num				)  # creates zigzag pattern
            temp_grid[num].append(__UpperCAmelCase				)
      SCREAMING_SNAKE_CASE_      		=     [''.join(__UpperCAmelCase				) for row in temp_grid]
      SCREAMING_SNAKE_CASE_      		=     ''.join(__UpperCAmelCase				)

      return output_string

def    UpperCAmelCase_				( __UpperCAmelCase		:      str     ,     __UpperCAmelCase		:      int				)   ->					str:
      SCREAMING_SNAKE_CASE_      		=     []
      SCREAMING_SNAKE_CASE_      		=     key - 1

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

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

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

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

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


if __name__ == "__main__":
   import doctest

   doctest.testmod()





import warnings

from ...utils import logging
from .image_processing_layoutlmva import LayoutLMvaImageProcessor


lowerCamelCase__					:  Union[str, Any]      							=				logging.get_logger(__name__)





class 			lowerCamelCase_				( _SCREAMING_SNAKE_CASE   ):


 '''simple docstring'''







 def __init__(				self    :						Dict							,							*_lowerCAmelCase    :						Optional[Any]							,							**_lowerCAmelCase    :						Any		):
       warnings.warn(
           'The class LayoutLMv2FeatureExtractor is deprecated and will be removed in version 5 of Transformers.'
           ' Please use LayoutLMv2ImageProcessor instead.'							,							_lowerCAmelCase							,							)
       super().__init__(*_lowerCAmelCase							,							**_lowerCAmelCase		)