code: def get_next_second(intersection, intersections, to_end=True):
      
      along_edge = None
      index_second = intersection.index_second
      t = intersection.t
      for other_int in intersections:
          other_t = other_int.t
          if other_int.index_second == index_second and other_t > t:
              if along_edge is None or other_t < along_edge.t:
                  along_edge = other_int
      if along_edge is None:
          if to_end:
              # If there is no other intersection on the edge, just return
              # the segment end.
              return _intersection_helpers.Intersection(
                  None,
                  None,
                  index_second,
                  1.0,
                  interior_curve=CLASSIFICATION_T.SECOND,
              )
  
          else:
              return None
  
      else:
          return along_edge
docs: Gets the next node along the current (second) edge.
  
      .. note::
  
         This is a helper used only by :func:`get_next`, which in
         turn is only used by :func:`basic_interior_combine`, which itself
         is only used by :func:`combine_intersections`.
  
      Along with :func:`get_next_first`, this function does the majority of the
      heavy lifting in :func:`get_next`. **Very** similar to
      :func:`get_next_first`, but this works with the second curve while the
      other function works with the first.
  
      Args:
          intersection (.Intersection): The current intersection.
          intersections (List[.Intersection]): List of all detected
              intersections, provided as a reference for potential
              points to arrive at.
          to_end (Optional[bool]): Indicates if the next node should just be
              the end of the first edge or :data:`None`.
  
      Returns:
          Optional[.Intersection]: The "next" point along a surface of
          intersection. This will produce the next intersection along the
          current (second) edge or the end of the same edge. If ``to_end`` is
          :data:`False` and there are no other intersections along the current
          edge, will return :data:`None` (rather than the end of the same edge).