<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def validate_generations(self):
        '''
        Make sure that the descendent depth is valid.
        '''
        nodes = self.arc_root_node.get_descendants()
        for node in nodes:
            logger.debug("Checking parent for node of type %s" % node.arc_element_type)
            parent = ArcElementNode.objects.get(pk=node.pk).get_parent(update=True)
            if 'mile' in node.arc_element_type and parent.get_depth() > 1:
                logger.debug("Milestone node... with leaf parent")
                raise ArcGenerationError(_("Milestones cannot be descendants of anything besides the root!"))
            if (parent.get_depth() > 1 and
                parent.arc_element_type not in ARC_NODE_ELEMENT_DEFINITIONS[node.arc_element_type]['allowed_parents']):
                raise ArcGenerationError(_("Node %s cannot be a descendant of node %s" % (node, parent)))
        return None