"""simple docstring"""


from __future__ import annotations

from collections.abc import Iterable






class    __UpperCAmelCase						:

				def __init__(      self	, _lowerCamelCase	, _lowerCamelCase      ):
										lowerCamelCase__					,      lowerCamelCase__					=float(_lowerCamelCase      ), float(_lowerCamelCase      )

				def __eq__(      self	, _lowerCamelCase      ):
										return self.x == other.x and self.y == other.y

				def __ne__(      self	, _lowerCamelCase      ):
										return not self == other

				def __gt__(      self	, _lowerCamelCase      ):
										if self.x > other.x:
																return True
										elif self.x == other.x:
																return self.y > other.y
										return False

				def __lt__(      self	, _lowerCamelCase      ):
										return not self > other

				def __ge__(      self	, _lowerCamelCase      ):
										if self.x > other.x:
																return True
										elif self.x == other.x:
																return self.y >= other.y
										return False

				def __le__(      self	, _lowerCamelCase      ):
										if self.x < other.x:
																return True
										elif self.x == other.x:
																return self.y <= other.y
										return False

				def __repr__(      self      ):
										return F'''({self.x}, {self.y})'''






				def __hash__(      self      ):
										return hash(self.x      )





def 			lowerCamelCase_ (					__lowerCAmelCase   ,    )							->					list[Point]:




						'''simple docstring'''



						lowerCamelCase__					=[]
						if list_of_tuples:
												for p in list_of_tuples:
																		if isinstance(__lowerCAmelCase   ,    __lowerCAmelCase				):
																								points.append(__lowerCAmelCase				)
																		else:
																								try:
																														points.append(Point(p[0]   ,    p[1]				)				)
																								except (IndexError, TypeError):
																														print(
																														    F'''Ignoring deformed point {p}. All points'''
																														    " must have at least 2 coordinates."				)
						return points





def 			lowerCamelCase_ (					__lowerCAmelCase				)							->					list[Point]:




						'''simple docstring'''



						if not hasattr(__lowerCAmelCase   ,    "__iter__"				):
												lowerCamelCase__					=F'''Expecting an iterable object but got an non-iterable type {points}'''
												raise ValueError(__lowerCAmelCase				)

						if not points:
												lowerCamelCase__					=F'''Expecting a list of points but got {points}'''
												raise ValueError(__lowerCAmelCase				)

						return _construct_points(__lowerCAmelCase				)





def 			lowerCamelCase_ (					__lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase				)							->					float:




						'''simple docstring'''



						lowerCamelCase__					=(a.x * b.y + b.x * c.y + c.x * a.y) - (a.y * b.x + b.y * c.x + c.y * a.x)
						return det





def 			lowerCamelCase_ (					__lowerCAmelCase				)							->					list[Point]:




						'''simple docstring'''



						lowerCamelCase__					=sorted(_validate_input(__lowerCAmelCase				)				)
						lowerCamelCase__					=len(__lowerCAmelCase				)
						lowerCamelCase__					=set()

						for i in range(n - 1				):
												for j in range(i + 1   ,    __lowerCAmelCase				):
																		lowerCamelCase__					=lowerCamelCase__					=False
																		lowerCamelCase__					=True
																		for k in range(__lowerCAmelCase				):
																								if k != i and k != j:
																														lowerCamelCase__					=_det(points[i]   ,    points[j]   ,    points[k]				)

																														if det_k > 0:
																																				lowerCamelCase__					=True
																														elif det_k < 0:
																																				lowerCamelCase__					=True
																														else:
																																				# point[i], point[j], point[k] all lie on a straight line
																																				# if point[k] is to the left of point[i] or it's to the
																																				# right of point[j], then point[i], point[j] cannot be
																																				# part of the convex hull of A
																																				if points[k] < points[i] or points[k] > points[j]:
																																										lowerCamelCase__					=False
																																										break

																								if points_left_of_ij and points_right_of_ij:
																														lowerCamelCase__					=False
																														break

																		if ij_part_of_convex_hull:
																								convex_set.update([points[i], points[j]]				)

						return sorted(__lowerCAmelCase				)





def 			lowerCamelCase_ (					__lowerCAmelCase				)							->					list[Point]:




						'''simple docstring'''



						lowerCamelCase__					=sorted(_validate_input(__lowerCAmelCase				)				)
						lowerCamelCase__					=len(__lowerCAmelCase				)

						# divide all the points into an upper hull and a lower hull
						# the left most point and the right most point are definitely
						# members of the convex hull by definition.
						# use these two anchors to divide all the points into two hulls,
						# an upper hull and a lower hull.

						# all points to the left (above) the line joining the extreme points belong to the
						# upper hull
						# all points to the right (below) the line joining the extreme points below to the
						# lower hull
						# ignore all points on the line joining the extreme points since they cannot be
						# part of the convex hull

						lowerCamelCase__					=points[0]
						lowerCamelCase__					=points[n - 1]

						lowerCamelCase__					={left_most_point, right_most_point}
						lowerCamelCase__					=[]
						lowerCamelCase__					=[]

						for i in range(1   ,    n - 1				):
												lowerCamelCase__					=_det(__lowerCAmelCase   ,    __lowerCAmelCase   ,    points[i]				)

												if det > 0:
																		upper_hull.append(points[i]				)
												elif det < 0:
																		lower_hull.append(points[i]				)

						_construct_hull(__lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase				)
						_construct_hull(__lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase				)

						return sorted(__lowerCAmelCase				)





def 			lowerCamelCase_ (					__lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase				)							->					None:




						'''simple docstring'''



						if points:
												lowerCamelCase__					=None
												lowerCamelCase__					=float("-inf"				)
												lowerCamelCase__					=[]

												for p in points:
																		lowerCamelCase__					=_det(__lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase				)

																		if det > 0:
																								candidate_points.append(__lowerCAmelCase				)

																								if det > extreme_point_distance:
																														lowerCamelCase__					=det
																														lowerCamelCase__					=p

												if extreme_point:
																		_construct_hull(__lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase				)
																		convex_set.add(__lowerCAmelCase				)
																		_construct_hull(__lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase				)





def 			lowerCamelCase_ (					__lowerCAmelCase				)							->					list[Point]:




						'''simple docstring'''



						lowerCamelCase__					=sorted(_validate_input(__lowerCAmelCase				)				)
						lowerCamelCase__					=len(__lowerCAmelCase				)

						lowerCamelCase__					=points[:2]
						for i in range(2   ,    __lowerCAmelCase				):
												lowerCamelCase__					=_det(convex_hull[1]   ,    convex_hull[0]   ,    points[i]				)
												if det > 0:
																		convex_hull.insert(0   ,    points[i]				)
																		break
												elif det < 0:
																		convex_hull.append(points[i]				)
																		break
												else:
																		lowerCamelCase__					=points[i]
						i += 1

						for j in range(__lowerCAmelCase   ,    __lowerCAmelCase				):
												if (
												    _det(convex_hull[0]   ,    convex_hull[-1]   ,    points[j]				) > 0
												    and _det(convex_hull[-1]   ,    convex_hull[0]   ,    points[1]				) < 0
												):
																		# The point lies within the convex hull
																		continue

												convex_hull.insert(0   ,    points[j]				)
												convex_hull.append(points[j]				)
												while _det(convex_hull[0]   ,    convex_hull[1]   ,    convex_hull[2]				) >= 0:
																		del convex_hull[1]
												while _det(convex_hull[-1]   ,    convex_hull[-2]   ,    convex_hull[-3]				) <= 0:
																		del convex_hull[-2]

    # `convex_hull` is contains the convex hull in circular order
						return sorted(convex_hull[1:] if len(__lowerCAmelCase				) > 3 else convex_hull				)





def 			lowerCamelCase_ (					)							->					List[Any]:




						'''simple docstring'''



						lowerCamelCase__					=[
						    (0, 3),
						    (2, 2),
						    (1, 1),
						    (2, 1),
						    (3, 0),
						    (0, 0),
						    (3, 3),
						    (2, -1),
						    (2, -4),
						    (1, -3),
						]
						# the convex set of points is
						# [(0, 0), (0, 3), (1, -3), (2, -4), (3, 0), (3, 3)]
						lowerCamelCase__					=convex_hull_bf(__lowerCAmelCase				)

						lowerCamelCase__					=convex_hull_recursive(__lowerCAmelCase				)
						assert results_bf == results_recursive

						lowerCamelCase__					=convex_hull_melkman(__lowerCAmelCase				)
						assert results_bf == results_melkman

						print(__lowerCAmelCase				)


if __name__ == "__main__":
	main()



"""simple docstring"""


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


a							=logging.get_logger(__name__)

a							={
    'microsoft/mpnet-base': 'https://huggingface.co/microsoft/mpnet-base/resolve/main/config.json',
}






class    __UpperCAmelCase						(	__lowerCAmelCase	):
				A__      :   Optional[int]  							=       '''mpnet'''

				def __init__(      self	, _lowerCamelCase=30527	, _lowerCamelCase=768	, _lowerCamelCase=12	, _lowerCamelCase=12	, _lowerCamelCase=3072	, _lowerCamelCase="gelu"	, _lowerCamelCase=0.1	, _lowerCamelCase=0.1	, _lowerCamelCase=512	, _lowerCamelCase=0.0_2	, _lowerCamelCase=1E-12	, _lowerCamelCase=32	, _lowerCamelCase=1	, _lowerCamelCase=0	, _lowerCamelCase=2	, **_lowerCamelCase	, ):
										super().__init__(pad_token_id=_lowerCamelCase	, bos_token_id=_lowerCamelCase	, eos_token_id=_lowerCamelCase	, **_lowerCamelCase      )

										lowerCamelCase__					=vocab_size
										lowerCamelCase__					=hidden_size
										lowerCamelCase__					=num_hidden_layers
										lowerCamelCase__					=num_attention_heads
										lowerCamelCase__					=hidden_act
										lowerCamelCase__					=intermediate_size
										lowerCamelCase__					=hidden_dropout_prob
										lowerCamelCase__					=attention_probs_dropout_prob
										lowerCamelCase__					=max_position_embeddings
										lowerCamelCase__					=initializer_range
										lowerCamelCase__					=layer_norm_eps
										lowerCamelCase__					=relative_attention_num_buckets


