def dict(cls, *args, **kwds):
        """Construct a q dictionary

        K.dict() -> new empty q dictionary (q('()!()')
        K.dict(mapping) -> new dictionary initialized from a mapping object's
            (key, value) pairs
        K.dict(iterable) -> new dictionary initialized from an iterable
            yielding (key, value) pairs
        K.dict(**kwargs) -> new dictionary initialized with the name=value
            pairs in the keyword argument list.
            For example: K.dict(one=1, two=2)
        """
        if args:
            if len(args) > 1:
                raise TypeError("Too many positional arguments")
            x = args[0]
            keys = []
            vals = []
            try:
                x_keys = x.keys
            except AttributeError:
                for k, v in x:
                    keys.append(k)
                    vals.append(v)
            else:
                keys = x_keys()
                vals = [x[k] for k in keys]
            return q('!', keys, vals)
        else:
            if kwds:
                keys = []
                vals = []
                for k, v in kwds.items():
                    keys.append(k)
                    vals.append(v)
                return q('!', keys, vals)
            else:
                return q('()!()')
Construct a q dictionary

        K.dict() -> new empty q dictionary (q('()!()')
        K.dict(mapping) -> new dictionary initialized from a mapping object's
            (key, value) pairs
        K.dict(iterable) -> new dictionary initialized from an iterable
            yielding (key, value) pairs
        K.dict(**kwargs) -> new dictionary initialized with the name=value
            pairs in the keyword argument list.
            For example: K.dict(one=1, two=2)