def __find_positive_survey(survey_file, week_info):
    week_no = week_info.keys()
    week_no.sort()

    ff = filterfields()
    s_obj = surveys()

    survey_data = hlp.readcsv(survey_file, delimiter_sym=',')
    n_data = s_obj.interpretanswers(survey_data, True)
    bullying_positives = ff.filterbyequality(s_i.s_qno, '4', data=n_data[1:])

    new_bullying_positives = []
    for datum in bullying_positives:
        datetime_of_survey = ff.converttodate(datum[s_i.s_time])
        found_match = False
        for week in week_no:
            (start_date, end_date) = week_info[week]
            if start_date <= datetime_of_survey <= end_date:
                datum.append(week)
                new_bullying_positives.append(datum)
                found_match = True
                break
        if not found_match:
            print 'Something funky happened...', datum
            return None
    return new_bullying_positives
def main(sql_path, variable_path):
    s_obj = surveys()

    data = s_obj.importsqlascsv(sql_path, 'survey')
    hlp.dumpvariable(data, 'survey_list.list', variable_path)
    hlp.writecsv(data, variable_path+'survey_list.csv')

    ndata = s_obj.interpretanswers(data)
    hlp.dumpvariable(ndata, 'survey_list_interpret.list', variable_path)
    hlp.writecsv(ndata, variable_path+'survey_list_interpret.csv')

    ndata_wR = s_obj.interpretanswers(data, True)
    hlp.dumpvariable(ndata_wR, 'survey_list_with_response_interpret.list', variable_path)
    hlp.writecsv(ndata_wR, variable_path+'survey_list_with_response_interpret.csv')

    data_dict = s_obj.datatodict(ndata)
    hlp.dumpvariable(data_dict, 'survey_dict_interpret.dict', variable_path)

    data_wR_dict = s_obj.datatodict(ndata_wR)
    hlp.dumpvariable(data_wR_dict, 'survey_dict_with_response_interpret.dict', variable_path)