def __len__(self):
        """
        Returns the number of components of CPE Name.

        :returns: count of components of CPE Name
        :rtype: int

        TEST: a CPE Name with two parts (hw and os) and
        some elements empty and with values

        >>> str = "cpe:/cisco::3825/cisco:ios:12.3"
        >>> c = CPE(str)
        >>> len(c)
        6
        """

        count = 0

        for part in CPE.CPE_PART_KEYS:
            elements = self.get(part)
            for elem in elements:
                for ck in CPEComponent.CPE_COMP_KEYS_EXTENDED:
                    comp = elem.get(ck)
                    if not isinstance(comp, CPEComponentUndefined):
                        count += 1

        return count
def __len__ ( self ) : count = 0 for part in CPE . CPE_PART_KEYS : elements = self . get ( part ) for elem in elements : for ck in CPEComponent . CPE_COMP_KEYS_EXTENDED : comp = elem . get ( ck ) if not isinstance ( comp , CPEComponentUndefined ) : count += 1 return count
Returns the number of components of CPE Name.

        :returns: count of components of CPE Name
        :rtype: int

        TEST: a CPE Name with two parts (hw and os) and
        some elements empty and with values

        >>> str = "cpe:/cisco::3825/cisco:ios:12.3"
        >>> c = CPE(str)
        >>> len(c)
        6