How to Identify Families with certain shared parameters

Hello guys,
Do you have any ideas how to track down certain families in a project file that contains bad or duplicated shared parameters. With API or dynamo, both ways work for me. Here is an example where you can see those duplicated shared parameters. They do not exist in the project file and come from some families.

This may get you started?

Modify as needed
Add a csv export of the gathered info?
Filter parameters in family to look specifically for your shared parameter names?

Once you’re happy with the graph, get rid of the item by index and run on all families on project? Or filter your family list to suit first.