def __init__(self, root, **kw):
        self.root = root
        for k, v in kw.iteritems():
            setattr(self, k, v)
Just set the root and any other attribs passes via **kw.
dataset/ETHPy150Open cloudera/hue/tools/ace-editor/static.py/Cling.__init__