



"""simple docstring"""







def       _lowerCamelCase				(							UpperCAmelCase_ :       Dict,	UpperCAmelCase_ :       Union[str, Any]     )	-> Dict:






	"""simple docstring"""





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

def       _lowerCamelCase				(							UpperCAmelCase_ :       List[str],	UpperCAmelCase_ :       Optional[int]=0     )	-> Union[str, Any]:






	"""simple docstring"""





	return sorted(_lowerCAmelCase,	key=lambda UpperCAmelCase_     : x[column]     )

def       _lowerCamelCase				(							UpperCAmelCase_ :       Optional[int],	UpperCAmelCase_ :       List[str],	UpperCAmelCase_ :       int=float("inf"     )     )	-> Optional[int]:






	"""simple docstring"""





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

def       _lowerCamelCase				(							UpperCAmelCase_ :       List[Any],	UpperCAmelCase_ :       List[Any],	UpperCAmelCase_ :       int=float("inf"     )     )	-> Dict:






	"""simple docstring"""





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

def       _lowerCamelCase				(							UpperCAmelCase_ :       Optional[int],	UpperCAmelCase_ :       Any,	UpperCAmelCase_ :       Union[str, Any]     )	-> Optional[int]:






	"""simple docstring"""





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

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

	A__											=					dis_between_closest_in_strip(
	    _lowerCAmelCase,	len(_lowerCAmelCase     ),	_lowerCAmelCase     )
	return min(_lowerCAmelCase,	_lowerCAmelCase     )

def       _lowerCamelCase				(							UpperCAmelCase_ :       List[Any],	UpperCAmelCase_ :       List[str]     )	-> Optional[int]:






	"""simple docstring"""





	A__											=					column_based_sort(_lowerCAmelCase,	column=0     )
	A__											=					column_based_sort(_lowerCAmelCase,	column=1     )
	return (
	    closest_pair_of_points_sqr(
	        _lowerCAmelCase,	_lowerCAmelCase,	_lowerCAmelCase     )
	) ** 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)))






"""simple docstring"""
import operator as op


SCREAMING_SNAKE_CASE_					     =	'''scaler.pt'''
SCREAMING_SNAKE_CASE_					     =	'''pytorch_model'''
SCREAMING_SNAKE_CASE_					     =	'''random_states'''
SCREAMING_SNAKE_CASE_					     =	'''optimizer'''
SCREAMING_SNAKE_CASE_					     =	'''scheduler'''
SCREAMING_SNAKE_CASE_					     =	'''pytorch_model.bin'''
SCREAMING_SNAKE_CASE_					     =	'''pytorch_model.bin.index.json'''
SCREAMING_SNAKE_CASE_					     =	'''model.safetensors'''
SCREAMING_SNAKE_CASE_					     =	'''model.safetensors.index.json'''
SCREAMING_SNAKE_CASE_					     =	'''1.10.2'''
SCREAMING_SNAKE_CASE_					     =	'''py38'''
SCREAMING_SNAKE_CASE_					     =	'''4.17.0'''
SCREAMING_SNAKE_CASE_					     =	['''ml.p3.16xlarge''', '''ml.p3dn.24xlarge''', '''ml.p4dn.24xlarge''']
SCREAMING_SNAKE_CASE_					     =	['''FULL_SHARD''', '''SHARD_GRAD_OP''', '''NO_SHARD''', '''HYBRID_SHARD''', '''HYBRID_SHARD_ZERO2''']
SCREAMING_SNAKE_CASE_					     =	['''TRANSFORMER_BASED_WRAP''', '''SIZE_BASED_WRAP''', '''NO_WRAP''']
SCREAMING_SNAKE_CASE_					     =	['''BACKWARD_PRE''', '''BACKWARD_POST''', '''NO_PREFETCH''']
SCREAMING_SNAKE_CASE_					     =	['''FULL_STATE_DICT''', '''LOCAL_STATE_DICT''', '''SHARDED_STATE_DICT''']
SCREAMING_SNAKE_CASE_					     =	'''2.0.1'''
SCREAMING_SNAKE_CASE_					     =	['''pdsh''', '''standard''', '''openmpi''', '''mvapich''']
SCREAMING_SNAKE_CASE_					     =	['''default''', '''reduce-overhead''', '''max-autotune''']

SCREAMING_SNAKE_CASE_					     =	{'''>''': op.gt, '''>=''': op.ge, '''==''': op.eq, '''!=''': op.ne, '''<=''': op.le, '''<''': op.lt}

# These are the args for `torch.distributed.launch` for pytorch < 1.9
SCREAMING_SNAKE_CASE_					     =	[
    '''nnodes''',
    '''nproc_per_node''',
    '''rdzv_backend''',
    '''rdzv_endpoint''',
    '''rdzv_id''',
    '''rdzv_conf''',
    '''standalone''',
    '''max_restarts''',
    '''monitor_interval''',
    '''start_method''',
    '''role''',
    '''module''',
    '''m''',
    '''no_python''',
    '''run_path''',
    '''log_dir''',
    '''r''',
    '''redirects''',
    '''t''',
    '''tee''',
    '''node_rank''',
    '''master_addr''',
    '''master_port''',
]

SCREAMING_SNAKE_CASE_					     =	['''DEEPSPEED''', '''MULTI_GPU''', '''FSDP''', '''MEGATRON_LM''']
SCREAMING_SNAKE_CASE_					     =	['''DEEPSPEED''', '''MULTI_XPU''', '''FSDP''']
