python parse json string with newlines