def METHOD_NAME(depend_on_it):
    if isinstance(depend_on_it, declaration.declaration_t):
        return [depend_on_it]
    base_type = type_traits.base_type(
        type_traits.remove_alias(depend_on_it))
    if isinstance(base_type, cpptypes.declarated_t):
        return [base_type.declaration]
    elif isinstance(base_type, cpptypes.calldef_type_t):
        result = []
        result.extend(impl_details.METHOD_NAME(base_type.return_type))
        for argtype in base_type.arguments_types:
            result.extend(impl_details.METHOD_NAME(argtype))
        if isinstance(base_type, cpptypes.member_function_type_t):
            result.extend(
                impl_details.METHOD_NAME(
                    base_type.class_inst))
        return result
    return []