def check_measurements_upload(entity_id, device_id, sensor_type,
                              start_date, end_date, user, pwd):
    """Check measurements were uploaded to a specific device.
    Expect the sensor type and start/end dates as strings like '2015-09-09'."""
    url = URL + "entities/" + entity_id + "/devices/" + device_id +\
    "/measurements/" + sensor_type + "?startDate=" + start_date +\
    "%2000:00:00&endDate=" + end_date + "%2000:00:00"
    print sr.get_request(user, pwd, url)
def get_programme_by_id(user, password, programme_id, action, *args):
    url = BASE_URL + programme_id
    print url
    data = sr.get_request(user, password, url)
    print data
    # print data['name'], " - ", data['programme_id']
    if action == 'stdout':
        results_to_stdout([data], args)
    elif action == 'csv':
        results_to_csv(data, args)
    elif action == 'both':
        results_to_stdout([data], args)
        results_to_csv(data, args)
    else:
        print """The only actions available are 
def get_all_profiles(user, password, entity_id, action):
    '''Return info on all your profiles for this entity:
    [action]: Results can be printed and/or written to 
    a csv file. Value should be 'stdout', 'csv', 'both'
    or 'return'.'''
    url = BASE_URL + entity_id + "/profiles/"
    data = sr.get_request(user, password, url)
    if action == 'stdout':
        print results_to_return(data)
    elif action == 'csv':
        results_to_csv(data)
    elif action == 'both':
        print results_to_return(data)
        results_to_csv(data)
    elif action == 'return':
        return results_to_return(data)
    else:
        print """The only actions available are 
def get_all_programmes(user, password, action, *args):
    '''Return info on all your programmes:
    [action]: Results can be printed and/or written to 
    a csv file. Value should be 'stdout', 'csv' or 'both'.
    [*args]: (see PROGRAMME_INFO for the full list)
    - If *args is left blank the info returned is 
    set in DEFAULT_INFO.
    - Otherwise it returns DEFAULT_INFO and the other 
    parameters specified.'''
    url = BASE_URL
    data = sr.get_request(user, password, url)
    if action == 'stdout':
        results_to_stdout(data, args)
    elif action == 'csv':
        results_to_csv(data, args)
    elif action == 'both':
        results_to_stdout(data, args)
        results_to_csv(data, args)
    else:
        print """The only actions available are