conversations
listlengths
2
2
source
stringclasses
8 values
[ { "role": "user", "content": "Code a function `write_text` to write text to a file. Add a brief docstring." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Add a function `write_text` that write text to a file. Make it robust to invalid input." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Implement the function `write_text` (a path and text) -> None. Add a brief docstring." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Make a function `write_text` to write text to a file. Avoid mutating the input." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Implement `write_text` with proper validation: write text to a file. " }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Develop `write_text` such that it write text to a file. " }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Make a function `write_text` to write text to a file. Add a brief docstring." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Produce a clean implementation of `write_text`: write text to a file. Avoid mutating the input." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Write code for `write_text` (a path and text) that write text to a file. Use only the standard library." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\...
file_io
[ { "role": "user", "content": "Write a Python function `write_text` that write text to a file. Make it robust to invalid input." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ...
file_io
[ { "role": "user", "content": "Construct `write_text` to write text to a file. Add a brief docstring." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Implement `write_text` returning None given a path and text. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n"...
file_io
[ { "role": "user", "content": "Define a function `write_text` taking a path and text and returning None. Include basic type checks." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" ...
file_io
[ { "role": "user", "content": "Build a function `write_text` that write text to a file, with edge-case handling. Use only the standard library." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.wri...
file_io
[ { "role": "user", "content": "Help me write `write_text` that write text to a file. Use only the standard library." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Write a reusable function `write_text` which write text to a file. Avoid mutating the input." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Construct `write_text` to write text to a file. Keep it efficient." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Draft a Python function `write_text` to write text to a file. Add a brief docstring." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Please provide `write_text` that write text to a file. Make it robust to invalid input." }, { "role": "assistant", "content": "def write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n" } ]
file_io
[ { "role": "user", "content": "Write code for `list_files` (a directory path) that list files in a directory. Handle empty input gracefully." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n re...
file_io
[ { "role": "user", "content": "Formulate `list_files` to list files in a directory. " }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in os.listdir(directory) if os.path....
file_io
[ { "role": "user", "content": "Write `list_files` handling edge cases; it should list files in a directory. Add a brief docstring." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name...
file_io
[ { "role": "user", "content": "Write a reusable function `list_files` which list files in a directory. Keep it efficient." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name...
file_io
[ { "role": "user", "content": "Define a function `list_files` taking a directory path and returning a list of file names. Handle empty input gracefully." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n retur...
file_io
[ { "role": "user", "content": "I need a Python helper `list_files` that list files in a directory. Include basic type checks." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for ...
file_io
[ { "role": "user", "content": "Build a function `list_files` that list files in a directory, with edge-case handling. Use only the standard library." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []...
file_io
[ { "role": "user", "content": "Define a function `list_files` taking a directory path and returning a list of file names. Make it robust to invalid input." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n ret...
file_io
[ { "role": "user", "content": "Add a function `list_files` that list files in a directory. " }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in os.listdir(directory) if o...
file_io
[ { "role": "user", "content": "Provide a Python solution for `list_files`: list files in a directory. Add a brief docstring." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for n...
file_io
[ { "role": "user", "content": "Write `list_files` in Python. It should list files in a directory. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n retu...
file_io
[ { "role": "user", "content": "Draft a Python function `list_files` to list files in a directory. " }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in os.listdir(director...
file_io
[ { "role": "user", "content": "Write code for `list_files` (a directory path) that list files in a directory. Keep it efficient." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name f...
file_io
[ { "role": "user", "content": "Please provide `list_files` that list files in a directory. Add a brief docstring." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in os.l...
file_io
[ { "role": "user", "content": "Write code for `list_files` (a directory path) that list files in a directory. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return ...
file_io
[ { "role": "user", "content": "I need a Python helper `list_files` that list files in a directory. " }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in os.listdir(directo...
file_io
[ { "role": "user", "content": "Implement `list_files(a directory path)` to list files in a directory. Include basic type checks." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name f...
file_io
[ { "role": "user", "content": "I need a Python helper `list_files` that list files in a directory. Keep it efficient." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in ...
file_io
[ { "role": "user", "content": "Formulate `list_files` to list files in a directory. Avoid mutating the input." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in os.listd...
file_io
[ { "role": "user", "content": "Write `list_files` handling edge cases; it should list files in a directory. Make it robust to invalid input." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n re...
file_io
[ { "role": "user", "content": "Develop `list_files` such that it list files in a directory. " }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in os.listdir(directory) if ...
file_io
[ { "role": "user", "content": "Implement the function `list_files` (a directory path) -> a list of file names. Include basic type checks." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n retur...
file_io
[ { "role": "user", "content": "Help me write `list_files` that list files in a directory. Handle empty input gracefully." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name ...
file_io
[ { "role": "user", "content": "Add a function `list_files` that list files in a directory. Add a brief docstring." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in os.l...
file_io
[ { "role": "user", "content": "Implement `list_files` with proper validation: list files in a directory. Include basic type checks." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [nam...
file_io
[ { "role": "user", "content": "Write `list_files` in Python. It should list files in a directory. " }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in os.listdir(director...
file_io
[ { "role": "user", "content": "Create a robust `list_files` that list files in a directory. Make it robust to invalid input." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for n...
file_io
[ { "role": "user", "content": "Build a function `list_files` that list files in a directory, with edge-case handling. Make it robust to invalid input." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return ...
file_io
[ { "role": "user", "content": "Write `list_files`: list files in a directory. " }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for name in os.listdir(directory) if os.path.isfile...
file_io
[ { "role": "user", "content": "Write a reusable function `list_files` which list files in a directory. Make it robust to invalid input." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return ...
file_io
[ { "role": "user", "content": "Develop `list_files` such that it list files in a directory. Use only the standard library." }, { "role": "assistant", "content": "import os\n\ndef list_files(directory: str) -> list:\n if not os.path.isdir(directory):\n return []\n return [name for nam...
file_io
[ { "role": "user", "content": "Write a reusable function `BankAccount` which model a bank account with deposit/withdraw. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owne...
oop
[ { "role": "user", "content": "Create a utility function named `BankAccount` which model a bank account with deposit/withdraw. Make it robust to invalid input." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner ...
oop
[ { "role": "user", "content": "Make a function `BankAccount` to model a bank account with deposit/withdraw. Make it robust to invalid input." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n se...
oop
[ { "role": "user", "content": "Write a reusable function `BankAccount` which model a bank account with deposit/withdraw. Add a brief docstring." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n ...
oop
[ { "role": "user", "content": "Implement `BankAccount` returning a BankAccount instance given owner and initial balance. Handle empty input gracefully." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\...
oop
[ { "role": "user", "content": "Formulate `BankAccount` to model a bank account with deposit/withdraw. Include basic type checks." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.balance =...
oop
[ { "role": "user", "content": "Build a function `BankAccount` that model a bank account with deposit/withdraw, with edge-case handling. " }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.b...
oop
[ { "role": "user", "content": "Write code for `BankAccount` (owner and initial balance) that model a bank account with deposit/withdraw. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n ...
oop
[ { "role": "user", "content": "Implement `BankAccount` with proper validation: model a bank account with deposit/withdraw. Make it robust to invalid input." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = ow...
oop
[ { "role": "user", "content": "Implement `BankAccount`. It should model a bank account with deposit/withdraw. Use only the standard library." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n se...
oop
[ { "role": "user", "content": "Write code for `BankAccount` (owner and initial balance) that model a bank account with deposit/withdraw. Make it robust to invalid input." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n s...
oop
[ { "role": "user", "content": "Construct `BankAccount` to model a bank account with deposit/withdraw. Keep it efficient." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.balance = balance...
oop
[ { "role": "user", "content": "Can you write code for `BankAccount` that model a bank account with deposit/withdraw? Return sensible defaults for edge cases." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = ...
oop
[ { "role": "user", "content": "Implement `BankAccount(owner and initial balance)` to model a bank account with deposit/withdraw. Make it robust to invalid input." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owne...
oop
[ { "role": "user", "content": "Formulate `BankAccount` to model a bank account with deposit/withdraw. Handle empty input gracefully." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.balan...
oop
[ { "role": "user", "content": "Write `BankAccount`: model a bank account with deposit/withdraw. Handle empty input gracefully." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.balance = b...
oop
[ { "role": "user", "content": "Implement the function `BankAccount` (owner and initial balance) -> a BankAccount instance. Add a brief docstring." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n ...
oop
[ { "role": "user", "content": "Generate a Python function `BankAccount` for model a bank account with deposit/withdraw. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner...
oop
[ { "role": "user", "content": "Implement `BankAccount` returning a BankAccount instance given owner and initial balance. Keep it efficient." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n sel...
oop
[ { "role": "user", "content": "Write a Python function `BankAccount` that model a bank account with deposit/withdraw. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner =...
oop
[ { "role": "user", "content": "Develop `BankAccount` such that it model a bank account with deposit/withdraw. Add a brief docstring." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.balan...
oop
[ { "role": "user", "content": "I need a Python helper `BankAccount` that model a bank account with deposit/withdraw. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = ...
oop
[ { "role": "user", "content": "Write `BankAccount` in Python. It should model a bank account with deposit/withdraw. Avoid mutating the input." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n s...
oop
[ { "role": "user", "content": "Write `BankAccount`: model a bank account with deposit/withdraw. Avoid mutating the input." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.balance = balanc...
oop
[ { "role": "user", "content": "Add a function `BankAccount` that model a bank account with deposit/withdraw. " }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.balance = balance\n\n def...
oop
[ { "role": "user", "content": "Implement `BankAccount(owner and initial balance)` to model a bank account with deposit/withdraw. Avoid mutating the input." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = own...
oop
[ { "role": "user", "content": "Develop `BankAccount` such that it model a bank account with deposit/withdraw. Keep it efficient." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.balance =...
oop
[ { "role": "user", "content": "Construct `BankAccount` to model a bank account with deposit/withdraw. " }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.balance = balance\n\n def deposi...
oop
[ { "role": "user", "content": "Build a function `BankAccount` that model a bank account with deposit/withdraw, with edge-case handling. Make it robust to invalid input." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n se...
oop
[ { "role": "user", "content": "Develop `BankAccount` such that it model a bank account with deposit/withdraw. Use only the standard library." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n se...
oop
[ { "role": "user", "content": "Write `BankAccount`: model a bank account with deposit/withdraw. Include basic type checks." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.balance = balan...
oop
[ { "role": "user", "content": "Draft a Python function `BankAccount` to model a bank account with deposit/withdraw. Keep it efficient." }, { "role": "assistant", "content": "class BankAccount:\n def __init__(self, owner: str, balance: float = 0.0):\n self.owner = owner\n self.bal...
oop
[ { "role": "user", "content": "Write `Stack` in Python. It should implement a stack. Handle empty input gracefully." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n ...
oop
[ { "role": "user", "content": "Implement `Stack(none)` to implement a stack. Make it robust to invalid input." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n def po...
oop
[ { "role": "user", "content": "Help me write `Stack` that implement a stack. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n ...
oop
[ { "role": "user", "content": "Formulate `Stack` to implement a stack. Add a brief docstring." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n def pop(self):\n ...
oop
[ { "role": "user", "content": "Write a reusable function `Stack` which implement a stack. " }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n def pop(self):\n i...
oop
[ { "role": "user", "content": "Write `Stack` handling edge cases; it should implement a stack. " }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n def pop(self):\n ...
oop
[ { "role": "user", "content": "Create a utility function named `Stack` which implement a stack. Handle empty input gracefully." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(it...
oop
[ { "role": "user", "content": "Provide a Python solution for `Stack`: implement a stack. Make it robust to invalid input." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n...
oop
[ { "role": "user", "content": "Define a function `Stack` taking none and returning a Stack instance. Return sensible defaults for edge cases." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._...
oop
[ { "role": "user", "content": "Can you write code for `Stack` that implement a stack? Handle empty input gracefully." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n ...
oop
[ { "role": "user", "content": "Please provide `Stack` that implement a stack. Keep it efficient." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n def pop(self):\n ...
oop
[ { "role": "user", "content": "Write a Python function `Stack` that implement a stack. Use only the standard library." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n ...
oop
[ { "role": "user", "content": "Write a Python function `Stack` that implement a stack. Make it robust to invalid input." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n...
oop
[ { "role": "user", "content": "Code a function `Stack` to implement a stack. Keep it efficient." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n def pop(self):\n ...
oop
[ { "role": "user", "content": "Develop `Stack` such that it implement a stack. Make it robust to invalid input." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n def ...
oop
[ { "role": "user", "content": "Write a reusable function `Stack` which implement a stack. Keep it efficient." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n def pop...
oop
[ { "role": "user", "content": "Create `Stack(none)` returning a Stack instance. Add a brief docstring." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n def pop(self)...
oop
[ { "role": "user", "content": "I need a Python helper `Stack` that implement a stack. Include basic type checks." }, { "role": "assistant", "content": "class Stack:\n def __init__(self):\n self._items = []\n\n def push(self, item) -> None:\n self._items.append(item)\n\n def...
oop