def __init__(self, **kargs):
        fnames = [ fname for fname, ftype in self._fields ]
        unvalid_kargs = set(kargs.keys()) - set(fnames)
        if unvalid_kargs:
            raise AttributeError('invalid field name/s: %s' % unvalid_kargs)
        for fn in fnames:
            setattr(self, fn, kargs.get(fn))
dataset/ETHPy150Open paolo-losi/stormed-amqp/stormed/util.py/WithFields.__init__/original