def data(request):
    print "\n\n DATA REACHED \n\n"

    '''parse json data and upload them to your PDS'''
    # does not allow get method when uploading json data. currently not parsing jsons correctly
    if request.method == 'GET':
        return HttpResponseBadRequest("GET requests disallowed", content_type = 'text/json')

    # get necessary info from outside request
    device_id = request.POST['device_id']
    # flie_hash = request.POST['file_hash']
    # temp token to insert data
    # 'bearer_token' = 3f4851fd8a
    token = request.POST['bearer_token']
    data = json.loads(request.POST['data'])
    result = {}
    funfresult = {}

    # use token to authorize writing to the PDS
    authorization = PDSAuthorization("ios_write", audit_enabled=True)
    if (not authorization.is_authorized(request)):
        print "authorization not received"
        return HttpResponse("Unauthorized", status=401)

    # Get the relevant internal data store
    datastore_owner, ds_owner_created = Profile.objects.get_or_create(uuid = device_id)
    internalDataStore = getInternalDataStore(datastore_owner, "Living Lab", "Social Health Tracker", token)

    # write to the datastore
    result = extractAndInsertData(data, internalDataStore, token)

    # write to funf data
    funfresult = insertfunf(data, internalDataStore, token)
    blankdata = getfunfdata.insertblankdata()
    try:
        internalDataStore.saveData(blankdata, 'funf')
        blankdata = {'status':'ok', 'entries_inserted':1}
    except Exception as e:
        print e %"\n\nException from os_connector on pds: %s\n"
        blankdata = {'success':False, 'error_message':e.message}

    # let the client know what happened
    print result
    if result.get('status'):
        return HttpResponse(json.dumps(result), content_type='application/json')
    else:
        return HttpResponseBadRequest(json.dumps(result), \
            content_type='application/json')
dataset/ETHPy150Open HumanDynamics/openPDS/openpds/connectors/opensense/views.py/data/swapped operands of `%`