
# this script reports modified .py files under the desired list of top-level sub-dirs passed as a list of arguments, e.g.:
#   python ./utils/get_modified_files.py utils src tests examples
#
# it uses git to find the forking point and which files were modified - i.e. files not under git won't be considered
# since the output of this script is fed into Makefile commands it doesn't print a newline after the results

import re
import subprocess
import sys


__lowerCAmelCase			:     int           =   subprocess.check_output('git merge-base main HEAD'.split()).decode('utf-8')
__lowerCAmelCase			:     Any           =   (
    subprocess.check_output(F'''git diff --diff-filter=d --name-only {fork_point_sha}'''.split()).decode('utf-8').split()
)

__lowerCAmelCase			:     str           =   '|'.join(sys.argv[1:])
__lowerCAmelCase			:     Tuple           =   re.compile(RF'''^({joined_dirs}).*?\.py$''')

__lowerCAmelCase			:     Union[str, Any]           =   [x for x in modified_files if regex.match(x)]
print(' '.join(relevant_modified_files), end='')




'''simple docstring'''






from __future__ import annotations


def 		_A     (    A__      ):






 """simple docstring"""



 __lowercase							  = len(A__      )
 # We need to create solution object to save path.
 __lowercase							  = [[0 for _ in range(A__      )] for _ in range(A__      )]
 __lowercase							  = run_maze(A__     ,				0     ,				0     ,				A__      )
 if solved:
  print('''\n'''.join(str(A__      ) for row in solutions      )      )
 else:
  print('''No solution exists!'''      )
 return solved


def 		_A     (    A__     ,				A__     ,				A__     ,				A__      ):






 """simple docstring"""



 __lowercase							  = len(A__      )
 # Final check point.
 if i == j == (size - 1):
  __lowercase							  = 1
  return True

 __lowercase							  = (not i < 0) and (not j < 0)  # Check lower bounds
 __lowercase							  = (i < size) and (j < size)  # Check upper bounds

 if lower_flag and upper_flag:
  # check for already visited and block points.
  __lowercase							  = (not solutions[i][j]) and (not maze[i][j])
  if block_flag:
   # check visited
   __lowercase							  = 1

   # check for directions
   if (
       run_maze(A__     ,				i + 1     ,				A__     ,				A__      )
       or run_maze(A__     ,				A__     ,				j + 1     ,				A__      )
       or run_maze(A__     ,				i - 1     ,				A__     ,				A__      )
       or run_maze(A__     ,				A__     ,				j - 1     ,				A__      )
   ):
    return True

   __lowercase							  = 0
   return False
 return False


if __name__ == "__main__":
 import doctest

 doctest.testmod()

