def get_spatial_dataset_engine(name, app_class=None):
    # If the app_class is given, check it first for a dataset engine
    app_spatial_dataset_services = None

    if app_class and issubclass(app_class, TethysAppBase):
        # Instantiate app class and retrieve dataset services list
        app = app_class()
        app_spatial_dataset_services = app.spatial_dataset_services()

    if app_spatial_dataset_services:
        # Search for match
        for app_spatial_dataset_service in app_spatial_dataset_services:

            # If match is found, initiate engine object
            if app_spatial_dataset_service.name == name:
                return initialize_engine_object(engine=app_spatial_dataset_service.engine,
                                                endpoint=app_spatial_dataset_service.endpoint,
                                                apikey=app_spatial_dataset_service.apikey,
                                                username=app_spatial_dataset_service.username,
                                                password=app_spatial_dataset_service.password)

    # If the dataset engine cannot be found in the app_class, check database for site-wide dataset engines
    site_spatial_dataset_services = SdsModel.objects.all()

    if site_spatial_dataset_services:
        # Search for match
        for site_spatial_dataset_service in site_spatial_dataset_services:

            # If match is found initiate engine object
            if site_spatial_dataset_service.name == name:
                 spatial_dataset_object = initialize_engine_object(engine=site_spatial_dataset_service.engine.encode('utf-8'),
                                                                   endpoint=site_spatial_dataset_service.endpoint,
                                                                   apikey=site_spatial_dataset_service.apikey,
                                                                   username=site_spatial_dataset_service.username,
                                                                   password=site_spatial_dataset_service.password)

                 spatial_dataset_object.public_endpoint = site_spatial_dataset_service.public_endpoint
                 return spatial_dataset_object

    raise NameError('Could not find spatial dataset service with name "{0}". Please check that dataset service with that name '
                    'exists in either the Admin Settings or in your app.py.'.format(name))
Print all the one-line module summaries that contain a substring.
dataset/ETHPy150Open tethysplatform/tethys/tethys_services/utilities.py/get_spatial_dataset_engine--crossover with--dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/pydoc.py/apropos