[python] How to check if a variable is a dictionary in Python?