I am working in a hosted notebook in ArcGIS Online.
I am using the following code to get a list of layers on a given web map:
wm_item = gis.content.get(item_id)
wm = WebMap(wm_item)
lyrs = wm.layers
I am running into an issue with web maps created in the new Map Viewer that use the grouped layer functionality. The above code reads the group layers but not the individual layers within the groups. So when run on the map in the screenshot below it returns only 7 'layers', which are actually the group layers.

Any ideas on how I can get around this?