nesting_structure function

Get the nesting structure for the units