def METHOD_NAME(self, content: List[str]) -> List[str]:
    filter_action = None
    if self.action == "r":
        filter_action = lambda l: l.replace(self.args[0], self.args[1])
    elif self.action == "d":
        filter_action = lambda l: l.replace(self.args[0], "")
    elif self.action == "R":
        filter_action = lambda l: self.args[1] if self.args[0] in l else l
    elif self.action == "D":
        filter_action = lambda l: "" if self.args[0] in l else l
    elif self.action == "s":
        class SubstituteAction:
            def __init__(self, pattern: str, repl: str):
                self.compiled_regex = re.compile(pattern)
                self.repl = repl
            def __call__(self, l: str) -> str:
                return re.sub(self.compiled_regex, self.repl, l)
        filter_action = SubstituteAction(self.args[0], self.args[1])
    return self._apply_to_lines(content, filter_action)