conversations listlengths 2 2 | source stringclasses 8
values |
|---|---|
[
{
"role": "user",
"content": "Make a function `partition_even_odd` to 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 a list\")... | list_ops |
[
{
"role": "user",
"content": "Write code for `find_max` (a list items) that find the maximum element. Use only the standard library."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in... | list_ops |
[
{
"role": "user",
"content": "Draft a Python function `find_max` to find the maximum element. Add a brief docstring."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n ... | list_ops |
[
{
"role": "user",
"content": "Write code for `find_max` (a list items) that find the maximum element. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in item... | list_ops |
[
{
"role": "user",
"content": "Write a Python function `find_max` that find the maximum element. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:... | list_ops |
[
{
"role": "user",
"content": "I need a Python helper `find_max` that find the maximum element. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\... | list_ops |
[
{
"role": "user",
"content": "Write a Python function `find_max` that find the maximum element. Add a brief docstring."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n ... | list_ops |
[
{
"role": "user",
"content": "Add a function `find_max` that find the maximum element. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n ... | list_ops |
[
{
"role": "user",
"content": "Write `find_max` handling edge cases; it should find the maximum element. Include basic type checks."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in i... | list_ops |
[
{
"role": "user",
"content": "Write `find_max`: find the maximum element. Include basic type checks."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n if x > resu... | list_ops |
[
{
"role": "user",
"content": "Implement `find_max(a list items)` to find the maximum element. Add a brief docstring."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n ... | list_ops |
[
{
"role": "user",
"content": "Define a function `find_max` taking a list items and returning the maximum. Add a brief docstring."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in ite... | list_ops |
[
{
"role": "user",
"content": "Write a Python function `find_max` that find the maximum element. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in ite... | list_ops |
[
{
"role": "user",
"content": "Formulate `find_max` to find the maximum element. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n ... | list_ops |
[
{
"role": "user",
"content": "Produce a clean implementation of `find_max`: find the maximum element. Add a brief docstring."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1... | list_ops |
[
{
"role": "user",
"content": "Implement `find_max`. It should find the maximum element. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n ... | list_ops |
[
{
"role": "user",
"content": "Produce a clean implementation of `find_max`: find the maximum element. Keep it efficient."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\... | list_ops |
[
{
"role": "user",
"content": "Write a reusable function `find_max` which find the maximum element. Use only the standard library."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in it... | list_ops |
[
{
"role": "user",
"content": "Implement `find_max`. It should find the maximum element. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\... | list_ops |
[
{
"role": "user",
"content": "Can you write code for `find_max` that find the maximum element? Avoid mutating the input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\... | list_ops |
[
{
"role": "user",
"content": "Produce a clean implementation of `find_max`: find the maximum element. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in item... | list_ops |
[
{
"role": "user",
"content": "Construct `find_max` to find the maximum element. Use only the standard library."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n i... | list_ops |
[
{
"role": "user",
"content": "Can you write code for `find_max` that find the maximum element? Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x... | list_ops |
[
{
"role": "user",
"content": "Help me write `find_max` that find the maximum element. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items... | list_ops |
[
{
"role": "user",
"content": "Provide a Python solution for `find_max`: find the maximum element. Keep it efficient."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n ... | list_ops |
[
{
"role": "user",
"content": "Produce a clean implementation of `find_max`: find the maximum element. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x ... | list_ops |
[
{
"role": "user",
"content": "Write `find_max` in Python. It should find the maximum element. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items... | list_ops |
[
{
"role": "user",
"content": "Write a reusable function `find_max` which find the maximum element. Include basic type checks."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[... | list_ops |
[
{
"role": "user",
"content": "Implement the function `find_max` (a list items) -> the maximum. Use only the standard library."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[... | list_ops |
[
{
"role": "user",
"content": "Implement `find_max(a list items)` to find the maximum element. Keep it efficient."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n ... | list_ops |
[
{
"role": "user",
"content": "Write `find_max`: find the maximum element. "
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n if x > result:\n result = ... | list_ops |
[
{
"role": "user",
"content": "Create `find_max(a list items)` returning the maximum. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def find_max(items: list):\n if not items:\n raise ValueError(\"empty list\")\n result = items[0]\n for x in items[1:]:\n i... | list_ops |
[
{
"role": "user",
"content": "Define a function `remove_element` taking a list items and value and returning a filtered list. Add a brief docstring."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeErro... | list_ops |
[
{
"role": "user",
"content": "Code a function `remove_element` to remove all occurrences of a value. Use only the standard library."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be... | list_ops |
[
{
"role": "user",
"content": "Create `remove_element(a list items and value)` returning a filtered list. Include basic type checks."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be... | list_ops |
[
{
"role": "user",
"content": "Implement `remove_element` returning a filtered list given a list items and value. Keep it efficient."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be... | list_ops |
[
{
"role": "user",
"content": "Write a reusable function `remove_element` which remove all occurrences of a value. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items... | list_ops |
[
{
"role": "user",
"content": "Write a Python function `remove_element` that remove all occurrences of a value. Use only the standard library."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"ite... | list_ops |
[
{
"role": "user",
"content": "I need a Python helper `remove_element` that remove all occurrences of a value. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"it... | list_ops |
[
{
"role": "user",
"content": "Create a utility function named `remove_element` which remove all occurrences of a value. Keep it efficient."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items ... | list_ops |
[
{
"role": "user",
"content": "Can you write code for `remove_element` that remove all occurrences of a value? Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"it... | list_ops |
[
{
"role": "user",
"content": "Develop `remove_element` such that it remove all occurrences of a value. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"i... | list_ops |
[
{
"role": "user",
"content": "Produce a clean implementation of `remove_element`: remove all occurrences of a value. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError... | list_ops |
[
{
"role": "user",
"content": "Help me write `remove_element` that remove all occurrences of a value. "
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n return [x for ... | list_ops |
[
{
"role": "user",
"content": "Implement `remove_element`. It should remove all occurrences of a value. Include basic type checks."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a... | list_ops |
[
{
"role": "user",
"content": "Provide a Python solution for `remove_element`: remove all occurrences of a value. Include basic type checks."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items... | list_ops |
[
{
"role": "user",
"content": "Implement `remove_element` with proper validation: remove all occurrences of a value. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(... | list_ops |
[
{
"role": "user",
"content": "Please provide `remove_element` that remove all occurrences of a value. "
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n return [x for... | list_ops |
[
{
"role": "user",
"content": "Implement `remove_element`. It should remove all occurrences of a value. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items mus... | list_ops |
[
{
"role": "user",
"content": "Write `remove_element` handling edge cases; it should remove all occurrences of a value. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeErr... | list_ops |
[
{
"role": "user",
"content": "Make a function `remove_element` to remove all occurrences of a value. Use only the standard library."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be... | list_ops |
[
{
"role": "user",
"content": "Write a Python function `remove_element` that remove all occurrences of a value. Keep it efficient."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a... | list_ops |
[
{
"role": "user",
"content": "Please provide `remove_element` that remove all occurrences of a value. Use only the standard library."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must b... | list_ops |
[
{
"role": "user",
"content": "Build a function `remove_element` that remove all occurrences of a value, with edge-case handling. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise Ty... | list_ops |
[
{
"role": "user",
"content": "Construct `remove_element` to remove all occurrences of a value. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a l... | list_ops |
[
{
"role": "user",
"content": "Make a function `remove_element` to remove all occurrences of a value. Keep it efficient."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n... | list_ops |
[
{
"role": "user",
"content": "Define a function `remove_element` taking a list items and value and returning a filtered list. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n ... | list_ops |
[
{
"role": "user",
"content": "Implement `remove_element`. It should remove all occurrences of a value. Add a brief docstring."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a lis... | list_ops |
[
{
"role": "user",
"content": "Create `remove_element(a list items and value)` returning a filtered list. "
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n return [x ... | list_ops |
[
{
"role": "user",
"content": "Write `remove_element` in Python. It should remove all occurrences of a value. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must... | list_ops |
[
{
"role": "user",
"content": "Write `remove_element` in Python. It should remove all occurrences of a value. Use only the standard library."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items... | list_ops |
[
{
"role": "user",
"content": "Write a reusable function `remove_element` which remove all occurrences of a value. Keep it efficient."
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must b... | list_ops |
[
{
"role": "user",
"content": "Formulate `remove_element` to remove all occurrences of a value. "
},
{
"role": "assistant",
"content": "def remove_element(items: list, value) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n return [x for x in i... | list_ops |
[
{
"role": "user",
"content": "Write `sum_list`: sum the elements of a list. Keep it efficient."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x in nums:\n ... | list_ops |
[
{
"role": "user",
"content": "Generate a Python function `sum_list` for sum the elements of a list. Keep it efficient."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n ... | list_ops |
[
{
"role": "user",
"content": "Construct `sum_list` to sum the elements of a list. Use only the standard library."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x... | list_ops |
[
{
"role": "user",
"content": "Draft a Python function `sum_list` to sum the elements of a list. Keep it efficient."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for... | list_ops |
[
{
"role": "user",
"content": "Implement `sum_list` with proper validation: sum the elements of a list. Keep it efficient."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n... | list_ops |
[
{
"role": "user",
"content": "Implement `sum_list`. It should sum the elements of a list. Include basic type checks."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n f... | list_ops |
[
{
"role": "user",
"content": "Implement the function `sum_list` (a list nums) -> the sum. Keep it efficient."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x in ... | list_ops |
[
{
"role": "user",
"content": "Create a utility function named `sum_list` which sum the elements of a list. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "Help me write `sum_list` that sum the elements of a list. Add a brief docstring."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x i... | list_ops |
[
{
"role": "user",
"content": "Implement the function `sum_list` (a list nums) -> the sum. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n ... | list_ops |
[
{
"role": "user",
"content": "Write a reusable function `sum_list` which sum the elements of a list. Include basic type checks."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total... | list_ops |
[
{
"role": "user",
"content": "Help me write `sum_list` that sum the elements of a list. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for ... | list_ops |
[
{
"role": "user",
"content": "Write `sum_list`: sum the elements of a list. Include basic type checks."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x in nums:\... | list_ops |
[
{
"role": "user",
"content": "Can you write code for `sum_list` that sum the elements of a list? Include basic type checks."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0... | list_ops |
[
{
"role": "user",
"content": "Construct `sum_list` to sum the elements of a list. Keep it efficient."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x in nums:\n ... | list_ops |
[
{
"role": "user",
"content": "Create a utility function named `sum_list` which sum the elements of a list. "
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x in n... | list_ops |
[
{
"role": "user",
"content": "Formulate `sum_list` to sum the elements of a list. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\... | list_ops |
[
{
"role": "user",
"content": "Draft a Python function `sum_list` to sum the elements of a list. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total ... | list_ops |
[
{
"role": "user",
"content": "Provide a Python solution for `sum_list`: sum the elements of a list. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "Write a reusable function `sum_list` which sum the elements of a list. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total ... | list_ops |
[
{
"role": "user",
"content": "Implement `sum_list`. It should sum the elements of a list. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\... | list_ops |
[
{
"role": "user",
"content": "Add a function `sum_list` that sum the elements of a list. Add a brief docstring."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x ... | list_ops |
[
{
"role": "user",
"content": "Build a function `sum_list` that sum the elements of a list, with edge-case handling. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a... | list_ops |
[
{
"role": "user",
"content": "Write `sum_list`: sum the elements of a list. Add a brief docstring."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x in nums:\n ... | list_ops |
[
{
"role": "user",
"content": "Add a function `sum_list` that sum the elements of a list. Use only the standard library."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n ... | list_ops |
[
{
"role": "user",
"content": "Write a Python function `sum_list` that sum the elements of a list. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0... | list_ops |
[
{
"role": "user",
"content": "Implement `sum_list(a list nums)` to sum the elements of a list. "
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x in nums:\n ... | list_ops |
[
{
"role": "user",
"content": "Produce a clean implementation of `sum_list`: sum the elements of a list. Add a brief docstring."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total ... | list_ops |
[
{
"role": "user",
"content": "Code a function `sum_list` to sum the elements of a list. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n tota... | list_ops |
[
{
"role": "user",
"content": "Formulate `sum_list` to sum the elements of a list. Add a brief docstring."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n total = 0\n for x in nums... | list_ops |
[
{
"role": "user",
"content": "Write `sum_list` handling edge cases; it should sum the elements of a list. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def sum_list(nums: list) -> int:\n if not isinstance(nums, list):\n raise TypeError(\"nums must be a list\")\n... | list_ops |
[
{
"role": "user",
"content": "Build a function `reverse_list` that reverse a list, with edge-case handling. Include basic type checks."
},
{
"role": "assistant",
"content": "def reverse_list(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a lis... | list_ops |
[
{
"role": "user",
"content": "Develop `reverse_list` such that it reverse a list. Use only the standard library."
},
{
"role": "assistant",
"content": "def reverse_list(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n return items... | list_ops |
[
{
"role": "user",
"content": "Generate a Python function `reverse_list` for reverse a list. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def reverse_list(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "I need a Python helper `reverse_list` that reverse a list. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def reverse_list(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n return ite... | list_ops |
[
{
"role": "user",
"content": "Produce a clean implementation of `reverse_list`: reverse a list. Keep it efficient."
},
{
"role": "assistant",
"content": "def reverse_list(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n return ite... | list_ops |
[
{
"role": "user",
"content": "Write `reverse_list`: reverse a list. Use only the standard library."
},
{
"role": "assistant",
"content": "def reverse_list(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n return items[::-1]\n"
}
... | list_ops |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.