Code Duplication    Length = 12-12 lines in 2 locations

src/egon/data/datasets/electrical_neighbours.py 2 locations

@@ 205-216 (lines=12) @@
202
                ignore_index=True,
203
            )
204
            next_bus_id += 1
205
        if 220.0 in vnom_per_country[cntr]:
206
            central_buses = central_buses.append(
207
                {
208
                    "scn_name": scenario,
209
                    "bus_id": next_bus_id,
210
                    "x": central_buses[
211
                        central_buses.country == cntr
212
                    ].x.unique()[0],
213
                    "y": central_buses[
214
                        central_buses.country == cntr
215
                    ].y.unique()[0],
216
                    "country": cntr,
217
                    "carrier": "AC",
218
                    "v_nom": 220.0,
219
                },
@@ 187-198 (lines=12) @@
184
    vnom_per_country = foreign_buses.groupby("country").v_nom.unique().copy()
185
    for cntr in vnom_per_country.index:
186
        print(cntr)
187
        if 110.0 in vnom_per_country[cntr]:
188
            central_buses = central_buses.append(
189
                {
190
                    "scn_name": scenario,
191
                    "bus_id": next_bus_id,
192
                    "x": central_buses[
193
                        central_buses.country == cntr
194
                    ].x.unique()[0],
195
                    "y": central_buses[
196
                        central_buses.country == cntr
197
                    ].y.unique()[0],
198
                    "country": cntr,
199
                    "carrier": "AC",
200
                    "v_nom": 110.0,
201
                },