(self, string: str)
return generate_anonymous(idx, new_party_id, role)
{role}_{party_id}_{idx}
{role}_{party_id}_{idx}
{ role } _ { party_id } _ { idx }
def anonymous_format(self, string: str):
        """{role}_{party_id}_{idx}"""
        role, party_id, idx = string.split('_')
        mapping = self.get_mapping(role)
        new_party_id = mapping[int(party_id)]
        return generate_anonymous(idx, new_party_id, role)
def anonymous_format ( self , string : str ) : role , party_id , idx = string . split ( '_' ) mapping = self . get_mapping ( role ) new_party_id = mapping [ int ( party_id ) ] return generate_anonymous ( idx , new_party_id , role )