Helper which instantiates the appropriate Engine and returns a Client

def get_CrossCatClient(client_type, **kwargs):
    """Helper which instantiates the appropriate Engine and returns a Client"""
    client = None

    if client_type == 'local':
        import crosscat.LocalEngine as LocalEngine
        le = LocalEngine.LocalEngine(**kwargs)
        client = CrossCatClient(le)

    elif client_type == 'multiprocessing':
        import crosscat.MultiprocessingEngine as MultiprocessingEngine
        me =  MultiprocessingEngine.MultiprocessingEngine(**kwargs)
        client = CrossCatClient(me)

    else:
        raise Exception('unknown client_type: %s' % client_type)

    return client