def METHOD_NAME():
    ensembles = [
        "r1i1p1f1",
        "r4i1p1f1",
        "r3i1p2f1",
        "r4i1p2f1",
        "r3i1p1f1",
    ]
    groups = _group_ensemble_names(ensembles)
    expected = ['r1i1p1f1', 'r(3:4)i1p(1:2)f1']
    print(groups)
    print(expected)
    assert groups == expected