'''simple docstring'''





def      lowerCAmelCase_    ( snake_case_	:			Any ,   snake_case_	:			Any ,   snake_case_	:			Optional[int] ,   snake_case_	:			str      )   ->				Optional[int]:


     '''simple docstring'''




     UpperCAmelCase_	   =       len(lowercase__      ), len(grid[0]      )
     if (
         min(lowercase__ ,   lowercase__      ) < 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)      )

     UpperCAmelCase_	   =       0
     count += depth_first_search(lowercase__ ,   row + 1 ,   lowercase__ ,   lowercase__      )
     count += depth_first_search(lowercase__ ,   row - 1 ,   lowercase__ ,   lowercase__      )
     count += depth_first_search(lowercase__ ,   lowercase__ ,   col + 1 ,   lowercase__      )
     count += depth_first_search(lowercase__ ,   lowercase__ ,   col - 1 ,   lowercase__      )

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


if __name__ == "__main__":
    import doctest

    doctest.testmod()





'''simple docstring'''





import unittest

from transformers import load_tool
from transformers.utils import is_torch_available


if is_torch_available():
    import torch

from transformers.testing_utils import require_torch

from .test_tools_common import ToolTesterMixin




@require_torch
class 	__A				(			unittest.TestCase		,     UpperCamelCase__     ):



    def  _lowercase						(self   :   Tuple			):
         UpperCAmelCase_	   =       load_tool("text-to-speech"			)
         self.tool.setup()



    def  _lowercase						(self   :   Union[str, Any]			):
         # SpeechT5 isn't deterministic
         torch.manual_seed(0			)
         UpperCAmelCase_	   =       self.tool("hey"			)
         UpperCAmelCase_	   =       result.to_raw()
         self.assertTrue(
             torch.allclose(
                 resulting_tensor[:3]       ,      torch.tensor([-0.0_00_59_66_66_88_32_11_58_29, -0.0_00_36_57_64_01_90_79_50_64, -0.00_01_34_39_50_27_99_88_34_85]			)       ,      )			)






    def  _lowercase						(self   :   List[str]			):
         # SpeechT5 isn't deterministic
         torch.manual_seed(0			)
         UpperCAmelCase_	   =       self.tool("hey"			)
         UpperCAmelCase_	   =       result.to_raw()
         self.assertTrue(
             torch.allclose(
                 resulting_tensor[:3]       ,      torch.tensor([-0.0_00_59_66_66_88_32_11_58_29, -0.0_00_36_57_64_01_90_79_50_64, -0.00_01_34_39_50_27_99_88_34_85]			)       ,      )			)




