def METHOD_NAME(self, event, action, matches):
    for name, value in action.items():
        try:
            newvalue = value.format(msg=event,
                                    matches={k: MatchGroupMapping(v)
                                             for (k, v) in matches.items()})
        except AttributeError:  # value has ne format: int, bool etc
            newvalue = value
        event.add(name, newvalue,
                  overwrite=self.overwrite)