
from ...configuration_utils import PretrainedConfig
from ...utils import logging


snake_case__      :		List[str]				=       logging.get_logger(__name__)

snake_case__      :		List[Any]				=       {
    'facebook/timesformer': 'https://huggingface.co/facebook/timesformer/resolve/main/config.json',
}





class 						_a   (						a__       ):

       """simple docstring"""





       snake_case				="""timesformer"""
       def __init__(					self       ,					_snake_case=224       ,					_snake_case=16       ,					_snake_case=3       ,					_snake_case=8       ,					_snake_case=768       ,					_snake_case=12       ,					_snake_case=12       ,					_snake_case=3072       ,					_snake_case="gelu"       ,					_snake_case=0.0       ,					_snake_case=0.0       ,					_snake_case=0.02       ,					_snake_case=1E-6       ,					_snake_case=True       ,					_snake_case="divided_space_time"       ,					_snake_case=0       ,					**_snake_case       ,					):
        super().__init__(**__a	)

        _UpperCAmelCase 				=image_size
        _UpperCAmelCase 				=patch_size
        _UpperCAmelCase 				=num_channels
        _UpperCAmelCase 				=num_frames

        _UpperCAmelCase 				=hidden_size
        _UpperCAmelCase 				=num_hidden_layers
        _UpperCAmelCase 				=num_attention_heads
        _UpperCAmelCase 				=intermediate_size
        _UpperCAmelCase 				=hidden_act
        _UpperCAmelCase 				=hidden_dropout_prob
        _UpperCAmelCase 				=attention_probs_dropout_prob
        _UpperCAmelCase 				=initializer_range
        _UpperCAmelCase 				=layer_norm_eps
        _UpperCAmelCase 				=qkv_bias

        _UpperCAmelCase 				=attention_type
        _UpperCAmelCase 				=drop_path_rate









class   SCREAMING_SNAKE_CASE_			:




       '''simple docstring'''



       def __init__(						self				:				List[Any]							)					->Tuple:
          lowerCamelCase_						:   Optional[Any]		= """"""
          lowerCamelCase_						:   Dict		= """"""
          lowerCamelCase_						:   Optional[Any]		= []



       def 				_lowerCAmelCase							(						self				:				Optional[Any]		,				__a				:				int		,				__a				:				int							)					->int:
          if m == -1:
             return n + 1
          elif n == -1:
             return m + 1
          elif self.dp[m][n] > -1:
             return self.dp[m][n]
          else:
             if self.worda[m] == self.worda[n]:
                lowerCamelCase_						:   Optional[Any]		= self.__min_dist_top_down_dp(m - 1		,				n - 1							)
             else:
                lowerCamelCase_						:   List[Any]		= self.__min_dist_top_down_dp(__a		,				n - 1							)
                lowerCamelCase_						:   Union[str, Any]		= self.__min_dist_top_down_dp(m - 1		,				__a							)
                lowerCamelCase_						:   Any		= self.__min_dist_top_down_dp(m - 1		,				n - 1							)
                lowerCamelCase_						:   Tuple		= 1 + min(__a		,				__a		,				__a							)

             return self.dp[m][n]



       def 				_lowerCAmelCase							(						self				:				Any		,				__a				:				str		,				__a				:				str							)					->int:
          lowerCamelCase_						:   Dict		= worda
          lowerCamelCase_						:   str		= worda
          lowerCamelCase_						:   Union[str, Any]		= [[-1 for _ in range(len(__a							)							)] for _ in range(len(__a							)							)]

          return self.__min_dist_top_down_dp(len(__a							) - 1		,				len(__a							) - 1							)




       def 				_lowerCAmelCase							(						self				:				int		,				__a				:				str		,				__a				:				str							)					->int:
          lowerCamelCase_						:   Tuple		= worda
          lowerCamelCase_						:   Optional[Any]		= worda
          lowerCamelCase_						:   Tuple		= len(__a							)
          lowerCamelCase_						:   Optional[Any]		= len(__a							)
          lowerCamelCase_						:   List[Any]		= [[0 for _ in range(n + 1							)] for _ in range(m + 1							)]

          for i in range(m + 1							):
             for j in range(n + 1							):
                if i == 0:  # first string is empty
                   lowerCamelCase_						:   Optional[Any]		= j
                elif j == 0:  # second string is empty
                   lowerCamelCase_						:   Any		= i
                elif worda[i - 1] == worda[j - 1]:  # last characters are equal
                   lowerCamelCase_						:   Tuple		= self.dp[i - 1][j - 1]
                else:
                   lowerCamelCase_						:   Dict		= self.dp[i][j - 1]
                   lowerCamelCase_						:   Union[str, Any]		= self.dp[i - 1][j]
                   lowerCamelCase_						:   Any		= self.dp[i - 1][j - 1]
                   lowerCamelCase_						:   Optional[int]		= 1 + min(__a		,				__a		,				__a							)
          return self.dp[m][n]


if __name__ == "__main__":
      snake_case__				:	Optional[Any]					       =					EditDistance()

      print('****************** Testing Edit Distance DP Algorithm ******************')
      print()

      snake_case__				:	Union[str, Any]					       =					input('Enter the first string: ').strip()
      snake_case__				:	List[Any]					       =					input('Enter the second string: ').strip()

      print()
      print(F'The minimum edit distance is: {solver.min_dist_top_down(Sa, Sa)}')
      print(F'The minimum edit distance is: {solver.min_dist_bottom_up(Sa, Sa)}')
      print()
      print('*************** End of Testing Edit Distance DP Algorithm ***************')





