
"""simple docstring"""


from copy import deepcopy







class 					lowerCAmelCase_					:



						'''simple docstring'''


						def __init__(			self  :   Optional[Any]	,A_  :   list[int] | None = None	,A_  :   int | None = None   )  -> None:

							if arr is None and size is not None:
								A     = size
								A     = [0] * size
							elif arr is not None:
								self.init(A_   )
							else:
								raise ValueError('Either arr or size must be specified'   )


						def     _SCREAMING_SNAKE_CASE   (			self  :   Tuple	,A_  :   list[int]   )  -> None:
							A     = len(A_   )
							A     = deepcopy(A_   )
							for i in range(1	,self.size   ):
								A     = self.next_(A_   )
								if j < self.size:
									self.tree[j] += self.tree[i]


						def     _SCREAMING_SNAKE_CASE   (			self  :   Optional[int]   )  -> list[int]:
							A     = self.tree[:]
							for i in range(self.size - 1	,0	,-1   ):
								A     = self.next_(A_   )
								if j < self.size:
									arr[j] -= arr[i]
							return arr


						@staticmethod
						def     _SCREAMING_SNAKE_CASE   (			A_  :   int   )  -> int:
							return index + (index & (-index))


						@staticmethod
						def     _SCREAMING_SNAKE_CASE   (			A_  :   int   )  -> int:
							return index - (index & (-index))


						def     _SCREAMING_SNAKE_CASE   (			self  :   Union[str, Any]	,A_  :   int	,A_  :   int   )  -> None:
							if index == 0:
								self.tree[0] += value
								return
							while index < self.size:
								self.tree[index] += value
								A     = self.next_(A_   )


						def     _SCREAMING_SNAKE_CASE   (			self  :   int	,A_  :   int	,A_  :   int   )  -> None:
							self.add(A_	,value - self.get(A_   )   )


						def     _SCREAMING_SNAKE_CASE   (			self  :   Union[str, Any]	,A_  :   int   )  -> int:
							if right == 0:
								return 0
							A     = self.tree[0]
							right -= 1  # make right inclusive
							while right > 0:
								result += self.tree[right]
								A     = self.prev(A_   )
							return result


						def     _SCREAMING_SNAKE_CASE   (			self  :   str	,A_  :   int	,A_  :   int   )  -> int:
							return self.prefix(A_   ) - self.prefix(A_   )


						def     _SCREAMING_SNAKE_CASE   (			self  :   Dict	,A_  :   int   )  -> int:
							return self.query(A_	,index + 1   )




						def     _SCREAMING_SNAKE_CASE   (			self  :   Dict	,A_  :   int   )  -> int:
							value -= self.tree[0]
							if value < 0:
								return -1

							A     = 1  # Largest power of 2 <= size
							while j * 2 < self.size:
								j *= 2

							A     = 0

							while j > 0:
								if i + j < self.size and self.tree[i + j] <= value:
									value -= self.tree[i + j]
									i += j
								j //= 2
							return i


if __name__ == "__main__":
		import doctest

		doctest.testmod()

"""simple docstring"""


from typing import TYPE_CHECKING

from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowercase				 =					{
    '''configuration_mctct''': ['''MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MCTCTConfig'''],
    '''feature_extraction_mctct''': ['''MCTCTFeatureExtractor'''],
    '''processing_mctct''': ['''MCTCTProcessor'''],
}


try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase				 =					[
		    '''MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''MCTCTForCTC''',
		    '''MCTCTModel''',
		    '''MCTCTPreTrainedModel''',
		]


if TYPE_CHECKING:
		from .configuration_mctct import MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP, MCTCTConfig
		from .feature_extraction_mctct import MCTCTFeatureExtractor
		from .processing_mctct import MCTCTProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_mctct import MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST, MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel

else:
		import sys

		_lowercase				 =					_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)