def init_with_context(self, context):
        if self._initialized:
            return
        new_children = []
        for link in self.children:
            if isinstance(link, (tuple, list,)):
                link_dict = {'title': link[0], 'url': link[1]}
                if len(link) >= 3:
                    link_dict['external'] = link[2]
                if len(link) >= 4:
                    link_dict['description'] = link[3]
                if len(link) >= 5:
                    link_dict['attrs'] = link[4]
                link = link_dict
            if 'attrs' not in link:
                link['attrs'] = {}
            link['attrs']['href'] = link['url']
            if link.get('description', ''):
                link['attrs']['title'] = link['description']
            if link.get('external', False):
                link['attrs']['class'] = ' '.join(
                    ['external-link'] + link['attrs'].get('class', '').split()
                ).strip()
            link['attrs'] = flatatt(link['attrs'])
            new_children.append(link)
        self.children = new_children
        self._initialized = True
dataset/ETHPy150Open django-admin-tools/django-admin-tools/admin_tools/dashboard/modules.py/LinkList.init_with_context/original