def METHOD_NAME(
    self, partner, number, allowed_codes=None, name_field="display_name", **kw
):
    data = {
        "name": partner[name_field],
        "identifiers": [
            {"attrs": {"schemeID": "cat1"}, "value": f"cat1-p{number}"},
            {"attrs": {"schemeID": "cat2"}, "value": f"cat2-p{number}"},
            {"attrs": {"schemeID": "cat3"}, "value": f"cat3-p{number}"},
        ],
        "endpoint": {},
    }
    data.update(kw)
    if allowed_codes:
        data["identifiers"] = [
            x
            for x in data["identifiers"]
            if x["attrs"]["schemeID"] in allowed_codes
        ]
    return data