def create_examples_menu(arduino_info):
    sub_menus = []
    for root_dir in arduino_info.get_root_dirs():
        examples = root_dir.get_examples()
        examples_menu = load_sketchbook_menu(examples)
        sub_menus += examples_menu.get_sub_menus()
        if sub_menus:
            sub_menus.append(Menu())

        libraries = root_dir.get_libraries()
        for library in libraries:
            lib_arch = library.get_arch()
            caption = (library.get_name(), lib_arch) % '%s (%s)'
            examples = library.get_examples()
            examples.set_name(caption)
            menu = load_sketchbook_menu(examples)
            if menu.has_sub_menus():
                sub_menus.append(menu)
        if sub_menus:
            sub_menus.append(Menu())
        for package in root_dir.get_packages():
            for platform in package.get_platforms():
                examples = platform.get_examples()
                examples_menu = load_sketchbook_menu(examples)
                libraries = platform.get_libraries()

                if examples_menu.get_sub_menus() or libraries:
                    menu_dict = {}
                    menu_dict['caption'] = platform.get_caption()
                    menu_dict['command'] = 'none_command'
                    menu = Menu(menu_dict)
                    sub_menus.append(menu)
                sub_menus += examples_menu.get_sub_menus()
                for library in libraries:
                    examples = library.get_examples()
                    menu = load_sketchbook_menu(examples)
                    if menu.has_sub_menus():
                        sub_menus.append(menu)
                if sub_menus:
                    sub_menus.append(Menu())
    write_menu('examples', sub_menus)
dataset/ETHPy150Open Robot-Will/Stino/stino/st_menu.py/create_examples_menu/swapped operands of `%`