
'''simple docstring'''





def      A (       A_							:					Tuple    ,							A_							:					Any       ):
						return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2

def      A (       A_							:					Tuple    ,							A_							:					List[Any]=0       ):
						return sorted(A_    ,							key=lambda A_       : x[column]       )

def      A (       A_							:					Optional[int]    ,							A_							:					int    ,							A_							:					List[str]=float('''inf'''       )       ):

						for i in range(points_counts - 1       ):
												for j in range(i + 1    ,							A_       ):
																		snake_case       :     Optional[int] =    euclidean_distance_sqr(points[i]    ,							points[j]       )
																		if current_dis < min_dis:
																								snake_case       :     Tuple =    current_dis
						return min_dis

def      A (       A_							:					Any    ,							A_							:					List[Any]    ,							A_							:					Any=float('''inf'''       )       ):

						for i in range(min(6    ,							points_counts - 1       )    ,							A_       ):
												for j in range(max(0    ,							i - 6       )    ,							A_       ):
																		snake_case       :     Union[str, Any] =    euclidean_distance_sqr(points[i]    ,							points[j]       )
																		if current_dis < min_dis:
																								snake_case       :     Any =    current_dis
						return min_dis

def      A (       A_							:					Tuple    ,							A_							:					str    ,							A_							:					Optional[Any]       ):

						# base case
						if points_counts <= 3:
												return dis_between_closest_pair(A_    ,							A_       )

						# recursion
						snake_case       :     str =    points_counts // 2
						snake_case       :     str =    closest_pair_of_points_sqr(
						    A_    ,							points_sorted_on_y[:mid]    ,							A_       )
						snake_case       :     List[Any] =    closest_pair_of_points_sqr(
						    A_    ,							points_sorted_on_y[mid:]    ,							points_counts - mid       )
						snake_case       :     Any =    min(A_    ,							A_       )
						snake_case       :     Union[str, Any] =    []
						for point in points_sorted_on_x:
												if abs(point[0] - points_sorted_on_x[mid][0]       ) < closest_pair_dis:
																		cross_strip.append(A_       )

						snake_case       :     Any =    dis_between_closest_in_strip(
						    A_    ,							len(A_       )    ,							A_       )
						return min(A_    ,							A_       )

def      A (       A_							:					Optional[int]    ,							A_							:					int       ):
						snake_case       :     List[str] =    column_based_sort(A_    ,							column=0       )
						snake_case       :     Optional[Any] =    column_based_sort(A_    ,							column=1       )
						return (
						    closest_pair_of_points_sqr(
						        A_    ,							A_    ,							A_       )
						) ** 0.5


if __name__ == "__main__":
						UpperCAmelCase    					=   [(2, 3), (12, 30), (40, 50), (5, 1), (12, 10), (3, 4)]
						print("Distance:", closest_pair_of_points(points, len(points)))



'''simple docstring'''





from typing import TYPE_CHECKING

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


UpperCAmelCase    					=   {
    "configuration_convbert": ["CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "ConvBertConfig", "ConvBertOnnxConfig"],
    "tokenization_convbert": ["ConvBertTokenizer"],
}

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

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						UpperCAmelCase    					=   [
						    "CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "ConvBertForMaskedLM",
						    "ConvBertForMultipleChoice",
						    "ConvBertForQuestionAnswering",
						    "ConvBertForSequenceClassification",
						    "ConvBertForTokenClassification",
						    "ConvBertLayer",
						    "ConvBertModel",
						    "ConvBertPreTrainedModel",
						    "load_tf_weights_in_convbert",
						]


try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						UpperCAmelCase    					=   [
						    "TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "TFConvBertForMaskedLM",
						    "TFConvBertForMultipleChoice",
						    "TFConvBertForQuestionAnswering",
						    "TFConvBertForSequenceClassification",
						    "TFConvBertForTokenClassification",
						    "TFConvBertLayer",
						    "TFConvBertModel",
						    "TFConvBertPreTrainedModel",
						]


if TYPE_CHECKING:
						from .configuration_convbert import CONVBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, ConvBertConfig, ConvBertOnnxConfig
						from .tokenization_convbert import ConvBertTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_convbert_fast import ConvBertTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_convbert import (
												    CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    ConvBertForMaskedLM,
												    ConvBertForMultipleChoice,
												    ConvBertForQuestionAnswering,
												    ConvBertForSequenceClassification,
												    ConvBertForTokenClassification,
												    ConvBertLayer,
												    ConvBertModel,
												    ConvBertPreTrainedModel,
												    load_tf_weights_in_convbert,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_convbert import (
												    TF_CONVBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFConvBertForMaskedLM,
												    TFConvBertForMultipleChoice,
												    TFConvBertForQuestionAnswering,
												    TFConvBertForSequenceClassification,
												    TFConvBertForTokenClassification,
												    TFConvBertLayer,
												    TFConvBertModel,
												    TFConvBertPreTrainedModel,
												)


else:
						import sys

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

