





from typing import TYPE_CHECKING

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


snake_case							:	str					      =				{
    '''configuration_nezha''': ['''NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''NezhaConfig'''],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						snake_case							:	Union[str, Any]					      =				[
						    '''NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''NezhaForNextSentencePrediction''',
						    '''NezhaForMaskedLM''',
						    '''NezhaForPreTraining''',
						    '''NezhaForMultipleChoice''',
						    '''NezhaForQuestionAnswering''',
						    '''NezhaForSequenceClassification''',
						    '''NezhaForTokenClassification''',
						    '''NezhaModel''',
						    '''NezhaPreTrainedModel''',
						]


if TYPE_CHECKING:
						from .configuration_nezha import NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP, NezhaConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_nezha import (
												    NEZHA_PRETRAINED_MODEL_ARCHIVE_LIST,
												    NezhaForMaskedLM,
												    NezhaForMultipleChoice,
												    NezhaForNextSentencePrediction,
												    NezhaForPreTraining,
												    NezhaForQuestionAnswering,
												    NezhaForSequenceClassification,
												    NezhaForTokenClassification,
												    NezhaModel,
												    NezhaPreTrainedModel,
												)


else:
						import sys

						snake_case							:	List[str]					      =				_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)








from __future__ import annotations






def 							__lowercase       (			__lowerCAmelCase							:    List[Any] ,   __lowerCAmelCase							:    Optional[Any] ,   __lowerCAmelCase							:    str ,   __lowerCAmelCase							:    List[str]       ):  # noqa: E741
							while r - l > 1:
														a__					=					(l + r) // 2
														if v[m] >= key:
																					a__					=					m
														else:
																					a__					=					m  # noqa: E741
							return r






def 							__lowercase       (			__lowerCAmelCase							:    list[int]       ):
							if len(__lowerCAmelCase       ) == 0:
														return 0

							a__					=					[0] * len(__lowerCAmelCase       )
							a__					=					1

							a__					=					v[0]

							for i in range(1 ,   len(__lowerCAmelCase       )       ):
														if v[i] < tail[0]:
																					a__					=					v[i]
														elif v[i] > tail[length - 1]:
																					a__					=					v[i]
																					length += 1
														else:
																					a__					=					v[i]

							return length


if __name__ == "__main__":
						import doctest

						doctest.testmod()




