


from ..utils import DummyObject, requires_backends


class        _a							(			metaclass=UpperCamelCase__			):
							_lowercase	:			Any        = ['''torch''', '''scipy''']

							def __init__(							self:	int    ,						*UpperCamelCase_:	Any    ,						**UpperCamelCase_:	Optional[Any]							)			->   List[str]:





									"""simple docstring"""







									requires_backends(self    ,						['''torch''', '''scipy''']							)

							@classmethod
							def       lowerCamelCase_ (							cls:	Optional[int]    ,						*UpperCamelCase_:	Any    ,						**UpperCamelCase_:	List[Any]							)			->   int:





									"""simple docstring"""







									requires_backends(cls    ,						['''torch''', '''scipy''']							)


							@classmethod
							def       lowerCamelCase_ (							cls:	Any    ,						*UpperCamelCase_:	Any    ,						**UpperCamelCase_:	Dict							)			->   Optional[int]:





									"""simple docstring"""







									requires_backends(cls    ,						['''torch''', '''scipy''']							)






from __future__ import annotations


class        _a							:

							def __init__(							self:	Union[str, Any]    ,						UpperCamelCase_:	str    ,						UpperCamelCase_:	str							)			->   List[Any]:





									"""simple docstring"""







									lowercase__     ,		lowercase__            =      text, pattern
									lowercase__     ,		lowercase__            =      len(UpperCamelCase_							), len(UpperCamelCase_							)

							def       lowerCamelCase_ (							self:	Optional[int]    ,						UpperCamelCase_:	str							)			->   int:





									"""simple docstring"""







									for i in range(self.patLen - 1    ,						-1    ,						-1							):
											if char == self.pattern[i]:
													return i
									return -1

							def       lowerCamelCase_ (							self:	Optional[int]    ,						UpperCamelCase_:	int							)			->   int:





									"""simple docstring"""







									for i in range(self.patLen - 1    ,						-1    ,						-1							):
											if self.pattern[i] != self.text[current_pos + i]:
													return current_pos + i
									return -1


							def       lowerCamelCase_ (							self:	List[Any]							)			->   list[int]:





									"""simple docstring"""







									lowercase__            =      []
									for i in range(self.textLen - self.patLen + 1							):
											lowercase__            =      self.mismatch_in_text(UpperCamelCase_							)
											if mismatch_index == -1:
													positions.append(UpperCamelCase_							)
											else:
													lowercase__            =      self.match_in_pattern(self.text[mismatch_index]							)
													lowercase__            =      (
													    mismatch_index - match_index
													)  # shifting index lgtm [py/multiple-definition]
									return positions
lowerCAmelCase       =							'ABAABA'
lowerCAmelCase       =							'AB'
lowerCAmelCase       =							BoyerMooreSearch(text, pattern)
lowerCAmelCase       =							bms.bad_character_heuristic()

if len(positions) == 0:
			print('No match found')
else:
			print('Pattern found in following positions: ')
			print(positions)


