






def       UpperCAmelCase__						(UpperCamelCase_							,UpperCamelCase_							,UpperCamelCase_							,UpperCamelCase_    ):



     """simple docstring"""






     snake_case			,  snake_case					=    len(SCREAMING_SNAKE_CASE__    ), len(grid[0]    )
     if (
         min(SCREAMING_SNAKE_CASE__							,SCREAMING_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					=    0
     count += depth_first_search(SCREAMING_SNAKE_CASE__							,row + 1							,SCREAMING_SNAKE_CASE__							,SCREAMING_SNAKE_CASE__    )
     count += depth_first_search(SCREAMING_SNAKE_CASE__							,row - 1							,SCREAMING_SNAKE_CASE__							,SCREAMING_SNAKE_CASE__    )
     count += depth_first_search(SCREAMING_SNAKE_CASE__							,SCREAMING_SNAKE_CASE__							,col + 1							,SCREAMING_SNAKE_CASE__    )
     count += depth_first_search(SCREAMING_SNAKE_CASE__							,SCREAMING_SNAKE_CASE__							,col - 1							,SCREAMING_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, is_vision_available


_SCREAMING_SNAKE_CASE      :			Dict      				=   {"configuration_van": ["VAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "VanConfig"]}


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _SCREAMING_SNAKE_CASE      :			Dict      				=   [
     "VAN_PRETRAINED_MODEL_ARCHIVE_LIST",
     "VanForImageClassification",
     "VanModel",
     "VanPreTrainedModel",
 ]

if TYPE_CHECKING:
 from .configuration_van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_van import (
      VAN_PRETRAINED_MODEL_ARCHIVE_LIST,
      VanForImageClassification,
      VanModel,
      VanPreTrainedModel,
  )

else:
 import sys

 _SCREAMING_SNAKE_CASE      :			str      				=   _LazyModule(__name__, globals()["__file__"], _import_structure)




