
"""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(__a				,   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				,   __a				):
															A_				 =						euclidean_distance_sqr(points[i]				,   points[j]				)
															if current_dis < min_dis:
																				A_				 =						current_dis
					return min_dis
def 							A_     (__a				,   __a				,   __a=float("inf"				)				):

					'''simple docstring'''





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

					'''simple docstring'''





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

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

					A_				 =						dis_between_closest_in_strip(
					    __a				,   len(__a				)				,   __a				)
					return min(__a				,   __a				)
def 							A_     (__a				,   __a				):

					'''simple docstring'''





					A_				 =						column_based_sort(__a				,   column=0				)
					A_				 =						column_based_sort(__a				,   column=1				)
					return (
					    closest_pair_of_points_sqr(
					        __a				,   __a				,   __a				)
					) ** 0.5


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






"""simple docstring"""





from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


UpperCamelCase_					:						Optional[int]				= logging.get_logger(__name__)

UpperCamelCase_					:						Dict				= {
    '''microsoft/focalnet-tiny''': '''https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json''',
}



class __lowerCAmelCase				(					_lowercase     ,				_lowercase      ):




			"""simple docstring"""







			snake_case	      =				"focalnet"




			def __init__(				self						:					Any       ,   _snake_case						:					Optional[int]=224       ,   _snake_case						:					List[str]=4       ,   _snake_case						:					Any=3       ,   _snake_case						:					List[Any]=96       ,   _snake_case						:					Union[str, Any]=False       ,   _snake_case						:					Optional[Any]=[192, 384, 768, 768]       ,   _snake_case						:					List[str]=[2, 2, 6, 2]       ,   _snake_case						:					Any=[2, 2, 2, 2]       ,   _snake_case						:					List[Any]=[3, 3, 3, 3]       ,   _snake_case						:					Optional[Any]="gelu"       ,   _snake_case						:					Dict=4.0       ,   _snake_case						:					List[Any]=0.0       ,   _snake_case						:					List[str]=0.1       ,   _snake_case						:					Optional[Any]=False       ,   _snake_case						:					Any=1e-4       ,   _snake_case						:					str=False       ,   _snake_case						:					Optional[int]=False       ,   _snake_case						:					Tuple=False       ,   _snake_case						:					Any=0.0_2       ,   _snake_case						:					List[Any]=1e-5       ,   _snake_case						:					Union[str, Any]=32       ,   _snake_case						:					Tuple=None       ,   _snake_case						:					Any=None       ,   **_snake_case						:					Tuple       ,   )      -> str:







								"""simple docstring"""
								super().__init__(**_snake_case	)

								A_				 =						image_size
								A_				 =						patch_size
								A_				 =						num_channels
								A_				 =						embed_dim
								A_				 =						use_conv_embed
								A_				 =						hidden_sizes
								A_				 =						depths
								A_				 =						focal_levels
								A_				 =						focal_windows
								A_				 =						hidden_act
								A_				 =						mlp_ratio
								A_				 =						hidden_dropout_prob
								A_				 =						drop_path_rate
								A_				 =						use_layerscale
								A_				 =						layerscale_value
								A_				 =						use_post_layernorm
								A_				 =						use_post_layernorm_in_modulation
								A_				 =						normalize_modulator
								A_				 =						initializer_range
								A_				 =						layer_norm_eps
								A_				 =						encoder_stride
								A_				 =						["stem"] + [F'stage{idx}' for idx in range(1       ,   len(self.depths	) + 1	)]
								A_ ,    A_				 =						get_aligned_output_features_output_indices(
								    out_features=_snake_case       ,   out_indices=_snake_case       ,   stage_names=self.stage_names	)




