





import os
import sys

__lowerCamelCase						: Optional[Any]		=   os.path.join(os.path.dirname(__file__), 'src')
sys.path.append(SRC_DIR)


from transformers import (
    AutoConfig,
    AutoModel,
    AutoModelForCausalLM,
    AutoModelForMaskedLM,
    AutoModelForQuestionAnswering,
    AutoModelForSequenceClassification,
    AutoTokenizer,
    add_start_docstrings,
)


__lowerCamelCase						: Optional[Any]		=   [
    'torch',
    'numpy',
    'tokenizers',
    'filelock',
    'requests',
    'tqdm',
    'regex',
    'sentencepiece',
    'sacremoses',
    'importlib_metadata',
    'huggingface_hub',
]


@add_start_docstrings(AutoConfig.__doc__   )
def 					_a   (*__SCREAMING_SNAKE_CASE  ,      **__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  return AutoConfig.from_pretrained(*lowerCAmelCase__  ,      **lowerCAmelCase__   )


@add_start_docstrings(AutoTokenizer.__doc__   )
def 					_a   (*__SCREAMING_SNAKE_CASE  ,      **__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  return AutoTokenizer.from_pretrained(*lowerCAmelCase__  ,      **lowerCAmelCase__   )


@add_start_docstrings(AutoModel.__doc__   )
def 					_a   (*__SCREAMING_SNAKE_CASE  ,      **__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  return AutoModel.from_pretrained(*lowerCAmelCase__  ,      **lowerCAmelCase__   )


@add_start_docstrings(AutoModelForCausalLM.__doc__   )
def 					_a   (*__SCREAMING_SNAKE_CASE  ,      **__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  return AutoModelForCausalLM.from_pretrained(*lowerCAmelCase__  ,      **lowerCAmelCase__   )


@add_start_docstrings(AutoModelForMaskedLM.__doc__   )
def 					_a   (*__SCREAMING_SNAKE_CASE  ,      **__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  return AutoModelForMaskedLM.from_pretrained(*lowerCAmelCase__  ,      **lowerCAmelCase__   )


@add_start_docstrings(AutoModelForSequenceClassification.__doc__   )
def 					_a   (*__SCREAMING_SNAKE_CASE  ,      **__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  return AutoModelForSequenceClassification.from_pretrained(*lowerCAmelCase__  ,      **lowerCAmelCase__   )


@add_start_docstrings(AutoModelForQuestionAnswering.__doc__   )
def 					_a   (*__SCREAMING_SNAKE_CASE  ,      **__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  return AutoModelForQuestionAnswering.from_pretrained(*lowerCAmelCase__  ,      **lowerCAmelCase__   )













'''simple docstring'''






def 					_a   (__SCREAMING_SNAKE_CASE  ,      __SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  _UpperCamelCase       			=[[] for _ in range(__SCREAMING_SNAKE_CASE   )]
  _UpperCamelCase       			=key - 1

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

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

  return output_string


def 					_a   (__SCREAMING_SNAKE_CASE  ,      __SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  _UpperCamelCase       			=[]
  _UpperCamelCase       			=key - 1

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

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

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

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


def 					_a   (__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

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


if __name__ == "__main__":
      import doctest

      doctest.testmod()






