


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


lowerCAmelCase__      		= logging.get_logger(__name__)

lowerCAmelCase__      		= {
    'funnel-transformer/small': 'https://huggingface.co/funnel-transformer/small/resolve/main/config.json',
    'funnel-transformer/small-base': 'https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json',
    'funnel-transformer/medium': 'https://huggingface.co/funnel-transformer/medium/resolve/main/config.json',
    'funnel-transformer/medium-base': 'https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json',
    'funnel-transformer/intermediate': (
        'https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json'
    ),
    'funnel-transformer/intermediate-base': (
        'https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json'
    ),
    'funnel-transformer/large': 'https://huggingface.co/funnel-transformer/large/resolve/main/config.json',
    'funnel-transformer/large-base': 'https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json',
    'funnel-transformer/xlarge': 'https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json',
    'funnel-transformer/xlarge-base': 'https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json',
}







class      lowerCAmelCase__       (				a):




     '''simple docstring'''
     __SCREAMING_SNAKE_CASE  			= "funnel"
     __SCREAMING_SNAKE_CASE  			= {
         "hidden_size": "d_model",
         "num_attention_heads": "n_head",
     }


     def __init__(						self ,						__lowerCamelCase=3_0_5_2_2 ,						__lowerCamelCase=[4, 4, 4] ,						__lowerCamelCase=None ,						__lowerCamelCase=2 ,						__lowerCamelCase=7_6_8 ,						__lowerCamelCase=1_2 ,						__lowerCamelCase=6_4 ,						__lowerCamelCase=3_0_7_2 ,						__lowerCamelCase="gelu_new" ,						__lowerCamelCase=0.1 ,						__lowerCamelCase=0.1 ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=0.1 ,						__lowerCamelCase=None ,						__lowerCamelCase=1e-9 ,						__lowerCamelCase="mean" ,						__lowerCamelCase="relative_shift" ,						__lowerCamelCase=True ,						__lowerCamelCase=True ,						__lowerCamelCase=True ,						**__lowerCamelCase ,						)			->				Tuple:
            _A      :       int				    = vocab_size
            _A      :       Optional[Any]				    = block_sizes
            _A      :       Tuple				    = [1] * len(__lowerCamelCase) if block_repeats is None else block_repeats
            assert len(__lowerCamelCase) == len(
                self.block_repeats), "`block_sizes` and `block_repeats` should have the same length."
            _A      :       Optional[Any]				    = num_decoder_layers
            _A      :       List[str]				    = d_model
            _A      :       Dict				    = n_head
            _A      :       Optional[int]				    = d_head
            _A      :       List[Any]				    = d_inner
            _A      :       Any				    = hidden_act
            _A      :       List[Any]				    = hidden_dropout
            _A      :       Dict				    = attention_dropout
            _A      :       List[Any]				    = activation_dropout
            _A      :       List[Any]				    = initializer_range
            _A      :       str				    = initializer_std
            _A      :       Any				    = layer_norm_eps
            assert pooling_type in [
                "mean",
                "max",
            ], F"Got {pooling_type} for `pooling_type` but only 'mean' and 'max' are supported."
            _A      :       Union[str, Any]				    = pooling_type
            assert attention_type in [
                "relative_shift",
                "factorized",
            ], F"Got {attention_type} for `attention_type` but only 'relative_shift' and 'factorized' are supported."
            _A      :       List[Any]				    = attention_type
            _A      :       Tuple				    = separate_cls
            _A      :       Tuple				    = truncate_seq
            _A      :       int				    = pool_q_only

            super().__init__(**__lowerCamelCase)


     @property
     def  _lowerCamelCase (						self)			->				Any:
            return sum(self.block_sizes)


     @num_hidden_layers.setter
     def  _lowerCamelCase (						self ,						__lowerCamelCase)			->				int:
            raise NotImplementedError(
                "This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`.")


     @property
     def  _lowerCamelCase (						self)			->				Any:
            return len(self.block_sizes)


     @num_blocks.setter
     def  _lowerCamelCase (						self ,						__lowerCamelCase)			->				Tuple:
            raise NotImplementedError("This model does not support the setting of `num_blocks`. Please set `block_sizes`.")



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







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







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

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







def 		_lowercase (     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					:						Union[str, Any]					=					euclidean_distance_sqr(points[i]   ,	points[j]						)
                  if current_dis < min_dis:
                        __lowerCAmelCase					:						int					=					current_dis
      return min_dis







def 		_lowercase (     lowercase__   ,	lowercase__   ,	lowercase__						):

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

      # recursion
      __lowerCAmelCase					:						Optional[Any]					=					points_counts // 2
      __lowerCAmelCase					:						Optional[Any]					=					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					:						Optional[int]					=					min(lowercase__   ,	lowercase__						)
      __lowerCAmelCase					:						Tuple					=					[]
      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					:						List[Any]					=					dis_between_closest_in_strip(
          lowercase__   ,	len(lowercase__						)   ,	lowercase__						)
      return min(lowercase__   ,	lowercase__						)







def 		_lowercase (     lowercase__   ,	lowercase__						):
      __lowerCAmelCase					:						Union[str, Any]					=					column_based_sort(lowercase__   ,	column=0						)
      __lowerCAmelCase					:						Any					=					column_based_sort(lowercase__   ,	column=1						)
      return (
          closest_pair_of_points_sqr(
              lowercase__   ,	lowercase__   ,	lowercase__						)
      ) ** 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)))


