python flatten dictionary to string