






class        lowerCAmelCase_				:







				"""simple docstring"""




				def __init__( self     :List[str]     ):
					UpperCamelCase__ :List[str]						=      """"""
					UpperCamelCase__ :Optional[Any]						=      """"""
					UpperCamelCase__ :Union[str, Any]						=      []







				def 				__a   ( self     :List[str]  ,     lowerCamelCase__     :int  ,     lowerCamelCase__     :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]:
							UpperCamelCase__ :str						=      self.__min_dist_top_down_dp(m - 1  ,     n - 1     )
						else:
							UpperCamelCase__ :Optional[Any]						=      self.__min_dist_top_down_dp(lowerCamelCase__  ,     n - 1     )
							UpperCamelCase__ :List[Any]						=      self.__min_dist_top_down_dp(m - 1  ,     lowerCamelCase__     )
							UpperCamelCase__ :Tuple						=      self.__min_dist_top_down_dp(m - 1  ,     n - 1     )
							UpperCamelCase__ :List[Any]						=      1 + min(lowerCamelCase__  ,     lowerCamelCase__  ,     lowerCamelCase__     )

						return self.dp[m][n]







				def 				__a   ( self     :Tuple  ,     lowerCamelCase__     :str  ,     lowerCamelCase__     :str     ):
					UpperCamelCase__ :Optional[Any]						=      worda
					UpperCamelCase__ :Union[str, Any]						=      worda
					UpperCamelCase__ :str						=      [[-1 for _ in range(len(lowerCamelCase__     )     )] for _ in range(len(lowerCamelCase__     )     )]

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







				def 				__a   ( self     :List[Any]  ,     lowerCamelCase__     :str  ,     lowerCamelCase__     :str     ):
					UpperCamelCase__ :Union[str, Any]						=      worda
					UpperCamelCase__ :str						=      worda
					UpperCamelCase__ :Dict						=      len(lowerCamelCase__     )
					UpperCamelCase__ :List[Any]						=      len(lowerCamelCase__     )
					UpperCamelCase__ :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
								UpperCamelCase__ :str						=      j
							elif j == 0:  # second string is empty
								UpperCamelCase__ :List[Any]						=      i
							elif worda[i - 1] == worda[j - 1]:  # last characters are equal
								UpperCamelCase__ :Tuple						=      self.dp[i - 1][j - 1]
							else:
								UpperCamelCase__ :Optional[int]						=      self.dp[i][j - 1]
								UpperCamelCase__ :str						=      self.dp[i - 1][j]
								UpperCamelCase__ :Union[str, Any]						=      self.dp[i - 1][j - 1]
								UpperCamelCase__ :List[str]						=      1 + min(lowerCamelCase__  ,     lowerCamelCase__  ,     lowerCamelCase__     )
					return self.dp[m][n]


if __name__ == "__main__":
							UpperCamelCase        =				EditDistance()

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

							UpperCamelCase        =				input("Enter the first string: ").strip()
							UpperCamelCase        =				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 ***************")






"""simple docstring"""


from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding



class   __SCREAMING_SNAKE_CASE     (    _UpperCamelCase ):







  '''simple docstring'''


  SCREAMING_SNAKE_CASE__				:Optional[Any]						  =       ["image_processor", "tokenizer"]
  SCREAMING_SNAKE_CASE__				:Dict						  =       "AutoImageProcessor"
  SCREAMING_SNAKE_CASE__				:Optional[int]						  =       "AutoTokenizer"

  def __init__(		self :							Dict       , __a :							Tuple       , __a :							str						)		->					Optional[Any]:
        super().__init__(__a       , __a						)
        _UpperCamelCase   :						Tuple    =							self.image_processor

  def __call__(		self :							Tuple       , __a :							Tuple=None       , __a :							str=None       , __a :							Any=None       , **__a :							Optional[Any]						)		->					Union[str, Any]:

        if text is None and images is None:
              raise ValueError("You have to specify either text or images. Both cannot be none."						)

        if text is not None:
              _UpperCamelCase   :						List[str]    =							self.tokenizer(__a       , return_tensors=__a       , **__a						)

        if images is not None:
              _UpperCamelCase   :						str    =							self.image_processor(__a       , return_tensors=__a       , **__a						)

        if text is not None and images is not None:
              _UpperCamelCase   :						Optional[int]    =							image_features.pixel_values
              return encoding
        elif text is not None:
              return encoding
        else:
              return BatchEncoding(data=dict(**__a						)       , tensor_type=__a						)

  def  __SCREAMING_SNAKE_CASE					(		self :							Optional[int]       , *__a :							Optional[int]       , **__a :							Optional[int]						)		->					List[Any]:
        return self.tokenizer.batch_decode(*__a       , **__a						)

  def  __SCREAMING_SNAKE_CASE					(		self :							int       , *__a :							Any       , **__a :							List[Any]						)		->					Tuple:
        return self.tokenizer.decode(*__a       , **__a						)


  @property
  def  __SCREAMING_SNAKE_CASE					(		self :							str						)		->					Any:
        return ["input_ids", "attention_mask", "pixel_values"]
