def METHOD_NAME(which):
    if which == "case9_27":
        net = pn.case9()
        expected_bbr = {"line": {2, 7}}
        expected_bb = {
            "all": {4, 5, 7, 8},
            0: {"all": {4, 5, 7, 8},
                "internal": {4, 8},
                "external": {5, 7},
                1: {5, 7}},
            1: {"all": {4, 5, 7, 8},
                "internal": {5, 7},
                "external": {4, 8},
                0: {4, 8}}}
    elif which == "case9_abc":
        net = pn.case9()
        net.bus["zone"] = ["a", "b", "c", "a", "a", "c", "c", "b", "b"]
        expected_bbr = {"all": {"line": {2, 5, 8}},
                        "a": {"line": {2, 8}},
                        "b": {"line": {5, 8}},
                        "c": {"line": {2, 5}}}
        expected_bb = {
            "a": {"internal": {3, 4},
                  "external": {5, 8}}}
    elif which == "case9_ab_merged":
        net1 = pn.case9()
        net1.bus["zone"] = "a"
        net2 = pn.case9()
        net2.bus["zone"] = "b"
        net2.ext_grid["p_disp_mw"] = 71.9547
        pp.replace_ext_grid_by_gen(net2)
        net = pp.merge_nets(net1, net2, merge_results=False, validate=False,
                            net2_reindex_log_level=None)
        new_bus = pp.create_bus(net, 345, zone="b")
        # expected_bbr
        expected_bbr = dict()
        expected_bbr["line"] = {pp.create_line_from_parameters(
            net, net.bus.index[net.bus.name == 9][0], net.bus.index[net.bus.name == 9][1], 1,
            0, 65, 0, 0.41)}
        expected_bbr["impedance"] = {pp.create_impedance(net, net.bus.index[net.bus.name == 5][0],
                                    net.bus.index[net.bus.name == 5][1], 0, 0.06, 250)}
        expected_bbr["switch"] = {pp.create_switch(net, net.bus.index[net.bus.name == 7][0],
                                net.bus.index[net.bus.name == 7][1], "b")}
        expected_bbr["trafo"] = {pp.create_transformer_from_parameters(
            net, net.bus.index[net.bus.name == 8][0], net.bus.index[net.bus.name == 8][1], 250,
            345, 345, 0, 10, 50, 0)}
        expected_bbr["trafo3w"] = {pp.create_transformer3w_from_parameters(
            net, net.bus.index[net.bus.name == 3][0], new_bus, net.bus.index[net.bus.name == 3][1],
            345, 345, 345, 250, 250, 250, 10, 10, 10, 0, 0, 0, 50, 0)}
        # expected_bb
        expected_bb = {key: dict() for key in ["a", "b"]}
        expected_bb["a"]["internal"] = set(net.bus.index[net.bus.name.isin(
            [9, 5, 7, 8, 3]) & (net.bus.zone == "a")])
        expected_bb["a"]["external"] = set(net.bus.index[net.bus.name.isin(
            [9, 5, 7, 8, 3]) & (net.bus.zone == "b")]) | {new_bus}
        expected_bb["b"]["internal"] = expected_bb["a"]["external"] - {18}
        expected_bb["b"]["external"] = expected_bb["a"]["internal"] | {18}
    pp.runpp(net)
    return net, expected_bb, expected_bbr