conversations listlengths 2 2 | source stringclasses 8
values |
|---|---|
[
{
"role": "user",
"content": "Implement `dedupe` with proper validation: remove duplicates while preserving order. Keep it efficient."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "Make a function `dedupe` to remove duplicates while preserving order. "
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n seen = set()\n result = []\... | list_ops |
[
{
"role": "user",
"content": "Implement `dedupe` returning a deduplicated list given a list items. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "Define a function `dedupe` taking a list items and returning a deduplicated list. Include basic type checks."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\... | list_ops |
[
{
"role": "user",
"content": "Implement `dedupe` returning a deduplicated list given a list items. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list... | list_ops |
[
{
"role": "user",
"content": "Implement `dedupe(a list items)` to remove duplicates while preserving order. Add a brief docstring."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "Write `dedupe`: remove duplicates while preserving order. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n se... | list_ops |
[
{
"role": "user",
"content": "Code a function `dedupe` to remove duplicates while preserving order. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a lis... | list_ops |
[
{
"role": "user",
"content": "I need a Python helper `dedupe` that remove duplicates while preserving order. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must... | list_ops |
[
{
"role": "user",
"content": "Help me write `dedupe` that remove duplicates while preserving order. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a lis... | list_ops |
[
{
"role": "user",
"content": "Provide a Python solution for `dedupe`: remove duplicates while preserving order. Include basic type checks."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\... | list_ops |
[
{
"role": "user",
"content": "Implement `dedupe(a list items)` to remove duplicates while preserving order. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a lis... | list_ops |
[
{
"role": "user",
"content": "Make a function `dedupe` to remove duplicates while preserving order. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "Formulate `dedupe` to remove duplicates while preserving order. Add a brief docstring."
},
{
"role": "assistant",
"content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n seen = set()\n... | list_ops |
[
{
"role": "user",
"content": "Draft a Python function `chunk` to split a list into chunks of given size. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a lis... | list_ops |
[
{
"role": "user",
"content": "Write a reusable function `chunk` which split a list into chunks of given size. Use only the standard library."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items mus... | list_ops |
[
{
"role": "user",
"content": "Generate a Python function `chunk` for split a list into chunks of given size. Add a brief docstring."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a li... | list_ops |
[
{
"role": "user",
"content": "Generate a Python function `chunk` for split a list into chunks of given size. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items mu... | list_ops |
[
{
"role": "user",
"content": "Write `chunk`: split a list into chunks of given size. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not isi... | list_ops |
[
{
"role": "user",
"content": "Write a reusable function `chunk` which split a list into chunks of given size. Keep it efficient."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\... | list_ops |
[
{
"role": "user",
"content": "I need a Python helper `chunk` that split a list into chunks of given size. Keep it efficient."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n... | list_ops |
[
{
"role": "user",
"content": "Create a robust `chunk` that split a list into chunks of given size. Add a brief docstring."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "Can you write code for `chunk` that split a list into chunks of given size? Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be... | list_ops |
[
{
"role": "user",
"content": "Can you write code for `chunk` that split a list into chunks of given size? Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must ... | list_ops |
[
{
"role": "user",
"content": "Write `chunk` in Python. It should split a list into chunks of given size. Keep it efficient."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "Implement `chunk` returning a list of chunks given a list items and size. Keep it efficient."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "Produce a clean implementation of `chunk`: split a list into chunks of given size. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeErro... | list_ops |
[
{
"role": "user",
"content": "Develop `chunk` such that it split a list into chunks of given size. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list... | list_ops |
[
{
"role": "user",
"content": "Implement `chunk(a list items and size)` to split a list into chunks of given size. Use only the standard library."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items... | list_ops |
[
{
"role": "user",
"content": "Create a robust `chunk` that split a list into chunks of given size. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a li... | list_ops |
[
{
"role": "user",
"content": "Produce a clean implementation of `chunk`: split a list into chunks of given size. Use only the standard library."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items ... | list_ops |
[
{
"role": "user",
"content": "Define a function `chunk` taking a list items and size and returning a list of chunks. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise Type... | list_ops |
[
{
"role": "user",
"content": "Create `chunk(a list items and size)` returning a list of chunks. Keep it efficient."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not... | list_ops |
[
{
"role": "user",
"content": "Write `chunk` in Python. It should split a list into chunks of given size. Include basic type checks."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a li... | list_ops |
[
{
"role": "user",
"content": "Provide a Python solution for `chunk`: split a list into chunks of given size. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"... | list_ops |
[
{
"role": "user",
"content": "Write `chunk` handling edge cases; it should split a list into chunks of given size. Use only the standard library."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"item... | list_ops |
[
{
"role": "user",
"content": "Implement `chunk` returning a list of chunks given a list items and size. Add a brief docstring."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")... | list_ops |
[
{
"role": "user",
"content": "Add a function `chunk` that split a list into chunks of given size. Use only the standard library."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\... | list_ops |
[
{
"role": "user",
"content": "Implement `chunk`. It should split a list into chunks of given size. Add a brief docstring."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ... | list_ops |
[
{
"role": "user",
"content": "Build a function `chunk` that split a list into chunks of given size, with edge-case handling. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n ra... | list_ops |
[
{
"role": "user",
"content": "Add a function `chunk` that split a list into chunks of given size. Keep it efficient."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if n... | list_ops |
[
{
"role": "user",
"content": "Help me write `chunk` that split a list into chunks of given size. Add a brief docstring."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n i... | list_ops |
[
{
"role": "user",
"content": "Write `chunk` in Python. It should split a list into chunks of given size. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be ... | list_ops |
[
{
"role": "user",
"content": "Write a Python function `chunk` that split a list into chunks of given size. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must b... | list_ops |
[
{
"role": "user",
"content": "Implement `chunk`. It should split a list into chunks of given size. Include basic type checks."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\... | list_ops |
[
{
"role": "user",
"content": "Construct `chunk` to split a list into chunks of given size. Include basic type checks."
},
{
"role": "assistant",
"content": "def chunk(items: list, size: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if ... | list_ops |
[
{
"role": "user",
"content": "Can you write code for `second_largest` that find the second largest distinct value? Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(... | list_ops |
[
{
"role": "user",
"content": "Create `second_largest(a list nums)` returning the second largest value. Keep it efficient."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at least two elem... | list_ops |
[
{
"role": "user",
"content": "Write `second_largest`: find the second largest distinct value. "
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at least two elements\")\n first = second... | list_ops |
[
{
"role": "user",
"content": "Write code for `second_largest` (a list nums) that find the second largest distinct value. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError... | list_ops |
[
{
"role": "user",
"content": "Implement `second_largest(a list nums)` to find the second largest distinct value. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise Val... | list_ops |
[
{
"role": "user",
"content": "Code a function `second_largest` to find the second largest distinct value. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at leas... | list_ops |
[
{
"role": "user",
"content": "Implement `second_largest` returning the second largest value given a list nums. Keep it efficient."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at least ... | list_ops |
[
{
"role": "user",
"content": "Generate a Python function `second_largest` for find the second largest distinct value. Use only the standard library."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueErr... | list_ops |
[
{
"role": "user",
"content": "Provide a Python solution for `second_largest`: find the second largest distinct value. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"... | list_ops |
[
{
"role": "user",
"content": "Write code for `second_largest` (a list nums) that find the second largest distinct value. Include basic type checks."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueErro... | list_ops |
[
{
"role": "user",
"content": "Write a reusable function `second_largest` which find the second largest distinct value. Keep it efficient."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need a... | list_ops |
[
{
"role": "user",
"content": "Provide a Python solution for `second_largest`: find the second largest distinct value. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueErr... | list_ops |
[
{
"role": "user",
"content": "Build a function `second_largest` that find the second largest distinct value, with edge-case handling. "
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at l... | list_ops |
[
{
"role": "user",
"content": "Make a function `second_largest` to find the second largest distinct value. Include basic type checks."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at lea... | list_ops |
[
{
"role": "user",
"content": "Construct `second_largest` to find the second largest distinct value. Keep it efficient."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at least two element... | list_ops |
[
{
"role": "user",
"content": "Implement `second_largest` returning the second largest value given a list nums. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"ne... | list_ops |
[
{
"role": "user",
"content": "Implement the function `second_largest` (a list nums) -> the second largest value. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise Val... | list_ops |
[
{
"role": "user",
"content": "Write `second_largest` handling edge cases; it should find the second largest distinct value. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n ... | list_ops |
[
{
"role": "user",
"content": "Make a function `second_largest` to find the second largest distinct value. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need ... | list_ops |
[
{
"role": "user",
"content": "Implement the function `second_largest` (a list nums) -> the second largest value. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(... | list_ops |
[
{
"role": "user",
"content": "Code a function `second_largest` to find the second largest distinct value. Use only the standard library."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at... | list_ops |
[
{
"role": "user",
"content": "Write a Python function `second_largest` that find the second largest distinct value. Keep it efficient."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at l... | list_ops |
[
{
"role": "user",
"content": "Produce a clean implementation of `second_largest`: find the second largest distinct value. Add a brief docstring."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\... | list_ops |
[
{
"role": "user",
"content": "Create `second_largest(a list nums)` returning the second largest value. Add a brief docstring."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at least two ... | list_ops |
[
{
"role": "user",
"content": "Create `second_largest(a list nums)` returning the second largest value. Include basic type checks."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at least ... | list_ops |
[
{
"role": "user",
"content": "Implement `second_largest` returning the second largest value given a list nums. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise Value... | list_ops |
[
{
"role": "user",
"content": "Add a function `second_largest` that find the second largest distinct value. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need a... | list_ops |
[
{
"role": "user",
"content": "Provide a Python solution for `second_largest`: find the second largest distinct value. Include basic type checks."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\... | list_ops |
[
{
"role": "user",
"content": "Write code for `second_largest` (a list nums) that find the second largest distinct value. Keep it efficient."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need... | list_ops |
[
{
"role": "user",
"content": "Write code for `second_largest` (a list nums) that find the second largest distinct value. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise Val... | list_ops |
[
{
"role": "user",
"content": "Implement `second_largest`. It should find the second largest distinct value. Keep it efficient."
},
{
"role": "assistant",
"content": "def second_largest(nums: list):\n if not isinstance(nums, list) or len(nums) < 2:\n raise ValueError(\"need at least two... | list_ops |
[
{
"role": "user",
"content": "Generate a Python function `rotate` for rotate a list by k positions. Avoid mutating the 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\")\n ... | list_ops |
[
{
"role": "user",
"content": "Write a Python function `rotate` that rotate a list by k positions. Avoid mutating the 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\")\n ... | list_ops |
[
{
"role": "user",
"content": "Help me write `rotate` that 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 return []\n... | list_ops |
[
{
"role": "user",
"content": "Formulate `rotate` to 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\")\n if not i... | list_ops |
[
{
"role": "user",
"content": "Construct `rotate` to rotate a list by k positions. Include basic type checks."
},
{
"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:\... | list_ops |
[
{
"role": "user",
"content": "Please provide `rotate` that rotate a list by k positions. Return sensible defaults for edge cases."
},
{
"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": "Generate a Python function `rotate` for 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": "Write a reusable function `rotate` which 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 if ... | list_ops |
[
{
"role": "user",
"content": "Draft a Python function `rotate` 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 if not i... | list_ops |
[
{
"role": "user",
"content": "Implement `rotate` with proper validation: rotate a list by k positions. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items mu... | list_ops |
[
{
"role": "user",
"content": "Implement the function `rotate` (a list items and int k) -> the rotated list. 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\... | list_ops |
[
{
"role": "user",
"content": "Can you write code for `rotate` that 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 if not ... | list_ops |
[
{
"role": "user",
"content": "Create a utility function named `rotate` which rotate a list by k positions. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a lis... | list_ops |
[
{
"role": "user",
"content": "Construct `rotate` to 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 not ite... | list_ops |
[
{
"role": "user",
"content": "Write `rotate`: rotate a list by k positions. Use only the standard library."
},
{
"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": "Draft a Python function `rotate` to 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 ret... | list_ops |
[
{
"role": "user",
"content": "Code a function `rotate` to rotate a list by k positions. Use only the standard library."
},
{
"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": "Define a function `rotate` taking a list items and int k and returning the rotated list. Use only the standard library."
},
{
"role": "assistant",
"content": "def rotate(items: list, k: int) -> list:\n if not isinstance(items, list):\n raise TypeError(\"it... | list_ops |
[
{
"role": "user",
"content": "Generate a Python function `rotate` for 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 ... | list_ops |
[
{
"role": "user",
"content": "Develop `rotate` such that it rotate a list by k positions. Include basic type checks."
},
{
"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... | list_ops |
[
{
"role": "user",
"content": "Formulate `rotate` 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 if not items:\n ... | list_ops |
[
{
"role": "user",
"content": "Implement `rotate(a list items and int k)` to rotate a list by k positions. Avoid mutating the 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": "Please provide `rotate` that 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 not item... | list_ops |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.