def validate(self, object, name, value):
        """ Validates that the value is a valid font descriptor string.
        """
        try:
            point_size = family = style = weight = underline = ''
            facename = ['']
            for word in value.split():
                lword = word.lower()
                if lword in font_families:
                    family = ' ' + lword
                elif lword in font_styles:
                    style = ' ' + lword
                elif font_weights in lword:
                    weight = ' ' + lword
                elif lword == 'underline':
                    underline = ' ' + lword
                elif lword not in font_noise:
                    try:
                        int(lword)
                        point_size = lword + ' pt'
                    except:
                        facename.append(word)
            fontstr = ('%s%s%s%s%s%s' % (point_size, family, style, weight,
                        underline, ' '.join(facename))).strip()
            return fontstr
        except Exception:
            pass
        raise TraitError(object, name, 'a font descriptor string',
                            repr(value))
dataset/ETHPy150Open enthought/traitsui/traitsui/null/font_trait.py/TraitFont.validate/swapped operands of `in`