def METHOD_NAME(
    nep,
    mastr,
    matched,
    buffer_capacity=0.1,
    consider_location="plz",
    consider_carrier=True,
    consider_capacity=True,
):
    """Match Power plants (no CHP) from MaStR to list of power plants from NEP
    Parameters
    ----------
    nep : pandas.DataFrame
        Power plants (no CHP) from NEP which are not matched to MaStR
    mastr : pandas.DataFrame
        Power plants (no CHP) from MaStR which are not matched to NEP
    matched : pandas.DataFrame
        Already matched power plants
    buffer_capacity : float, optional
        Maximum difference in capacity in p.u. The default is 0.1.
    Returns
    -------
    matched : pandas.DataFrame
        Matched CHP
    mastr : pandas.DataFrame
        CHP plants from MaStR which are not matched to NEP
    nep : pandas.DataFrame
        CHP plants from NEP which are not matched to MaStR
    """
    list_federal_states = pd.Series(
        {
            "Hamburg": "HH",
            "Sachsen": "SN",
            "MecklenburgVorpommern": "MV",
            "Thueringen": "TH",
            "SchleswigHolstein": "SH",
            "Bremen": "HB",
            "Saarland": "SL",
            "Bayern": "BY",
            "BadenWuerttemberg": "BW",
            "Brandenburg": "BB",
            "Hessen": "HE",
            "NordrheinWestfalen": "NW",
            "Berlin": "BE",
            "Niedersachsen": "NI",
            "SachsenAnhalt": "ST",
            "RheinlandPfalz": "RP",
        }
    )
    for ET in nep["carrier"].unique():
        for index, row in nep[
            (nep["carrier"] == ET) & (nep["postcode"] != "None")
        ].iterrows():
            # Select plants from MaStR that match carrier, PLZ
            # and have a similar capacity
            # Create a copy of all power plants from MaStR
            selected = mastr.copy()
            # Set capacity constraint using buffer
            if consider_capacity:
                selected = selected[
                    (
                        selected.el_capacity
                        <= row["capacity"] * (1 + buffer_capacity)
                    )
                    & (
                        selected.el_capacity
                        >= row["capacity"] * (1 - buffer_capacity)
                    )
                ]
            # Set geographic constraint, either choose power plants
            # with the same postcode, city or federal state
            if consider_location == "plz":
                selected = selected[
                    selected.plz.astype(int).astype(str) == row["postcode"]
                ]
            elif consider_location == "city":
                selected = selected[
                    selected.city == row.city.replace("\n", " ")
                ]
            elif consider_location == "federal_state":
                selected.loc[:, "federal_state"] = list_federal_states[
                    selected.federal_state
                ].values
                selected = selected[
                    selected.federal_state == row.federal_state
                ]
            # Set capacity constraint if selected
            if consider_carrier:
                selected = selected[selected.carrier == ET]
            # If a plant could be matched, add this to matched
            if len(selected) > 0:
                matched = matched.append(
                    gpd.GeoDataFrame(
                        data={
                            "source": "MaStR scaled with NEP 2021 list",
                            "MaStRNummer": selected.EinheitMastrNummer.head(1),
                            "carrier": ET,
                            "el_capacity": row.c2035_capacity,
                            "scenario": "eGon2035",
                            "geometry": selected.geometry.head(1),
                            "voltage_level": selected.voltage_level.head(1),
                        }
                    )
                )
                # Drop matched power plant from nep
                nep = nep.drop(index)
                # Drop matched powerplant from MaStR list if the location is
                # accurate
                if consider_capacity & consider_carrier:
                    mastr = mastr.drop(selected.index)
    return matched, mastr, nep