<commit_before>__copyright__ = "Copyright (C) 2013 <NAME> - Released under terms of the AGPLv3 License"

import numpy

def convexHull(pointList):
	def _isRightTurn((p, q, r)):
		sum1 = q[0]*r[1] + p[0]*q[1] + r[0]*p[1]
		sum2 = q[0]*p[1] + r[0]*q[1] + p[0]*r[1]

		if sum1 - sum2 < 0:
			return 1
		else:
			return 0

	unique = {}
	for p in pointList:
		unique[p[0],p[1]] = 1

	points = unique.keys()
	points.sort()
	if len(points) < 2:
		return numpy.array([], numpy.float32)

	# Build upper half of the hull.
	upper = [points[0], points[1]]
	for p in points[2:]:
		upper.append(p)
		while len(upper) > 2 and not _isRightTurn(upper[-3:]):
			del upper[-2]

	# Build lower half of the hull.
	points = points[::-1]
	lower = [points[0], points[1]]
	for p in points[2:]:
		lower.append(p)
		while len(lower) > 2 and not _isRightTurn(lower[-3:]):
			del lower[-2]

	# Remove duplicates.<commit_msg>Fix the bug of loading very small objects.<commit_after>__copyright__ = "Copyright (C) 2013 <NAME> - Released under terms of the AGPLv3 License"

import numpy

def convexHull(pointList):
	def _isRightTurn((p, q, r)):
		sum1 = q[0]*r[1] + p[0]*q[1] + r[0]*p[1]
		sum2 = q[0]*p[1] + r[0]*q[1] + p[0]*r[1]

		if sum1 - sum2 < 0:
			return 1
		else:
			return 0

	unique = {}
	for p in pointList:
		unique[p[0],p[1]] = 1

	points = unique.keys()
	points.sort()
	if len(points) < 1:
		return numpy.zeros((0, 2), numpy.float32)
	if len(points) < 2:
		return numpy.array(points, numpy.float32)

	# Build upper half of the hull.
	upper = [points[0], points[1]]
	for p in points[2:]:
		upper.append(p)
		while len(upper) > 2 and not _isRightTurn(upper[-3:]):
			del upper[-2]

	# Build lower half of the hull.
	points = points[::-1]
	lower = [points[0], points[1]]
	for p in points[2:]:
		lower.append(p)
		while len(lower) > 2 and not _isRightTurn(lower[-3:]):
			del lower[-2]

	# Remove duplicates.
{'fraction_non_alphanumeric': 0.17444326617179215, 'fraction_numerical': 0.048250265111346766, 'mean_word_length': 3.625, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '616445', 'n_tokens_mistral': 853, 'n_tokens_neox': 764, 'n_words': 215}