@@ -0,0 +1,898 @@
+%22%22%22%0AUtility classes and funcitons for template mathcing framework.%0A%22%22%22%0A%0Aclass BoundingBox(object):%0A%0A    def __init__(self, lr, ul):%0A%0A        self.lrx = lr%5B0%5D%0A        self.lry = lr%5B1%5D%0A        self.lr = lr%0A%0A        self.ulx = ul%5B0%5D%0A        self.uly = ul%5B1%5D%0A        self.ul = ul%0A%0A        self.llx = ul%5B0%5D%0A        self.lly = lr%5B1%5D%0A        self.ll = (self.llx, self.lly)%0A%0A        self.urx = lr%5B0%5D%0A        self.ury = ul%5B1%5D%0A        self.ur = (self.urx, self.ury)%0A%0A        self.corners = %5Bself.ul, self.ll, self.ur, self.lr%5D %0A%0A    def contains(self, point):%0A%0A        intersect_x = point%5B0%5D %3E= self.ulx and point%5B0%5D %3C= self.lrx%0A        intersect_y = point%5B1%5D %3E= self.lry and point%5B1%5D %3C= self.uly%0A%0A        return intersect_x and intersect_y%0A%0A    def intersects(self, bbox):%0A        %0A        for corner in bbox.corners:%0A            if self.contains(corner):%0A                return True%0A%0A        return False%0A%0A

Move utilities to separate file