import inspect


def is_valid_resource(test_item, api_name = None):
    """ Filter function used to determine whether the given objects within a module represent
    valid ModelResources for this API version"""

    if inspect.isclass(test_item):
        if test_item.api_name == api_name and "DefaultResource" not in test_item.__name__:
            return True
    return False