@classmethod
    def set_attribute(cls, obj, key, val):
        idx_dot = key.find('.')
        if idx_dot == -1: #single key
            setattr(obj, key, val)
        else: #dotted key
            keyhead, keyrest = key[:idx_dot], key[idx_dot+1:]
            if hasattr(obj, keyhead):
                p = getattr(obj, keyhead)            
                cls.set_attribute(p, keyrest, val)
            else:
                p = Context()
                cls.set_attribute(p, keyrest, val)
                setattr(obj, key[:idx_dot], p)
recurisivly adds fields to obj according to key
dataset/ETHPy150Open concurrence/concurrence/lib/concurrence/application.py/Context.set_attribute