

'''simple docstring'''

from __future__ import annotations





def       lowercase					(     __magic_name__ ,    __magic_name__ ,    __magic_name__ ,    __magic_name__							):  # noqa: E741



					'''simple docstring'''







					while r - l > 1:
										UpperCAmelCase		:							List[str]   					=   (l + r) // 2
										if v[m] >= key:
															UpperCAmelCase		:							int   					=   m
										else:
															UpperCAmelCase		:							int   					=   m  # noqa: E741
					return r





def       lowercase					(     __magic_name__							):



					'''simple docstring'''







					if len(__A							) == 0:
										return 0

					UpperCAmelCase		:							Optional[Any]   					=   [0] * len(__A							)
					UpperCAmelCase		:							Optional[Any]   					=   1

					UpperCAmelCase		:							Tuple   					=   v[0]

					for i in range(1 ,    len(__A							)							):
										if v[i] < tail[0]:
															UpperCAmelCase		:							List[Any]   					=   v[i]
										elif v[i] > tail[length - 1]:
															UpperCAmelCase		:							str   					=   v[i]
															length += 1
										else:
															UpperCAmelCase		:							str   					=   v[i]

					return length


if __name__ == "__main__":
				import doctest

				doctest.testmod()


'''simple docstring'''







from typing import TYPE_CHECKING

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


lowercase    :							Any      =					{
    "configuration_chinese_clip": [
        "CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "ChineseCLIPConfig",
        "ChineseCLIPOnnxConfig",
        "ChineseCLIPTextConfig",
        "ChineseCLIPVisionConfig",
    ],
    "processing_chinese_clip": ["ChineseCLIPProcessor"],
}

try:
					if not is_vision_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowercase    :							Optional[Any]      =					["ChineseCLIPFeatureExtractor"]
					lowercase    :							List[Any]      =					["ChineseCLIPImageProcessor"]

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowercase    :							Any      =					[
					    "CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "ChineseCLIPModel",
					    "ChineseCLIPPreTrainedModel",
					    "ChineseCLIPTextModel",
					    "ChineseCLIPVisionModel",
					]

if TYPE_CHECKING:
					from .configuration_chinese_clip import (
					    CHINESE_CLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    ChineseCLIPConfig,
					    ChineseCLIPOnnxConfig,
					    ChineseCLIPTextConfig,
					    ChineseCLIPVisionConfig,
					)
					from .processing_chinese_clip import ChineseCLIPProcessor

					try:
										if not is_vision_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .feature_extraction_chinese_clip import ChineseCLIPFeatureExtractor, ChineseCLIPImageProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_chinese_clip import (
										    CHINESE_CLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
										    ChineseCLIPModel,
										    ChineseCLIPPreTrainedModel,
										    ChineseCLIPTextModel,
										    ChineseCLIPVisionModel,
										)

else:
					import sys

					lowercase    :							List[Any]      =					_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

