intent: Python: sorting items in a dictionary by a part of a key?
rewritten_intent: Sort items in dictionary `d`  using the first part of the key after splitting the key
snippet: sorted(list(d.items()), key=lambda name_num: (name_num[0].rsplit(None, 1)[0], name_num[1]))