def init_from_dict(self, d):
        for k, v in d.items():
            # First, keys must be strings, not ints
            if isinstance(k, int):
                k = str(k)
            # Now, assign to the key, handling nested AttrDicts properly
            if isinstance(v, dict):
                self.set_key(k, AttrDict(v))
            elif isinstance(v, list):
                self.set_key(k, [i if not isinstance(i, dict) else AttrDict(i)
                                 for i in v])
            else:
                self.set_key(k, v)
Initialize a new AttrDict from the given dict. Handles any
dataset/ETHPy150Open calliope-project/calliope/calliope/utils.py/AttrDict.init_from_dict