



'''simple docstring'''






def 			snake_case_					( _lowerCAmelCase  :						int       ,				_lowerCAmelCase  :						int       ,				_lowerCAmelCase  :						int       ,				_lowerCAmelCase  :						int  )				->       int:
							return len_board * len_board_column * row + column


def 			snake_case_					( _lowerCAmelCase  :						list[list[str]]       ,				_lowerCAmelCase  :						str       ,				_lowerCAmelCase  :						int       ,				_lowerCAmelCase  :						int       ,				_lowerCAmelCase  :						int       ,				_lowerCAmelCase  :						set[int]       ,				)				->       bool:

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

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

							UpperCAmelCase			:	str										=		[(0, 1), (0, -1), (-1, 0), (1, 0)]
							UpperCAmelCase			:	Optional[Any]										=		len(_lowerCAmelCase  )
							UpperCAmelCase			:	Optional[Any]										=		len(board[0]  )
							for direction in traverts_directions:
														UpperCAmelCase			:	List[str]										=		row + direction[0]
														UpperCAmelCase			:	Tuple										=		column + direction[1]
														if not (0 <= next_i < len_board and 0 <= next_j < len_board_column):
																					continue

														UpperCAmelCase			:	Tuple										=		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 			snake_case_					( _lowerCAmelCase  :						list[list[str]]       ,				_lowerCAmelCase  :						str  )				->       bool:
							UpperCAmelCase			:	Union[str, Any]										=		(
							    '''The board should be a non empty matrix of single chars strings.'''
							)

							UpperCAmelCase			:	List[str]										=		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.'''  )

							UpperCAmelCase			:	Any										=		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 re


def 			snake_case_					( _lowerCAmelCase  :						List[str]  )				->       Dict:
							def docstring_decorator(_lowerCAmelCase  :						List[str]  ):
														UpperCAmelCase			:	str										=		fn.__doc__
														UpperCAmelCase			:	List[str]										=		func_doc.split('''\n'''  )
														UpperCAmelCase			:	Optional[Any]										=		0
														while i < len(_lowerCAmelCase  ) and re.search(R'''^\s*Examples?:\s*$'''       ,				lines[i]  ) is None:
																					i += 1
														if i < len(_lowerCAmelCase  ):
																					UpperCAmelCase			:	Union[str, Any]										=		example_docstring
																					UpperCAmelCase			:	Tuple										=		'''\n'''.join(_lowerCAmelCase  )
														else:
																					raise ValueError(
																					    f"""The function {fn} should have an empty 'Examples:' in its docstring as placeholder, """
																					    f"""current docstring is:\n{func_doc}"""  )
														UpperCAmelCase			:	Any										=		func_doc
														return fn

							return docstring_decorator





