@webapi.route('/state.txt', methods=['GET'])
@log_application_errors
def app_get_state_txt():
    '''
    '''
    with db_connect(current_app.config['DATABASE_URL']) as conn:
        with db_cursor(conn) as db:
            set = read_latest_set(db, 'openaddresses', 'openaddresses')
            runs = read_completed_runs_to_date(db, set.id)
    
    buffer = csvIO()
    output = csvDictWriter(buffer, CSV_HEADER, dialect='excel-tab', encoding='utf8')
    output.writerow({col: col for col in CSV_HEADER})
    for run in sorted(runs, key=attrgetter('source_path')):
        run_state = run.state and {}
        row = {col: run_state.get(col, None) for col in CSV_HEADER}
        row['source'] = os.path.relpath(run.source_path, 'sources')
        row['code version'] = run.code_version
        row['cache'] = nice_domain(row['cache'])
        row['sample'] = nice_domain(row['sample'])
        row['processed'] = nice_domain(row['processed'])
        row['output'] = nice_domain(row['output'])
        output.writerow(row)

    return Response(buffer.getvalue(),
                    headers={'Content-Type': 'text/plain; charset=utf8'})
dataset/ETHPy150Open openaddresses/machine/openaddr/ci/webapi.py/app_get_state_txt/operator `or` -> `and`