def save(data, outputPath):

    # Over-write check
    if glob(outputPath) > 0 \
            or glob(outputPath+os.sep+'oscaarDataBase.pkl') > 0 \
            or glob(outputPath+'.pkl') > 0:
        print 'WARNING: could potentially overwrite the most recent oscaarDataBase.pkl'

    if outputPath.endswith('.pkl') or outputPath.endswith('.PKL'):
        outputName = outputPath
    elif outputPath[-1] == os.sep:
        outputName = outputPath+'oscaarDataBase.pkl'
    else:
        outputName = outputPath+'.pkl'

    # cPickle can not save functions, so delete the function data.convertToJD
    # before saving the object data
    try:
        del data.convertToJD
    except:
        pass

    output = open(outputName, 'wb')
    cPickle.dump(data, output)
    output.close()
Save everything in oscaar.dataBank object <data> to a python pickle
dataset/ETHPy150Open OSCAAR/OSCAAR/oscaar/IO.py/save