def _ensure_list(obj):
    if isinstance(obj, Clustering):
        return obj.membership
    return list(obj)
def _ensure_list(obj):
    if isinstance(obj, Clustering):
        return obj.membership
    return list(obj)