


"""simple docstring"""
def 		lowercase							(     _snake_case						:      list[list[int]]     ,   _snake_case						:      int     ,   _snake_case						:      int     ,   _snake_case						:      set     )     ->int:
	"""simple docstring"""





	__snake_case	,							__snake_case	:						Optional[Any]						=				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)     )

	__snake_case	:						Tuple						=				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 typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCAmelCase								=						{
    'configuration_time_series_transformer': [
        'TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'TimeSeriesTransformerConfig',
    ],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__UpperCAmelCase								=						[
		    'TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TimeSeriesTransformerForPrediction',
		    'TimeSeriesTransformerModel',
		    'TimeSeriesTransformerPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_time_series_transformer import (
		    TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    TimeSeriesTransformerConfig,
		)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_time_series_transformer import (
				    TIME_SERIES_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TimeSeriesTransformerForPrediction,
				    TimeSeriesTransformerModel,
				    TimeSeriesTransformerPreTrainedModel,
				)

else:
		import sys

		__UpperCAmelCase								=						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






