def merge_with_linear_rings( polygon_kinds: List[BoundPortedPolygonKindsPair] ) -> Tuple[List[BoundLinearRingWithPolygonKind], List[PortedLinearRingWithPolygonKind]]: bound_kinds, ported_kinds = transpose_pairs(polygon_kinds) return (list(zip(bound_linear_rings, bound_kinds)), list(zip(ported_linear_rings, ported_kinds)))
def to_linear_rings_with_polygon_kinds( linear_rings_pairs: List[BoundPortedLocalMinimumListsPair] ) -> Strategy[Tuple[List[BoundLinearRingWithPolygonKind], List[PortedLinearRingWithPolygonKind]]]: bound_linear_rings, ported_linear_rings = transpose_pairs( linear_rings_pairs) def merge_with_linear_rings( polygon_kinds: List[BoundPortedPolygonKindsPair] ) -> Tuple[List[BoundLinearRingWithPolygonKind], List[PortedLinearRingWithPolygonKind]]: bound_kinds, ported_kinds = transpose_pairs(polygon_kinds) return (list(zip(bound_linear_rings, bound_kinds)), list(zip(ported_linear_rings, ported_kinds))) return (strategies.lists(polygon_kinds_pairs, min_size=len(bound_linear_rings), max_size=len(bound_linear_rings)) .map(merge_with_linear_rings))
def to_bound_with_ported_polygons_lists_pair( raw_multipolygon: RawMultipolygon) -> BoundPortedPolygonsListsPair: return transpose_pairs( list(map(to_bound_with_ported_polygons_pair, raw_multipolygon)))