digraph G {
    subgraph a {
    enter [shape=rect];
    exit [shape=rect];
    enter -> try;
    try -> X -> f;
    f [label = <x_in = x<br/>y_in = y<br/>f()>];
    f -> { "normal return"; catch; };
    "normal return" -> "x = x_out" -> Y -> Z;
    catch -> "y = y_out" -> "print(error)" -> Z -> "normal exit" -> exit;
    { edge [style = dashed, constraint = false];
        enter -> exit;
        try -> Z;
        catch -> Z;
        "normal return" -> Z;
    }
    }

    subgraph b {
        method [label="Start", shape=rect];
        t [label = "try"];
        x [label = "X"];
        x_in [label = "x_in = x"];
        y_in [label = "y_in = y"];
        call [label = "f()"];
        nr [style=dashed, label = "normal return"];
        data [style=dashed, label = "x = x_out"];
        y [label = "Y"];
        c [label = "catch"];
        data_catch [style=dashed,label="y = y_out"];
        print [label = "print(error)"];
        z [label = "Z"];
        ne [style=dashed, label = "normal exit"];
        method -> {t z ne};
        t -> {x call}
        call -> {x_in y_in nr c}
        nr -> {data y}
        c -> {data_catch print}
    }
}