def __match__(self, name=None, attrs=()):
if '<STR_LIT:{>' in name or '<STR_LIT:[>' in name:<EOL><INDENT>return str(self) == name<EOL><DEDENT>attrs['<STR_LIT:name>'] = name<EOL>for k, v in attrs.items():<EOL><INDENT>if getattr(self, k) != v:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL>
r"""Check if given attributes match current object

        >>> from TexSoup import TexSoup
        >>> soup = TexSoup(r'\ref{hello}\ref{hello}\ref{hello}\ref{nono}')
        >>> soup.count(r'\ref{hello}')
        3