import inspect


def get_classes(module, base_cls, include_base_cls=True):
    """Get specified classes form module.

    Args:
        module (module): Where to find classes.
        base_cls (type): The base class.
        include_base_cls (bool, optional): Defaults to True.
            Whether include base class.

    Returns:
        list: The specified classes.
    """
    def is_class(c):
        return inspect.isclass(c) \
            and issubclass(c, base_cls) \
            and (include_base_cls or c != base_cls)
    return [c for _, c in inspect.getmembers(module, is_class)]