Many editors have some form of support to give an overview over the top-level structure (e.g., classes and methods) of a source file. At least in well-formatted sources, this structure is also represented in by the indentation of the individual lines; some programming languages (like Python) even require this for the program to be correct at all. Therefore, getting an overview can be more uniform than it seems. The more I try various such approaches, the more I like one provided by traditional ed. For Python, a simple
g/^class \|^ def /n
And in the worst case, you can focus on the structure by first removing everything else,
v/^class \|^ def /d