def has_spatialite():
    use_exceptions = ogr.GetUseExceptions()
    ogr.UseExceptions()
    try:
        ds = ogr.GetDriverByName('Memory').CreateDataSource('memory')
        sql = '''SELECT sqlite_version(), spatialite_version()'''
        lyr = ds.ExecuteSQL(sql, dialect='SQLite')
        return True
    except Exception as e:
        return False
    finally:
        if not use_exceptions:
            ogr.DontUseExceptions()
Harness to test if the FrameSet.__rand__ call works properly.
dataset/ETHPy150Open cgarrard/osgeopy-code/ospybook/ospybook/__init__.py/has_spatialite--crossover with--dataset/ETHPy150Open sqlboy/fileseq/test/run.py/TestFrameSet._check___rand__