






def 					SCREAMING_SNAKE_CASE    (			snake_case_ :							list[list[int]]					,  snake_case_ :							int					,  snake_case_ :							int					,  snake_case_ :							set       ):
	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__			:				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 typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__lowerCamelCase :      Union[str, Any]										=				{
    """configuration_time_series_transformer""": [
        """TIME_SERIES_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """TimeSeriesTransformerConfig""",
    ],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowerCamelCase :      Tuple										=				[
	    """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

	__lowerCamelCase :      Tuple										=				_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



