Python: convert defaultdict to dict,"isinstance(a, dict)"