conversations
listlengths
2
2
source
stringclasses
8 values
[ { "role": "user", "content": "Create a utility function named `rotate` which rotate a list by k positions. Make it robust to invalid input." }, { "role": "assistant", "content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must b...
list_ops
[ { "role": "user", "content": "Write `rotate` in Python. It should rotate a list by k positions. Add a brief docstring." }, { "role": "assistant", "content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if n...
list_ops
[ { "role": "user", "content": "Write a Python function `rotate` that rotate a list by k positions. Make it robust to invalid input." }, { "role": "assistant", "content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\...
list_ops
[ { "role": "user", "content": "Implement `rotate(a list items and int k)` to rotate a list by k positions. Keep it efficient." }, { "role": "assistant", "content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ...
list_ops
[ { "role": "user", "content": "Write a reusable function `rotate` which rotate a list by k positions. " }, { "role": "assistant", "content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items:\n ...
list_ops
[ { "role": "user", "content": "Add a function `rotate` that rotate a list by k positions. Handle empty input gracefully." }, { "role": "assistant", "content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if ...
list_ops
[ { "role": "user", "content": "Create `rotate(a list items and int k)` returning the rotated list. " }, { "role": "assistant", "content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items:\n r...
list_ops
[ { "role": "user", "content": "Define a function `rotate` taking a list items and int k and returning the rotated list. Make it robust to invalid input." }, { "role": "assistant", "content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"...
list_ops
[ { "role": "user", "content": "Write code for `running_sum` (a list nums) that compute prefix sums of a list. Make it robust to invalid input." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a ...
list_ops
[ { "role": "user", "content": "Implement `running_sum`. It should compute prefix sums of a list. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\...
list_ops
[ { "role": "user", "content": "Add a function `running_sum` that compute prefix sums of a list. Include basic type checks." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result ...
list_ops
[ { "role": "user", "content": "Generate a Python function `running_sum` for compute prefix sums of a list. Add a brief docstring." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n ...
list_ops
[ { "role": "user", "content": "Help me write `running_sum` that compute prefix sums of a list. Make it robust to invalid input." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n re...
list_ops
[ { "role": "user", "content": "Code a function `running_sum` to compute prefix sums of a list. Add a brief docstring." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = []\...
list_ops
[ { "role": "user", "content": "Create `running_sum(a list nums)` returning a list of running sums. Handle empty input gracefully." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n ...
list_ops
[ { "role": "user", "content": "Implement the function `running_sum` (a list nums) -> a list of running sums. Make it robust to invalid input." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a l...
list_ops
[ { "role": "user", "content": "Provide a Python solution for `running_sum`: compute prefix sums of a list. " }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = []\n total...
list_ops
[ { "role": "user", "content": "Write a reusable function `running_sum` which compute prefix sums of a list. " }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = []\n tota...
list_ops
[ { "role": "user", "content": "Develop `running_sum` such that it compute prefix sums of a list. Add a brief docstring." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = [...
list_ops
[ { "role": "user", "content": "Help me write `running_sum` that compute prefix sums of a list. Keep it efficient." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = []\n ...
list_ops
[ { "role": "user", "content": "Define a function `running_sum` taking a list nums and returning a list of running sums. Use only the standard library." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums mu...
list_ops
[ { "role": "user", "content": "Write `running_sum` handling edge cases; it should compute prefix sums of a list. Handle empty input gracefully." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a...
list_ops
[ { "role": "user", "content": "Create `running_sum(a list nums)` returning a list of running sums. " }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = []\n total = 0\n ...
list_ops
[ { "role": "user", "content": "Draft a Python function `running_sum` to compute prefix sums of a list. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a...
list_ops
[ { "role": "user", "content": "Create `running_sum(a list nums)` returning a list of running sums. Include basic type checks." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n resu...
list_ops
[ { "role": "user", "content": "Write code for `running_sum` (a list nums) that compute prefix sums of a list. Handle empty input gracefully." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a li...
list_ops
[ { "role": "user", "content": "Code a function `running_sum` to compute prefix sums of a list. Keep it efficient." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = []\n ...
list_ops
[ { "role": "user", "content": "Help me write `running_sum` that compute prefix sums of a list. Add a brief docstring." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = []\...
list_ops
[ { "role": "user", "content": "Implement the function `running_sum` (a list nums) -> a list of running sums. Use only the standard library." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a lis...
list_ops
[ { "role": "user", "content": "Construct `running_sum` to compute prefix sums of a list. Keep it efficient." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = []\n total...
list_ops
[ { "role": "user", "content": "Write `running_sum` in Python. It should compute prefix sums of a list. Handle empty input gracefully." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n...
list_ops
[ { "role": "user", "content": "Draft a Python function `running_sum` to compute prefix sums of a list. Include basic type checks." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n ...
list_ops
[ { "role": "user", "content": "Create `running_sum(a list nums)` returning a list of running sums. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a lis...
list_ops
[ { "role": "user", "content": "Generate a Python function `running_sum` for compute prefix sums of a list. Handle empty input gracefully." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\...
list_ops
[ { "role": "user", "content": "Create a utility function named `running_sum` which compute prefix sums of a list. " }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = []\n ...
list_ops
[ { "role": "user", "content": "Code a function `running_sum` to compute prefix sums of a list. Avoid mutating the input." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n result = ...
list_ops
[ { "role": "user", "content": "Create a utility function named `running_sum` which compute prefix sums of a list. Avoid mutating the input." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a lis...
list_ops
[ { "role": "user", "content": "Build a function `running_sum` that compute prefix sums of a list, with edge-case handling. Make it robust to invalid input." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nu...
list_ops
[ { "role": "user", "content": "Code a function `running_sum` to compute prefix sums of a list. Handle empty input gracefully." }, { "role": "assistant", "content": "def running_sum(nums: list) -> list:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n resu...
list_ops
[ { "role": "user", "content": "Add a function `interleave` that interleave two lists. Keep it efficient." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists\")\n...
list_ops
[ { "role": "user", "content": "Code a function `interleave` to interleave two lists. Add a brief docstring." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists\"...
list_ops
[ { "role": "user", "content": "Build a function `interleave` that interleave two lists, with edge-case handling. Avoid mutating the input." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise Typ...
list_ops
[ { "role": "user", "content": "Can you write code for `interleave` that interleave two lists? Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeErr...
list_ops
[ { "role": "user", "content": "Draft a Python function `interleave` to interleave two lists. Use only the standard library." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs...
list_ops
[ { "role": "user", "content": "Create a robust `interleave` that interleave two lists. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"in...
list_ops
[ { "role": "user", "content": "Write a Python function `interleave` that interleave two lists. Make it robust to invalid input." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"in...
list_ops
[ { "role": "user", "content": "Please provide `interleave` that interleave two lists. Avoid mutating the input." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lis...
list_ops
[ { "role": "user", "content": "Create a utility function named `interleave` which interleave two lists. Avoid mutating the input." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"...
list_ops
[ { "role": "user", "content": "I need a Python helper `interleave` that interleave two lists. Handle empty input gracefully." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"input...
list_ops
[ { "role": "user", "content": "Implement `interleave` with proper validation: interleave two lists. Handle empty input gracefully." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\...
list_ops
[ { "role": "user", "content": "Construct `interleave` to interleave two lists. Use only the standard library." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists...
list_ops
[ { "role": "user", "content": "Add a function `interleave` that interleave two lists. Make it robust to invalid input." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must...
list_ops
[ { "role": "user", "content": "Draft a Python function `interleave` to interleave two lists. " }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists\")\n result ...
list_ops
[ { "role": "user", "content": "Create `interleave(lists a and b)` returning an interleaved list. Add a brief docstring." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs mus...
list_ops
[ { "role": "user", "content": "Write a reusable function `interleave` which interleave two lists. Keep it efficient." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must b...
list_ops
[ { "role": "user", "content": "Produce a clean implementation of `interleave`: interleave two lists. Make it robust to invalid input." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeErro...
list_ops
[ { "role": "user", "content": "Please provide `interleave` that interleave two lists. Add a brief docstring." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists\...
list_ops
[ { "role": "user", "content": "Create a robust `interleave` that interleave two lists. Keep it efficient." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists\")\...
list_ops
[ { "role": "user", "content": "Write code for `interleave` (lists a and b) that interleave two lists. Make it robust to invalid input." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeErr...
list_ops
[ { "role": "user", "content": "Formulate `interleave` to interleave two lists. Use only the standard library." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists...
list_ops
[ { "role": "user", "content": "Write a Python function `interleave` that interleave two lists. " }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists\")\n resul...
list_ops
[ { "role": "user", "content": "Implement `interleave`. It should interleave two lists. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"in...
list_ops
[ { "role": "user", "content": "Develop `interleave` such that it interleave two lists. Keep it efficient." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists\")\...
list_ops
[ { "role": "user", "content": "Create `interleave(lists a and b)` returning an interleaved list. " }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists\")\n res...
list_ops
[ { "role": "user", "content": "Write code for `interleave` (lists a and b) that interleave two lists. Include basic type checks." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"i...
list_ops
[ { "role": "user", "content": "Define a function `interleave` taking lists a and b and returning an interleaved list. Add a brief docstring." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise T...
list_ops
[ { "role": "user", "content": "Implement `interleave`. It should interleave two lists. Handle empty input gracefully." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must ...
list_ops
[ { "role": "user", "content": "Please provide `interleave` that interleave two lists. Use only the standard library." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must b...
list_ops
[ { "role": "user", "content": "Write `interleave`: interleave two lists. " }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs must be lists\")\n result = []\n for x, y i...
list_ops
[ { "role": "user", "content": "Implement `interleave` returning an interleaved list given lists a and b. Keep it efficient." }, { "role": "assistant", "content": "def interleave(a: list, b: list) -> list:\n if not (isinstance(a, list) and isinstance(b, list)):\n raise TypeError(\"inputs...
list_ops
[ { "role": "user", "content": "Draft a Python function `partition_even_odd` to partition a list into evens and odds. " }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n even...
list_ops
[ { "role": "user", "content": "Produce a clean implementation of `partition_even_odd`: partition a list into evens and odds. Include basic type checks." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(...
list_ops
[ { "role": "user", "content": "Implement `partition_even_odd(a list nums)` to partition a list into evens and odds. Make it robust to invalid input." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"n...
list_ops
[ { "role": "user", "content": "Write code for `partition_even_odd` (a list nums) that partition a list into evens and odds. Keep it efficient." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums mu...
list_ops
[ { "role": "user", "content": "Make a function `partition_even_odd` to partition a list into evens and odds. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"...
list_ops
[ { "role": "user", "content": "Write a reusable function `partition_even_odd` which partition a list into evens and odds. " }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n ...
list_ops
[ { "role": "user", "content": "Implement `partition_even_odd(a list nums)` to partition a list into evens and odds. " }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n evens...
list_ops
[ { "role": "user", "content": "Code a function `partition_even_odd` to partition a list into evens and odds. Include basic type checks." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a...
list_ops
[ { "role": "user", "content": "Create `partition_even_odd(a list nums)` returning a tuple of two lists. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums ...
list_ops
[ { "role": "user", "content": "Develop `partition_even_odd` such that it partition a list into evens and odds. Use only the standard library." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums mus...
list_ops
[ { "role": "user", "content": "Write `partition_even_odd` in Python. It should partition a list into evens and odds. Make it robust to invalid input." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"...
list_ops
[ { "role": "user", "content": "Construct `partition_even_odd` to partition a list into evens and odds. Handle empty input gracefully." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a l...
list_ops
[ { "role": "user", "content": "Create a robust `partition_even_odd` that partition a list into evens and odds. Make it robust to invalid input." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums m...
list_ops
[ { "role": "user", "content": "Create `partition_even_odd(a list nums)` returning a tuple of two lists. " }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n evens = [x for x ...
list_ops
[ { "role": "user", "content": "Formulate `partition_even_odd` to partition a list into evens and odds. Handle empty input gracefully." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a l...
list_ops
[ { "role": "user", "content": "Implement the function `partition_even_odd` (a list nums) -> a tuple of two lists. Use only the standard library." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums ...
list_ops
[ { "role": "user", "content": "Help me write `partition_even_odd` that partition a list into evens and odds. Make it robust to invalid input." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums mus...
list_ops
[ { "role": "user", "content": "Please provide `partition_even_odd` that partition a list into evens and odds. Avoid mutating the input." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a...
list_ops
[ { "role": "user", "content": "Implement `partition_even_odd` returning a tuple of two lists given a list nums. " }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n evens = [...
list_ops
[ { "role": "user", "content": "Implement `partition_even_odd` with proper validation: partition a list into evens and odds. Avoid mutating the input." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"...
list_ops
[ { "role": "user", "content": "I need a Python helper `partition_even_odd` that partition a list into evens and odds. Keep it efficient." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be ...
list_ops
[ { "role": "user", "content": "Create `partition_even_odd(a list nums)` returning a tuple of two lists. Add a brief docstring." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\...
list_ops
[ { "role": "user", "content": "Construct `partition_even_odd` to partition a list into evens and odds. Use only the standard library." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a l...
list_ops
[ { "role": "user", "content": "Write `partition_even_odd`: partition a list into evens and odds. " }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n evens = [x for x in nums...
list_ops
[ { "role": "user", "content": "Write a reusable function `partition_even_odd` which partition a list into evens and odds. Handle empty input gracefully." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError...
list_ops
[ { "role": "user", "content": "Write `partition_even_odd` in Python. It should partition a list into evens and odds. Include basic type checks." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums m...
list_ops
[ { "role": "user", "content": "Generate a Python function `partition_even_odd` for partition a list into evens and odds. Handle empty input gracefully." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(...
list_ops
[ { "role": "user", "content": "Implement `partition_even_odd(a list nums)` to partition a list into evens and odds. Add a brief docstring." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must b...
list_ops
[ { "role": "user", "content": "Generate a Python function `partition_even_odd` for partition a list into evens and odds. Avoid mutating the input." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"num...
list_ops
[ { "role": "user", "content": "Create `partition_even_odd(a list nums)` returning a tuple of two lists. Handle empty input gracefully." }, { "role": "assistant", "content": "def partition_even_odd(nums: list) -> tuple:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a ...
list_ops