conversations
listlengths
2
2
source
stringclasses
8 values
[ { "role": "user", "content": "Create `reverse_recursive(a string s)` returning the reversed string. Keep it efficient." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s) <= 1:\n...
recursion
[ { "role": "user", "content": "Implement `reverse_recursive`. It should reverse a string recursively. " }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s) <= 1:\n return s\...
recursion
[ { "role": "user", "content": "Write a Python function `reverse_recursive` that reverse a string recursively. Keep it efficient." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s...
recursion
[ { "role": "user", "content": "Write `reverse_recursive` handling edge cases; it should reverse a string recursively. Use only the standard library." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a ...
recursion
[ { "role": "user", "content": "Develop `reverse_recursive` such that it reverse a string recursively. Include basic type checks." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s...
recursion
[ { "role": "user", "content": "Formulate `reverse_recursive` to reverse a string recursively. Make it robust to invalid input." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s) ...
recursion
[ { "role": "user", "content": "Construct `reverse_recursive` to reverse a string recursively. Use only the standard library." }, { "role": "assistant", "content": "def reverse_recursive(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n if len(s) <=...
recursion
[ { "role": "user", "content": "Draft a Python function `flatten_depth` to flatten a nested list up to a depth. Include basic type checks." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError...
recursion
[ { "role": "user", "content": "Implement the function `flatten_depth` (nested list and depth) -> a flattened list. Keep it efficient." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"n...
recursion
[ { "role": "user", "content": "Implement the function `flatten_depth` (nested list and depth) -> a flattened list. " }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a li...
recursion
[ { "role": "user", "content": "Write a reusable function `flatten_depth` which flatten a nested list up to a depth. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n ...
recursion
[ { "role": "user", "content": "Add a function `flatten_depth` that flatten a nested list up to a depth. " }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n ...
recursion
[ { "role": "user", "content": "Implement `flatten_depth` with proper validation: flatten a nested list up to a depth. Keep it efficient." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(...
recursion
[ { "role": "user", "content": "Write `flatten_depth` handling edge cases; it should flatten a nested list up to a depth. Use only the standard library." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n r...
recursion
[ { "role": "user", "content": "Implement the function `flatten_depth` (nested list and depth) -> a flattened list. Avoid mutating the input." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeEr...
recursion
[ { "role": "user", "content": "Provide a Python solution for `flatten_depth`: flatten a nested list up to a depth. Make it robust to invalid input." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise...
recursion
[ { "role": "user", "content": "Please provide `flatten_depth` that flatten a nested list up to a depth. Keep it efficient." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must ...
recursion
[ { "role": "user", "content": "Write a Python function `flatten_depth` that flatten a nested list up to a depth. Add a brief docstring." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\...
recursion
[ { "role": "user", "content": "Define a function `flatten_depth` taking nested list and depth and returning a flattened list. Keep it efficient." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise Ty...
recursion
[ { "role": "user", "content": "Write a reusable function `flatten_depth` which flatten a nested list up to a depth. Add a brief docstring." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeErro...
recursion
[ { "role": "user", "content": "Build a function `flatten_depth` that flatten a nested list up to a depth, with edge-case handling. Use only the standard library." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\...
recursion
[ { "role": "user", "content": "Provide a Python solution for `flatten_depth`: flatten a nested list up to a depth. Keep it efficient." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"n...
recursion
[ { "role": "user", "content": "Create a robust `flatten_depth` that flatten a nested list up to a depth. Avoid mutating the input." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nest...
recursion
[ { "role": "user", "content": "Implement `flatten_depth`. It should flatten a nested list up to a depth. Add a brief docstring." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested ...
recursion
[ { "role": "user", "content": "Provide a Python solution for `flatten_depth`: flatten a nested list up to a depth. Add a brief docstring." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError...
recursion
[ { "role": "user", "content": "Create a utility function named `flatten_depth` which flatten a nested list up to a depth. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):...
recursion
[ { "role": "user", "content": "Write a Python function `flatten_depth` that flatten a nested list up to a depth. Use only the standard library." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise Typ...
recursion
[ { "role": "user", "content": "Code a function `flatten_depth` to flatten a nested list up to a depth. Keep it efficient." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must b...
recursion
[ { "role": "user", "content": "Implement `flatten_depth(nested list and depth)` to flatten a nested list up to a depth. Avoid mutating the input." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise T...
recursion
[ { "role": "user", "content": "Write a Python function `flatten_depth` that flatten a nested list up to a depth. Make it robust to invalid input." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise T...
recursion
[ { "role": "user", "content": "Implement `flatten_depth` with proper validation: flatten a nested list up to a depth. Make it robust to invalid input." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n ra...
recursion
[ { "role": "user", "content": "Build a function `flatten_depth` that flatten a nested list up to a depth, with edge-case handling. Include basic type checks." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n ...
recursion
[ { "role": "user", "content": "Implement `flatten_depth` returning a flattened list given nested list and depth. Handle empty input gracefully." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise Typ...
recursion
[ { "role": "user", "content": "Add a function `flatten_depth` that flatten a nested list up to a depth. Handle empty input gracefully." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"...
recursion
[ { "role": "user", "content": "Define a function `flatten_depth` taking nested list and depth and returning a flattened list. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, li...
recursion
[ { "role": "user", "content": "Write a Python function `flatten_depth` that flatten a nested list up to a depth. Keep it efficient." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nes...
recursion
[ { "role": "user", "content": "Build a function `flatten_depth` that flatten a nested list up to a depth, with edge-case handling. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(neste...
recursion
[ { "role": "user", "content": "Provide a Python solution for `flatten_depth`: flatten a nested list up to a depth. Handle empty input gracefully." }, { "role": "assistant", "content": "def flatten_depth(nested: list, depth: int = -1) -> list:\n if not isinstance(nested, list):\n raise T...
recursion
[ { "role": "user", "content": "Implement the function `binary_search_recursive` (sorted list, target, bounds) -> the index or -1. Add a brief docstring." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, ...
recursion
[ { "role": "user", "content": "Write a Python function `binary_search_recursive` that binary search recursively. Keep it efficient." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise...
recursion
[ { "role": "user", "content": "Create a utility function named `binary_search_recursive` which binary search recursively. " }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise TypeErro...
recursion
[ { "role": "user", "content": "Formulate `binary_search_recursive` to binary search recursively. Make it robust to invalid input." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise T...
recursion
[ { "role": "user", "content": "Implement the function `binary_search_recursive` (sorted list, target, bounds) -> the index or -1. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if no...
recursion
[ { "role": "user", "content": "Write `binary_search_recursive`: binary search recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise...
recursion
[ { "role": "user", "content": "Generate a Python function `binary_search_recursive` for binary search recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n ...
recursion
[ { "role": "user", "content": "Write `binary_search_recursive` in Python. It should binary search recursively. Use only the standard library." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n ...
recursion
[ { "role": "user", "content": "Create a utility function named `binary_search_recursive` which binary search recursively. Use only the standard library." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, ...
recursion
[ { "role": "user", "content": "Create a robust `binary_search_recursive` that binary search recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\...
recursion
[ { "role": "user", "content": "Help me write `binary_search_recursive` that binary search recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise Ty...
recursion
[ { "role": "user", "content": "Build a function `binary_search_recursive` that binary search recursively, with edge-case handling. Make it robust to invalid input." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isins...
recursion
[ { "role": "user", "content": "Develop `binary_search_recursive` such that it binary search recursively. Handle empty input gracefully." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n r...
recursion
[ { "role": "user", "content": "Construct `binary_search_recursive` to binary search recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n ...
recursion
[ { "role": "user", "content": "Draft a Python function `binary_search_recursive` to binary search recursively. Use only the standard library." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n ...
recursion
[ { "role": "user", "content": "Implement `binary_search_recursive(sorted list, target, bounds)` to binary search recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not is...
recursion
[ { "role": "user", "content": "Write a Python function `binary_search_recursive` that binary search recursively. Include basic type checks." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n ...
recursion
[ { "role": "user", "content": "Implement `binary_search_recursive`. It should binary search recursively. Include basic type checks." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise...
recursion
[ { "role": "user", "content": "Implement `binary_search_recursive` returning the index or -1 given sorted list, target, bounds. Use only the standard library." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance...
recursion
[ { "role": "user", "content": "Construct `binary_search_recursive` to binary search recursively. Use only the standard library." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise Typ...
recursion
[ { "role": "user", "content": "Develop `binary_search_recursive` such that it binary search recursively. " }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise TypeError(\"arr must be a...
recursion
[ { "role": "user", "content": "Code a function `binary_search_recursive` to binary search recursively. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n ...
recursion
[ { "role": "user", "content": "Provide a Python solution for `binary_search_recursive`: binary search recursively. Keep it efficient." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n rai...
recursion
[ { "role": "user", "content": "Construct `binary_search_recursive` to binary search recursively. Keep it efficient." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise TypeError(\"arr...
recursion
[ { "role": "user", "content": "Write `binary_search_recursive` handling edge cases; it should binary search recursively. " }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise TypeError...
recursion
[ { "role": "user", "content": "Please provide `binary_search_recursive` that binary search recursively. Include basic type checks." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n raise ...
recursion
[ { "role": "user", "content": "Produce a clean implementation of `binary_search_recursive`: binary search recursively. Make it robust to invalid input." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, l...
recursion
[ { "role": "user", "content": "Write a reusable function `binary_search_recursive` which binary search recursively. Avoid mutating the input." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n ...
recursion
[ { "role": "user", "content": "Write code for `binary_search_recursive` (sorted list, target, bounds) that binary search recursively. Use only the standard library." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isin...
recursion
[ { "role": "user", "content": "Write `binary_search_recursive` in Python. It should binary search recursively. Add a brief docstring." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstance(arr, list):\n rai...
recursion
[ { "role": "user", "content": "Create `binary_search_recursive(sorted list, target, bounds)` returning the index or -1. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def binary_search_recursive(arr: list, target, lo: int = 0, hi=None) -> int:\n if not isinstan...
recursion
[ { "role": "user", "content": "Provide a Python solution for `subsets`: generate all subsets of a list. Avoid mutating the input." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n i...
recursion
[ { "role": "user", "content": "I need a Python helper `subsets` that generate all subsets of a list. Make it robust to invalid input." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ...
recursion
[ { "role": "user", "content": "Formulate `subsets` to generate all subsets of a list. Use only the standard library." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items:\...
recursion
[ { "role": "user", "content": "Please provide `subsets` that generate all subsets of a list. Avoid mutating the input." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items...
recursion
[ { "role": "user", "content": "Implement `subsets`. It should generate all subsets of a list. Keep it efficient." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items:\n ...
recursion
[ { "role": "user", "content": "Write a reusable function `subsets` which generate all subsets of a list. Keep it efficient." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not ...
recursion
[ { "role": "user", "content": "Can you write code for `subsets` that generate all subsets of a list? " }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items:\n return...
recursion
[ { "role": "user", "content": "Implement the function `subsets` (a list items) -> a list of subsets. Add a brief docstring." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not ...
recursion
[ { "role": "user", "content": "Write code for `subsets` (a list items) that generate all subsets of a list. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must ...
recursion
[ { "role": "user", "content": "I need a Python helper `subsets` that generate all subsets of a list. Use only the standard library." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ...
recursion
[ { "role": "user", "content": "Provide a Python solution for `subsets`: generate all subsets of a list. Make it robust to invalid input." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")...
recursion
[ { "role": "user", "content": "Develop `subsets` such that it generate all subsets of a list. Include basic type checks." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not ite...
recursion
[ { "role": "user", "content": "Write `subsets` handling edge cases; it should generate all subsets of a list. Make it robust to invalid input." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a l...
recursion
[ { "role": "user", "content": "Write a Python function `subsets` that generate all subsets of a list. Add a brief docstring." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not...
recursion
[ { "role": "user", "content": "Please provide `subsets` that generate all subsets of a list. Include basic type checks." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not item...
recursion
[ { "role": "user", "content": "Add a function `subsets` that generate all subsets of a list. Handle empty input gracefully." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not ...
recursion
[ { "role": "user", "content": "Implement `subsets` returning a list of subsets given a list items. " }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items:\n return [...
recursion
[ { "role": "user", "content": "Develop `subsets` such that it generate all subsets of a list. Use only the standard library." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not...
recursion
[ { "role": "user", "content": "Construct `subsets` to generate all subsets of a list. Include basic type checks." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items:\n ...
recursion
[ { "role": "user", "content": "Define a function `subsets` taking a list items and returning a list of subsets. Include basic type checks." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\...
recursion
[ { "role": "user", "content": "Help me write `subsets` that generate all subsets of a list. Use only the standard library." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not i...
recursion
[ { "role": "user", "content": "Write a Python function `subsets` that generate all subsets of a list. Make it robust to invalid input." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n...
recursion
[ { "role": "user", "content": "Write `subsets`: generate all subsets of a list. Add a brief docstring." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items:\n retur...
recursion
[ { "role": "user", "content": "Create a utility function named `subsets` which generate all subsets of a list. Include basic type checks." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\"...
recursion
[ { "role": "user", "content": "Implement the function `subsets` (a list items) -> a list of subsets. Use only the standard library." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n ...
recursion
[ { "role": "user", "content": "Define a function `subsets` taking a list items and returning a list of subsets. Make it robust to invalid input." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a...
recursion
[ { "role": "user", "content": "Make a function `subsets` to generate all subsets of a list. " }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items:\n return [[]]\n ...
recursion
[ { "role": "user", "content": "Write `subsets`: generate all subsets of a list. " }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n if not items:\n return [[]]\n rest = sub...
recursion
[ { "role": "user", "content": "Create a utility function named `subsets` which generate all subsets of a list. Handle empty input gracefully." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a li...
recursion
[ { "role": "user", "content": "Implement the function `subsets` (a list items) -> a list of subsets. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a li...
recursion
[ { "role": "user", "content": "Create a utility function named `subsets` which generate all subsets of a list. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def subsets(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items mu...
recursion