def __findout_range(self, name, decl_type, recursive):
if not self._optimized:<EOL><INDENT>self._logger.debug(<EOL>'<STR_LIT>')<EOL>decls = self.declarations<EOL>if recursive:<EOL><INDENT>decls = make_flatten(self.declarations)<EOL><DEDENT>if decl_type:<EOL><INDENT>decls = [d for d in decls if isinstance(d, decl_type)]<EOL><DEDENT>return decls<EOL><DEDENT>if name and templates.is_instantiation(name):<EOL><INDENT>name = None<EOL><DEDENT>if name and decl_type:<EOL><INDENT>impl_match = scopedef_t._impl_matchers[scopedef_t.decl](name=name)<EOL>if impl_match.is_full_name():<EOL><INDENT>name = impl_match.decl_name_only<EOL><DEDENT>if recursive:<EOL><INDENT>self._logger.debug(<EOL>'<STR_LIT>')<EOL>return self._type2name2decls[decl_type].get(name, [])<EOL><DEDENT>self._logger.debug(<EOL>'<STR_LIT>')<EOL>return self._type2name2decls_nr[decl_type].get(name, [])<EOL><DEDENT>elif decl_type:<EOL><INDENT>if recursive:<EOL><INDENT>self._logger.debug('<STR_LIT>')<EOL>return self._type2decls[decl_type]<EOL><DEDENT>self._logger.debug(<EOL>'<STR_LIT>')<EOL>return self._type2decls_nr[decl_type]<EOL><DEDENT>else:<EOL><INDENT>if recursive:<EOL><INDENT>self._logger.debug((<EOL>'<STR_LIT>' +<EOL>'<STR_LIT>'))<EOL>return self._all_decls<EOL><DEDENT>self._logger.debug((<EOL>'<STR_LIT>' +<EOL>'<STR_LIT>'))<EOL>return self._all_decls_not_recursive<EOL><DEDENT>
implementation details