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