human
Flattening a shallow list in Python
assistant
Here is some code to flatten list `list_of_menuitems`

[image for menuitem in list_of_menuitems for image in menuitem]

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.