This is just not how signals work in Godot, you have to connect them to a script through the "Node" tab that is right next to the Inspector. When you do so, a new function will be created on your script. It should look something like:
I'm not sure if this is how the name looks like by default... Anyways, this function (that may have any name you wish as long as you connect it from the Node tab) will be called every time an animation finishes.
So, taking your code as an example... It should look like this, if correctly used the function.
if anim_name == "name":
Hope I helped you!
Basicly the function is automatically called once the even triggers.
If you want to learn more about signals, check this page on the docs.