<commit_before>"""
GeoMath - Analytical Geometry Module
Originally written by: <NAME> and <NAME>
Last Modification: 23/03/2016 #vmesel
"""

from math import sqrt

class Point:
	"Object type cartesian Point"

	#Defines the Point(x, y)
	def __init__(self, x,y):
		self.x = x
		self.y = y

	#Defines the output of the point
	def __repr__(self):
		return (("Point(%s, %s)") % (self.x, self.y))

	#Defines the distance between two points
	def distance(self, point_two):
		return sqrt(
				pow(point_two.x - self.x, 2) + pow(point_two.y - self.y, 2)
				)

	#Defined the midpoint between two points
	def midpoint(self, point_two):
		return(
		(self.x + point_two.x)/2 , (self.y + point_two.y)/2
		)

class Figure:
	def squarearea(self, a):
		return(a**2)

	def barycenter(points):
		i = 0
		arrayx = []
		arrayy = []
		for point in points:
			arrayx.append(point.x)
			arrayy.append(point.y)

		XPoint = sum(arrayx)/len(arrayx)
		YPoint = sum(arrayx)/len(arrayy)

		return(("Point(%s, %s)") % (XPoint, YPoint))



# Defining tests for the TravisCI and Build Checking
from nose import with_setup # optional

def testing():
	su = [Point(1,2),Point(2,3),Point(4,5)]
    print(assert Point(1,2) == "Point(1,2)")
    print(assert Point(9,8).distance(Point(1,2)) == 10.0)
    print(assert Point(9,8).midpoint(Point(1,2)) == "(5.0, 5.0)")
    print(assert Area.squarearea(4) == 16)
	print(assert Figure.barycenter(su) = "Point(2.3333333333333335, 2.3333333333333335)")<commit_msg>All tests are Corrected!<commit_after>"""
GeoMath - Analytical Geometry Module
Originally written by: <NAME> and <NAME>
Last Modification: 23/03/2016 #vmesel
"""

from math import sqrt

class Point:
	"Object type cartesian Point"

	#Defines the Point(x, y)
	def __init__(self, x,y):
		self.x = x
		self.y = y

	#Defines the output of the point
	def __repr__(self):
		return (("Point(%s, %s)") % (self.x, self.y))

	#Defines the distance between two points
	def distance(self, point_two):
		return sqrt(
				pow(point_two.x - self.x, 2) + pow(point_two.y - self.y, 2)
				)

	#Defined the midpoint between two points
	def midpoint(self, point_two):
		return(
		(self.x + point_two.x)/2 , (self.y + point_two.y)/2
		)

class Figure:
	def squarearea(a):
		return(a**2)

	def barycenter(points):
		i = 0
		arrayx = []
		arrayy = []
		for point in points:
			arrayx.append(point.x)
			arrayy.append(point.y)

		XPoint = sum(arrayx)/len(arrayx)
		YPoint = sum(arrayx)/len(arrayy)

		return(("Point(%s, %s)") % (XPoint, YPoint))



# Defining tests for the TravisCI and Build Checking
from nose import with_setup # optional
import unittest

def testtwo():
	print("Testando 2")
	assert(Point(9,8).distance(Point(1,2)) == 10)
def testthree():
	print("Testando 3")
	assert(str(Point(9,8).midpoint(Point(1,2)) == "(5.0, 5.0)"))
def testfour():
	print("Testando 4")
	assert(Figure.squarearea(4) == 16)
def testfive():
	print("Testando 5")
	assert(Figure.barycenter([Point(1,2),Point(2,3),Point(4,5)]) == "Point(2.3333333333333335, 2.3333333333333335)")
{'fraction_non_alphanumeric': 0.1616228799467908, 'fraction_numerical': 0.05021616228799468, 'mean_word_length': 4.231304347826087, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '721633', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1157, 'n_words': 288}