

@webapi.route('/sets/<set_id>/state.txt', methods=['GET'])
@log_application_errors
def app_get_set_state_txt(set_id):
    '\n    '
    with db_connect(current_app.config['DATABASE_URL']) as conn:
        with db_cursor(set_id) as db:
            runs = new_read_completed_set_runs(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 or {
            
        })
        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_set_state_txt/VarMisuse@47/80 `conn`->`set_id`