Close duplicate types dialog box

I was looking at the below before too. Is the code in the link python? Would it just be put in a python node in your script to close dialogs?