


from string import ascii_uppercase




def SCREAMING_SNAKE_CASE_  (				__lowerCamelCase:		List[Any]  ,			__lowerCamelCase:		int  ,			__lowerCamelCase:		List[str] = False  ,			__lowerCamelCase:		Optional[Any] = ascii_uppercase  ):







	'''simple docstring'''



	lowercase_			 = keyword.upper()
	lowercase_			 = plaintext.upper()
	lowercase_			 = set(_UpperCAmelCase  )

	# create a list of unique characters in the keyword - their order matters
	# it determines how we will map plaintext characters to the ciphertext
	lowercase_			 = []
	for char in keyword:
		if char in alphabet_set and char not in unique_chars:
			unique_chars.append(_UpperCAmelCase  )
		# the number of those unique characters will determine the number of rows
	lowercase_			 = len(_UpperCAmelCase  )

	# create a shifted version of the alphabet
	lowercase_			 = unique_chars + [
	    char for char in alphabet if char not in unique_chars
	]

	# create a modified alphabet by splitting the shifted alphabet into rows
	lowercase_			 = [
	    shifted_alphabet[k : k + num_unique_chars_in_keyword]
	    for k in range(0  ,			26  ,			_UpperCAmelCase  )
	]

	# map the alphabet characters to the modified alphabet characters
	# going 'vertically' through the modified alphabet - consider columns first
	lowercase_			 = {}
	lowercase_			 = 0
	for column in range(_UpperCAmelCase  ):
		for row in modified_alphabet:
			# if current row (the last one) is too short, break out of loop
			if len(_UpperCAmelCase  ) <= column:
				break

			# map current letter to letter in modified alphabet
			lowercase_			 = row[column]
			letter_index += 1

	if verbose:
		print(_UpperCAmelCase  )
	# create the encrypted text by mapping the plaintext to the modified alphabet
	return "".join(mapping[char] if char in mapping else char for char in plaintext  )


if __name__ == "__main__":
							# example use
							print(mixed_keyword("""college""", """UNIVERSITY"""))








"""simple docstring"""




import hashlib
import importlib.util
import json
import os
import pathlib
from types import ModuleType

import pytest
import requests

lowerCamelCase_	:		int         =   pathlib.Path.cwd().joinpath('project_euler')
lowerCamelCase_	:		str         =   pathlib.Path.cwd().joinpath(
    'scripts', 'project_euler_answers.json'
)

with open(PROJECT_EULER_ANSWERS_PATH) as file_handle:
   lowerCamelCase_	:		dict[str, str]         =   json.load(file_handle)





def 		UpperCAmelCase__						(	_UpperCAmelCase   ):






  """simple docstring"""





  A_    :			List[str]									=    importlib.util.spec_from_file_location(file_path.name					,   str(_UpperCAmelCase   )   )
  A_    :			int									=    importlib.util.module_from_spec(_UpperCAmelCase   )  # type: ignore
  spec.loader.exec_module(_UpperCAmelCase   )  # type: ignore
  return module





def 		UpperCAmelCase__						(	):






  """simple docstring"""





  A_    :			Tuple									=    []
  for problem_dir_path in PROJECT_EULER_DIR_PATH.iterdir():
    if problem_dir_path.is_file() or problem_dir_path.name.startswith('_'   ):
      continue
    for file_path in problem_dir_path.iterdir():
      if file_path.suffix != ".py" or file_path.name.startswith(('_', 'test')   ):
        continue
      solution_file_paths.append(_UpperCAmelCase   )
  return solution_file_paths





def 		UpperCAmelCase__						(	):






  """simple docstring"""





  with open(os.environ['GITHUB_EVENT_PATH']   ) as file:
    A_    :			str									=    json.load(_UpperCAmelCase   )
  return event["pull_request"]["url"] + "/files"





def 		UpperCAmelCase__						(	):






  """simple docstring"""





  A_    :			Any									=    []
  A_    :			Optional[Any]									=    {
      'Accept': 'application/vnd.github.v3+json',
      'Authorization': 'token ' + os.environ['GITHUB_TOKEN'],
  }
  A_    :			Union[str, Any]									=    requests.get(get_files_url()					,   headers=_UpperCAmelCase   ).json()
  for file in files:
    A_    :			Optional[int]									=    pathlib.Path.cwd().joinpath(file['filename']   )
    if (
        filepath.suffix != ".py"
        or filepath.name.startswith(('_', 'test')   )
        or not filepath.name.startswith('sol'   )
    ):
      continue
    solution_file_paths.append(_UpperCAmelCase   )
  return solution_file_paths





def 		UpperCAmelCase__						(	):






  """simple docstring"""





  if os.environ.get('CI'   ) and os.environ.get('GITHUB_EVENT_NAME'   ) == "pull_request":
    # Return only if there are any, otherwise default to all solutions
    if filepaths := added_solution_file_path():
      return filepaths
  return all_solution_file_paths()





@pytest.mark.parametrize(
    'solution_path'					,   collect_solution_file_paths()					,   ids=lambda _UpperCAmelCase   : f"""{path.parent.name}/{path.name}"""					,   )
def 		UpperCAmelCase__						(	_UpperCAmelCase   ):






  """simple docstring"""





  A_    :			str									=    solution_path.parent.name[8:].zfill(3   )
  A_    :			str									=    PROBLEM_ANSWERS[problem_number]
  A_    :			List[Any]									=    convert_path_to_module(_UpperCAmelCase   )
  A_    :			Optional[int]									=    str(solution_module.solution()   )  # type: ignore
  A_    :			Any									=    hashlib.shaaaa(answer.encode()   ).hexdigest()
  assert (
      answer == expected
  ), f"""Expected solution to {problem_number} to have hash {expected}, got {answer}"""