def METHOD_NAME(self, persistent, mode="i"):
    """Add a given filename as input or output."""
    if mode == "i":
        if isinstance(persistent, list):
            self.input.extend(persistent)
        else:
            self.input.append(persistent)
    else:
        if isinstance(persistent, list):
            self.output.extend(persistent)
        else:
            self.output.append(persistent)