def __contains__(self, s: Signature) -> bool:
<EOL>from pyrser.type_system.type import Type<EOL>found = False<EOL>txt = "<STR_LIT>"<EOL>if isinstance(s, Signature):<EOL><INDENT>txt = s.internal_name()<EOL><DEDENT>elif isinstance(s, Type):<EOL><INDENT>txt = s.type_name<EOL><DEDENT>elif isinstance(s, str):<EOL><INDENT>txt = s<EOL><DEDENT>found = (txt in self._hsig)<EOL>if not found and self.parent is not None:<EOL><INDENT>if self.state != StateScope.FREE and isinstance(s, Type):<EOL><INDENT>found = (s.type_name in self.parent())<EOL><DEDENT>if self.state == StateScope.EMBEDDED:<EOL><INDENT>found = (txt in self.parent())<EOL><DEDENT><DEDENT>return found<EOL>
check if a Signature or a Type is declared in a Scope