

'''simple docstring'''






def 		_A     (    A__     ,				A__      ):






 """simple docstring"""



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


def 		_A     (    A__     ,				A__=0      ):






 """simple docstring"""



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


def 		_A     (    A__     ,				A__     ,				A__=float('''inf'''      )      ):






 """simple docstring"""



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


def 		_A     (    A__     ,				A__     ,				A__=float('''inf'''      )      ):






 """simple docstring"""



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


def 		_A     (    A__     ,				A__     ,				A__      ):






 """simple docstring"""



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

 # recursion
 __lowercase							  = points_counts // 2
 __lowercase							  = closest_pair_of_points_sqr(
     __snake_case     ,				points_sorted_on_y[:mid]     ,				__snake_case      )
 __lowercase							  = closest_pair_of_points_sqr(
     __snake_case     ,				points_sorted_on_y[mid:]     ,				points_counts - mid      )
 __lowercase							  = min(__snake_case     ,				__snake_case      )
 __lowercase							  = []
 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      )

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


def 		_A     (    A__     ,				A__      ):






 """simple docstring"""



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


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









from typing import List

from ...configuration_utils import PretrainedConfig
from ...utils import logging


__UpperCAmelCase								=						logging.get_logger(__name__)

__UpperCAmelCase								=						{
    'snap-research/efficientformer-l1-300': (
        'https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json'
    ),
}



class   lowerCamelCase      (_snake_case			):







		'''simple docstring'''



		_snake_case    :    Optional[int]       						=  '''efficientformer'''



		def __init__(							self				,		_UpperCamelCase = [3, 2, 6, 4]				,		_UpperCamelCase = [4_8, 9_6, 2_2_4, 4_4_8]				,		_UpperCamelCase = [True, True, True, True]				,		_UpperCamelCase = 4_4_8				,		_UpperCamelCase = 3_2				,		_UpperCamelCase = 4				,		_UpperCamelCase = 7				,		_UpperCamelCase = 5				,		_UpperCamelCase = 8				,		_UpperCamelCase = 4				,		_UpperCamelCase = 0.0				,		_UpperCamelCase = 1_6				,		_UpperCamelCase = 3				,		_UpperCamelCase = 3				,		_UpperCamelCase = 3				,		_UpperCamelCase = 2				,		_UpperCamelCase = 1				,		_UpperCamelCase = 0.0				,		_UpperCamelCase = 1				,		_UpperCamelCase = True				,		_UpperCamelCase = True				,		_UpperCamelCase = 1E-5				,		_UpperCamelCase = "gelu"				,		_UpperCamelCase = 0.02				,		_UpperCamelCase = 1E-12				,		_UpperCamelCase = 2_2_4				,		_UpperCamelCase = 1E-05				,		**_UpperCamelCase				,		)	->							None:
							super().__init__(**_UpperCamelCase   )

							UpperCAmelCase_    :      int            =						hidden_act
							UpperCAmelCase_    :      Union[str, Any]            =						hidden_dropout_prob
							UpperCAmelCase_    :      Tuple            =						hidden_sizes
							UpperCAmelCase_    :      Union[str, Any]            =						num_hidden_layers
							UpperCAmelCase_    :      List[str]            =						num_attention_heads
							UpperCAmelCase_    :      List[Any]            =						initializer_range
							UpperCAmelCase_    :      int            =						layer_norm_eps
							UpperCAmelCase_    :      List[str]            =						patch_size
							UpperCAmelCase_    :      Union[str, Any]            =						num_channels
							UpperCAmelCase_    :      Optional[Any]            =						depths
							UpperCAmelCase_    :      List[Any]            =						mlp_expansion_ratio
							UpperCAmelCase_    :      List[str]            =						downsamples
							UpperCAmelCase_    :      List[Any]            =						dim
							UpperCAmelCase_    :      Tuple            =						key_dim
							UpperCAmelCase_    :      Optional[int]            =						attention_ratio
							UpperCAmelCase_    :      str            =						resolution
							UpperCAmelCase_    :      Dict            =						pool_size
							UpperCAmelCase_    :      Union[str, Any]            =						downsample_patch_size
							UpperCAmelCase_    :      List[str]            =						downsample_stride
							UpperCAmelCase_    :      List[str]            =						downsample_pad
							UpperCAmelCase_    :      Any            =						drop_path_rate
							UpperCAmelCase_    :      Dict            =						num_metaad_blocks
							UpperCAmelCase_    :      Dict            =						distillation
							UpperCAmelCase_    :      int            =						use_layer_scale
							UpperCAmelCase_    :      Any            =						layer_scale_init_value
							UpperCAmelCase_    :      Any            =						image_size
							UpperCAmelCase_    :      Dict            =						batch_norm_eps






