def METHOD_NAME(self, query):
    parent_name, name = utils.split_compound_name(query)
    model = self._index[parent_name].model
    attrs_to_check = [ 'functions', 'typedefs', 'enum_classes' ]
    try:
        for attr in attrs_to_check:
            for inner in getattr(model, attr):
                if inner.name == name:
                    return inner
    except AttributeError:
        pass
    raise KeyError(f'Cannot find {name} inside {parent_name}')