



'''simple docstring'''

def a_     (    __UpperCAmelCase				,							__UpperCAmelCase				,							__UpperCAmelCase				,							__UpperCAmelCase					)				->					int:





			"""simple docstring"""







			snake_case							,  snake_case:    Any      							=len(__UpperCAmelCase					), len(grid[0]					)
			if (
			    min(__UpperCAmelCase				,							__UpperCAmelCase					) < 0
			    or row == row_length
			    or col == col_length
			    or (row, col) in visit
			    or grid[row][col] == 1
			):
						return 0
			if row == row_length - 1 and col == col_length - 1:
						return 1

			visit.add((row, col)					)

			snake_case:    Optional[int]      							=0
			count += depth_first_search(__UpperCAmelCase				,							row + 1				,							__UpperCAmelCase				,							__UpperCAmelCase					)
			count += depth_first_search(__UpperCAmelCase				,							row - 1				,							__UpperCAmelCase				,							__UpperCAmelCase					)
			count += depth_first_search(__UpperCAmelCase				,							__UpperCAmelCase				,							col + 1				,							__UpperCAmelCase					)
			count += depth_first_search(__UpperCAmelCase				,							__UpperCAmelCase				,							col - 1				,							__UpperCAmelCase					)

			visit.remove((row, col)					)
			return count


if __name__ == "__main__":
	import doctest

	doctest.testmod()









'''simple docstring'''

import os


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_doctest_list.py
a							   =				'.'


if __name__ == "__main__":
	a							   =				os.path.join(REPO_PATH, 'utils/documentation_tests.txt')
	a							   =				[]
	a							   =				[]
	with open(doctest_file_path) as fp:
		for line in fp:
			a							   =				line.strip()
			a							   =				os.path.join(REPO_PATH, line)
			if not (os.path.isfile(path) or os.path.isdir(path)):
				non_existent_paths.append(line)
			all_paths.append(path)
	if len(non_existent_paths) > 0:
		a							   =				'\n'.join(non_existent_paths)
		raise ValueError(F"""`utils/documentation_tests.txt` contains non-existent paths:\n{non_existent_paths}""")
	if all_paths != sorted(all_paths):
		raise ValueError('Files in `utils/documentation_tests.txt` are not in alphabetical order.')




