def find_symbol(self, name=None, kind=None):
for s in reversed(self.stack):<EOL><INDENT>for symbol_name, handle in s.symbols.items():<EOL><INDENT>symbol_kind = handle.__class__.__name__<EOL>if name == symbol_name and kind == symbol_kind:<EOL><INDENT>return handle<EOL><DEDENT>elif name is None and kind == handle.__class__.__name__:<EOL><INDENT>return handle<EOL><DEDENT>elif name == symbol_name and kind is None:<EOL><INDENT>return handle<EOL><DEDENT><DEDENT>if name is None and kind == s.handle.__class__.__name__:<EOL><INDENT>return s.handle<EOL><DEDENT><DEDENT>
Find a symbol in the symbol table by name, kind, or both.