def service_factory(prefix, base):
    if not prefix:
        return base
    name = prefix.title() + base.__name__
    cls = type(name, (base,), {'name': prefix})
    return cls
Test utility to create subclasses of the above ServiceHandler classes
dataset/ETHPy150Open onefinestay/nameko/test/test_events.py/service_factory