def METHOD_NAME(self, n: ast.node, input, type, output, heredoc) -> ast.node:
    newoutput = output
    newheredoc = heredoc
    if isinstance(n.output, ast.node):
        newoutput = self.visit(n.output)
    if n.heredoc:
        newheredoc = self.visit(n.heredoc)
    return ast.node(
        kind="redirect",
        input=input,
        type=type,
        output=newoutput,
        heredoc=newheredoc,
    )