






'''simple docstring'''







import os
import tempfile
import unittest

from transformers.models.marian.convert_marian_tatoeba_to_pytorch import DEFAULT_REPO, TatoebaConverter
from transformers.testing_utils import slow
from transformers.utils import cached_property

@unittest.skipUnless(os.path.exists(_lowercase		)				,      """Tatoeba directory does not exist."""		)
class _lowercase	(				unittest.TestCase		):




							@cached_property
							def 		lowerCamelCase_				(							self:				Optional[Any]     ):
														lowerCamelCase__					:	Any         =       tempfile.mkdtemp()
														return TatoebaConverter(save_dir=UpperCamelCase__     )




							@slow
							def 		lowerCamelCase_				(							self:				Union[str, Any]     ):
														self.resolver.convert_models(["""heb-eng"""]     )




							@slow
							def 		lowerCamelCase_				(							self:				List[Any]     ):
														lowerCamelCase__  ,		lowerCamelCase__					:	Dict         =       self.resolver.write_model_card("""opus-mt-he-en"""			,							dry_run=UpperCamelCase__     )
														assert mmeta["long_pair"] == "heb-eng"









'''simple docstring'''







class _lowercase	:




							def __init__(							self:				Tuple			,							UpperCamelCase__:				list[int]     ):
														lowerCamelCase__					:	Union[str, Any]         =       len(UpperCamelCase__     )
														lowerCamelCase__					:	Union[str, Any]         =       [0] * len_array

														if len_array > 0:
																					lowerCamelCase__					:	Union[str, Any]         =       array[0]

														for i in range(1			,							UpperCamelCase__     ):
																					lowerCamelCase__					:	Tuple         =       self.prefix_sum[i - 1] + array[i]




							def 		lowerCamelCase_				(							self:				Tuple			,							UpperCamelCase__:				int			,							UpperCamelCase__:				int     ):
														if start == 0:
																					return self.prefix_sum[end]

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




							def 		lowerCamelCase_				(							self:				Optional[int]			,							UpperCamelCase__:				int     ):
														lowerCamelCase__					:	Dict         =       {0}
														for sum_item in self.prefix_sum:
																					if sum_item - target_sum in sums:
																												return True

																					sums.add(UpperCamelCase__     )

														return False


if __name__ == "__main__":
			import doctest

			doctest.testmod()

