def find_intersections_with(self, other):
import shapely.geometry<EOL>geom = _convert_var_to_shapely_geometry(other)<EOL>result = []<EOL>for p_start, p_end in zip(self.coords[:-<NUM_LIT:1>], self.coords[<NUM_LIT:1>:]):<EOL><INDENT>ls = shapely.geometry.LineString([p_start, p_end])<EOL>intersections = ls.intersection(geom)<EOL>intersections = list(_flatten_shapely_collection(intersections))<EOL>intersections_points = []<EOL>for inter in intersections:<EOL><INDENT>if isinstance(inter, shapely.geometry.linestring.LineString):<EOL><INDENT>inter_start = (inter.coords[<NUM_LIT:0>][<NUM_LIT:0>], inter.coords[<NUM_LIT:0>][<NUM_LIT:1>])<EOL>inter_end = (inter.coords[-<NUM_LIT:1>][<NUM_LIT:0>], inter.coords[-<NUM_LIT:1>][<NUM_LIT:1>])<EOL>intersections_points.extend([inter_start, inter_end])<EOL><DEDENT>else:<EOL><INDENT>assert isinstance(inter, shapely.geometry.point.Point), (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % (type(inter),))<EOL>intersections_points.append((inter.x, inter.y))<EOL><DEDENT><DEDENT>inter_sorted = sorted(<EOL>intersections_points,<EOL>key=lambda p: np.linalg.norm(np.float32(p) - p_start)<EOL>)<EOL>result.append(inter_sorted)<EOL><DEDENT>return result<EOL>
Find all intersection points between the line string and `other`.

Parameters
----------
other : tuple of number or list of tuple of number or \
        list of LineString or LineString
    The other geometry to use during intersection tests.

Returns
-------
list of list of tuple of number
    All intersection points. One list per pair of consecutive start
    and end point, i.e. `N-1` lists of `N` points. Each list may
    be empty or may contain multiple points.