<commit_before>'''
Dragonfly
<NAME>
2017

loadfixtures.py

Sends test data to api.

'''
import math
import requests
import json
import time


def loadfixtures():
    sensorUrl = "http://localhost:8000/api/sensor"
    readingUrl = "http://localhost:8000/api/reading"

    testTemp = {
        'name': "waterTemp",
        'description': "A test sensor",
        'coefficients': "(1,0)",
        'sensor_type': "temperature",
        'units': "F",
        'min_value': 65,
        'max_value': 85
    }
    print "saving waterTemp"
    requests.post(sensorUrl, json.dumps(testTemp))
    for i in range(0, 24 * 60):
        newReading = {
            "sensor_name": "waterTemp",
            "value": 60 + 7 * math.sin(0.1 * i),
            "timestamp": time.time() - i * 1000
        }
        requests.post(readingUrl, json.dumps(newReading))

    testTurb = {
        'name': "waterTurb",
        'description': "A test sensor",<commit_msg>pointing fixtures at heroku<commit_after>'''
Dragonfly
<NAME>
2017

loadfixtures.py

Sends test data to api.

'''
import math
import requests
import json
import time


def loadfixtures():
    sensorUrl = "https://dragonf1y.herokuapp.com/api/sensor"
    readingUrl = "https://dragonf1y.herokuapp.com/api/reading"

    testTemp = {
        'name': "waterTemp",
        'description': "A test sensor",
        'coefficients': "(1,0)",
        'sensor_type': "temperature",
        'units': "F",
        'min_value': 65,
        'max_value': 85
    }
    print "saving waterTemp"
    requests.post(sensorUrl, json.dumps(testTemp))
    for i in range(0, 24 * 60):
        newReading = {
            "sensor_name": "waterTemp",
            "value": 60 + 7 * math.sin(0.1 * i),
            "timestamp": time.time() - i * 1000
        }
        requests.post(readingUrl, json.dumps(newReading))

    testTurb = {
        'name': "waterTurb",
        'description': "A test sensor",
{'fraction_non_alphanumeric': 0.14748953974895398, 'fraction_numerical': 0.030334728033472803, 'mean_word_length': 2.391843971631206, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '627883', 'n_tokens_mistral': 679, 'n_tokens_neox': 619, 'n_words': 148}