How does ghpython add menus and menu items to grasshopper and set icons for each menu item?

I know that overriding the assemblypriority class in c# can achieve the purpose described in my title, but I only know python. Can anyone help?