How can I convert a string representation of a dictionary to an actual dictionary in Python