Group inherited from main element

def group(self):
        "Group inherited from main element"
        if self.main and self.main.group != type(self.main).__name__:
            return self.main.group
        else:
            return 'AdjointLayout'