conversations
listlengths
2
2
source
stringclasses
8 values
[ { "role": "user", "content": "Generate a Python function `binomial` for compute the binomial coefficient C(n,k). Use only the standard library." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise Type...
math
[ { "role": "user", "content": "Create a utility function named `binomial` which compute the binomial coefficient C(n,k). Add a brief docstring." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeE...
math
[ { "role": "user", "content": "Write `binomial` in Python. It should compute the binomial coefficient C(n,k). Use only the standard library." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeErro...
math
[ { "role": "user", "content": "Implement `binomial` with proper validation: compute the binomial coefficient C(n,k). Add a brief docstring." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeError...
math
[ { "role": "user", "content": "Write a Python function `binomial` that compute the binomial coefficient C(n,k). " }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeError(\"n and k must be int\")\n...
math
[ { "role": "user", "content": "Provide a Python solution for `binomial`: compute the binomial coefficient C(n,k). Avoid mutating the input." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeError...
math
[ { "role": "user", "content": "Add a function `binomial` that compute the binomial coefficient C(n,k). Avoid mutating the input." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeError(\"n and k ...
math
[ { "role": "user", "content": "Generate a Python function `binomial` for compute the binomial coefficient C(n,k). Add a brief docstring." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeError(\"...
math
[ { "role": "user", "content": "Write `binomial` handling edge cases; it should compute the binomial coefficient C(n,k). Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n ...
math
[ { "role": "user", "content": "Write code for `binomial` (integers n and k) that compute the binomial coefficient C(n,k). Include basic type checks." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise ...
math
[ { "role": "user", "content": "Can you write code for `binomial` that compute the binomial coefficient C(n,k)? Handle empty input gracefully." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeErr...
math
[ { "role": "user", "content": "Code a function `binomial` to compute the binomial coefficient C(n,k). Handle empty input gracefully." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeError(\"n an...
math
[ { "role": "user", "content": "Formulate `binomial` to compute the binomial coefficient C(n,k). Handle empty input gracefully." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeError(\"n and k mu...
math
[ { "role": "user", "content": "Implement `binomial` returning C(n,k) given integers n and k. Keep it efficient." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeError(\"n and k must be int\")\n ...
math
[ { "role": "user", "content": "Implement `binomial(integers n and k)` to compute the binomial coefficient C(n,k). Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n ...
math
[ { "role": "user", "content": "Can you write code for `binomial` that compute the binomial coefficient C(n,k)? Include basic type checks." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeError(\...
math
[ { "role": "user", "content": "Write a reusable function `binomial` which compute the binomial coefficient C(n,k). Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n ...
math
[ { "role": "user", "content": "Please provide `binomial` that compute the binomial coefficient C(n,k). Handle empty input gracefully." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n raise TypeError(\"n a...
math
[ { "role": "user", "content": "Build a function `binomial` that compute the binomial coefficient C(n,k), with edge-case handling. Add a brief docstring." }, { "role": "assistant", "content": "def binomial(n: int, k: int) -> int:\n if not (isinstance(n, int) and isinstance(k, int)):\n ra...
math
[ { "role": "user", "content": "Can you write code for `nth_prime` that find the nth prime number? Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive i...
math
[ { "role": "user", "content": "Implement the function `nth_prime` (a positive integer n) -> the nth prime. " }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_prime(x):\n ...
math
[ { "role": "user", "content": "Implement `nth_prime` with proper validation: find the nth prime number. Add a brief docstring." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n d...
math
[ { "role": "user", "content": "Make a function `nth_prime` to find the nth prime number. Avoid mutating the input." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_prime...
math
[ { "role": "user", "content": "Create a utility function named `nth_prime` which find the nth prime number. Keep it efficient." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n d...
math
[ { "role": "user", "content": "Write a Python function `nth_prime` that find the nth prime number. Include basic type checks." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n de...
math
[ { "role": "user", "content": "Implement `nth_prime`. It should find the nth prime number. Add a brief docstring." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_prime(...
math
[ { "role": "user", "content": "Generate a Python function `nth_prime` for find the nth prime number. Add a brief docstring." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def ...
math
[ { "role": "user", "content": "Create a utility function named `nth_prime` which find the nth prime number. Use only the standard library." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive i...
math
[ { "role": "user", "content": "Make a function `nth_prime` to find the nth prime number. Include basic type checks." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_prim...
math
[ { "role": "user", "content": "Implement `nth_prime(a positive integer n)` to find the nth prime number. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be pos...
math
[ { "role": "user", "content": "Provide a Python solution for `nth_prime`: find the nth prime number. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positiv...
math
[ { "role": "user", "content": "Construct `nth_prime` to find the nth prime number. Handle empty input gracefully." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_prime(...
math
[ { "role": "user", "content": "Can you write code for `nth_prime` that find the nth prime number? Avoid mutating the input." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def ...
math
[ { "role": "user", "content": "Develop `nth_prime` such that it find the nth prime number. Keep it efficient." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_prime(x):\...
math
[ { "role": "user", "content": "Implement `nth_prime` returning the nth prime given a positive integer n. Use only the standard library." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\...
math
[ { "role": "user", "content": "Create `nth_prime(a positive integer n)` returning the nth prime. Avoid mutating the input." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _...
math
[ { "role": "user", "content": "Generate a Python function `nth_prime` for find the nth prime number. Use only the standard library." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n...
math
[ { "role": "user", "content": "Generate a Python function `nth_prime` for find the nth prime number. Handle empty input gracefully." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n...
math
[ { "role": "user", "content": "Formulate `nth_prime` to find the nth prime number. Handle empty input gracefully." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_prime(...
math
[ { "role": "user", "content": "Construct `nth_prime` to find the nth prime number. Include basic type checks." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_prime(x):\...
math
[ { "role": "user", "content": "Create a robust `nth_prime` that find the nth prime number. Handle empty input gracefully." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _i...
math
[ { "role": "user", "content": "Help me write `nth_prime` that find the nth prime number. Use only the standard library." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_...
math
[ { "role": "user", "content": "Make a function `nth_prime` to find the nth prime number. Make it robust to invalid input." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _i...
math
[ { "role": "user", "content": "Help me write `nth_prime` that find the nth prime number. " }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_prime(x):\n if x < 2:\n...
math
[ { "role": "user", "content": "Develop `nth_prime` such that it find the nth prime number. Use only the standard library." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _i...
math
[ { "role": "user", "content": "Implement `nth_prime(a positive integer n)` to find the nth prime number. Keep it efficient." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def ...
math
[ { "role": "user", "content": "Produce a clean implementation of `nth_prime`: find the nth prime number. Make it robust to invalid input." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive in...
math
[ { "role": "user", "content": "Create a utility function named `nth_prime` which find the nth prime number. Handle empty input gracefully." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive i...
math
[ { "role": "user", "content": "Draft a Python function `nth_prime` to find the nth prime number. Add a brief docstring." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def _is_...
math
[ { "role": "user", "content": "Formulate `nth_prime` to find the nth prime number. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def nth_prime(n: int) -> int:\n if not isinstance(n, int) or n < 1:\n raise ValueError(\"n must be positive int\")\n def ...
math
[ { "role": "user", "content": "Produce a clean implementation of `flatten`: flatten a nested list. Add a brief docstring." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result...
list_ops
[ { "role": "user", "content": "Write a Python function `flatten` that flatten a nested list. " }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n for item in neste...
list_ops
[ { "role": "user", "content": "Make a function `flatten` to flatten a nested list. Handle empty input gracefully." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n ...
list_ops
[ { "role": "user", "content": "I need a Python helper `flatten` that flatten a nested list. Handle empty input gracefully." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n resul...
list_ops
[ { "role": "user", "content": "Help me write `flatten` that flatten a nested list. Make it robust to invalid input." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\...
list_ops
[ { "role": "user", "content": "Draft a Python function `flatten` to flatten a nested list. Keep it efficient." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n f...
list_ops
[ { "role": "user", "content": "Can you write code for `flatten` that flatten a nested list? Handle empty input gracefully." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n resul...
list_ops
[ { "role": "user", "content": "Produce a clean implementation of `flatten`: flatten a nested list. Use only the standard library." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n ...
list_ops
[ { "role": "user", "content": "Code a function `flatten` to flatten a nested list. Keep it efficient." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n for item ...
list_ops
[ { "role": "user", "content": "Create a utility function named `flatten` which flatten a nested list. Keep it efficient." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result ...
list_ops
[ { "role": "user", "content": "Formulate `flatten` to flatten a nested list. Add a brief docstring." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n for item in...
list_ops
[ { "role": "user", "content": "Build a function `flatten` that flatten a nested list, with edge-case handling. Use only the standard library." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a...
list_ops
[ { "role": "user", "content": "Make a function `flatten` to flatten a nested list. Avoid mutating the input." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n fo...
list_ops
[ { "role": "user", "content": "Please provide `flatten` that flatten a nested list. " }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n for item in nested:\n ...
list_ops
[ { "role": "user", "content": "Write a reusable function `flatten` which flatten a nested list. " }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n for item in ne...
list_ops
[ { "role": "user", "content": "Implement `flatten(a nested list)` to flatten a nested list. Keep it efficient." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n ...
list_ops
[ { "role": "user", "content": "Implement `flatten`. It should flatten a nested list. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n re...
list_ops
[ { "role": "user", "content": "Define a function `flatten` taking a nested list and returning a flat list. " }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n for...
list_ops
[ { "role": "user", "content": "I need a Python helper `flatten` that flatten a nested list. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\...
list_ops
[ { "role": "user", "content": "Create a utility function named `flatten` which flatten a nested list. Handle empty input gracefully." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\...
list_ops
[ { "role": "user", "content": "Create a robust `flatten` that flatten a nested list. Avoid mutating the input." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n ...
list_ops
[ { "role": "user", "content": "Build a function `flatten` that flatten a nested list, with edge-case handling. Make it robust to invalid input." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be...
list_ops
[ { "role": "user", "content": "Make a function `flatten` to flatten a nested list. Make it robust to invalid input." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\...
list_ops
[ { "role": "user", "content": "Write `flatten` handling edge cases; it should flatten a nested list. Make it robust to invalid input." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")...
list_ops
[ { "role": "user", "content": "Develop `flatten` such that it flatten a nested list. Add a brief docstring." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n for...
list_ops
[ { "role": "user", "content": "Implement `flatten`. It should flatten a nested list. Make it robust to invalid input." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = [...
list_ops
[ { "role": "user", "content": "Write `flatten` handling edge cases; it should flatten a nested list. Add a brief docstring." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n resu...
list_ops
[ { "role": "user", "content": "Write `flatten`: flatten a nested list. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n ...
list_ops
[ { "role": "user", "content": "Write a Python function `flatten` that flatten a nested list. Include basic type checks." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result =...
list_ops
[ { "role": "user", "content": "Draft a Python function `flatten` to flatten a nested list. Avoid mutating the input." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []...
list_ops
[ { "role": "user", "content": "Implement `flatten(a nested list)` to flatten a nested list. Add a brief docstring." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\")\n result = []\n...
list_ops
[ { "role": "user", "content": "Generate a Python function `flatten` for flatten a nested list. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def flatten(nested: list) -> list:\n if not isinstance(nested, list):\n raise TypeError(\"nested must be a list\...
list_ops
[ { "role": "user", "content": "Code a function `dedupe` to remove duplicates while preserving order. Handle empty input gracefully." }, { "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. Avoid mutating the input." }, { "role": "assistant", "content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be a list\")\n seen ...
list_ops
[ { "role": "user", "content": "Define a function `dedupe` taking a list items and returning a deduplicated list. " }, { "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": "Please provide `dedupe` that remove duplicates while preserving order. Handle empty input gracefully." }, { "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": "Implement `dedupe` with proper validation: remove duplicates while preserving order. Use only the standard library." }, { "role": "assistant", "content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must be ...
list_ops
[ { "role": "user", "content": "Generate a Python function `dedupe` for 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 m...
list_ops
[ { "role": "user", "content": "Write `dedupe` handling edge cases; it should remove duplicates while preserving order. Use only the standard library." }, { "role": "assistant", "content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must ...
list_ops
[ { "role": "user", "content": "Define a function `dedupe` taking a list items and returning a deduplicated list. 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_ops
[ { "role": "user", "content": "Construct `dedupe` to remove duplicates while preserving order. Avoid mutating the input." }, { "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(...
list_ops
[ { "role": "user", "content": "Write `dedupe`: remove duplicates while preserving order. Avoid mutating the input." }, { "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": "Implement the function `dedupe` (a list items) -> 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\")\n see...
list_ops
[ { "role": "user", "content": "Implement the function `dedupe` (a list items) -> a deduplicated list. Handle empty input gracefully." }, { "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 a reusable function `dedupe` which 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 ...
list_ops
[ { "role": "user", "content": "Create a utility function named `dedupe` which remove duplicates while preserving order. Use only the standard library." }, { "role": "assistant", "content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise TypeError(\"items must...
list_ops
[ { "role": "user", "content": "Implement `dedupe` returning a deduplicated list given a list items. 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\")\n seen ...
list_ops
[ { "role": "user", "content": "Add a function `dedupe` that 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\")\n see...
list_ops
[ { "role": "user", "content": "Draft a Python function `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 ...
list_ops
[ { "role": "user", "content": "Build a function `dedupe` that remove duplicates while preserving order, with edge-case handling. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def dedupe(items: list) -> list:\n if not isinstance(items, list):\n raise Typ...
list_ops