





import argparse
from collections import defaultdict

def     a_       (					lowerCAmelCase_ :     Optional[int],      lowerCAmelCase_ :     Optional[int],      lowerCAmelCase_ :     str,      lowerCAmelCase_ :     int,      lowerCAmelCase_ :     List[str]      ):
   __lowerCAmelCase				      =      F"""{file}_{class_name}_{test_name}"""
   done_test[_id] += 1

   with open(lowerCAmelCase_,      'r'      ) as f:
      __lowerCAmelCase				      =      f.readlines()

   __lowerCAmelCase				      =      F"""class {class_name}("""
   __lowerCAmelCase				      =      F"""{4 * " "}def {test_name}("""
   __lowerCAmelCase				      =      F"""{8 * " "}{correct_line.split()[0]}"""
   __lowerCAmelCase				      =      F"""{16 * " "}{correct_line.split()[0]}"""
   __lowerCAmelCase				      =      False
   __lowerCAmelCase				      =      False
   __lowerCAmelCase				      =      False
   __lowerCAmelCase				      =      False
   __lowerCAmelCase				      =      0
   __lowerCAmelCase				      =      0

   __lowerCAmelCase				      =      []
   for line in lines:
      if line.startswith(lowerCAmelCase_      ):
         __lowerCAmelCase				      =      True
      elif in_class and line.startswith(lowerCAmelCase_      ):
         __lowerCAmelCase				      =      True
      elif in_class and in_func and (line.startswith(lowerCAmelCase_      ) or line.startswith(lowerCAmelCase_      )):
         __lowerCAmelCase				      =      len(line.split(correct_line.split()[0]      )[0]      )
         count += 1

         if count == done_test[_id]:
            __lowerCAmelCase				      =      True

      if in_class and in_func and in_line:
         if ")" not in line:
            continue
         else:
            __lowerCAmelCase				      =      True

      if in_class and in_func and in_line and insert_line:
         new_lines.append(F"""{spaces * " "}{correct_line}"""      )
         __lowerCAmelCase				      =      __lowerCAmelCase				      =      __lowerCAmelCase				      =      __lowerCAmelCase				      =      False
      else:
         new_lines.append(lowerCAmelCase_      )

   with open(lowerCAmelCase_,      'w'      ) as f:
      for line in new_lines:
         f.write(lowerCAmelCase_      )

def     a_       (					lowerCAmelCase_ :     Tuple,      lowerCAmelCase_ :     Any=None      ):
   if fail is not None:
      with open(lowerCAmelCase_,      'r'      ) as f:
         __lowerCAmelCase				      =      {l.strip() for l in f.readlines()}
   else:
      __lowerCAmelCase				      =      None

   with open(lowerCAmelCase_,      'r'      ) as f:
      __lowerCAmelCase				      =      f.readlines()

   __lowerCAmelCase				      =      defaultdict(lowerCAmelCase_      )
   for line in correct_lines:
      __lowerCAmelCase      ,      __lowerCAmelCase      ,      __lowerCAmelCase      ,      __lowerCAmelCase				      =      line.split(';'      )
      if test_failures is None or "::".join([file, class_name, test_name]      ) in test_failures:
         overwrite_file(lowerCAmelCase_,      lowerCAmelCase_,      lowerCAmelCase_,      lowerCAmelCase_,      lowerCAmelCase_      )


if __name__ == "__main__":
     _snake_case    :       List[str]		       =    argparse.ArgumentParser()
     parser.add_argument('--correct_filename', help='filename of tests with expected result')
     parser.add_argument('--fail_filename', help='filename of test failures', type=str, default=None)
     _snake_case    :       str		       =    parser.parse_args()

     main(args.correct_filename, args.fail_filename)





'''simple docstring'''






from __future__ import annotations


def    _snake_case  (	A			)		->       bool:
							lowerCAmelCase__			  =      str(A			)
							return len(A			) == 9 and set(A			) == set('''123456789'''			)


def    _snake_case  (	)		->       int | None:
							for base_num in range(9999					,       4999					,       -1			):
														lowerCAmelCase__			  =      100002 * base_num
														if is_9_pandigital(A			):
																					return candidate

							for base_num in range(333					,       99					,       -1			):
														lowerCAmelCase__			  =      1002003 * base_num
														if is_9_pandigital(A			):
																					return candidate

							return None


if __name__ == "__main__":
		print(f"""{solution() = }""")