def _are_nearby_parallel_boxes(self, b1, b2):
        "Are two boxes nearby, parallel, and similar in width?"
        if not self._are_aligned_angles(b1.angle, b2.angle):
            return False
        # Otherwise pick the smaller angle and see whether the two boxes are close according to the "up" direction wrt that angle
        angle = min(b1.angle, b2.angle)
        return abs(np.dot(b1.center - b2.center, [-np.sin(angle), np.cos(angle)])) < self.lineskip_tol * (
            b1.height + b2.height) and (b1.width > 0) and (b2.width > 0) and (0.5 < b1.width / b2.width < 2.0)
def _are_nearby_parallel_boxes ( self , b1 , b2 ) : if not self . _are_aligned_angles ( b1 . angle , b2 . angle ) : return False angle = min ( b1 . angle , b2 . angle ) return abs ( np . dot ( b1 . center - b2 . center , [ - np . sin ( angle ) , np . cos ( angle ) ] ) ) < self . lineskip_tol * ( b1 . height + b2 . height ) and ( b1 . width > 0 ) and ( b2 . width > 0 ) and ( 0.5 < b1 . width / b2 . width < 2.0 )
Are two boxes nearby, parallel, and similar in width?