def set_key(self, key, value):
        if '.' in key:
            key, remainder = key.split('.', 1)
            try:
                self[key].set_key(remainder, value)
            except KeyError:
                self[key] = AttrDict()
                self[key].set_key(remainder, value)
            except AttributeError:
                if self[key] is None:  # If the value is None, we replace it
                    self[key] = AttrDict()
                    self[key].set_key(remainder, value)
                # Else there is probably something there, and we don't just
                # want to overwrite so stop and warn the user
                else:
                    raise KeyError('Cannot set nested key on non-dict key.')
        else:
            self[key] = value
Retrieve file from zip files.
dataset/ETHPy150Open calliope-project/calliope/calliope/utils.py/AttrDict.set_key--crossover with--dataset/ETHPy150Open aehlke/manabi/apps/dojango/appengine/memcache_zipserve.py/MemcachedZipHandler.GetFromStore