def METHOD_NAME(pot_io_var, edges):
    # TODO: this is currently a hack but eventually every possible type gets their own to_ast-function
    if isinstance(pot_io_var, int):
        return dereference_io_var(pot_io_var, edges)
    elif isinstance(pot_io_var, ArgStringType):
        return to_ast_arg_string_type(pot_io_var)
    elif isinstance(pot_io_var, CommandInvocationWithIOVars):
        assert(False)
        # only happens as r-wrapped node
        return to_node_cmd_inv_with_io_vars(pot_io_var, edges, [], [])
    elif isinstance(pot_io_var, Arg):
        return pot_io_var.to_ast()
    else:
        raise Exception("Unhandled type for operand in to_ast!")