python flatten dict to string