code: def intersect(self, other_curve, justonemode=False, tol=1e-12):
          
          path1 = self
          if isinstance(other_curve, Path):
              path2 = other_curve
          else:
              path2 = Path(other_curve)
          assert path1 != path2
          intersection_list = []
          for seg1 in path1:
              for seg2 in path2:
                  if justonemode and intersection_list:
                      return intersection_list[0]
                  for t1, t2 in seg1.intersect(seg2, tol=tol):
                      T1 = path1.t2T(seg1, t1)
                      T2 = path2.t2T(seg2, t2)
                      intersection_list.append(((T1, seg1, t1), (T2, seg2, t2)))
          if justonemode and intersection_list:
              return intersection_list[0]
  
          # Note: If the intersection takes place at a joint (point one seg ends
          # and next begins in path) then intersection_list may contain a
          # redundant intersection.  This code block checks for and removes said
          # redundancies.
          if intersection_list:
              pts = [seg1.point(_t1)
                     for _T1, _seg1, _t1 in list(zip(*intersection_list))[0]]
              indices2remove = []
              for ind1 in range(len(pts)):
                  for ind2 in range(ind1 + 1, len(pts)):
                      if abs(pts[ind1] - pts[ind2]) < tol:
                          # then there's a redundancy. Remove it.
                          indices2remove.append(ind2)
              intersection_list = [inter for ind, inter in
                                   enumerate(intersection_list) if
                                   ind not in indices2remove]
          return intersection_list
docs: returns list of pairs of pairs ((T1, seg1, t1), (T2, seg2, t2))
          giving the intersection points.
          If justonemode==True, then returns just the first
          intersection found.
          tol is used to check for redundant intersections (see comment above
          the code block where tol is used).
          Note:  If the two path objects coincide for more than a finite set of
          points, this code will fail.