
def 				lowercase      (_lowerCAmelCase				,  _lowerCAmelCase				,  _lowerCAmelCase				,  _lowerCAmelCase		):
						return len_board * len_board_column * row + column

def 				lowercase      (_lowerCAmelCase				,  _lowerCAmelCase				,  _lowerCAmelCase				,  _lowerCAmelCase				,  _lowerCAmelCase				,  _lowerCAmelCase				,  ):

						if board[row][column] != word[word_index]:
												return False

						if word_index == len(_lowerCamelCase		) - 1:
												return True

						__lowerCAmelCase        =       [(0, 1), (0, -1), (-1, 0), (1, 0)]
						__lowerCAmelCase        =       len(_lowerCamelCase		)
						__lowerCAmelCase        =       len(board[0]		)
						for direction in traverts_directions:
												__lowerCAmelCase        =       row + direction[0]
												__lowerCAmelCase        =       column + direction[1]
												if not (0 <= next_i < len_board and 0 <= next_j < len_board_column):
																		continue

												__lowerCAmelCase        =       get_point_key(_lowerCamelCase				,  _lowerCamelCase				,  _lowerCamelCase				,  _lowerCamelCase		)
												if key in visited_points_set:
																		continue

												visited_points_set.add(_lowerCamelCase		)
												if exits_word(_lowerCamelCase				,  _lowerCamelCase				,  _lowerCamelCase				,  _lowerCamelCase				,  word_index + 1				,  _lowerCamelCase		):
																		return True

												visited_points_set.remove(_lowerCamelCase		)

						return False

def 				lowercase      (_lowerCAmelCase				,  _lowerCAmelCase		):
						__lowerCAmelCase        =       (
						    """The board should be a non empty matrix of single chars strings."""
						)

						__lowerCAmelCase        =       len(_lowerCamelCase		)
						if not isinstance(_lowerCamelCase				,  _lowerCamelCase		) or len(_lowerCamelCase		) == 0:
												raise ValueError(_lowerCamelCase		)

						for row in board:
												if not isinstance(_lowerCamelCase				,  _lowerCamelCase		) or len(_lowerCamelCase		) == 0:
																		raise ValueError(_lowerCamelCase		)

												for item in row:
																		if not isinstance(_lowerCamelCase				,  _lowerCamelCase		) or len(_lowerCamelCase		) != 1:
																								raise ValueError(_lowerCamelCase		)

												# Validate word
						if not isinstance(_lowerCamelCase				,  _lowerCamelCase		) or len(_lowerCamelCase		) == 0:
												raise ValueError(
												    """The word parameter should be a string of length greater than 0."""		)

						__lowerCAmelCase        =       len(board[0]		)
						for i in range(_lowerCamelCase		):
												for j in range(_lowerCamelCase		):
																		if exits_word(
																		    _lowerCamelCase				,  _lowerCamelCase				,  _lowerCamelCase				,  _lowerCamelCase				,  0				,  {get_point_key(_lowerCamelCase				,  _lowerCamelCase				,  _lowerCamelCase				,  _lowerCamelCase		)}		):
																								return True

						return False


if __name__ == "__main__":
			import doctest

			doctest.testmod()


"""simple docstring"""
import unittest

from transformers import is_torch_available, load_tool

from .test_tools_common import ToolTesterMixin


if is_torch_available():
			import torch
class      lowerCAmelCase_						(							unittest.TestCase							,							A__				):



							'''simple docstring'''





							def  A__		(				self							)   ->       Any:
													__lowerCAmelCase        =       load_tool("""speech-to-text"""							)
													self.tool.setup()




							def  A__		(				self							)   ->       int:
													__lowerCAmelCase        =       self.tool(torch.ones(3_000							)							)
													self.assertEqual(snake_case_  ,							""" you"""							)




							def  A__		(				self							)   ->       Optional[int]:
													__lowerCAmelCase        =       self.tool(audio=torch.ones(3_000							)							)
													self.assertEqual(snake_case_  ,							""" you"""							)
