code: def verify_edge_segments(edge_infos):
      
      if edge_infos is None:
          return
  
      for edge_info in edge_infos:
          num_segments = len(edge_info)
          for index in six.moves.xrange(-1, num_segments - 1):
              index1, start1, end1 = edge_info[index]
              # First, verify the start and end parameters for the current
              # segment.
              if not 0.0 <= start1 < end1 <= 1.0:
                  raise ValueError(BAD_SEGMENT_PARAMS, edge_info[index])
  
              # Then, verify that the indices are not the same.
              index2, _, _ = edge_info[index + 1]
              if index1 == index2:
                  raise ValueError(
                      SEGMENTS_SAME_EDGE, edge_info[index], edge_info[index + 1]
                  )
docs: Verify that the edge segments in an intersection are valid.
  
      .. note::
  
         This is a helper used only by :func:`generic_intersect`.
  
      Args:
          edge_infos (Optional[list]): List of "edge info" lists. Each list
              represents a curved polygon and contains 3-tuples of edge index,
              start and end (see the output of :func:`ends_to_curve`).
  
      Raises:
          ValueError: If two consecutive edge segments lie on the same edge
              index.
          ValueError: If the start and end parameter are "invalid" (they should
              be between 0 and 1 and start should be strictly less than end).