def instantiate_children(
        self,
        menu_list,
        top_surf_data,
    ):
        """Instantiate children widgets.

        menu_list (list of dicts)
            contains data about menu manager items. See
            __init__ docstring for additional information.
        """
        children = self.children = List2D()

        ### iterate over menu data instantiating the
        ### top items (if an item is a menu.submenu.main.Menu
        ### instance, its children, grandchildren and so on
        ### are instantiated recursively inside its __init__
        ### method)

        for item_data, surface_map in zip(menu_list, top_surf_data):

            ## choose top item class based on presence/
            ## absence of attribute and instantiate it

            # try retrieving children data
            try:
                item_data["children"]

            # not having children data means the data
            # describes a command, so instantiate one

            except KeyError:
                widget = Command(self, item_data, surface_map)

            # otherwise the data really describes a menu
            # and its children, so instantiate a menu

            else:

                # instantiate menu (all its children are
                # instantiated recursively in this step)

                widget = Menu(self, item_data, surface_map)

            children.append(widget)

        ###

        retrieve_pos_from = "topright" if self.is_menubar else "bottomleft"

        children.rect.snap_rects_ip(
            retrieve_pos_from=retrieve_pos_from,
            assign_pos_to="topleft",
        )
Instantiate children widgets.

        menu_list (list of dicts)
            contains data about menu manager items. See
            __init__ docstring for additional information.
        
nodezator/menu/main.py