





'''simple docstring'''




def 			_lowerCAmelCase     (    __snake_case    :					list[list[int]]					,				__snake_case    :					int					,				__snake_case    :					int					,				__snake_case    :					set     )	->	int:
     __A					,__A		:					str						=			len(__snake_case     ), len(grid[0]     )
     if (
         min(__snake_case					,				__snake_case     ) < 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)     )

     __A		:					int						=			0
     count += depth_first_search(__snake_case					,				row + 1					,				__snake_case					,				__snake_case     )
     count += depth_first_search(__snake_case					,				row - 1					,				__snake_case					,				__snake_case     )
     count += depth_first_search(__snake_case					,				__snake_case					,				col + 1					,				__snake_case     )
     count += depth_first_search(__snake_case					,				__snake_case					,				col - 1					,				__snake_case     )

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


if __name__ == "__main__":
  import doctest

  doctest.testmod()



from ...utils import is_torch_available, is_transformers_available


if is_transformers_available() and is_torch_available():
 from .pipeline_vq_diffusion import LearnedClassifierFreeSamplingEmbeddings, VQDiffusionPipeline




