In the following thread, there is a discussion about needing to search for any objects having an Attribute name with a particular value.
There is a SuperTool script (by @kku) demonstrating python code to do that. It uses some SuperTool specific methods (like getargs() user input dialogs)… so that SuperTool script is not copy’n’paste chunks of code.
You may also find the Attributes section of the Sphinx-driven Gramps developer docs useful. (The site is showing some some latency today. So it and @gramps-project are probably defending against a DoS attack. Please have patience. )