





'''simple docstring'''






from typing import TYPE_CHECKING

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


__UpperCamelCase					    =	{
    "configuration_mobilebert": [
        "MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "MobileBertConfig",
        "MobileBertOnnxConfig",
    ],
    "tokenization_mobilebert": ["MobileBertTokenizer"],
}

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

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__UpperCamelCase					    =	[
	    "MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
	    "MobileBertForMaskedLM",
	    "MobileBertForMultipleChoice",
	    "MobileBertForNextSentencePrediction",
	    "MobileBertForPreTraining",
	    "MobileBertForQuestionAnswering",
	    "MobileBertForSequenceClassification",
	    "MobileBertForTokenClassification",
	    "MobileBertLayer",
	    "MobileBertModel",
	    "MobileBertPreTrainedModel",
	    "load_tf_weights_in_mobilebert",
	]

try:
	if not is_tf_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__UpperCamelCase					    =	[
	    "TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
	    "TFMobileBertForMaskedLM",
	    "TFMobileBertForMultipleChoice",
	    "TFMobileBertForNextSentencePrediction",
	    "TFMobileBertForPreTraining",
	    "TFMobileBertForQuestionAnswering",
	    "TFMobileBertForSequenceClassification",
	    "TFMobileBertForTokenClassification",
	    "TFMobileBertMainLayer",
	    "TFMobileBertModel",
	    "TFMobileBertPreTrainedModel",
	]


if TYPE_CHECKING:
	from .configuration_mobilebert import (
	    MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
	    MobileBertConfig,
	    MobileBertOnnxConfig,
	)
	from .tokenization_mobilebert import MobileBertTokenizer

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_mobilebert_fast import MobileBertTokenizerFast

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_mobilebert import (
		    MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    MobileBertForMaskedLM,
		    MobileBertForMultipleChoice,
		    MobileBertForNextSentencePrediction,
		    MobileBertForPreTraining,
		    MobileBertForQuestionAnswering,
		    MobileBertForSequenceClassification,
		    MobileBertForTokenClassification,
		    MobileBertLayer,
		    MobileBertModel,
		    MobileBertPreTrainedModel,
		    load_tf_weights_in_mobilebert,
		)

	try:
		if not is_tf_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tf_mobilebert import (
		    TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    TFMobileBertForMaskedLM,
		    TFMobileBertForMultipleChoice,
		    TFMobileBertForNextSentencePrediction,
		    TFMobileBertForPreTraining,
		    TFMobileBertForQuestionAnswering,
		    TFMobileBertForSequenceClassification,
		    TFMobileBertForTokenClassification,
		    TFMobileBertMainLayer,
		    TFMobileBertModel,
		    TFMobileBertPreTrainedModel,
		)

else:
	import sys

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









'''simple docstring'''




from __future__ import annotations



def 		__A		(  lowerCamelCase_			,			lowerCamelCase_	):


		"""simple docstring"""



		if partitions <= 0:
				raise ValueError("""partitions must be a positive number!"""	)
		if partitions > number_of_bytes:
				raise ValueError("""partitions can not > number_of_bytes!"""	)
		SCREAMING_SNAKE_CASE :				int		=			number_of_bytes // partitions
		SCREAMING_SNAKE_CASE :				int		=			[]
		for i in range(lowerCamelCase_	):
				SCREAMING_SNAKE_CASE :				Optional[Any]		=			i * bytes_per_partition + 1
				SCREAMING_SNAKE_CASE :				Optional[int]		=			(
				    number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition
				)
				allocation_list.append(f'''{start_bytes}-{end_bytes}'''	)
		return allocation_list


if __name__ == "__main__":
							import doctest

							doctest.testmod()



