
'''simple docstring'''



def A (__lowerCamelCase :list[list[int]]					,      __lowerCamelCase :int					,      __lowerCamelCase :int					,      __lowerCamelCase :set						):
						_lowerCAmelCase    		=					len(_lowerCAmelCase						), len(grid[0]						)
						if (
						    min(_lowerCAmelCase					,      _lowerCAmelCase						) < 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)						)

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

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


if __name__ == "__main__":
						import doctest

						doctest.testmod()







import logging

from transformers import PretrainedConfig


_lowerCAmelCase				:   str						       =						logging.getLogger(__name__)


_lowerCAmelCase				:   Dict						       =						{
    '''bertabs-finetuned-cnndm''': '''https://huggingface.co/remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization/resolve/main/config.json''',
}


class        __magic_name__	(				lowerCamelCase__				):





     """simple docstring"""



     __UpperCamelCase            =  '''bertabs'''



     def __init__(				self							:Optional[int]      ,   snake_case							:Any=30_522      ,   snake_case							:List[str]=512      ,   snake_case							:str=6      ,   snake_case							:int=512      ,   snake_case							:Optional[Any]=8      ,   snake_case							:Tuple=512      ,   snake_case							:str=0.2      ,   snake_case							:Any=6      ,   snake_case							:Optional[Any]=768      ,   snake_case							:Optional[Any]=8      ,   snake_case							:List[Any]=2_048      ,   snake_case							:Dict=0.2      ,   **snake_case							:List[str]      ,   ):





        '''simple docstring'''




        super().__init__(**snake_case	)

        A_       :					List[str]        =      vocab_size
        A_       :					int        =      max_pos

        A_       :					Tuple        =      enc_layers
        A_       :					Tuple        =      enc_hidden_size
        A_       :					str        =      enc_heads
        A_       :					Optional[Any]        =      enc_ff_size
        A_       :					Optional[Any]        =      enc_dropout

        A_       :					List[str]        =      dec_layers
        A_       :					List[Any]        =      dec_hidden_size
        A_       :					Optional[int]        =      dec_heads
        A_       :					Any        =      dec_ff_size
        A_       :					Optional[int]        =      dec_dropout
