conversations listlengths 2 2 | source stringclasses 8
values |
|---|---|
[
{
"role": "user",
"content": "Provide a Python solution for `read_lines`: read all lines from a file. Include basic type checks."
},
{
"role": "assistant",
"content": "def read_lines(path: str) -> list:\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return [line.rstrip(\"\\n\") f... | file_io |
[
{
"role": "user",
"content": "Write a reusable function `read_lines` which read all lines from a file. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def read_lines(path: str) -> list:\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return [line.rstrip(\"\... | file_io |
[
{
"role": "user",
"content": "Write code for `read_lines` (a file path) that read all lines from a file. Include basic type checks."
},
{
"role": "assistant",
"content": "def read_lines(path: str) -> list:\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return [line.rstrip(\"\\n\"... | file_io |
[
{
"role": "user",
"content": "Create `read_lines(a file path)` returning a list of lines. Keep it efficient."
},
{
"role": "assistant",
"content": "def read_lines(path: str) -> list:\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return [line.rstrip(\"\\n\") for line in f]\n"
}... | file_io |
[
{
"role": "user",
"content": "Implement `read_lines` with proper validation: read all lines from a file. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def read_lines(path: str) -> list:\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return [line.rstrip(\... | file_io |
[
{
"role": "user",
"content": "Create `read_lines(a file path)` returning a list of lines. Include basic type checks."
},
{
"role": "assistant",
"content": "def read_lines(path: str) -> list:\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return [line.rstrip(\"\\n\") for line in f... | file_io |
[
{
"role": "user",
"content": "Provide a Python solution for `read_lines`: read all lines from a file. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def read_lines(path: str) -> list:\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return [line.rstrip(\"\\n\") fo... | file_io |
[
{
"role": "user",
"content": "Construct `write_json` to write data to a JSON file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with open(p... | file_io |
[
{
"role": "user",
"content": "Implement `write_json` with proper validation: write data to a JSON file. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)... | file_io |
[
{
"role": "user",
"content": "Construct `write_json` to write data to a JSON file. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n ... | file_io |
[
{
"role": "user",
"content": "Implement `write_json` returning None given a path and data. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with op... | file_io |
[
{
"role": "user",
"content": "Please provide `write_json` that write data to a JSON file. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n ... | file_io |
[
{
"role": "user",
"content": "Create `write_json(a path and data)` returning None. "
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with open(path, \"w\", encoding=\"utf... | file_io |
[
{
"role": "user",
"content": "Make a function `write_json` to write data to a JSON file. Keep it efficient."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with open(pat... | file_io |
[
{
"role": "user",
"content": "Draft a Python function `write_json` to write data to a JSON file. "
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with open(path, \"w\", ... | file_io |
[
{
"role": "user",
"content": "Create a utility function named `write_json` which write data to a JSON file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_... | file_io |
[
{
"role": "user",
"content": "Please provide `write_json` that write data to a JSON file. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with ... | file_io |
[
{
"role": "user",
"content": "Code a function `write_json` to write data to a JSON file. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=Tr... | file_io |
[
{
"role": "user",
"content": "Create a robust `write_json` that write data to a JSON file. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with op... | file_io |
[
{
"role": "user",
"content": "Write `write_json` handling edge cases; it should write data to a JSON file. Use only the standard library."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exi... | file_io |
[
{
"role": "user",
"content": "Add a function `write_json` that write data to a JSON file. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=T... | file_io |
[
{
"role": "user",
"content": "Formulate `write_json` to write data to a JSON file. Use only the standard library."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with op... | file_io |
[
{
"role": "user",
"content": "Add a function `write_json` that write data to a JSON file. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n ... | file_io |
[
{
"role": "user",
"content": "Can you write code for `write_json` that write data to a JSON file? Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n ... | file_io |
[
{
"role": "user",
"content": "Implement `write_json(a path and data)` to write data to a JSON file. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n ... | file_io |
[
{
"role": "user",
"content": "Implement the function `write_json` (a path and data) -> None. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_o... | file_io |
[
{
"role": "user",
"content": "Formulate `write_json` to write data to a JSON file. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with open(path,... | file_io |
[
{
"role": "user",
"content": "Write a reusable function `write_json` which write data to a JSON file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=Tru... | file_io |
[
{
"role": "user",
"content": "Write `write_json`: write data to a JSON file. Keep it efficient."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with open(path, \"w\", en... | file_io |
[
{
"role": "user",
"content": "Develop `write_json` such that it write data to a JSON file. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n ... | file_io |
[
{
"role": "user",
"content": "Help me write `write_json` that write data to a JSON file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with ... | file_io |
[
{
"role": "user",
"content": "Produce a clean implementation of `write_json`: write data to a JSON file. Use only the standard library."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist... | file_io |
[
{
"role": "user",
"content": "I need a Python helper `write_json` that write data to a JSON file. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n ... | file_io |
[
{
"role": "user",
"content": "Formulate `write_json` to write data to a JSON file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with open(p... | file_io |
[
{
"role": "user",
"content": "Add a function `write_json` that write data to a JSON file. Use only the standard library."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n ... | file_io |
[
{
"role": "user",
"content": "Add a function `write_json` that write data to a JSON file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with... | file_io |
[
{
"role": "user",
"content": "Write `write_json`: write data to a JSON file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with open(path, \... | file_io |
[
{
"role": "user",
"content": "Write `write_json`: write data to a JSON file. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True)\n with open(path, \"... | file_io |
[
{
"role": "user",
"content": "Produce a clean implementation of `write_json`: write data to a JSON file. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\nimport os\n\ndef write_json(path: str, data) -> None:\n os.makedirs(os.path.dirname(path) or \".\", exist_ok=True... | file_io |
[
{
"role": "user",
"content": "Create `read_json(a file path)` returning the parsed data. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "I need a Python helper `read_json` that read JSON data from a file. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.lo... | file_io |
[
{
"role": "user",
"content": "Write a reusable function `read_json` which read JSON data from a file. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return jso... | file_io |
[
{
"role": "user",
"content": "Write `read_json` handling edge cases; it should read JSON data from a file. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
... | file_io |
[
{
"role": "user",
"content": "Implement the function `read_json` (a file path) -> the parsed data. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Add a function `read_json` that read JSON data from a file. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"... | file_io |
[
{
"role": "user",
"content": "Construct `read_json` to read JSON data from a file. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Help me write `read_json` that read JSON data from a file. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Create `read_json(a file path)` returning the parsed data. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
... | file_io |
[
{
"role": "user",
"content": "Add a function `read_json` that read JSON data from a file. "
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Construct `read_json` to read JSON data from a file. Keep it efficient."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Make a function `read_json` to read JSON data from a file. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
... | file_io |
[
{
"role": "user",
"content": "Implement the function `read_json` (a file path) -> the parsed data. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Make a function `read_json` to read JSON data from a file. Use only the standard library."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Implement `read_json(a file path)` to read JSON data from a file. Use only the standard library."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}... | file_io |
[
{
"role": "user",
"content": "Draft a Python function `read_json` to read JSON data from a file. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Code a function `read_json` to read JSON data from a file. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Write `read_json` handling edge cases; it should read JSON data from a file. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n retur... | file_io |
[
{
"role": "user",
"content": "Draft a Python function `read_json` to read JSON data from a file. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "I need a Python helper `read_json` that read JSON data from a file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Implement `read_json(a file path)` to read JSON data from a file. Keep it efficient."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Construct `read_json` to read JSON data from a file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Define a function `read_json` taking a file path and returning the parsed data. Add a brief docstring."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\... | file_io |
[
{
"role": "user",
"content": "Write code for `read_json` (a file path) that read JSON data from a file. Keep it efficient."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Implement `read_json` returning the parsed data given a file path. "
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Create a robust `read_json` that read JSON data from a file. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Code a function `read_json` to read JSON data from a file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Write code for `read_json` (a file path) that read JSON data from a file. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
... | file_io |
[
{
"role": "user",
"content": "Write `read_json` handling edge cases; it should read JSON data from a file. Keep it efficient."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
... | file_io |
[
{
"role": "user",
"content": "Formulate `read_json` to read JSON data from a file. Include basic type checks."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Develop `read_json` such that it read JSON data from a file. Keep it efficient."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
}
] | file_io |
[
{
"role": "user",
"content": "Code a function `read_json` to read JSON data from a file. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import json\n\ndef read_json(path: str):\n with open(path, \"r\", encoding=\"utf-8\") as f:\n return json.load(f)\n"
... | file_io |
[
{
"role": "user",
"content": "Implement the function `read_csv` (a file path) -> a list of rows. Keep it efficient."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f... | file_io |
[
{
"role": "user",
"content": "Define a function `read_csv` taking a file path and returning a list of rows. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return... | file_io |
[
{
"role": "user",
"content": "Write `read_csv`: read a CSV file into rows. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f... | file_io |
[
{
"role": "user",
"content": "Create `read_csv(a file path)` returning a list of rows. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\... | file_io |
[
{
"role": "user",
"content": "Create a utility function named `read_csv` which read a CSV file into rows. Add a brief docstring."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list... | file_io |
[
{
"role": "user",
"content": "Construct `read_csv` to read a CSV file into rows. "
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\n"
}
] | file_io |
[
{
"role": "user",
"content": "Write a Python function `read_csv` that read a CSV file into rows. Use only the standard library."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(... | file_io |
[
{
"role": "user",
"content": "Create a utility function named `read_csv` which read a CSV file into rows. Include basic type checks."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return ... | file_io |
[
{
"role": "user",
"content": "Write `read_csv` handling edge cases; it should read a CSV file into rows. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return li... | file_io |
[
{
"role": "user",
"content": "Make a function `read_csv` to read a CSV file into rows. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\... | file_io |
[
{
"role": "user",
"content": "Make a function `read_csv` to read a CSV file into rows. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(... | file_io |
[
{
"role": "user",
"content": "Implement the function `read_csv` (a file path) -> a list of rows. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(... | file_io |
[
{
"role": "user",
"content": "Generate a Python function `read_csv` for read a CSV file into rows. Use only the standard library."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return lis... | file_io |
[
{
"role": "user",
"content": "Implement `read_csv` with proper validation: read a CSV file into rows. "
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\n"
}
] | file_io |
[
{
"role": "user",
"content": "Create `read_csv(a file path)` returning a list of rows. Keep it efficient."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\n"
}
... | file_io |
[
{
"role": "user",
"content": "Add a function `read_csv` that read a CSV file into rows. Add a brief docstring."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\n"... | file_io |
[
{
"role": "user",
"content": "Create a utility function named `read_csv` which read a CSV file into rows. "
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\n"
}... | file_io |
[
{
"role": "user",
"content": "Implement the function `read_csv` (a file path) -> a list of rows. Add a brief docstring."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.read... | file_io |
[
{
"role": "user",
"content": "Provide a Python solution for `read_csv`: read a CSV file into rows. Include basic type checks."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(cs... | file_io |
[
{
"role": "user",
"content": "Write code for `read_csv` (a file path) that read a CSV file into rows. Keep it efficient."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.rea... | file_io |
[
{
"role": "user",
"content": "Create a robust `read_csv` that read a CSV file into rows. Keep it efficient."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\n"
... | file_io |
[
{
"role": "user",
"content": "Implement `read_csv(a file path)` to read a CSV file into rows. Keep it efficient."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\... | file_io |
[
{
"role": "user",
"content": "Construct `read_csv` to read a CSV file into rows. Add a brief docstring."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\n"
}
] | file_io |
[
{
"role": "user",
"content": "Formulate `read_csv` to read a CSV file into rows. Keep it efficient."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader(f))\n"
}
] | file_io |
[
{
"role": "user",
"content": "Implement `read_csv` with proper validation: read a CSV file into rows. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n ... | file_io |
[
{
"role": "user",
"content": "Code a function `read_csv` to read a CSV file into rows. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.reader... | file_io |
[
{
"role": "user",
"content": "Implement `read_csv(a file path)` to read a CSV file into rows. Include basic type checks."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.rea... | file_io |
[
{
"role": "user",
"content": "Write a Python function `read_csv` that read a CSV file into rows. Avoid mutating the input."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n return list(csv.r... | file_io |
[
{
"role": "user",
"content": "Implement `read_csv` returning a list of rows given a file path. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "import csv\n\ndef read_csv(path: str) -> list:\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n retu... | file_io |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.