'The usage keys for all descendants of an XBlock/XModule as a flat list.
Includes the location of the node passed in.'

def _locations_in_subtree(self, node):

    stack = [node]
    locations = []
    while stack:
        curr = stack.pop()
        locations.append(curr.location)
        if curr.has_children:
            stack.extend(curr.get_children())
    return locations
