





'''simple docstring'''





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   int:







	'''simple docstring'''







	return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2





def lowerCAmelCase__(__snake_case ,__snake_case=0							)       ->   Optional[Any]:







	'''simple docstring'''







	return sorted(__snake_case ,key=lambda __snake_case							: x[column]							)





def lowerCAmelCase__(__snake_case ,__snake_case ,__snake_case=float('''inf'''							)							)       ->   int:







	'''simple docstring'''







	for i in range(points_counts - 1							):
		for j in range(i + 1 ,__snake_case							):
			lowerCamelCase__              =	euclidean_distance_sqr(points[i] ,points[j]							)
			if current_dis < min_dis:
				lowerCamelCase__              =	current_dis
	return min_dis





def lowerCAmelCase__(__snake_case ,__snake_case ,__snake_case=float('''inf'''							)							)       ->   Dict:







	'''simple docstring'''







	for i in range(min(6 ,points_counts - 1							) ,__snake_case							):
		for j in range(max(0 ,i - 6							) ,__snake_case							):
			lowerCamelCase__              =	euclidean_distance_sqr(points[i] ,points[j]							)
			if current_dis < min_dis:
				lowerCamelCase__              =	current_dis
	return min_dis





def lowerCAmelCase__(__snake_case ,__snake_case ,__snake_case							)       ->   Union[str, Any]:







	'''simple docstring'''







	if points_counts <= 3:
		return dis_between_closest_pair(__snake_case ,__snake_case							)

	# recursion
	lowerCamelCase__              =	points_counts // 2
	lowerCamelCase__              =	closest_pair_of_points_sqr(
	    __snake_case ,points_sorted_on_y[:mid] ,__snake_case							)
	lowerCamelCase__              =	closest_pair_of_points_sqr(
	    __snake_case ,points_sorted_on_y[mid:] ,points_counts - mid							)
	lowerCamelCase__              =	min(__snake_case ,__snake_case							)
	lowerCamelCase__              =	[]
	for point in points_sorted_on_x:
		if abs(point[0] - points_sorted_on_x[mid][0]							) < closest_pair_dis:
			cross_strip.append(__snake_case							)

	lowerCamelCase__              =	dis_between_closest_in_strip(
	    __snake_case ,len(__snake_case							) ,__snake_case							)
	return min(__snake_case ,__snake_case							)





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   int:







	'''simple docstring'''







	lowerCamelCase__              =	column_based_sort(__snake_case ,column=0							)
	lowerCamelCase__              =	column_based_sort(__snake_case ,column=1							)
	return (
	    closest_pair_of_points_sqr(
	        __snake_case ,__snake_case ,__snake_case							)
	) ** 0.5


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










from typing import TYPE_CHECKING

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


_a						=   {
    "configuration_funnel": ["FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP", "FunnelConfig"],
    "convert_funnel_original_tf_checkpoint_to_pytorch": [],
    "tokenization_funnel": ["FunnelTokenizer"],
}

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

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_a						=   [
			    "FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST",
			    "FunnelBaseModel",
			    "FunnelForMaskedLM",
			    "FunnelForMultipleChoice",
			    "FunnelForPreTraining",
			    "FunnelForQuestionAnswering",
			    "FunnelForSequenceClassification",
			    "FunnelForTokenClassification",
			    "FunnelModel",
			    "FunnelPreTrainedModel",
			    "load_tf_weights_in_funnel",
			]

try:
			if not is_tf_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_a						=   [
			    "TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST",
			    "TFFunnelBaseModel",
			    "TFFunnelForMaskedLM",
			    "TFFunnelForMultipleChoice",
			    "TFFunnelForPreTraining",
			    "TFFunnelForQuestionAnswering",
			    "TFFunnelForSequenceClassification",
			    "TFFunnelForTokenClassification",
			    "TFFunnelModel",
			    "TFFunnelPreTrainedModel",
			]


if TYPE_CHECKING:
			from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
			from .tokenization_funnel import FunnelTokenizer

			try:
						if not is_tokenizers_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .tokenization_funnel_fast import FunnelTokenizerFast

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_funnel import (
						    FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
						    FunnelBaseModel,
						    FunnelForMaskedLM,
						    FunnelForMultipleChoice,
						    FunnelForPreTraining,
						    FunnelForQuestionAnswering,
						    FunnelForSequenceClassification,
						    FunnelForTokenClassification,
						    FunnelModel,
						    FunnelPreTrainedModel,
						    load_tf_weights_in_funnel,
						)

			try:
						if not is_tf_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_tf_funnel import (
						    TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
						    TFFunnelBaseModel,
						    TFFunnelForMaskedLM,
						    TFFunnelForMultipleChoice,
						    TFFunnelForPreTraining,
						    TFFunnelForQuestionAnswering,
						    TFFunnelForSequenceClassification,
						    TFFunnelForTokenClassification,
						    TFFunnelModel,
						    TFFunnelPreTrainedModel,
						)

else:
			import sys

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



