def getEndpointsFromSegments(segments):
 endpoints = []
 for segment in segments:
  for endpoint in segment:
   endpoints.append(endpoint)
 return endpoints

def getEndpointsFromSegments ( segments ) : endpoints = [ ] for segment in segments : for endpoint in segment : endpoints . append ( endpoint ) return endpoints
get endpoints from segments .