conversations listlengths 2 2 | source stringclasses 8
values |
|---|---|
[
{
"role": "user",
"content": "Implement `reverse_string` returning the reversed string given a string s. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n ... | string_utils |
[
{
"role": "user",
"content": "Create `reverse_string(a string s)` returning the reversed string. Include basic type checks."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n raise ... | string_utils |
[
{
"role": "user",
"content": "Create a robust `reverse_string` that reverse a string. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n raise TypeErr... | string_utils |
[
{
"role": "user",
"content": "Build a function `reverse_string` that reverse a string, with edge-case handling. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result... | string_utils |
[
{
"role": "user",
"content": "Write a reusable function `reverse_string` which reverse a string. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n... | string_utils |
[
{
"role": "user",
"content": "Develop `reverse_string` such that it reverse a string. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n raise TypeErr... | string_utils |
[
{
"role": "user",
"content": "Write `reverse_string`: reverse a string. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n raise TypeError(\"s must be a st... | string_utils |
[
{
"role": "user",
"content": "Generate a Python function `reverse_string` for reverse a string. Include basic type checks."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n raise T... | string_utils |
[
{
"role": "user",
"content": "Please provide `reverse_string` that reverse a string. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in s:\n... | string_utils |
[
{
"role": "user",
"content": "Write `reverse_string` handling edge cases; it should reverse a string. Keep it efficient."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in s... | string_utils |
[
{
"role": "user",
"content": "Build a function `reverse_string` that reverse a string, with edge-case handling. Include basic type checks."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\... | string_utils |
[
{
"role": "user",
"content": "Write `reverse_string`: reverse a string. "
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return s[::-1]\... | string_utils |
[
{
"role": "user",
"content": "Create `reverse_string(a string s)` returning the reversed string. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n fo... | string_utils |
[
{
"role": "user",
"content": "Generate a Python function `reverse_string` for reverse a string. Add a brief docstring."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n raise TypeE... | string_utils |
[
{
"role": "user",
"content": "Create a robust `reverse_string` that reverse a string. Keep it efficient."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in s:\n resul... | string_utils |
[
{
"role": "user",
"content": "I need a Python helper `reverse_string` that reverse a string. Keep it efficient."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in s:\n ... | string_utils |
[
{
"role": "user",
"content": "Write a reusable function `reverse_string` which reverse a string. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in... | string_utils |
[
{
"role": "user",
"content": "Write a reusable function `reverse_string` which reverse a string. "
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in s:\n result = ch ... | string_utils |
[
{
"role": "user",
"content": "Produce a clean implementation of `reverse_string`: reverse a string. Keep it efficient."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in s:\... | string_utils |
[
{
"role": "user",
"content": "Write `reverse_string` handling edge cases; it should reverse a string. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n ra... | string_utils |
[
{
"role": "user",
"content": "Implement `reverse_string` returning the reversed string given a string s. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n ... | string_utils |
[
{
"role": "user",
"content": "Formulate `reverse_string` to reverse a string. "
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in s:\n result = ch + result\n retur... | string_utils |
[
{
"role": "user",
"content": "Develop `reverse_string` such that it reverse a string. "
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in s:\n result = ch + result\n ... | string_utils |
[
{
"role": "user",
"content": "Write a Python function `reverse_string` that reverse a string. Add a brief docstring."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n raise TypeErr... | string_utils |
[
{
"role": "user",
"content": "Create a robust `reverse_string` that reverse a string. "
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in s:\n result = ch + result\n ... | string_utils |
[
{
"role": "user",
"content": "Provide a Python solution for `reverse_string`: reverse a string. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n rai... | string_utils |
[
{
"role": "user",
"content": "Make a function `reverse_string` to reverse a string. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n raise... | string_utils |
[
{
"role": "user",
"content": "Implement the function `reverse_string` (a string s) -> the reversed string. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"... | string_utils |
[
{
"role": "user",
"content": "Create a utility function named `reverse_string` which reverse a string. Add a brief docstring."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch... | string_utils |
[
{
"role": "user",
"content": "Construct `reverse_string` to reverse a string. Use only the standard library."
},
{
"role": "assistant",
"content": "def reverse_string(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n result = \"\"\n for ch in s:\n r... | string_utils |
[
{
"role": "user",
"content": "Implement the function `reverse_string` (a string s) -> the reversed string. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(... | string_utils |
[
{
"role": "user",
"content": "Draft a Python function `reverse_string` to reverse a string. "
},
{
"role": "assistant",
"content": "def reverse_string(s: str) -> str:\n \"\"\"Return the reversed version of s.\"\"\"\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\... | string_utils |
[
{
"role": "user",
"content": "Can you write code for `is_palindrome` that check whether a string is a palindrome? Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")... | string_utils |
[
{
"role": "user",
"content": "Add a function `is_palindrome` that check whether a string is a palindrome. Include basic type checks."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleane... | string_utils |
[
{
"role": "user",
"content": "Write `is_palindrome` in Python. It should check whether a string is a palindrome. Keep it efficient."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned... | string_utils |
[
{
"role": "user",
"content": "Implement the function `is_palindrome` (a string s) -> True if s is a palindrome. Keep it efficient."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned ... | string_utils |
[
{
"role": "user",
"content": "Build a function `is_palindrome` that check whether a string is a palindrome, with edge-case handling. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise T... | string_utils |
[
{
"role": "user",
"content": "Write `is_palindrome` handling edge cases; it should check whether a string is a palindrome. "
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned = \"\".... | string_utils |
[
{
"role": "user",
"content": "Construct `is_palindrome` to check whether a string is a palindrome. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned = \"\"... | string_utils |
[
{
"role": "user",
"content": "Implement `is_palindrome` returning True if s is a palindrome given a string s. Add a brief docstring."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleane... | string_utils |
[
{
"role": "user",
"content": "Construct `is_palindrome` to check whether a string is a palindrome. Keep it efficient."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned = \"\".join(c... | string_utils |
[
{
"role": "user",
"content": "Create `is_palindrome(a string s)` returning True if s is a palindrome. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n... | string_utils |
[
{
"role": "user",
"content": "Develop `is_palindrome` such that it check whether a string is a palindrome. Add a brief docstring."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned =... | string_utils |
[
{
"role": "user",
"content": "I need a Python helper `is_palindrome` that check whether a string is a palindrome. Keep it efficient."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleane... | string_utils |
[
{
"role": "user",
"content": "Build a function `is_palindrome` that check whether a string is a palindrome, with edge-case handling. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\... | string_utils |
[
{
"role": "user",
"content": "Code a function `is_palindrome` to check whether a string is a palindrome. Include basic type checks."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned... | string_utils |
[
{
"role": "user",
"content": "Implement `is_palindrome(a string s)` to check whether a string is a palindrome. "
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned = \"\".join(ch.lowe... | string_utils |
[
{
"role": "user",
"content": "Write `is_palindrome` in Python. It should check whether a string is a palindrome. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be... | string_utils |
[
{
"role": "user",
"content": "Write code for `is_palindrome` (a string s) that check whether a string is a palindrome. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s m... | string_utils |
[
{
"role": "user",
"content": "Write code for `is_palindrome` (a string s) that check whether a string is a palindrome. Keep it efficient."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n c... | string_utils |
[
{
"role": "user",
"content": "Make a function `is_palindrome` to check whether a string is a palindrome. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cle... | string_utils |
[
{
"role": "user",
"content": "Write `is_palindrome` in Python. It should check whether a string is a palindrome. Include basic type checks."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n ... | string_utils |
[
{
"role": "user",
"content": "Make a function `is_palindrome` to check whether a string is a palindrome. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned ... | string_utils |
[
{
"role": "user",
"content": "Define a function `is_palindrome` taking a string s and returning True if s is a palindrome. Include basic type checks."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a s... | string_utils |
[
{
"role": "user",
"content": "Add a function `is_palindrome` that check whether a string is a palindrome. Add a brief docstring."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned = ... | string_utils |
[
{
"role": "user",
"content": "Create a utility function named `is_palindrome` which check whether a string is a palindrome. Add a brief docstring."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\... | string_utils |
[
{
"role": "user",
"content": "Implement `is_palindrome`. It should check whether a string is a palindrome. Keep it efficient."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned = \"\... | string_utils |
[
{
"role": "user",
"content": "Write `is_palindrome`: check whether a string is a palindrome. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n clean... | string_utils |
[
{
"role": "user",
"content": "Implement `is_palindrome(a string s)` to check whether a string is a palindrome. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cl... | string_utils |
[
{
"role": "user",
"content": "Write `is_palindrome`: check whether a string is a palindrome. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned = \"\".... | string_utils |
[
{
"role": "user",
"content": "Provide a Python solution for `is_palindrome`: check whether a string is a palindrome. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str... | string_utils |
[
{
"role": "user",
"content": "Write `is_palindrome`: check whether a string is a palindrome. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned = \"\... | string_utils |
[
{
"role": "user",
"content": "Construct `is_palindrome` to check whether a string is a palindrome. Add a brief docstring."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned = \"\".jo... | string_utils |
[
{
"role": "user",
"content": "Write `is_palindrome`: check whether a string is a palindrome. Add a brief docstring."
},
{
"role": "assistant",
"content": "def is_palindrome(s: str) -> bool:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n cleaned = \"\".join(ch.... | string_utils |
[
{
"role": "user",
"content": "Implement `count_vowels` with proper validation: count the vowels in a string. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aei... | string_utils |
[
{
"role": "user",
"content": "Implement `count_vowels` with proper validation: count the vowels in a string. Use only the standard library."
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(... | string_utils |
[
{
"role": "user",
"content": "Implement `count_vowels`. It should count the vowels in a string. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aeiouAEIOU\")\n ... | string_utils |
[
{
"role": "user",
"content": "Build a function `count_vowels` that count the vowels in a string, with edge-case handling. "
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aeiouAEIOU\")\n... | string_utils |
[
{
"role": "user",
"content": "Provide a Python solution for `count_vowels`: count the vowels in a string. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n retu... | string_utils |
[
{
"role": "user",
"content": "Write a reusable function `count_vowels` which count the vowels in a string. Keep it efficient."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1 fo... | string_utils |
[
{
"role": "user",
"content": "Produce a clean implementation of `count_vowels`: count the vowels in a string. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n ... | string_utils |
[
{
"role": "user",
"content": "Add a function `count_vowels` that count the vowels in a string. Keep it efficient."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1 for ch in s.lo... | string_utils |
[
{
"role": "user",
"content": "Help me write `count_vowels` that count the vowels in a string. "
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aeiouAEIOU\")\n return sum(1 for ch in s... | string_utils |
[
{
"role": "user",
"content": "Formulate `count_vowels` to count the vowels in a string. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1 for ch in s.lo... | string_utils |
[
{
"role": "user",
"content": "Implement `count_vowels` with proper validation: count the vowels in a string. "
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aeiouAEIOU\")\n return su... | string_utils |
[
{
"role": "user",
"content": "Provide a Python solution for `count_vowels`: count the vowels in a string. Add a brief docstring."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1... | string_utils |
[
{
"role": "user",
"content": "Create a utility function named `count_vowels` which count the vowels in a string. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n re... | string_utils |
[
{
"role": "user",
"content": "Formulate `count_vowels` to count the vowels in a string. Include basic type checks."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1 for ch in s.l... | string_utils |
[
{
"role": "user",
"content": "Implement `count_vowels`. It should count the vowels in a string. Add a brief docstring."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1 for ch in... | string_utils |
[
{
"role": "user",
"content": "Implement `count_vowels(a string s)` to count the vowels in a string. Keep it efficient."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1 for ch in... | string_utils |
[
{
"role": "user",
"content": "Write `count_vowels` handling edge cases; it should count the vowels in a string. "
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aeiouAEIOU\")\n return... | string_utils |
[
{
"role": "user",
"content": "Implement `count_vowels(a string s)` to count the vowels in a string. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aeiouAE... | string_utils |
[
{
"role": "user",
"content": "Define a function `count_vowels` taking a string s and returning the number of vowels. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n ... | string_utils |
[
{
"role": "user",
"content": "Please provide `count_vowels` that count the vowels in a string. "
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aeiouAEIOU\")\n return sum(1 for ch in ... | string_utils |
[
{
"role": "user",
"content": "Write `count_vowels`: count the vowels in a string. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aeiouAEIOU\")\n retu... | string_utils |
[
{
"role": "user",
"content": "I need a Python helper `count_vowels` that count the vowels in a string. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = ... | string_utils |
[
{
"role": "user",
"content": "Write `count_vowels` handling edge cases; it should count the vowels in a string. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = s... | string_utils |
[
{
"role": "user",
"content": "Produce a clean implementation of `count_vowels`: count the vowels in a string. Make it robust to invalid input."
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = s... | string_utils |
[
{
"role": "user",
"content": "I need a Python helper `count_vowels` that count the vowels in a string. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1... | string_utils |
[
{
"role": "user",
"content": "Construct `count_vowels` to count the vowels in a string. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aeiouAEIOU\")\n retur... | string_utils |
[
{
"role": "user",
"content": "Write `count_vowels` handling edge cases; it should count the vowels in a string. Include basic type checks."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n re... | string_utils |
[
{
"role": "user",
"content": "Construct `count_vowels` to count the vowels in a string. "
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1 for ch in s.lower() if ch in \"aeiou\")... | string_utils |
[
{
"role": "user",
"content": "Make a function `count_vowels` to count the vowels in a string. Add a brief docstring."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1 for ch in s... | string_utils |
[
{
"role": "user",
"content": "Generate a Python function `count_vowels` for count the vowels in a string. "
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return sum(1 for ch in s.lower() i... | string_utils |
[
{
"role": "user",
"content": "Write a reusable function `count_vowels` which count the vowels in a string. Avoid mutating the input."
},
{
"role": "assistant",
"content": "def count_vowels(s):\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n vowels = set(\"aeiou... | string_utils |
[
{
"role": "user",
"content": "Write a reusable function `count_vowels` which count the vowels in a string. Return sensible defaults for edge cases."
},
{
"role": "assistant",
"content": "def count_vowels(s: str) -> int:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\"... | string_utils |
[
{
"role": "user",
"content": "Formulate `capitalize_words` to capitalize the first letter of each word. Keep it efficient."
},
{
"role": "assistant",
"content": "def capitalize_words(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return \" \".j... | string_utils |
[
{
"role": "user",
"content": "Develop `capitalize_words` such that it capitalize the first letter of each word. Include basic type checks."
},
{
"role": "assistant",
"content": "def capitalize_words(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n ... | string_utils |
[
{
"role": "user",
"content": "Implement `capitalize_words` with proper validation: capitalize the first letter of each word. Handle empty input gracefully."
},
{
"role": "assistant",
"content": "def capitalize_words(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s mus... | string_utils |
[
{
"role": "user",
"content": "Code a function `capitalize_words` to capitalize the first letter of each word. "
},
{
"role": "assistant",
"content": "def capitalize_words(s: str) -> str:\n if not isinstance(s, str):\n raise TypeError(\"s must be a str\")\n return \" \".join(word.cap... | string_utils |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.