




"""simple docstring"""






def   _snake_case    (       lowercase__							,					lowercase__	):
				return (pointa[0] - pointa[0]) ** 2 + (pointa[1] - pointa[1]) ** 2







def   _snake_case    (       lowercase__							,					lowercase__=0	):
				return sorted(lowercase__							,					key=lambda lowercase__	: x[column]	)







def   _snake_case    (       lowercase__							,					lowercase__							,					lowercase__=float('inf'	)	):

				for i in range(points_counts - 1	):
								for j in range(i + 1							,					lowercase__	):
												_lowerCamelCase  :    int					=					euclidean_distance_sqr(points[i]							,					points[j]	)
												if current_dis < min_dis:
																_lowerCamelCase  :    str					=					current_dis
				return min_dis







def   _snake_case    (       lowercase__							,					lowercase__							,					lowercase__=float('inf'	)	):

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







def   _snake_case    (       lowercase__							,					lowercase__							,					lowercase__	):

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

				# recursion
				_lowerCamelCase  :    Optional[int]					=					points_counts // 2
				_lowerCamelCase  :    int					=					closest_pair_of_points_sqr(
				    lowercase__							,					points_sorted_on_y[:mid]							,					lowercase__	)
				_lowerCamelCase  :    str					=					closest_pair_of_points_sqr(
				    lowercase__							,					points_sorted_on_y[mid:]							,					points_counts - mid	)
				_lowerCamelCase  :    Any					=					min(lowercase__							,					lowercase__	)
				_lowerCamelCase  :    str					=					[]
				for point in points_sorted_on_x:
								if abs(point[0] - points_sorted_on_x[mid][0]	) < closest_pair_dis:
												cross_strip.append(lowercase__	)

				_lowerCamelCase  :    Any					=					dis_between_closest_in_strip(
				    lowercase__							,					len(lowercase__	)							,					lowercase__	)
				return min(lowercase__							,					lowercase__	)







def   _snake_case    (       lowercase__							,					lowercase__	):
				_lowerCamelCase  :    Optional[int]					=					column_based_sort(lowercase__							,					column=0	)
				_lowerCamelCase  :    Optional[int]					=					column_based_sort(lowercase__							,					column=1	)
				return (
				    closest_pair_of_points_sqr(
				        lowercase__							,					lowercase__							,					lowercase__	)
				) ** 0.5


if __name__ == "__main__":
			lowercase__  		=		[(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


lowercase__  		=		logging.get_logger(__name__)

lowercase__  		=		{
    """google/realm-cc-news-pretrained-embedder""": (
        """https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/config.json"""
    ),
    """google/realm-cc-news-pretrained-encoder""": (
        """https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/config.json"""
    ),
    """google/realm-cc-news-pretrained-scorer""": (
        """https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/config.json"""
    ),
    """google/realm-cc-news-pretrained-openqa""": (
        """https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/config.json"""
    ),
    """google/realm-orqa-nq-openqa""": """https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/config.json""",
    """google/realm-orqa-nq-reader""": """https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/config.json""",
    """google/realm-orqa-wq-openqa""": """https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/config.json""",
    """google/realm-orqa-wq-reader""": """https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/config.json""",
    # See all REALM models at https://huggingface.co/models?filter=realm
}






class lowerCAmelCase__			(  lowercase		):






			'''simple docstring'''



			lowerCamelCase__   =    """realm"""
			def __init__(						self						,   lowercase=30522						,   lowercase=768						,   lowercase=128						,   lowercase=12						,   lowercase=12						,   lowercase=8						,   lowercase=3072						,   lowercase="gelu_new"						,   lowercase=0.1						,   lowercase=0.1						,   lowercase=512						,   lowercase=2						,   lowercase=0.02						,   lowercase=1E-12						,   lowercase=256						,   lowercase=10						,   lowercase=1E-3						,   lowercase=5						,   lowercase=320						,   lowercase=13353718						,   lowercase=5000						,   lowercase=1						,   lowercase=0						,   lowercase=2						,   **lowercase						,   ):
							super().__init__(pad_token_id=lowercase						,   bos_token_id=lowercase						,   eos_token_id=lowercase						,   **lowercase						)

							# Common config
							_lowerCamelCase  :    str					=					vocab_size
							_lowerCamelCase  :    Dict					=					max_position_embeddings
							_lowerCamelCase  :    int					=					hidden_size
							_lowerCamelCase  :    Optional[Any]					=					retriever_proj_size
							_lowerCamelCase  :    Dict					=					num_hidden_layers
							_lowerCamelCase  :    Any					=					num_attention_heads
							_lowerCamelCase  :    int					=					num_candidates
							_lowerCamelCase  :    List[Any]					=					intermediate_size
							_lowerCamelCase  :    int					=					hidden_act
							_lowerCamelCase  :    Union[str, Any]					=					hidden_dropout_prob
							_lowerCamelCase  :    Dict					=					attention_probs_dropout_prob
							_lowerCamelCase  :    Union[str, Any]					=					initializer_range
							_lowerCamelCase  :    List[Any]					=					type_vocab_size
							_lowerCamelCase  :    int					=					layer_norm_eps

							# Reader config
							_lowerCamelCase  :    Tuple					=					span_hidden_size
							_lowerCamelCase  :    int					=					max_span_width
							_lowerCamelCase  :    Tuple					=					reader_layer_norm_eps
							_lowerCamelCase  :    Union[str, Any]					=					reader_beam_size
							_lowerCamelCase  :    Union[str, Any]					=					reader_seq_len

							# Retrieval config
							_lowerCamelCase  :    Optional[Any]					=					num_block_records
							_lowerCamelCase  :    str					=					searcher_beam_size