def _get_point(self, profile, point):
cur_points_z = [p.location.z for p in profile.elements]<EOL>try:<EOL><INDENT>cur_idx = cur_points_z.index(point.z)<EOL>return profile.elements[cur_idx]<EOL><DEDENT>except ValueError:<EOL><INDENT>new_idx = bisect_left(cur_points_z, point.z)<EOL>new_point = Point()<EOL>new_point.location = sPoint(point)<EOL>new_point.time = profile.time<EOL>profile.elements.insert(new_idx, new_point)<EOL>return new_point<EOL><DEDENT>
Finds the given point in the profile, or adds it in sorted z order.