def dm_subset(dm_sq, idxs):
    """Get subset of distance matrix given list of indices

    Args:
        dm_sq (numpy.array): squareform distance matrix from pdist
        idxs (list of int): list of indices
    Returns:
        numpy.array: subset of `dm_sq` with `shape == (len(idxs), len(idxs))`
    """
    return dm_sq[idxs][:,idxs]