def __setitem__(self, key, kwds):
        if not key:
            raise TypeError('Malformed name.')
        n = 'opt'
        if key.isupper():
            n = 'grp'
        new = '_%s' % n
        sig = '_%s_sig' % n
        sig_hash = '_%s_sig_hash' % n
        try:
            None in kwds
        except TypeError:
            raise TypeError('Must pass list or dict.')
        else:
            try:
                kwds[None]
            except __HOLE__:
                kwds= dict(zip(getattr(self, sig), kwds))
            except KeyError:
                pass
        if set(kwds.keys()) != getattr(self, sig_hash):
            raise TypeError('Malformed signature.')
        getattr(self, new)(key, **kwds)
dataset/ETHPy150Open pyjs/pyjs/pyjs/options.py/Mappings.__setitem__