

def _auto_init(self, *args, **kwrds):
    'Our decorator will add this as __init__ to target classes\n    '
    for fld in getattr(self, '__fields__', []):
        val = kwrds.get(fld.name, _NO_VAL)
        if (val is _NO_VAL):
            val = fld.get_default_val()
        setattr(self, fld.name, val)
    if callable(getattr(self, 'setup', None)):
        self.setup(*args, **kwrds)

dataset/ETHPy150Open memphis-iis/GLUDB/gludb/simple.py _auto_init/original