

'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


a   :			Tuple         = {}

try:
				if not is_sentencepiece_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				a   :			Dict         = ["NllbTokenizer"]

try:
				if not is_tokenizers_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				a   :			Tuple         = ["NllbTokenizerFast"]


if TYPE_CHECKING:
				try:
								if not is_sentencepiece_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_nllb import NllbTokenizer

				try:
								if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .tokenization_nllb_fast import NllbTokenizerFast

else:
				import sys

				a   :			Dict         = _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)


class      A__							:






				def __init__(						self					:      Dict    ,     a					:      list[int]   ):






							'''simple docstring'''







							lowerCAmelCase__      :      Union[str, Any]         =		len(a   )
							lowerCAmelCase__      :      Optional[Any]         =		[0] * len_array

							if len_array > 0:
										lowerCAmelCase__      :      List[Any]         =		array[0]

							for i in range(1    ,     a   ):
										lowerCAmelCase__      :      Optional[int]         =		self.prefix_sum[i - 1] + array[i]






				def 							_lowerCamelCase		(						self					:      int    ,     a					:      int    ,     a					:      int   ):






							'''simple docstring'''







							if start == 0:
										return self.prefix_sum[end]

							return self.prefix_sum[end] - self.prefix_sum[start - 1]






				def 							_lowerCamelCase		(						self					:      Optional[Any]    ,     a					:      int   ):






							'''simple docstring'''







							lowerCAmelCase__      :      Any         =		{0}
							for sum_item in self.prefix_sum:
										if sum_item - target_sum in sums:
													return True

										sums.add(a   )

							return False


if __name__ == "__main__":
					import doctest

					doctest.testmod()