Detect if object data is associated with a scene in any way
I looked at Blender's source code and realised it was quite an ordeal for the dopesheet to filter objects relevant to a context, so I gave up any hope of a simple solution and just went about doing a ersatz version of it in python.

It's a bit of a mess, but it works for detecting most non-objects (and objects) with animation data in a context:

https://gist.github.com/hedgehog90/634ea03acd2a1d87f99fbb06857e1956