

def    SCREAMING_SNAKE_CASE__       (  lowerCamelCase__	, lowerCamelCase__	, lowerCamelCase__	, lowerCamelCase__			)  ->     Tuple:
	__lowerCamelCase       , __lowerCamelCase				:				Dict					       = len(lowerCamelCase__			), len(grid[0]			)
	if (
	    min(lowerCamelCase__	, lowerCamelCase__			) < 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)			)

	__lowerCamelCase				:				int					       = 0
	count += depth_first_search(lowerCamelCase__	, row + 1	, lowerCamelCase__	, lowerCamelCase__			)
	count += depth_first_search(lowerCamelCase__	, row - 1	, lowerCamelCase__	, lowerCamelCase__			)
	count += depth_first_search(lowerCamelCase__	, lowerCamelCase__	, col + 1	, lowerCamelCase__			)
	count += depth_first_search(lowerCamelCase__	, lowerCamelCase__	, col - 1	, lowerCamelCase__			)

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


if __name__ == "__main__":
					import doctest

					doctest.testmod()








'''simple docstring'''




import pickle
import unittest

import torch

from accelerate import Accelerator
from accelerate.state import AcceleratorState
from accelerate.test_utils import require_cpu

@require_cpu
class 		UpperCAmelCase_      (  unittest.TestCase		):





     def 							__UpperCAmelCase      ( self       :      str    )				->  List[Any]:
        lowerCAmelCase     =			torch.nn.Linear(1_0    ,      1_0    )
        lowerCAmelCase     =			torch.optim.SGD(model.parameters()    ,      0.1    )
        lowerCAmelCase     =			Accelerator()
        lowerCAmelCase     =			accelerator.prepare(UpperCAmelCase__    )
        try:
           pickle.loads(pickle.dumps(UpperCAmelCase__    )    )
        except Exception as e:
           self.fail(F'''Accelerated optimizer pickling failed with {e}'''    )
        AcceleratorState._reset_state()





