def get_class(cls, name=None):
    """Obtain the class for some (named) service

            In a shortened example::

                class Foo(Base):
                    _name = 'foo'

                assert Base.get_class('foo') == Foo
        """
    if name is None:
        name = '*'
    svc_classes = getattr(cls, '__service_classes', None)
    if svc_classes is None:
        for b in cls.__mro__:
            svc_classes = getattr(b, '__service_classes', None)
            if svc_classes is not None:
                break
    if svc_classes is None:
        raise RuntimeError('No base service class for %s' % cls.__name__)
    if isinstance(name, (list, tuple)):
        for n in name:
            base_class = svc_classes.get(n, None)
            if base_class is not None:
                break
    else:
        base_class = svc_classes.get(name, None)
    if base_class is None:
        raise TypeError('No %s class with name: %s' % (cls.__name__, name))
    return base_class
