def extractAndInsertData(data, internalDataStore, token):
    result = {}
    print '\n======================\nextractAndInsertData:'
    print data
    print '\n======================\n'

    try:
        #insert each json object in data list, saveData only takes one input 'data'
        for json_object in data:
            internalDataStore.saveData(json_object, 'opensense')
        result = {'status':'ok', 'entries_inserted':len(data)}
    except Exception as e:
        print "\n\nException from os_connector on pds: %s\n" %e
        result = {'success':False, 'error_message':e.message}
    return result
dataset/ETHPy150Open HumanDynamics/openPDS/openpds/connectors/opensense/views.py/extractAndInsertData/original