



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available, is_tokenizers_available


A__       =			{}

try:
	if not is_sentencepiece_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	A__       =			["""CpmTokenizer"""]

try:
	if not is_tokenizers_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	A__       =			["""CpmTokenizerFast"""]


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

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_cpm_fast import CpmTokenizerFast

else:
	import sys

	A__       =			_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)








def 						_UpperCAmelCase							( snake_case     ):





					"""simple docstring"""

					_lowerCAmelCase         =       str(snake_case     ).strip()
					if not bin_string:
										raise ValueError("""Empty string was passed to the function"""     )
					_lowerCAmelCase         =       bin_string[0] == """-"""
					if is_negative:
										_lowerCAmelCase         =       bin_string[1:]
					if not all(char in """01""" for char in bin_string     ):
										raise ValueError("""Non-binary value was passed to the function"""     )
					_lowerCAmelCase         =       0
					for char in bin_string:
										_lowerCAmelCase         =       2 * decimal_number + int(snake_case     )
					return -decimal_number if is_negative else decimal_number


if __name__ == "__main__":
	from doctest import testmod

	testmod()



