def count(self, value):
from pcapkit.protocols.protocol import Protocol<EOL>try:<EOL><INDENT>flag = issubclass(value, Protocol)<EOL><DEDENT>except TypeError:<EOL><INDENT>flag = issubclass(type(value), Protocol)<EOL><DEDENT>if flag or isinstance(value, Protocol):<EOL><INDENT>value = value.__index__()<EOL>if isinstance(value, tuple):<EOL><INDENT>value = r'<STR_LIT:|>'.join(value)<EOL><DEDENT><DEDENT>with contextlib.suppress(Exception):<EOL><INDENT>return sum(<NUM_LIT:1> for data in self.__data__ if re.fullmatch(value, data, re.IGNORECASE) is not None)<EOL><DEDENT>return <NUM_LIT:0><EOL>
S.count(value) -> integer -- return number of occurrences of value