Task: Prepare a reproducible input dataset for the verifier
Objective
Implement a small utility placed in /app/ that, when executed, ensures there is a directory named input in the current working directory and that it contains at least one CSV dataset file. If the input directory already exists, the utility should exit gracefully without making changes.
What to build
A script (recommended: Python 3) at /app/setup_input.py (or an equivalent executable in /app/) with idempotent behavior:
If input/ already exists, exit with code 0 (no changes).
If input/ does not exist, create input/ and populate it with one valid CSV file (e.g., sample_dataset.csv) containing sample data.
Required outputs
A directory named input in the current working directory after the script runs (if it didn’t exist before).
Inside input/, at least one CSV file (e.g., sample_dataset.csv) with:
A header row such as: id,feature1,feature2,feature3,label
Several data rows (e.g., 5–10 rows) with simple, consistent values
File locations and naming
Solution script: /app/setup_input.py
Generated data: /app/input/sample_dataset.csv (the script creates input/ in the current working directory and places the CSV file inside)
Expected inputs and outputs for the task runner
Input: None required; the script reads/writes to the filesystem.
Output: An input/ directory containing at least one CSV file with a header and rows, created on demand.
Notes
The implementation should avoid network access. Do not rely on external data sources.
Ensure robust error handling: if creation fails due to permissions or other filesystem errors, exit with a non-zero status and print a helpful error message.
The approach should be language-agnostic, but a small, self-contained Python script is recommended for reliability.