def match(self, item):
        """ Get whether or not the style matches an item.

        Parameters
        ----------
        item : :class:`Stylable`
            The item to test for a style match.

        Returns
        -------
        result : int
            The match value for the item. A value less than zero
            indicates no match. A value greater than or equal to zero
            indicates a match and the specificity of the match.

        """
        specificity = 0

        if self.object_name:
            item_name = item.name
            if item_name and item_name in _comma_split(self.object_name):
                specificity += 0x100
            else:
                return -1

        if self.style_class:
            item_class = item.style_class
            if item_class:
                count = 0
                style_classes = _comma_split(self.style_class)
                for item_class in item_class.split():
                    if item_class in style_classes:
                        count += 1
                if count > 0:
                    specificity += 0x10 * count
                else:
                    return -1
            else:
                return -1

        if self.element:
            elements = _comma_split(self.element)
            for t in type(item).__mro__:
                if t.__name__ in elements:
                    specificity += 0x1
                    break
            else:
                return -1

        return specificity
dataset/ETHPy150Open nucleic/enaml/enaml/styling.py/Style.match/original