'Parameters
name : String Atom name
type : String Atom name
format : 8, 16, 32'

def set_property(self, name, value, type=None, format=None):

    if (name in PropertyMap):
        if (type or format):
            raise ValueError('Over-riding    default    type    or    format    for    property.')
        (type, format) = PropertyMap[name]
    elif (None in (type, format)):
        raise ValueError('Must    specify    type    and    format    for    unknown    property.')
    try:
        if isinstance(value, six.string_types):
            if six.PY3:
                value = value.encode()
            elif (not isinstance(value, str)):
                value = value.encode('utf-8')
        else:
            next(iter(value))
    except StopIteration:
        value = []
    except TypeError:
        value = [value]
    try:
        self.conn.conn.core.ChangePropertyChecked(xcffib.xproto.PropMode.Replace, self.wid, self.conn.atoms[name], self.conn.atoms[type], format, len(value), value).check()
    except xcffib.xproto.WindowError:
        logger.warning('X    error    in    SetProperty    (wid=%r,    prop=%r),    ignoring', self.wid, name)
