<commit_before>
import numpy as np

class Point:
    def __init__(self,x,y):
        self.x = float(x)
        self.y = float(y)
        
    def __repr__(self):
        return '({0},{1})'.format(self.x,self.y)
    
    def getDistance(self,pt):
        return np.sqrt((self.x-pt.x)**2+(self.y-pt.y)**2)

class LineSegment:
    def __init__(self,pts,order=1):
        self.pts = pts
        self.m = (pts[1].y-pts[0].y)/(pts[1].x-pts[0].x)
        self.b = self.pts[0].y-self.m*self.pts[0].x
        self.theta = np.arctan(self.m)
        xs = [pt.x for pt in pts]
        #ys = [pt.y for pt in pts]
        self.xmin = min(xs)
        self.xmax = max(xs)
        #self.ymin = min(ys)
        #self.ymax = max(ys)
        self.length = pts[0].getDistance(pts[1])
        self.order = order #bond order
        
    def pointIn(self,pt):
        """
        is pt within the line segement
        """
        boo1 = pt.y-self.m*pt.x-self.b < 1e-8
        boo2 = pt.x >= self.xmin and pt.x <= self.xmax
        return boo1 and boo2
    
    def getShortestDistToPoint(self,pt):
        """
        The shortest distance between the point pt and the overall line (not segemented)
        """
        mp = -1.0/self.m
        bp = pt.y-mp*pt.x
        xstar = (bp-self.b)/(self.m-mp)
        ystar = self.m*xstar+self.b
        ptstar = Point(xstar,ystar)
        boo =  self.pointIn(ptstar)
        dist = ptstar.getDistance(pt)
        if boo:
            return dist
        else:
            return np.inf
    
    def getMinimumDist(self,L):
        """
        find the minimum distance between two line segements
        """
        dists = [self.getShortestDistToPoint(pt) for pt in L.pts]
        dists += [L.getShortestDistToPoint(pt) for pt in self.pts]
        dists += [L.pts[0].getDistance(pt) for pt in self.pts]
        dists += [L.pts[1].getDistance(pt) for pt in self.pts]
        print dists<commit_msg>removed print<commit_after>
import numpy as np

class Point:
    def __init__(self,x,y):
        self.x = float(x)
        self.y = float(y)
        
    def __repr__(self):
        return '({0},{1})'.format(self.x,self.y)
    
    def getDistance(self,pt):
        return np.sqrt((self.x-pt.x)**2+(self.y-pt.y)**2)

class LineSegment:
    def __init__(self,pts,order=1):
        self.pts = pts
        self.m = (pts[1].y-pts[0].y)/(pts[1].x-pts[0].x)
        self.b = self.pts[0].y-self.m*self.pts[0].x
        self.theta = np.arctan(self.m)
        xs = [pt.x for pt in pts]
        #ys = [pt.y for pt in pts]
        self.xmin = min(xs)
        self.xmax = max(xs)
        #self.ymin = min(ys)
        #self.ymax = max(ys)
        self.length = pts[0].getDistance(pts[1])
        self.order = order #bond order
        
    def pointIn(self,pt):
        """
        is pt within the line segement
        """
        boo1 = pt.y-self.m*pt.x-self.b < 1e-8
        boo2 = pt.x >= self.xmin and pt.x <= self.xmax
        return boo1 and boo2
    
    def getShortestDistToPoint(self,pt):
        """
        The shortest distance between the point pt and the overall line (not segemented)
        """
        mp = -1.0/self.m
        bp = pt.y-mp*pt.x
        xstar = (bp-self.b)/(self.m-mp)
        ystar = self.m*xstar+self.b
        ptstar = Point(xstar,ystar)
        boo =  self.pointIn(ptstar)
        dist = ptstar.getDistance(pt)
        if boo:
            return dist
        else:
            return np.inf
    
    def getMinimumDist(self,L):
        """
        find the minimum distance between two line segements
        """
        dists = [self.getShortestDistToPoint(pt) for pt in L.pts]
        dists += [L.getShortestDistToPoint(pt) for pt in self.pts]
        dists += [L.pts[0].getDistance(pt) for pt in self.pts]
        dists += [L.pts[1].getDistance(pt) for pt in self.pts]
{'fraction_non_alphanumeric': 0.1430817610062893, 'fraction_numerical': 0.012054507337526206, 'mean_word_length': 1.7861313868613138, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '860606', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1387, 'n_words': 302}