def shrink(coords: np.ndarray, dist: np.ndarray) -> tuple[np.ndarray]:
    'Shrinks a 2D polygon by a given distance.\n\n    The coordinates of the polygon are expected as an N x 2-matrix,\n    and a positive distance results in inward shrinking.\n    \n    An empty set is returned if the shrinking operation removes all\n    original elements.\n\n    Args:\n        coords: A matrix of coordinates.\n        dist: The distance to shrink by.\n\n    Returns:\n        A tuple containing the x, y coordinates of the original set, as\n        well as the x and y coordinates of the shrunken set, in that\n        order.\n    '
    my_polygon = geometry.Polygon(coords)
    xy = my_polygon.exterior.xy
    my_polygon_shrunken = my_polygon.buffer((- dist))
    try:
        xys = my_polygon_shrunken.exterior.xy
    except AttributeError:
        xys = ([0], [0])
    return (*xy, *xys)
Shrinks a 2D polygon by a given distance.

The coordinates of the polygon are expected as an N x 2-matrix,
and a positive distance results in inward shrinking.

An empty set is returned if the shrinking operation removes all
original elements.

Args:
    coords: A matrix of coordinates.
    dist: The distance to shrink by.

Returns:
    A tuple containing the x, y coordinates of the original set, as
    well as the x and y coordinates of the shrunken set, in that
    order.
def shrink(coords: np.ndarray, dist: np.ndarray) -> tuple[np.ndarray]:
    'Shrinks a 2D polygon by a given distance.\n\n    The coordinates of the polygon are expected as an N x 2-matrix,\n    and a positive distance results in inward shrinking.\n    \n    An empty set is returned if the shrinking operation removes all\n    original elements.\n\n    Args:\n        coords: A matrix of coordinates.\n        dist: The distance to shrink by.\n\n    Returns:\n        A tuple containing the x, y coordinates of the original set, as\n        well as the x and y coordinates of the shrunken set, in that\n        order.\n    '
    my_polygon = geometry.Polygon(coords)
    xy = my_polygon.exterior.xy
    my_polygon_shrunken = my_polygon.buffer((- dist))
    try:
        xys = my_polygon_shrunken.exterior.xy
    except AttributeError:
        xys = ([0], [0])
    return (*xy, *xys)