Download train.jsonl from KucLab/czech_code_chat: direct link, hf CLI and curl.
- Browser
- Download file 113 kB
-
https://huggingface.co/datasets/KucLab/czech_code_chat/resolve/main/train.jsonl
- Command line
-
hf download hf://datasets/KucLab/czech_code_chat/train.jsonl
-
curl -L -o train.jsonl https://huggingface.co/datasets/KucLab/czech_code_chat/resolve/main/train.jsonl
113 kB
| {"instruction": "Thanks", "input": "", "output": "You're welcome!"} | |
| {"instruction": "Ukaž čistý Python kód: unique preserve order.", "input": "", "output": "```python\ndef unique(seq):\n seen = set()\n out = []\n for x in seq:\n if x not in seen:\n seen.add(x)\n out.append(x)\n return out\n```"} | |
| {"instruction": "Co je merge?", "input": "", "output": "Merge spojuje změny z jedné větve do druhé a může vyžadovat řešení konfliktů."} | |
| {"instruction": "Ukaž čistý kód: spočítej samohlásky v textu. Pojmenuj funkci `count_vowels`.", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} | |
| {"instruction": "Spočítej: 23 + 10 = ?", "input": "", "output": "23 + 10 = 33"} | |
| {"instruction": "Kolik je 22 × 5?", "input": "", "output": "22 × 5 = 110"} | |
| {"instruction": "Napiš Python funkci: zapíše text do souboru (`write_text`).", "input": "", "output": "```python\ndef write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n```"} | |
| {"instruction": "Implement `count_vowels` in Python (spočítej samohlásky v textu).", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} | |
| {"instruction": "Kolik je 26 × 5?", "input": "", "output": "26 × 5 = 130"} | |
| {"instruction": "Co je SQL JOIN?", "input": "", "output": "JOIN spojuje řádky z více tabulek podle podmínky. INNER JOIN jen shody, LEFT JOIN všechny z levé + případné z pravé."} | |
| {"instruction": "Implement `to_upper` in Python (převod na velká písmena).", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} | |
| {"instruction": "Vysvětli branch?", "input": "", "output": "Branch je větev historie — oddělená linka vývoje, kterou pak sloučíš do main."} | |
| {"instruction": "Kolik je 4 × 5?", "input": "", "output": "4 × 5 = 20"} | |
| {"instruction": "Napiš Python funkci: odstraní whitespace (`strip_ws`).", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} | |
| {"instruction": "Spočítej: 5 + 7 = ?", "input": "", "output": "5 + 7 = 12"} | |
| {"instruction": "Kolik je 14 × 9?", "input": "", "output": "14 × 9 = 126"} | |
| {"instruction": "Kolik je 7 - 3?", "input": "", "output": "7 - 3 = 4"} | |
| {"instruction": "Hello", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..16.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 16}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Kolik je 22 - 6?", "input": "", "output": "22 - 6 = 16"} | |
| {"instruction": "Zdravím tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Write a Python function `is_even` that vrátí True pokud je sudé.", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} | |
| {"instruction": "Napiš FastAPI endpoint GET /health.", "input": "", "output": "```python\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\n@app.get(\"/health\")\ndef health():\n return {\"ok\": True}\n```"} | |
| {"instruction": "Hey tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Kolik je 19 - 9?", "input": "", "output": "19 - 9 = 10"} | |
| {"instruction": "Spočítej: 10 + 11 = ?", "input": "", "output": "10 + 11 = 21"} | |
| {"instruction": "Co je commit? (stručně)", "input": "", "output": "Commit je uložený snímek změn v Gitu s popisem, co a proč se změnilo."} | |
| {"instruction": "Oprav kód:\n```python\nx = 1\nif x = 1: print('ok')\n```", "input": "", "output": "Použij porovnání `==`: `if x == 1: print('ok')`.\n\nOpravená verze podle vysvětlení výše."} | |
| {"instruction": "Spočítej: 8 + 4 = ?", "input": "", "output": "8 + 4 = 12"} | |
| {"instruction": "Kolik je 10 × 12?", "input": "", "output": "10 × 12 = 120"} | |
| {"instruction": "Napiš bash skript: záloha složky do tar.gz s datem.", "input": "", "output": "```bash\n#!/usr/bin/env bash\nset -euo pipefail\nSRC=${1:-.}\nDST=\"backup-$(date +%Y%m%d-%H%M%S).tar.gz\"\ntar -czf \"$DST\" \"$SRC\"\necho \"Hotovo: $DST\"\n```"} | |
| {"instruction": "Co je databáze? (stručně)", "input": "", "output": "Databáze ukládá strukturovaná data tak, aby šla spolehlivě číst, zapisovat a dotazovat."} | |
| {"instruction": "Kolik je 7 - 5?", "input": "", "output": "7 - 5 = 2"} | |
| {"instruction": "Kolik je 16 × 5?", "input": "", "output": "16 × 5 = 80"} | |
| {"instruction": "Jak v Pythonu udělám deep copy slovníku?", "input": "", "output": "```python\nimport copy\nnew = copy.deepcopy(original)\n```\nPozor: `dict(original)` nebo `original.copy()` je jen mělká kopie."} | |
| {"instruction": "Potřebuju Python helper `sum_list`: sečte čísla v seznamu.", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} | |
| {"instruction": "Díky", "input": "", "output": "Není zač."} | |
| {"instruction": "Oprav češtinu: potrebuju pomoct s pythonem", "input": "", "output": "Potřebuju pomoct s Pythonem."} | |
| {"instruction": "Kolik je 6 × 12?", "input": "", "output": "6 × 12 = 72"} | |
| {"instruction": "Napiš Python: přečti CSV a vypiš průměr sloupce price.", "input": "", "output": "```python\nimport csv\nfrom pathlib import Path\n\ndef avg_price(path: str) -> float:\n prices = []\n with open(path, newline=\"\", encoding=\"utf-8\") as f:\n for row in csv.DictReader(f):\n prices.append(float(row[\"price\"]))\n return sum(prices) / len(prices) if prices else 0.0\n```"} | |
| {"instruction": "Jak bezpečně uložit heslo do databáze?", "input": "", "output": "Nikdy plaintext. Použij pomalý hash s solí: Argon2id, bcrypt nebo scrypt. V Pythonu např. `argon2-cffi` nebo `passlib`."} | |
| {"instruction": "Co je databáze?", "input": "", "output": "Databáze ukládá strukturovaná data tak, aby šla spolehlivě číst, zapisovat a dotazovat."} | |
| {"instruction": "Napiš SQL: vyber 12 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 12;\n```"} | |
| {"instruction": "Kolik je 18 - 8?", "input": "", "output": "18 - 8 = 10"} | |
| {"instruction": "Co je terminál?", "input": "", "output": "Terminál je textové rozhraní pro spouštění příkazů v systému."} | |
| {"instruction": "Kolik je 4 × 9?", "input": "", "output": "4 × 9 = 36"} | |
| {"instruction": "Spočítej: 24 + 3 = ?", "input": "", "output": "24 + 3 = 27"} | |
| {"instruction": "Kolik je 21 - 3?", "input": "", "output": "21 - 3 = 18"} | |
| {"instruction": "Kolik je 20 - 8?", "input": "", "output": "20 - 8 = 12"} | |
| {"instruction": "Implementuj `count_vowels` v Pythonu — spočítej samohlásky v textu.", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} | |
| {"instruction": "Write a Python function `avg_list` that spočítej průměr.", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} | |
| {"instruction": "Hey tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Hey!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Kolik je 28 - 2?", "input": "", "output": "28 - 2 = 26"} | |
| {"instruction": "Write a Python function `strip_ws` that odstraní whitespace.", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} | |
| {"instruction": "Kolik je 10 × 11?", "input": "", "output": "10 × 11 = 110"} | |
| {"instruction": "Implementuj `to_upper` v Pythonu — převod na velká písmena.", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} | |
| {"instruction": "Jak seřadím seznam slovníků podle klíče age?", "input": "", "output": "```python\npeople.sort(key=lambda p: p[\"age\"])\n# nebo nový seznam:\nsorted(people, key=lambda p: p[\"age\"])\n```"} | |
| {"instruction": "Spočítej: 21 + 6 = ?", "input": "", "output": "21 + 6 = 27"} | |
| {"instruction": "Napiš v Pythonu bubble sort.", "input": "", "output": "```python\ndef bubble_sort(a: list[int]) -> list[int]:\n a = a[:]\n n = len(a)\n for i in range(n):\n for j in range(0, n - i - 1):\n if a[j] > a[j + 1]:\n a[j], a[j + 1] = a[j + 1], a[j]\n return a\n```"} | |
| {"instruction": "Kolik je 19 - 11?", "input": "", "output": "19 - 11 = 8"} | |
| {"instruction": "Přelož do češtiny: Create a new branch.", "input": "", "output": "Vytvoř novou větev."} | |
| {"instruction": "Kolik je 12 × 4?", "input": "", "output": "12 × 4 = 48"} | |
| {"instruction": "Co je branch? (stručně)", "input": "", "output": "Branch je větev historie — oddělená linka vývoje, kterou pak sloučíš do main."} | |
| {"instruction": "Potřebuju Python helper `read_lines`: načte řádky souboru.", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} | |
| {"instruction": "Co je bug? (stručně)", "input": "", "output": "Bug je chyba v programu, kvůli které se chová jinak, než autor chtěl."} | |
| {"instruction": "Kolik je 16 × 6?", "input": "", "output": "16 × 6 = 96"} | |
| {"instruction": "Napiš SQL: vyber 1 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 1;\n```"} | |
| {"instruction": "Kolik je 18 × 6?", "input": "", "output": "18 × 6 = 108"} | |
| {"instruction": "Napiš SQL: vyber 11 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 11;\n```"} | |
| {"instruction": "Kolik je 18 × 3?", "input": "", "output": "18 × 3 = 54"} | |
| {"instruction": "Napiš skript, který spočítá řádky ve všech .py souborech ve složce.", "input": "", "output": "```python\nfrom pathlib import Path\n\ndef count_py_lines(root: str = \".\") -> int:\n total = 0\n for p in Path(root).rglob(\"*.py\"):\n total += sum(1 for _ in p.open(encoding=\"utf-8\", errors=\"ignore\"))\n return total\n\nif __name__ == \"__main__\":\n print(count_py_lines())\n```"} | |
| {"instruction": "Ukaž čistý kód: vrátí posledních n prvků. Pojmenuj funkci `last_n`.", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} | |
| {"instruction": "Přelož do češtiny: I need help with a bug.", "input": "", "output": "Potřebuju pomoct s bugem."} | |
| {"instruction": "Kolik je 20 - 6?", "input": "", "output": "20 - 6 = 14"} | |
| {"instruction": "Co je REST API?", "input": "", "output": "REST API je styl webových služeb: zdroje mají URL, operace se dělají HTTP metodami a data často chodí jako JSON."} | |
| {"instruction": "Kolik je 2 × 4?", "input": "", "output": "2 × 4 = 8"} | |
| {"instruction": "Ukaž čistý kód: sečte čísla v seznamu. Pojmenuj funkci `sum_list`.", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} | |
| {"instruction": "Napiš funkci v Pythonu: reverse string.", "input": "", "output": "```python\ndef rev(s: str) -> str:\n return s[::-1]\n```"} | |
| {"instruction": "Hey", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Spočítej: 27 + 9 = ?", "input": "", "output": "27 + 9 = 36"} | |
| {"instruction": "Ahoj tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Kolik je 24 - 2?", "input": "", "output": "24 - 2 = 22"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..14.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 14}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Implementuj v Pythonu unique preserve order.", "input": "", "output": "```python\ndef unique(seq):\n seen = set()\n out = []\n for x in seq:\n if x not in seen:\n seen.add(x)\n out.append(x)\n return out\n```"} | |
| {"instruction": "Napiš mini CLI TODO v Pythonu (add/list) v paměti. Komentáře piš česky.", "input": "", "output": "```python\nclass Todo:\n def __init__(self):\n self.items = []\n def add(self, title: str) -> None:\n self.items.append({\"title\": title, \"done\": False})\n def list(self) -> None:\n for i, it in enumerate(self.items, 1):\n mark = \"x\" if it[\"done\"] else \" \"\n print(f\"{i}. [{mark}] {it['title']}\")\n\nif __name__ == \"__main__\":\n t = Todo()\n t.add(\"Naučit se Python\")\n t.add(\"Napsat testy\")\n t.list()\n```"} | |
| {"instruction": "Kolik je 22 × 4?", "input": "", "output": "22 × 4 = 88"} | |
| {"instruction": "Kolik je 24 - 10?", "input": "", "output": "24 - 10 = 14"} | |
| {"instruction": "Napiš Python funkci: spočítej průměr (`avg_list`).", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} | |
| {"instruction": "Kolik je 24 - 6?", "input": "", "output": "24 - 6 = 18"} | |
| {"instruction": "Spočítej: 15 + 6 = ?", "input": "", "output": "15 + 6 = 21"} | |
| {"instruction": "Hey", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Dobrý den", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Oprav kód:\n```python\nxs = [1,2,3]\nfor i in range(4): print(xs[i])\n```", "input": "", "output": "Index 3 neexistuje. `range(len(xs))` nebo iteruj `for x in xs`.\n\nOpravená verze podle vysvětlení výše."} | |
| {"instruction": "Kolik je 15 - 5?", "input": "", "output": "15 - 5 = 10"} | |
| {"instruction": "Kolik je 8 - 4?", "input": "", "output": "8 - 4 = 4"} | |
| {"instruction": "Napiš SQL: vyber 16 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 16;\n```"} | |
| {"instruction": "Spočítej: 17 + 10 = ?", "input": "", "output": "17 + 10 = 27"} | |
| {"instruction": "Spočítej: 26 + 4 = ?", "input": "", "output": "26 + 4 = 30"} | |
| {"instruction": "Kolik je 20 × 5?", "input": "", "output": "20 × 5 = 100"} | |
| {"instruction": "Napiš v Pythonu reverse string.", "input": "", "output": "```python\ndef rev(s: str) -> str:\n return s[::-1]\n```"} | |
| {"instruction": "Kolik je 23 - 11?", "input": "", "output": "23 - 11 = 12"} | |
| {"instruction": "Vysvětli Python?", "input": "", "output": "Python je vysokoúrovňový programovací jazyk s jednoduchou syntaxí. Hodí se na web, data, skripty i AI."} | |
| {"instruction": "Kolik je 24 - 14?", "input": "", "output": "24 - 14 = 10"} | |
| {"instruction": "Translate to English: Jak nainstaluju balíčky?", "input": "", "output": "How do I install packages?"} | |
| {"instruction": "Potřebuju Python helper `to_upper`: převod na velká písmena.", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} | |
| {"instruction": "Napiš SQL: vyber 19 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 19;\n```"} | |
| {"instruction": "Kolik je 20 × 8?", "input": "", "output": "20 × 8 = 160"} | |
| {"instruction": "Write a Python function `last_n` that vrátí posledních n prvků.", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} | |
| {"instruction": "Oprav bug: `for i in range(len(items)): print(items[i+1])`", "input": "", "output": "Padá na IndexError u posledního prvku. Možnosti:\n```python\nfor i in range(len(items) - 1):\n print(items[i + 1])\n# nebo\nfor a, b in zip(items, items[1:]):\n print(b)\n```"} | |
| {"instruction": "Hello tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Spočítej: 22 + 11 = ?", "input": "", "output": "22 + 11 = 33"} | |
| {"instruction": "Kolik je 8 × 14?", "input": "", "output": "8 × 14 = 112"} | |
| {"instruction": "Kolik je 10 - 8?", "input": "", "output": "10 - 8 = 2"} | |
| {"instruction": "Kolik je 21 - 9?", "input": "", "output": "21 - 9 = 12"} | |
| {"instruction": "Spočítej: 3 + 9 = ?", "input": "", "output": "3 + 9 = 12"} | |
| {"instruction": "Co je framework? (stručně)", "input": "", "output": "Framework je připravená kostra aplikace s pravidly a nástroji (Django, React, Spring)."} | |
| {"instruction": "Hey tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "říkej pořád jak se jmenuješ", "input": "", "output": "Stačí se zeptat na jméno, když to potřebuješ. Jinak jdu rovnou k úkolu. Co řešíme?"} | |
| {"instruction": "Ahoj!", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Napiš FastAPI CRUD kostru pro poznámky (in-memory). Komentáře piš česky.", "input": "", "output": "```python\nfrom fastapi import FastAPI, HTTPException\nfrom pydantic import BaseModel\n\napp = FastAPI()\nDB: dict[int, dict] = {}\n_seq = 0\n\nclass NoteIn(BaseModel):\n text: str\n\n@app.get(\"/notes\")\ndef list_notes():\n return list(DB.values())\n\n@app.post(\"/notes\")\ndef create_note(body: NoteIn):\n global _seq\n _seq += 1\n DB[_seq] = {\"id\": _seq, \"text\": body.text}\n return DB[_seq]\n\n@app.get(\"/notes/{note_id}\")\ndef get_note(note_id: int):\n if note_id not in DB:\n raise HTTPException(404)\n return DB[note_id]\n```"} | |
| {"instruction": "Kolik je 4 × 14?", "input": "", "output": "4 × 14 = 56"} | |
| {"instruction": "Kolik je 27 - 7?", "input": "", "output": "27 - 7 = 20"} | |
| {"instruction": "Jen česky: k čemu je pip?", "input": "", "output": "pip je správce balíčků pro Python — instaluje knihovny z PyPI (`pip install název`)."} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..20.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 20}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Odpovídej jen česky. Co je smyčka while?", "input": "", "output": "While opakuje blok, dokud platí podmínka. Hodí se, když neznáš předem počet opakování."} | |
| {"instruction": "Spočítej: 4 + 8 = ?", "input": "", "output": "4 + 8 = 12"} | |
| {"instruction": "Kolik je 14 - 10?", "input": "", "output": "14 - 10 = 4"} | |
| {"instruction": "Kolik je 17 - 13?", "input": "", "output": "17 - 13 = 4"} | |
| {"instruction": "Kolik je 29 - 3?", "input": "", "output": "29 - 3 = 26"} | |
| {"instruction": "hello", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Vysvětli pojem CI/CD česky a stručně.", "input": "", "output": "CI automaticky testuje a buildí při změně kódu. CD automaticky nasazuje (nebo připravuje nasazení) po úspěšném CI."} | |
| {"instruction": "Spočítej: 24 + 12 = ?", "input": "", "output": "24 + 12 = 36"} | |
| {"instruction": "Kolik je 21 - 7?", "input": "", "output": "21 - 7 = 14"} | |
| {"instruction": "Kolik je 16 - 6?", "input": "", "output": "16 - 6 = 10"} | |
| {"instruction": "Spočítej: 2 + 4 = ?", "input": "", "output": "2 + 4 = 6"} | |
| {"instruction": "Kolik je 18 × 9?", "input": "", "output": "18 × 9 = 162"} | |
| {"instruction": "Kolik je 24 × 6?", "input": "", "output": "24 × 6 = 144"} | |
| {"instruction": "Zdravím", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Spočítej: 18 + 6 = ?", "input": "", "output": "18 + 6 = 24"} | |
| {"instruction": "Spočítej: 27 + 3 = ?", "input": "", "output": "27 + 3 = 30"} | |
| {"instruction": "Kolik je 17 - 7?", "input": "", "output": "17 - 7 = 10"} | |
| {"instruction": "Spočítej: 27 + 6 = ?", "input": "", "output": "27 + 6 = 33"} | |
| {"instruction": "Napiš funkci v Pythonu: safe get nested dict.", "input": "", "output": "```python\ndef dig(d, *keys, default=None):\n cur = d\n for k in keys:\n if not isinstance(cur, dict) or k not in cur:\n return default\n cur = cur[k]\n return cur\n```"} | |
| {"instruction": "Kolik je 2 × 7?", "input": "", "output": "2 × 7 = 14"} | |
| {"instruction": "Napiš v Pythonu safe get nested dict.", "input": "", "output": "```python\ndef dig(d, *keys, default=None):\n cur = d\n for k in keys:\n if not isinstance(cur, dict) or k not in cur:\n return default\n cur = cur[k]\n return cur\n```"} | |
| {"instruction": "Kolik je 25 - 11?", "input": "", "output": "25 - 11 = 14"} | |
| {"instruction": "Kolik je 26 - 8?", "input": "", "output": "26 - 8 = 18"} | |
| {"instruction": "Kolik je 13 - 9?", "input": "", "output": "13 - 9 = 4"} | |
| {"instruction": "CORS error v prohlížeči při volání API. Co dělat?", "input": "", "output": "Prohlížeč blokuje cross-origin request. Na backendu nastav CORS (např. FastAPI `CORSMiddleware`) s povoleným origin frontendu, nebo proxy přes stejnou doménu."} | |
| {"instruction": "Kolik je 19 - 13?", "input": "", "output": "19 - 13 = 6"} | |
| {"instruction": "Kolik je 12 × 8?", "input": "", "output": "12 × 8 = 96"} | |
| {"instruction": "Kolik je 14 × 7?", "input": "", "output": "14 × 7 = 98"} | |
| {"instruction": "Kolik je 10 × 6?", "input": "", "output": "10 × 6 = 60"} | |
| {"instruction": "Spočítej: 2 + 7 = ?", "input": "", "output": "2 + 7 = 9"} | |
| {"instruction": "Spočítej: 24 + 6 = ?", "input": "", "output": "24 + 6 = 30"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..12.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 12}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Kolik je 4 × 7?", "input": "", "output": "4 × 7 = 28"} | |
| {"instruction": "Kolik je 8 - 2?", "input": "", "output": "8 - 2 = 6"} | |
| {"instruction": "Kolik je 2 × 10?", "input": "", "output": "2 × 10 = 20"} | |
| {"instruction": "Write a Python function `count_vowels` that spočítej samohlásky v textu.", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} | |
| {"instruction": "Napiš skript, který spočítá řádky ve všech .py souborech ve složce. Komentáře piš česky.", "input": "", "output": "```python\nfrom pathlib import Path\n\ndef count_py_lines(root: str = \".\") -> int:\n total = 0\n for p in Path(root).rglob(\"*.py\"):\n total += sum(1 for _ in p.open(encoding=\"utf-8\", errors=\"ignore\"))\n return total\n\nif __name__ == \"__main__\":\n print(count_py_lines())\n```"} | |
| {"instruction": "Implementuj v Pythonu chunk list.", "input": "", "output": "```python\ndef chunked(xs, n):\n return [xs[i:i+n] for i in range(0, len(xs), n)]\n```"} | |
| {"instruction": "Kolik je 25 - 5?", "input": "", "output": "25 - 5 = 20"} | |
| {"instruction": "Spočítej: 16 + 11 = ?", "input": "", "output": "16 + 11 = 27"} | |
| {"instruction": "Kolik je 8 × 6?", "input": "", "output": "8 × 6 = 48"} | |
| {"instruction": "Spočítej: 26 + 7 = ?", "input": "", "output": "26 + 7 = 33"} | |
| {"instruction": "Napiš Python decorator @timer, který změří běh funkce.", "input": "", "output": "```python\nimport time\nfrom functools import wraps\n\ndef timer(fn):\n @wraps(fn)\n def wrapper(*args, **kwargs):\n t0 = time.perf_counter()\n try:\n return fn(*args, **kwargs)\n finally:\n dt = time.perf_counter() - t0\n print(f\"{fn.__name__} took {dt:.3f}s\")\n return wrapper\n```"} | |
| {"instruction": "Jaké je dnes datum?", "input": "", "output": "Aktuální datum na tvém zařízení nevidím. Najdeš ho v systémovém kalendáři."} | |
| {"instruction": "Kolik je 14 × 11?", "input": "", "output": "14 × 11 = 154"} | |
| {"instruction": "Kolik je 20 - 2?", "input": "", "output": "20 - 2 = 18"} | |
| {"instruction": "Kolik je 16 - 14?", "input": "", "output": "16 - 14 = 2"} | |
| {"instruction": "Potřebuju Python helper `is_even`: vrátí True pokud je sudé.", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} | |
| {"instruction": "Implement `first_n` in Python (vrátí prvních n prvků).", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} | |
| {"instruction": "nesedí to", "input": "", "output": "OK, ladíme. Pošli chybovou hlášku / očekávané vs skutečné chování a kousek kódu."} | |
| {"instruction": "Napiš Python funkci, která spočítá faktoriál.", "input": "", "output": "```python\ndef factorial(n: int) -> int:\n if n < 0:\n raise ValueError(\"n musí být >= 0\")\n result = 1\n for i in range(2, n + 1):\n result *= i\n return result\n```"} | |
| {"instruction": "Co je latency? (stručně)", "input": "", "output": "Latence je zpoždění — jak dlouho trvá, než přijde odpověď."} | |
| {"instruction": "can u speak czech?", "input": "", "output": "Ano, umím česky. Můžu odpovídat jen česky."} | |
| {"instruction": "Přepiš spisovně: zitra bude hezky", "input": "", "output": "Zítra bude hezky."} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..19.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 19}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Spočítej: 10 + 2 = ?", "input": "", "output": "10 + 2 = 12"} | |
| {"instruction": "Kolik je 28 × 2?", "input": "", "output": "28 × 2 = 56"} | |
| {"instruction": "Co je algoritmus? (stručně)", "input": "", "output": "Algoritmus je přesný postup kroků k vyřešení úlohy."} | |
| {"instruction": "Napiš SQL: vyber 14 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 14;\n```"} | |
| {"instruction": "Vysvětli funkce?", "input": "", "output": "Funkce je pojmenovaný blok kódu, který bere vstupy a vrací výsledek. Umožňuje znovupoužití logiky."} | |
| {"instruction": "Kolik je 19 - 5?", "input": "", "output": "19 - 5 = 14"} | |
| {"instruction": "Co je cache?", "input": "", "output": "Cache dočasně ukládá výsledky, aby se nemusely počítat/stahovat znovu."} | |
| {"instruction": "Ukaž čistý Python kód: flatten nested list one level.", "input": "", "output": "```python\ndef flatten(xs):\n out = []\n for x in xs:\n if isinstance(x, list):\n out.extend(x)\n else:\n out.append(x)\n return out\n```"} | |
| {"instruction": "Napiš řešení v Pythonu: Best time to buy/sell stock once.", "input": "", "output": "```python\ndef max_profit(prices: list[int]) -> int:\n best = 0\n lo = prices[0]\n for p in prices[1:]:\n best = max(best, p - lo)\n lo = min(lo, p)\n return best\n```"} | |
| {"instruction": "Spočítej: 16 + 8 = ?", "input": "", "output": "16 + 8 = 24"} | |
| {"instruction": "Implementuj `strip_ws` v Pythonu — odstraní whitespace.", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} | |
| {"instruction": "Spočítej: 18 + 3 = ?", "input": "", "output": "18 + 3 = 21"} | |
| {"instruction": "Spočítej: 8 + 10 = ?", "input": "", "output": "8 + 10 = 18"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..13.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 13}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Ukaž čistý kód: spočítej průměr. Pojmenuj funkci `avg_list`.", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} | |
| {"instruction": "Spočítej: 20 + 10 = ?", "input": "", "output": "20 + 10 = 30"} | |
| {"instruction": "Dobrý den!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Spočítej: 21 + 12 = ?", "input": "", "output": "21 + 12 = 33"} | |
| {"instruction": "Implement `avg_list` in Python (spočítej průměr).", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} | |
| {"instruction": "Kolik je 16 - 10?", "input": "", "output": "16 - 10 = 6"} | |
| {"instruction": "Přepiš spisovně: prisel jsem pozde", "input": "", "output": "Přišel jsem pozdě."} | |
| {"instruction": "Vysvětli terminál?", "input": "", "output": "Terminál je textové rozhraní pro spouštění příkazů v systému."} | |
| {"instruction": "Potřebuju Python helper `count_vowels`: spočítej samohlásky v textu.", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} | |
| {"instruction": "Kolik je 8 × 4?", "input": "", "output": "8 × 4 = 32"} | |
| {"instruction": "Ahoj tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Spočítej: 25 + 8 = ?", "input": "", "output": "25 + 8 = 33"} | |
| {"instruction": "Kolik je 19 - 7?", "input": "", "output": "19 - 7 = 12"} | |
| {"instruction": "Kolik je 22 - 10?", "input": "", "output": "22 - 10 = 12"} | |
| {"instruction": "Vysvětli pojem GIL česky a stručně.", "input": "", "output": "GIL (Global Interpreter Lock) v CPythonu brání běhu více bytecode vláken najednou v jednom procesu. Pro CPU-bound paralelismus spíš multiprocessing nebo jiný runtime; pro I/O stačí threading/async."} | |
| {"instruction": "Kolik je 24 × 5?", "input": "", "output": "24 × 5 = 120"} | |
| {"instruction": "Kolik je 9 - 5?", "input": "", "output": "9 - 5 = 4"} | |
| {"instruction": "Zdravím tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Kolik je 14 × 2?", "input": "", "output": "14 × 2 = 28"} | |
| {"instruction": "Napiš v Pythonu chunk list.", "input": "", "output": "```python\ndef chunked(xs, n):\n return [xs[i:i+n] for i in range(0, len(xs), n)]\n```"} | |
| {"instruction": "Čau", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Vysvětli HTTP status 404 a 500.", "input": "", "output": "404 Not Found = zdroj neexistuje. 500 Internal Server Error = chyba na serveru (bug, pád, špatná konfigurace)."} | |
| {"instruction": "Kolik je 26 × 2?", "input": "", "output": "26 × 2 = 52"} | |
| {"instruction": "Napiš Python funkci: prohodí klíče a hodnoty (unikátní) (`invert_dict`).", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} | |
| {"instruction": "Vysvětli proměnná?", "input": "", "output": "Proměnná je pojmenované místo pro hodnotu v paměti, např. `x = 10`."} | |
| {"instruction": "kolik je 2+2?", "input": "", "output": "2 + 2 = 4."} | |
| {"instruction": "Kolik je 21 - 11?", "input": "", "output": "21 - 11 = 10"} | |
| {"instruction": "Čau!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Přepiš spisovně: mel bych jit domu", "input": "", "output": "Měl bych jít domů."} | |
| {"instruction": "Kolik je 27 - 5?", "input": "", "output": "27 - 5 = 22"} | |
| {"instruction": "Kolik je 8 × 3?", "input": "", "output": "8 × 3 = 24"} | |
| {"instruction": "Spočítej: 29 + 13 = ?", "input": "", "output": "29 + 13 = 42"} | |
| {"instruction": "Kolik je 4 × 4?", "input": "", "output": "4 × 4 = 16"} | |
| {"instruction": "Kolik je 25 - 7?", "input": "", "output": "25 - 7 = 18"} | |
| {"instruction": "Kolik je 22 × 3?", "input": "", "output": "22 × 3 = 66"} | |
| {"instruction": "Kolik je 6 × 4?", "input": "", "output": "6 × 4 = 24"} | |
| {"instruction": "Spočítej: 26 + 10 = ?", "input": "", "output": "26 + 10 = 36"} | |
| {"instruction": "Spočítej: 16 + 5 = ?", "input": "", "output": "16 + 5 = 21"} | |
| {"instruction": "Kolik je 20 - 10?", "input": "", "output": "20 - 10 = 10"} | |
| {"instruction": "Spočítej: 5 + 10 = ?", "input": "", "output": "5 + 10 = 15"} | |
| {"instruction": "Zdravím tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Translate to English: Potřebuju pomoct s bugem.", "input": "", "output": "I need help with a bug."} | |
| {"instruction": "Kolik je 14 × 5?", "input": "", "output": "14 × 5 = 70"} | |
| {"instruction": "Kolik je 26 - 12?", "input": "", "output": "26 - 12 = 14"} | |
| {"instruction": "Co je třída? (stručně)", "input": "", "output": "Třída je šablona pro objekty — definuje data (atributy) a chování (metody)."} | |
| {"instruction": "Co je unit test?", "input": "", "output": "Unit test ověřuje malou část kódu (funkci/metodu) automaticky a opakovatelně."} | |
| {"instruction": "Kolik je 26 × 3?", "input": "", "output": "26 × 3 = 78"} | |
| {"instruction": "Kolik je 6 × 5?", "input": "", "output": "6 × 5 = 30"} | |
| {"instruction": "Python solution: Two Sum: najdi indexy dvou čísel se součtem target.", "input": "", "output": "```python\ndef two_sum(nums: list[int], target: int) -> list[int]:\n seen = {}\n for i, x in enumerate(nums):\n need = target - x\n if need in seen:\n return [seen[need], i]\n seen[x] = i\n raise ValueError(\"nenalezeno\")\n```"} | |
| {"instruction": "Spočítej: 2 + 10 = ?", "input": "", "output": "2 + 10 = 12"} | |
| {"instruction": "Napiš v Pythonu clamp value.", "input": "", "output": "```python\ndef clamp(x, lo, hi):\n return max(lo, min(hi, x))\n```"} | |
| {"instruction": "Implement `group_by` in Python (seskupí list dictů podle klíče).", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} | |
| {"instruction": "Spočítej: 15 + 3 = ?", "input": "", "output": "15 + 3 = 18"} | |
| {"instruction": "Kolik je 26 × 7?", "input": "", "output": "26 × 7 = 182"} | |
| {"instruction": "Vysvětli OOP česky.", "input": "", "output": "Objektově orientované programování modeluje svět jako objekty: třídy definují šablonu, objekty jsou instance. Důležité koncepty: zapouzdření, dědičnost, polymorfismus."} | |
| {"instruction": "Kolik je 6 × 13?", "input": "", "output": "6 × 13 = 78"} | |
| {"instruction": "Kolik je 6 × 2?", "input": "", "output": "6 × 2 = 12"} | |
| {"instruction": "Kolik je 22 × 8?", "input": "", "output": "22 × 8 = 176"} | |
| {"instruction": "Kolik je 10 - 2?", "input": "", "output": "10 - 2 = 8"} | |
| {"instruction": "Kolik je 12 - 4?", "input": "", "output": "12 - 4 = 8"} | |
| {"instruction": "Napiš Python funkci: načte řádky souboru (`read_lines`).", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} | |
| {"instruction": "Napiš async funkci v Pythonu, která stáhne URL pomocí httpx.", "input": "", "output": "```python\nimport httpx\n\nasync def fetch_text(url: str) -> str:\n async with httpx.AsyncClient(timeout=30) as client:\n r = await client.get(url)\n r.raise_for_status()\n return r.text\n```"} | |
| {"instruction": "Vysvětli pojem hash map česky a stručně.", "input": "", "output": "Hash mapa (dict) ukládá klíče přes hash do přihrádek — průměrně O(1) lookup. Klíče musí být hashable (neměnné)."} | |
| {"instruction": "Kolik je 12 × 2?", "input": "", "output": "12 × 2 = 24"} | |
| {"instruction": "Spočítej: 4 + 11 = ?", "input": "", "output": "4 + 11 = 15"} | |
| {"instruction": "Kolik je 9 - 7?", "input": "", "output": "9 - 7 = 2"} | |
| {"instruction": "Potřebuju Python helper `retry`: zavolá fn max n-krát při výjimce.", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} | |
| {"instruction": "Potřebuju Python helper `repeat_str`: zopakuje řetězec n-krát.", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} | |
| {"instruction": "Kolik je 4 × 3?", "input": "", "output": "4 × 3 = 12"} | |
| {"instruction": "Kolik je 18 - 12?", "input": "", "output": "18 - 12 = 6"} | |
| {"instruction": "Kolik je 14 × 4?", "input": "", "output": "14 × 4 = 56"} | |
| {"instruction": "Kolik je 16 × 11?", "input": "", "output": "16 × 11 = 176"} | |
| {"instruction": "Napiš Python funkci: zavolá fn max n-krát při výjimce (`retry`).", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..7.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 7}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Implementuj v Pythonu flatten nested list one level.", "input": "", "output": "```python\ndef flatten(xs):\n out = []\n for x in xs:\n if isinstance(x, list):\n out.extend(x)\n else:\n out.append(x)\n return out\n```"} | |
| {"instruction": "Čau", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Napiš Dockerfile pro jednoduchou Python FastAPI app.", "input": "", "output": "```dockerfile\nFROM python:3.12-slim\nWORKDIR /app\nCOPY requirements.txt .\nRUN pip install --no-cache-dir -r requirements.txt\nCOPY . .\nCMD [\"uvicorn\", \"main:app\", \"--host\", \"0.0.0.0\", \"--port\", \"8000\"]\n```"} | |
| {"instruction": "Spočítej: 27 + 12 = ?", "input": "", "output": "27 + 12 = 39"} | |
| {"instruction": "Kolik je 18 - 6?", "input": "", "output": "18 - 6 = 12"} | |
| {"instruction": "Kolik je 24 × 4?", "input": "", "output": "24 × 4 = 96"} | |
| {"instruction": "Spočítej: 19 + 2 = ?", "input": "", "output": "19 + 2 = 21"} | |
| {"instruction": "Kolik je 24 × 2?", "input": "", "output": "24 × 2 = 48"} | |
| {"instruction": "Spočítej: 12 + 3 = ?", "input": "", "output": "12 + 3 = 15"} | |
| {"instruction": "Implementuj `repeat_str` v Pythonu — zopakuje řetězec n-krát.", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} | |
| {"instruction": "Proč tento kód padá?\n```python\nx = 1\nif x = 1: print('ok')\n```", "input": "", "output": "Použij porovnání `==`: `if x == 1: print('ok')`."} | |
| {"instruction": "Napiš v Pythonu fibonacci iterative.", "input": "", "output": "```python\ndef fib(n: int) -> int:\n if n < 0:\n raise ValueError\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a + b\n return a\n```"} | |
| {"instruction": "Zdravím!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Vysvětli knihovna?", "input": "", "output": "Knihovna je sada funkcí/modulů, které použiješ ve svém kódu (requests, numpy)."} | |
| {"instruction": "Kolik je 14 - 12?", "input": "", "output": "14 - 12 = 2"} | |
| {"instruction": "Spočítej: 14 + 10 = ?", "input": "", "output": "14 + 10 = 24"} | |
| {"instruction": "Napiš Python funkci, která spočítá součet sudých čísel v seznamu.", "input": "", "output": "```python\ndef sum_even(nums: list[int]) -> int:\n return sum(x for x in nums if x % 2 == 0)\n```"} | |
| {"instruction": "Ahoj", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Kolik je 25 - 9?", "input": "", "output": "25 - 9 = 16"} | |
| {"instruction": "Kolik je 17 - 9?", "input": "", "output": "17 - 9 = 8"} | |
| {"instruction": "Napiš mini CLI TODO v Pythonu (add/list) v paměti.", "input": "", "output": "```python\nclass Todo:\n def __init__(self):\n self.items = []\n def add(self, title: str) -> None:\n self.items.append({\"title\": title, \"done\": False})\n def list(self) -> None:\n for i, it in enumerate(self.items, 1):\n mark = \"x\" if it[\"done\"] else \" \"\n print(f\"{i}. [{mark}] {it['title']}\")\n\nif __name__ == \"__main__\":\n t = Todo()\n t.add(\"Naučit se Python\")\n t.add(\"Napsat testy\")\n t.list()\n```"} | |
| {"instruction": "Spočítej: 9 + 9 = ?", "input": "", "output": "9 + 9 = 18"} | |
| {"instruction": "Napiš SQL: vyber 13 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 13;\n```"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..10.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 10}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Python solution: Best time to buy/sell stock once.", "input": "", "output": "```python\ndef max_profit(prices: list[int]) -> int:\n best = 0\n lo = prices[0]\n for p in prices[1:]:\n best = max(best, p - lo)\n lo = min(lo, p)\n return best\n```"} | |
| {"instruction": "Implementuj v Pythonu clamp value.", "input": "", "output": "```python\ndef clamp(x, lo, hi):\n return max(lo, min(hi, x))\n```"} | |
| {"instruction": "Potřebuju Python helper `first_n`: vrátí prvních n prvků.", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} | |
| {"instruction": "Potřebuju Python helper `dict_keys`: seřadí klíče slovníku.", "input": "", "output": "```python\ndef sorted_keys(d: dict) -> list:\n return sorted(d.keys())\n```"} | |
| {"instruction": "Spočítej: 23 + 4 = ?", "input": "", "output": "23 + 4 = 27"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..2.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 2}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Proč tento kód padá?\n```python\nprint 'hello'\n```", "input": "", "output": "V Pythonu 3 musíš volat funkci: `print('hello')`."} | |
| {"instruction": "Kolik je 29 - 7?", "input": "", "output": "29 - 7 = 22"} | |
| {"instruction": "Oprav pravopis: Dneska jdu do skoly nakupit rohliki.", "input": "", "output": "Dneska jdu do školy nakoupit rohlíky."} | |
| {"instruction": "Dobrý den tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Spočítej: 5 + 13 = ?", "input": "", "output": "5 + 13 = 18"} | |
| {"instruction": "umíš česky?", "input": "", "output": "Ano, umím česky. Můžeme psát jen česky, pokud chceš."} | |
| {"instruction": "Čau tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Spočítej: 4 + 5 = ?", "input": "", "output": "4 + 5 = 9"} | |
| {"instruction": "Kolik je 28 × 3?", "input": "", "output": "28 × 3 = 84"} | |
| {"instruction": "Přelož do češtiny: How do I install packages?", "input": "", "output": "Jak nainstaluju balíčky?"} | |
| {"instruction": "Kolik je 16 × 2?", "input": "", "output": "16 × 2 = 32"} | |
| {"instruction": "Co je API? (stručně)", "input": "", "output": "API je rozhraní, přes které spolu programy komunikují — často přes HTTP a JSON."} | |
| {"instruction": "Kolik je 12 × 3?", "input": "", "output": "12 × 3 = 36"} | |
| {"instruction": "Implement `last_n` in Python (vrátí posledních n prvků).", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} | |
| {"instruction": "Spočítej: 16 + 2 = ?", "input": "", "output": "16 + 2 = 18"} | |
| {"instruction": "Co je open source?", "input": "", "output": "Open source znamená, že je dostupný zdrojový kód a licence dovoluje studium i úpravy."} | |
| {"instruction": "jsi kokot?", "input": "", "output": "Ne. Pojďme k věci — s čím pomoct?"} | |
| {"instruction": "Spočítej: 11 + 7 = ?", "input": "", "output": "11 + 7 = 18"} | |
| {"instruction": "Translate to English: Vytvoř novou větev.", "input": "", "output": "Create a new branch."} | |
| {"instruction": "Kolik je 4 × 13?", "input": "", "output": "4 × 13 = 52"} | |
| {"instruction": "Napiš Python funkci: vrátí posledních n prvků (`last_n`).", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} | |
| {"instruction": "Explain what a REST API is in 2 sentences.", "input": "", "output": "A REST API exposes resources via URLs and standard HTTP methods like GET and POST. Clients exchange data (often JSON) in a stateless way."} | |
| {"instruction": "Vysvětli list comprehension a dej příklad s filtrováním sudých.", "input": "", "output": "List comprehension zkracuje for+append do jedné řádky:\n```python\nevens = [x for x in range(10) if x % 2 == 0]\n# [0, 2, 4, 6, 8]\n```"} | |
| {"instruction": "Kolik je 18 × 7?", "input": "", "output": "18 × 7 = 126"} | |
| {"instruction": "Napiš SQL: vyber 2 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 2;\n```"} | |
| {"instruction": "Dobrý den tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Napiš SQL: vyber 15 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 15;\n```"} | |
| {"instruction": "Write a Python function to check prime numbers.", "input": "", "output": "```python\ndef is_prime(n: int) -> bool:\n if n < 2:\n return False\n if n % 2 == 0:\n return n == 2\n i = 3\n while i * i <= n:\n if n % i == 0:\n return False\n i += 2\n return True\n```"} | |
| {"instruction": "Vysvětli unit test?", "input": "", "output": "Unit test ověřuje malou část kódu (funkci/metodu) automaticky a opakovatelně."} | |
| {"instruction": "Kolik je 13 - 11?", "input": "", "output": "13 - 11 = 2"} | |
| {"instruction": "Ahoj!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Kolik je 24 - 12?", "input": "", "output": "24 - 12 = 12"} | |
| {"instruction": "Spočítej: 15 + 12 = ?", "input": "", "output": "15 + 12 = 27"} | |
| {"instruction": "Čau", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Kolik je 23 - 9?", "input": "", "output": "23 - 9 = 14"} | |
| {"instruction": "Kolik je 10 × 5?", "input": "", "output": "10 × 5 = 50"} | |
| {"instruction": "Spočítej: 3 + 6 = ?", "input": "", "output": "3 + 6 = 9"} | |
| {"instruction": "Proč tento kód padá?\n```python\nxs = [1,2,3]\nfor i in range(4): print(xs[i])\n```", "input": "", "output": "Index 3 neexistuje. `range(len(xs))` nebo iteruj `for x in xs`."} | |
| {"instruction": "Jak se máš?", "input": "", "output": "Funguju v pohodě, díky. Co potřebuješ vyřešit?"} | |
| {"instruction": "Kolik je 8 × 12?", "input": "", "output": "8 × 12 = 96"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..11.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 11}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Napiš funkci merge_sorted(a, b) — sloučení dvou seřazených seznamů.", "input": "", "output": "```python\ndef merge_sorted(a: list[int], b: list[int]) -> list[int]:\n i = j = 0\n out = []\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n out.append(a[i]); i += 1\n else:\n out.append(b[j]); j += 1\n out.extend(a[i:])\n out.extend(b[j:])\n return out\n```"} | |
| {"instruction": "Spočítej: 20 + 7 = ?", "input": "", "output": "20 + 7 = 27"} | |
| {"instruction": "Kolik je 18 - 14?", "input": "", "output": "18 - 14 = 4"} | |
| {"instruction": "Napiš TypeScript typ User s id, name, email?.", "input": "", "output": "```typescript\ntype User = {\n id: number;\n name: string;\n email?: string;\n};\n```"} | |
| {"instruction": "Kolik je 26 - 10?", "input": "", "output": "26 - 10 = 16"} | |
| {"instruction": "Implementuj `first_n` v Pythonu — vrátí prvních n prvků.", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} | |
| {"instruction": "Kolik je 8 × 10?", "input": "", "output": "8 × 10 = 80"} | |
| {"instruction": "Spočítej: 28 + 8 = ?", "input": "", "output": "28 + 8 = 36"} | |
| {"instruction": "Napiš SQL: vyber 4 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 4;\n```"} | |
| {"instruction": "Kolik je 18 × 2?", "input": "", "output": "18 × 2 = 36"} | |
| {"instruction": "napiš hello world v pythonu", "input": "", "output": "```python\nprint(\"Hello, world!\")\n```"} | |
| {"instruction": "Kolik je 18 × 4?", "input": "", "output": "18 × 4 = 72"} | |
| {"instruction": "Kolik je 2 × 2?", "input": "", "output": "2 × 2 = 4"} | |
| {"instruction": "Oprav kód:\n```python\nimport json\njson.loads(\"{a:1}\")\n```", "input": "", "output": "JSON vyžaduje uvozovky u klíčů: `json.loads('{\"a\": 1}')`.\n\nOpravená verze podle vysvětlení výše."} | |
| {"instruction": "Vysvětli pojem big O česky a stručně.", "input": "", "output": "Big O popisuje, jak roste čas/paměť s velikostí vstupu. O(1) konstantní, O(n) lineární, O(n log n) typicky dobré řazení, O(n²) vnořené smyčky."} | |
| {"instruction": "Jak načtu JSON soubor v Pythonu?", "input": "", "output": "```python\nimport json\nwith open(\"data.json\", encoding=\"utf-8\") as f:\n data = json.load(f)\n```"} | |
| {"instruction": "Napiš Python funkci: zopakuje řetězec n-krát (`repeat_str`).", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} | |
| {"instruction": "zdravím", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Kolik je 8 × 7?", "input": "", "output": "8 × 7 = 56"} | |
| {"instruction": "Kolik je 28 × 5?", "input": "", "output": "28 × 5 = 140"} | |
| {"instruction": "Implementuj `last_n` v Pythonu — vrátí posledních n prvků.", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} | |
| {"instruction": "Napiš krátký e-mail česky: omluvím se za zpoždění.", "input": "", "output": "Předmět: Omluva za zpoždění\n\nDobrý den,\nomlouvám se za zpoždění s odpovědí/dodáním. Doplním to co nejdříve.\n\nS pozdravem"} | |
| {"instruction": "hey", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Kolik je 2 × 6?", "input": "", "output": "2 × 6 = 12"} | |
| {"instruction": "Spočítej: 25 + 2 = ?", "input": "", "output": "25 + 2 = 27"} | |
| {"instruction": "Spočítej: 14 + 7 = ?", "input": "", "output": "14 + 7 = 21"} | |
| {"instruction": "Spočítej: 29 + 4 = ?", "input": "", "output": "29 + 4 = 33"} | |
| {"instruction": "Kolik je 22 × 6?", "input": "", "output": "22 × 6 = 132"} | |
| {"instruction": "Kolik je 10 × 2?", "input": "", "output": "10 × 2 = 20"} | |
| {"instruction": "Napiš SQL: všichni uživatelé starší 18 let.", "input": "", "output": "```sql\nSELECT * FROM users WHERE age > 18;\n```"} | |
| {"instruction": "Čau! tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Kolik je 10 - 6?", "input": "", "output": "10 - 6 = 4"} | |
| {"instruction": "Spočítej: 24 + 9 = ?", "input": "", "output": "24 + 9 = 33"} | |
| {"instruction": "Implement `sum_list` in Python (sečte čísla v seznamu).", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} | |
| {"instruction": "Napiš SQL: vyber 10 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 10;\n```"} | |
| {"instruction": "Přepiš spisovně: napsal jsem kod", "input": "", "output": "Napsal jsem kód."} | |
| {"instruction": "dobrý den", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Co je Python?", "input": "", "output": "Python je vysokoúrovňový programovací jazyk s jednoduchou syntaxí. Hodí se na web, data, skripty i AI."} | |
| {"instruction": "Kolik je 22 - 4?", "input": "", "output": "22 - 4 = 18"} | |
| {"instruction": "Implement `dict_keys` in Python (seřadí klíče slovníku).", "input": "", "output": "```python\ndef sorted_keys(d: dict) -> list:\n return sorted(d.keys())\n```"} | |
| {"instruction": "Spočítej: 9 + 12 = ?", "input": "", "output": "9 + 12 = 21"} | |
| {"instruction": "Spočítej: 22 + 8 = ?", "input": "", "output": "22 + 8 = 30"} | |
| {"instruction": "Ahoj", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Kolik je 29 - 5?", "input": "", "output": "29 - 5 = 24"} | |
| {"instruction": "Shrň v 2 větách, co je umělá inteligence.", "input": "", "output": "Umělá inteligence jsou systémy, které se učí vzory z dat a řeší úlohy jako text, obraz nebo rozhodování. Dnes často běží na neuronových sítích trénovaných na velkých korpusech."} | |
| {"instruction": "Ahoj tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Jaké je počasí?", "input": "", "output": "Počasí v reálném čase nemám. Zkus meteo.cz, yr.no nebo předpověď v telefonu."} | |
| {"instruction": "Napiš unit test (pytest) pro funkci add(a,b).", "input": "", "output": "```python\nfrom mymodule import add\n\ndef test_add_positive():\n assert add(2, 3) == 5\n\ndef test_add_zero():\n assert add(0, 0) == 0\n```"} | |
| {"instruction": "Spočítej: 17 + 13 = ?", "input": "", "output": "17 + 13 = 30"} | |
| {"instruction": "Čau, co děláš?", "input": "", "output": "Ahoj! Jsem připravený pomoct — s kódem, češtinou, vysvětlením nebo čímkoli dalším."} | |
| {"instruction": "Hello!", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Kolik je 15 - 11?", "input": "", "output": "15 - 11 = 4"} | |
| {"instruction": "Kolik je 4 × 11?", "input": "", "output": "4 × 11 = 44"} | |
| {"instruction": "Ahoj! tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Kolik je 24 × 7?", "input": "", "output": "24 × 7 = 168"} | |
| {"instruction": "Co je latency?", "input": "", "output": "Latence je zpoždění — jak dlouho trvá, než přijde odpověď."} | |
| {"instruction": "Čau! tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Hello", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "pokračuj", "input": "", "output": "Jasně — v čem mám pokračovat? Doplň prosím kontext (kód/úkol)."} | |
| {"instruction": "Implementuj `write_text` v Pythonu — zapíše text do souboru.", "input": "", "output": "```python\ndef write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n```"} | |
| {"instruction": "Kolik je 12 × 7?", "input": "", "output": "12 × 7 = 84"} | |
| {"instruction": "Co je knihovna?", "input": "", "output": "Knihovna je sada funkcí/modulů, které použiješ ve svém kódu (requests, numpy)."} | |
| {"instruction": "Přelož do češtiny: The server is down.", "input": "", "output": "Server neběží / je vypnutý."} | |
| {"instruction": "Napiš SQL: vyber 9 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 9;\n```"} | |
| {"instruction": "Odpověz pouze česky, stručně: barvy české vlajky?", "input": "", "output": "Česká vlajka má bílou, červenou a modrou."} | |
| {"instruction": "Spočítej: 3 + 3 = ?", "input": "", "output": "3 + 3 = 6"} | |
| {"instruction": "Write a Python function `retry` that zavolá fn max n-krát při výjimce.", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} | |
| {"instruction": "Kolik je 28 - 4?", "input": "", "output": "28 - 4 = 24"} | |
| {"instruction": "Čau! tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Kolik je 11 - 5?", "input": "", "output": "11 - 5 = 6"} | |
| {"instruction": "Ukaž čistý Python kód: bubble sort.", "input": "", "output": "```python\ndef bubble_sort(a: list[int]) -> list[int]:\n a = a[:]\n n = len(a)\n for i in range(n):\n for j in range(0, n - i - 1):\n if a[j] > a[j + 1]:\n a[j], a[j + 1] = a[j + 1], a[j]\n return a\n```"} | |
| {"instruction": "Co je funkce? (stručně)", "input": "", "output": "Funkce je pojmenovaný blok kódu, který bere vstupy a vrací výsledek."} | |
| {"instruction": "Dobrý den tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "thx", "input": "", "output": "Anytime."} | |
| {"instruction": "Co je cache? (stručně)", "input": "", "output": "Cache dočasně ukládá výsledky, aby se nemusely počítat/stahovat znovu."} | |
| {"instruction": "Vysvětli API?", "input": "", "output": "API je rozhraní, přes které spolu programy komunikují — často přes HTTP a JSON."} | |
| {"instruction": "Ukaž čistý kód: zapíše text do souboru. Pojmenuj funkci `write_text`.", "input": "", "output": "```python\ndef write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n```"} | |
| {"instruction": "Kolik je 12 - 8?", "input": "", "output": "12 - 8 = 4"} | |
| {"instruction": "ahoj", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Napiš Python funkci: seřadí klíče slovníku (`dict_keys`).", "input": "", "output": "```python\ndef sorted_keys(d: dict) -> list:\n return sorted(d.keys())\n```"} | |
| {"instruction": "Kolik je 25 - 3?", "input": "", "output": "25 - 3 = 22"} | |
| {"instruction": "Spočítej: 25 + 5 = ?", "input": "", "output": "25 + 5 = 30"} | |
| {"instruction": "Děkuju", "input": "", "output": "Rádo se stalo."} | |
| {"instruction": "Jak se řekne anglicky „prosím“?", "input": "", "output": "„Prosím“ je anglicky „please“. V obchodech „here you go“ odpovídá spíš „tady máš“."} | |
| {"instruction": "Oprav kód:\n```python\nd = {}\nprint(d['a'])\n```", "input": "", "output": "Klíč nemusí existovat — použij `d.get('a')` nebo `if 'a' in d`.\n\nOpravená verze podle vysvětlení výše."} | |
| {"instruction": "Kolik je 17 - 3?", "input": "", "output": "17 - 3 = 14"} | |
| {"instruction": "Co je IDE? (stručně)", "input": "", "output": "IDE je vývojové prostředí s editorem, debuggerem a nástroji (VS Code, PyCharm)."} | |
| {"instruction": "Spočítej: 26 + 13 = ?", "input": "", "output": "26 + 13 = 39"} | |
| {"instruction": "tak mluv česky pouze", "input": "", "output": "Dobře, dál budu odpovídat jen česky. Na co se chceš zeptat?"} | |
| {"instruction": "speak english please", "input": "", "output": "Sure — I can speak English. What do you need?"} | |
| {"instruction": "Kolik je 8 × 8?", "input": "", "output": "8 × 8 = 64"} | |
| {"instruction": "Potřebuju Python helper `strip_ws`: odstraní whitespace.", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} | |
| {"instruction": "Napiš Python funkci: převod na velká písmena (`to_upper`).", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} | |
| {"instruction": "Implementuj `retry` v Pythonu — zavolá fn max n-krát při výjimce.", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} | |
| {"instruction": "Spočítej: 23 + 13 = ?", "input": "", "output": "23 + 13 = 36"} | |
| {"instruction": "Spočítej: 18 + 9 = ?", "input": "", "output": "18 + 9 = 27"} | |
| {"instruction": "Kolik je 2 × 12?", "input": "", "output": "2 × 12 = 24"} | |
| {"instruction": "Spočítej: 19 + 5 = ?", "input": "", "output": "19 + 5 = 24"} | |
| {"instruction": "Spočítej: 8 + 7 = ?", "input": "", "output": "8 + 7 = 15"} | |
| {"instruction": "Implementuj `dict_keys` v Pythonu — seřadí klíče slovníku.", "input": "", "output": "```python\ndef sorted_keys(d: dict) -> list:\n return sorted(d.keys())\n```"} | |
| {"instruction": "Jak funguje for cyklus?", "input": "", "output": "For prochází sekvenci prvek po prvku. V Pythonu: `for x in items: ...`. V C-like jazycích často `for (init; cond; step)`."} | |
| {"instruction": "Kolik je 2 × 9?", "input": "", "output": "2 × 9 = 18"} | |
| {"instruction": "Kolik je 29 - 13?", "input": "", "output": "29 - 13 = 16"} | |
| {"instruction": "Napiš JS funkci debounce(fn, ms).", "input": "", "output": "```javascript\nfunction debounce(fn, ms) {\n let t;\n return (...args) => {\n clearTimeout(t);\n t = setTimeout(() => fn(...args), ms);\n };\n}\n```"} | |
| {"instruction": "Ukaž čistý kód: seřadí klíče slovníku. Pojmenuj funkci `dict_keys`.", "input": "", "output": "```python\ndef sorted_keys(d: dict) -> list:\n return sorted(d.keys())\n```"} | |
| {"instruction": "Napiš SQL: top 5 nejprodávanějších produktů.", "input": "", "output": "```sql\nSELECT product_id, SUM(qty) AS total\nFROM order_items\nGROUP BY product_id\nORDER BY total DESC\nLIMIT 5;\n```"} | |
| {"instruction": "Čau tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Kolik je 14 × 3?", "input": "", "output": "14 × 3 = 42"} | |
| {"instruction": "Hello", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Kolik je 8 × 11?", "input": "", "output": "8 × 11 = 88"} | |
| {"instruction": "Spočítej: 17 + 7 = ?", "input": "", "output": "17 + 7 = 24"} | |
| {"instruction": "Kolik je 22 - 12?", "input": "", "output": "22 - 12 = 10"} | |
| {"instruction": "Vysvětli bug?", "input": "", "output": "Bug je chyba v programu, kvůli které se chová jinak, než autor chtěl."} | |
| {"instruction": "Napiš řešení v Pythonu: Two Sum: najdi indexy dvou čísel se součtem target.", "input": "", "output": "```python\ndef two_sum(nums: list[int], target: int) -> list[int]:\n seen = {}\n for i, x in enumerate(nums):\n need = target - x\n if need in seen:\n return [seen[need], i]\n seen[x] = i\n raise ValueError(\"nenalezeno\")\n```"} | |
| {"instruction": "Kolik je 16 × 9?", "input": "", "output": "16 × 9 = 144"} | |
| {"instruction": "Spočítej: 6 + 9 = ?", "input": "", "output": "6 + 9 = 15"} | |
| {"instruction": "Kolik je 20 - 14?", "input": "", "output": "20 - 14 = 6"} | |
| {"instruction": "Kolik je 4 - 2?", "input": "", "output": "4 - 2 = 2"} | |
| {"instruction": "Kolik je 2 × 11?", "input": "", "output": "2 × 11 = 22"} | |
| {"instruction": "Kolik je 14 × 6?", "input": "", "output": "14 × 6 = 84"} | |
| {"instruction": "Kolik je 26 × 6?", "input": "", "output": "26 × 6 = 156"} | |
| {"instruction": "Kolik je 28 - 12?", "input": "", "output": "28 - 12 = 16"} | |
| {"instruction": "Kolik je 6 × 3?", "input": "", "output": "6 × 3 = 18"} | |
| {"instruction": "Vysvětli open source?", "input": "", "output": "Open source znamená, že je dostupný zdrojový kód a licence dovoluje studium i úpravy."} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..9.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 9}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Oprav češtinu: napsal jsem kod", "input": "", "output": "Napsal jsem kód."} | |
| {"instruction": "Co je refaktoring? (stručně)", "input": "", "output": "Refaktoring vylepšuje strukturu kódu bez změny vnějšího chování."} | |
| {"instruction": "Spočítej: 12 + 12 = ?", "input": "", "output": "12 + 12 = 24"} | |
| {"instruction": "Spočítej: 6 + 6 = ?", "input": "", "output": "6 + 6 = 12"} | |
| {"instruction": "Implementuj `read_lines` v Pythonu — načte řádky souboru.", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} | |
| {"instruction": "Napiš funkci v Pythonu: clamp value.", "input": "", "output": "```python\ndef clamp(x, lo, hi):\n return max(lo, min(hi, x))\n```"} | |
| {"instruction": "Vysvětli cache?", "input": "", "output": "Cache dočasně ukládá výsledky, aby se nemusely počítat/stahovat znovu."} | |
| {"instruction": "Implement `is_even` in Python (vrátí True pokud je sudé).", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} | |
| {"instruction": "Kolik je 16 × 4?", "input": "", "output": "16 × 4 = 64"} | |
| {"instruction": "Ukaž čistý kód: zopakuje řetězec n-krát. Pojmenuj funkci `repeat_str`.", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} | |
| {"instruction": "Spočítej: 7 + 5 = ?", "input": "", "output": "7 + 5 = 12"} | |
| {"instruction": "Kolik je 28 × 4?", "input": "", "output": "28 × 4 = 112"} | |
| {"instruction": "Implementuj v Pythonu fibonacci iterative.", "input": "", "output": "```python\ndef fib(n: int) -> int:\n if n < 0:\n raise ValueError\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a + b\n return a\n```"} | |
| {"instruction": "Kolik je 18 × 5?", "input": "", "output": "18 × 5 = 90"} | |
| {"instruction": "Kolik je 12 × 9?", "input": "", "output": "12 × 9 = 108"} | |
| {"instruction": "Kolik je 20 × 2?", "input": "", "output": "20 × 2 = 40"} | |
| {"instruction": "Kolik je 10 - 4?", "input": "", "output": "10 - 4 = 6"} | |
| {"instruction": "Napiš Python funkci: sečte čísla v seznamu (`sum_list`).", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} | |
| {"instruction": "Co je framework?", "input": "", "output": "Framework je připravená kostra aplikace s pravidly a nástroji (Django, React, Spring)."} | |
| {"instruction": "Vysvětli refaktoring?", "input": "", "output": "Refaktoring vylepšuje strukturu kódu bez změny vnějšího chování."} | |
| {"instruction": "Spočítej: 28 + 5 = ?", "input": "", "output": "28 + 5 = 33"} | |
| {"instruction": "Kolik je 22 × 2?", "input": "", "output": "22 × 2 = 44"} | |
| {"instruction": "Kolik je 10 × 4?", "input": "", "output": "10 × 4 = 40"} | |
| {"instruction": "Ahoj tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Jaký je rozdíl mezi == a === v JavaScriptu?", "input": "", "output": "`==` porovnává s převodem typů, `===` bez převodu (striktní). Preferuj `===`, ať se vyhneš překvapením."} | |
| {"instruction": "Co je HTTP?", "input": "", "output": "HTTP je protokol, kterým si prohlížeč a server posílají webové stránky a API data. Metody: GET (čtení), POST (odeslání), PUT/PATCH (úprava), DELETE (smazání)."} | |
| {"instruction": "Kolik je 12 × 14?", "input": "", "output": "12 × 14 = 168"} | |
| {"instruction": "Kolik je 12 × 12?", "input": "", "output": "12 × 12 = 144"} | |
| {"instruction": "Kolik je 2 × 14?", "input": "", "output": "2 × 14 = 28"} | |
| {"instruction": "Napiš funkci v Pythonu: bubble sort.", "input": "", "output": "```python\ndef bubble_sort(a: list[int]) -> list[int]:\n a = a[:]\n n = len(a)\n for i in range(n):\n for j in range(0, n - i - 1):\n if a[j] > a[j + 1]:\n a[j], a[j + 1] = a[j + 1], a[j]\n return a\n```"} | |
| {"instruction": "Kolik je 11 - 9?", "input": "", "output": "11 - 9 = 2"} | |
| {"instruction": "představ se celou větou a pak mlč", "input": "", "output": "Jsem AI asistent na programování a češtinu. Co potřebuješ?"} | |
| {"instruction": "Vysvětli commit?", "input": "", "output": "Commit je uložený snímek změn v Gitu s popisem, co a proč se změnilo."} | |
| {"instruction": "Kolik je 13 - 3?", "input": "", "output": "13 - 3 = 10"} | |
| {"instruction": "Kolik je 14 × 14?", "input": "", "output": "14 × 14 = 196"} | |
| {"instruction": "Kolik je 8 × 13?", "input": "", "output": "8 × 13 = 104"} | |
| {"instruction": "Ukaž čistý kód: prohodí klíče a hodnoty (unikátní). Pojmenuj funkci `invert_dict`.", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} | |
| {"instruction": "Spočítej: 17 + 4 = ?", "input": "", "output": "17 + 4 = 21"} | |
| {"instruction": "Ukaž čistý Python kód: fibonacci iterative.", "input": "", "output": "```python\ndef fib(n: int) -> int:\n if n < 0:\n raise ValueError\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a + b\n return a\n```"} | |
| {"instruction": "Kolik je 20 × 6?", "input": "", "output": "20 × 6 = 120"} | |
| {"instruction": "Kolik je 26 - 6?", "input": "", "output": "26 - 6 = 20"} | |
| {"instruction": "Napiš Python funkci: seskupí list dictů podle klíče (`group_by`).", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} | |
| {"instruction": "Implement `repeat_str` in Python (zopakuje řetězec n-krát).", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} | |
| {"instruction": "Co je terminál? (stručně)", "input": "", "output": "Terminál je textové rozhraní pro spouštění příkazů v systému."} | |
| {"instruction": "Kolik je 16 × 7?", "input": "", "output": "16 × 7 = 112"} | |
| {"instruction": "Kolik je 10 × 14?", "input": "", "output": "10 × 14 = 140"} | |
| {"instruction": "Ahoj! tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Kolik je 22 - 8?", "input": "", "output": "22 - 8 = 14"} | |
| {"instruction": "Hey tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Spočítej: 2 + 13 = ?", "input": "", "output": "2 + 13 = 15"} | |
| {"instruction": "Jak se v češtině skloňuje slovo „algoritmus“?", "input": "", "output": "1. algoritmus, 2. algoritmu, 3. algoritmu, 4. algoritmus, 5. algoritme, 6. algoritmu, 7. algoritmem. Množné: algoritmy, algoritmů…"} | |
| {"instruction": "Kolik je 24 × 3?", "input": "", "output": "24 × 3 = 72"} | |
| {"instruction": "Napiš Python: context manager pro změnu pracovního adresáře.", "input": "", "output": "```python\nimport os\nfrom contextlib import contextmanager\n\n@contextmanager\ndef cwd(path):\n prev = os.getcwd()\n os.chdir(path)\n try:\n yield\n finally:\n os.chdir(prev)\n```"} | |
| {"instruction": "Spočítej: 16 + 14 = ?", "input": "", "output": "16 + 14 = 30"} | |
| {"instruction": "Napiš SQL: vyber 18 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 18;\n```"} | |
| {"instruction": "Kolik je 4 × 10?", "input": "", "output": "4 × 10 = 40"} | |
| {"instruction": "Potřebuju Python helper `write_text`: zapíše text do souboru.", "input": "", "output": "```python\ndef write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n```"} | |
| {"instruction": "Kolik je 22 × 7?", "input": "", "output": "22 × 7 = 154"} | |
| {"instruction": "Kolik je 14 - 8?", "input": "", "output": "14 - 8 = 6"} | |
| {"instruction": "Kolik je 18 × 10?", "input": "", "output": "18 × 10 = 180"} | |
| {"instruction": "Kolik je 12 × 11?", "input": "", "output": "12 × 11 = 132"} | |
| {"instruction": "Write a Python function `to_upper` that převod na velká písmena.", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} | |
| {"instruction": "Spočítej: 29 + 7 = ?", "input": "", "output": "29 + 7 = 36"} | |
| {"instruction": "Kolik je 8 × 5?", "input": "", "output": "8 × 5 = 40"} | |
| {"instruction": "Napiš Python funkci: spočítej samohlásky v textu (`count_vowels`).", "input": "", "output": "```python\ndef count_vowels(s: str) -> int:\n vowels = set(\"aeiouyáéíóúůýAEIOUYÁÉÍÓÚŮÝ\")\n return sum(1 for ch in s if ch in vowels)\n```"} | |
| {"instruction": "Vysvětli třída?", "input": "", "output": "Třída je šablona pro objekty — definuje data (atributy) a chování (metody)."} | |
| {"instruction": "Co je unit test? (stručně)", "input": "", "output": "Unit test ověřuje malou část kódu (funkci/metodu) automaticky a opakovatelně."} | |
| {"instruction": "Kolik je 18 - 10?", "input": "", "output": "18 - 10 = 8"} | |
| {"instruction": "Co je třída?", "input": "", "output": "Třída je šablona pro objekty — definuje data (atributy) a chování (metody)."} | |
| {"instruction": "Kolik je 22 - 14?", "input": "", "output": "22 - 14 = 8"} | |
| {"instruction": "Spočítej: 11 + 4 = ?", "input": "", "output": "11 + 4 = 15"} | |
| {"instruction": "Ahoj", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Kolik je 27 - 3?", "input": "", "output": "27 - 3 = 24"} | |
| {"instruction": "Vysvětli pojem mutability česky a stručně.", "input": "", "output": "Mutabilita znamená, že objekt lze změnit po vytvoření (list, dict). Immutable typy (tuple, str, int) po vytvoření neměníš — operace vrací novou hodnotu."} | |
| {"instruction": "Vysvětli pojem REST vs GraphQL česky a stručně.", "input": "", "output": "REST má více endpointů pro zdroje. GraphQL má jeden endpoint a klient si řekne přesně o pole, která chce — méně over-fetchingu, složitější server."} | |
| {"instruction": "Proč `if x = 1` v Pythonu nefunguje?", "input": "", "output": "V Pythonu je `=` přiřazení, ne porovnání. Použij `==` pro rovnost: `if x == 1:`. Od 3.8 existuje walrus `:=` pro přiřazení ve výrazech, ale ne místo `==` v klasické podmínce."} | |
| {"instruction": "Čau tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Kolik je 23 - 5?", "input": "", "output": "23 - 5 = 18"} | |
| {"instruction": "Kolik je 16 - 2?", "input": "", "output": "16 - 2 = 14"} | |
| {"instruction": "Kolik je 18 × 11?", "input": "", "output": "18 × 11 = 198"} | |
| {"instruction": "Spočítej: 25 + 14 = ?", "input": "", "output": "25 + 14 = 39"} | |
| {"instruction": "Kolik je 28 - 10?", "input": "", "output": "28 - 10 = 18"} | |
| {"instruction": "Kolik je 26 - 14?", "input": "", "output": "26 - 14 = 12"} | |
| {"instruction": "Jaký je rozdíl mezi TCP a UDP?", "input": "", "output": "TCP je spolehlivý a uspořádaný (web, e-mail). UDP je rychlejší, ale nespolehlivý (streaming, hry, DNS)."} | |
| {"instruction": "Dobrý den", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Čau!", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Kolik je 20 × 4?", "input": "", "output": "20 × 4 = 80"} | |
| {"instruction": "Kolik je 20 × 7?", "input": "", "output": "20 × 7 = 140"} | |
| {"instruction": "Spočítej: 4 + 14 = ?", "input": "", "output": "4 + 14 = 18"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..5.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 5}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Kolik je 29 - 11?", "input": "", "output": "29 - 11 = 18"} | |
| {"instruction": "Implement `strip_ws` in Python (odstraní whitespace).", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} | |
| {"instruction": "Spočítej: 29 + 10 = ?", "input": "", "output": "29 + 10 = 39"} | |
| {"instruction": "Zdravím", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Kolik je 6 × 6?", "input": "", "output": "6 × 6 = 36"} | |
| {"instruction": "Kolik je 13 - 5?", "input": "", "output": "13 - 5 = 8"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..1.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 1}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Odpověz pouze česky, stručně: hlavní město ČR?", "input": "", "output": "Hlavní město České republiky je Praha."} | |
| {"instruction": "Napiš v Pythonu flatten nested list one level.", "input": "", "output": "```python\ndef flatten(xs):\n out = []\n for x in xs:\n if isinstance(x, list):\n out.extend(x)\n else:\n out.append(x)\n return out\n```"} | |
| {"instruction": "Spočítej: 19 + 8 = ?", "input": "", "output": "19 + 8 = 27"} | |
| {"instruction": "Kolik je 14 × 13?", "input": "", "output": "14 × 13 = 182"} | |
| {"instruction": "Jaký je rozdíl mezi seznamem a n-ticí v Pythonu?", "input": "", "output": "List (`[]`) je měnitelný (můžeš přidávat/mazat prvky). Tuple (`()`) je neměnný. Tuple se hodí na pevné skupiny hodnot a jako klíče ve slovníku."} | |
| {"instruction": "Kolik je 6 × 10?", "input": "", "output": "6 × 10 = 60"} | |
| {"instruction": "Co je Python? (stručně)", "input": "", "output": "Python je vysokoúrovňový programovací jazyk s jednoduchou syntaxí."} | |
| {"instruction": "Write a Python function `dict_keys` that seřadí klíče slovníku.", "input": "", "output": "```python\ndef sorted_keys(d: dict) -> list:\n return sorted(d.keys())\n```"} | |
| {"instruction": "Hello tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Kolik je 6 - 2?", "input": "", "output": "6 - 2 = 4"} | |
| {"instruction": "Kolik je 28 × 6?", "input": "", "output": "28 × 6 = 168"} | |
| {"instruction": "Kolik je 15 - 3?", "input": "", "output": "15 - 3 = 12"} | |
| {"instruction": "Co je algoritmus?", "input": "", "output": "Algoritmus je přesný postup kroků k vyřešení úlohy."} | |
| {"instruction": "Kolik je 20 × 9?", "input": "", "output": "20 × 9 = 180"} | |
| {"instruction": "Ukaž čistý kód: seskupí list dictů podle klíče. Pojmenuj funkci `group_by`.", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} | |
| {"instruction": "Write a Python function `read_lines` that načte řádky souboru.", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} | |
| {"instruction": "Spočítej: 4 + 2 = ?", "input": "", "output": "4 + 2 = 6"} | |
| {"instruction": "Implement `invert_dict` in Python (prohodí klíče a hodnoty (unikátní)).", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} | |
| {"instruction": "Hello", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Vysvětli latency?", "input": "", "output": "Latence je zpoždění — jak dlouho trvá, než přijde odpověď."} | |
| {"instruction": "Spočítej: 6 + 3 = ?", "input": "", "output": "6 + 3 = 9"} | |
| {"instruction": "Translate to English: Prosím o review mého pull requestu.", "input": "", "output": "Please review my pull request."} | |
| {"instruction": "Napiš regex pro české PSČ (123 45 nebo 12345).", "input": "", "output": "`^\\d{3}\\s?\\d{2}$`"} | |
| {"instruction": "Jak vytvořím virtuální prostředí v Pythonu?", "input": "", "output": "```bash\npython3 -m venv .venv\nsource .venv/bin/activate # Windows: .venv\\Scripts\\activate\npip install -r requirements.txt\n```"} | |
| {"instruction": "Kolik je 14 - 4?", "input": "", "output": "14 - 4 = 10"} | |
| {"instruction": "Spočítej: 7 + 8 = ?", "input": "", "output": "7 + 8 = 15"} | |
| {"instruction": "Kolik je 22 - 2?", "input": "", "output": "22 - 2 = 20"} | |
| {"instruction": "Super, díky", "input": "", "output": "Jasně — kdyby co, napiš."} | |
| {"instruction": "Vysvětli framework?", "input": "", "output": "Framework je připravená kostra aplikace s pravidly a nástroji (Django, React, Spring)."} | |
| {"instruction": "Kolik je 17 - 11?", "input": "", "output": "17 - 11 = 6"} | |
| {"instruction": "Co je open source? (stručně)", "input": "", "output": "Open source znamená, že je dostupný zdrojový kód a licence dovoluje studium i úpravy."} | |
| {"instruction": "Hello tam?", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Kolik je 25 - 13?", "input": "", "output": "25 - 13 = 12"} | |
| {"instruction": "Ukaž čistý kód: odstraní whitespace. Pojmenuj funkci `strip_ws`.", "input": "", "output": "```python\ndef strip_ws(s: str) -> str:\n return \" \".join(s.split())\n```"} | |
| {"instruction": "Kolik je 8 - 6?", "input": "", "output": "8 - 6 = 2"} | |
| {"instruction": "Spočítej: 10 + 14 = ?", "input": "", "output": "10 + 14 = 24"} | |
| {"instruction": "Spočítej: 10 + 8 = ?", "input": "", "output": "10 + 8 = 18"} | |
| {"instruction": "Spočítej: 28 + 11 = ?", "input": "", "output": "28 + 11 = 39"} | |
| {"instruction": "Implement `write_text` in Python (zapíše text do souboru).", "input": "", "output": "```python\ndef write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n```"} | |
| {"instruction": "Dobrý den tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Write a Python function `group_by` that seskupí list dictů podle klíče.", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} | |
| {"instruction": "Spočítej: 9 + 6 = ?", "input": "", "output": "9 + 6 = 15"} | |
| {"instruction": "Oprav češtinu: prisel jsem pozde", "input": "", "output": "Přišel jsem pozdě."} | |
| {"instruction": "Přelož do češtiny: The train leaves at noon.", "input": "", "output": "Vlak odjíždí v poledne."} | |
| {"instruction": "Napiš Python funkci: vrátí True pokud je sudé (`is_even`).", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} | |
| {"instruction": "Kolik je 14 × 10?", "input": "", "output": "14 × 10 = 140"} | |
| {"instruction": "Napiš funkci v Pythonu: chunk list.", "input": "", "output": "```python\ndef chunked(xs, n):\n return [xs[i:i+n] for i in range(0, len(xs), n)]\n```"} | |
| {"instruction": "Kolik je 11 - 3?", "input": "", "output": "11 - 3 = 8"} | |
| {"instruction": "Ahoj!", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Spočítej: 25 + 11 = ?", "input": "", "output": "25 + 11 = 36"} | |
| {"instruction": "Spočítej: 10 + 5 = ?", "input": "", "output": "10 + 5 = 15"} | |
| {"instruction": "Kolik je 26 × 4?", "input": "", "output": "26 × 4 = 104"} | |
| {"instruction": "Kolik je 21 - 13?", "input": "", "output": "21 - 13 = 8"} | |
| {"instruction": "Kolik je 9 - 3?", "input": "", "output": "9 - 3 = 6"} | |
| {"instruction": "Čau! tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Kolik je 6 × 7?", "input": "", "output": "6 × 7 = 42"} | |
| {"instruction": "Oprav češtinu: zitra bude hezky", "input": "", "output": "Zítra bude hezky."} | |
| {"instruction": "Kolik je 24 - 4?", "input": "", "output": "24 - 4 = 20"} | |
| {"instruction": "Kolik je 16 - 12?", "input": "", "output": "16 - 12 = 4"} | |
| {"instruction": "Kolik je 27 - 13?", "input": "", "output": "27 - 13 = 14"} | |
| {"instruction": "Napiš binary search v Pythonu.", "input": "", "output": "```python\ndef binary_search(arr: list[int], target: int) -> int:\n lo, hi = 0, len(arr) - 1\n while lo <= hi:\n mid = (lo + hi) // 2\n if arr[mid] == target:\n return mid\n if arr[mid] < target:\n lo = mid + 1\n else:\n hi = mid - 1\n return -1\n```"} | |
| {"instruction": "Ukaž čistý kód: vrátí prvních n prvků. Pojmenuj funkci `first_n`.", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} | |
| {"instruction": "Kolik je 6 × 11?", "input": "", "output": "6 × 11 = 66"} | |
| {"instruction": "Kolik je 6 × 8?", "input": "", "output": "6 × 8 = 48"} | |
| {"instruction": "Spočítej: 5 + 4 = ?", "input": "", "output": "5 + 4 = 9"} | |
| {"instruction": "Kolik je 6 × 14?", "input": "", "output": "6 × 14 = 84"} | |
| {"instruction": "Mám `NoneType has no attribute append`. Co to znamená?", "input": "", "output": "Voláš `.append` na `None`. Typicky funkce nic nevrací (`return` chybí) nebo jsi přepsal proměnnou. Zkontroluj, že list opravdu existuje před append."} | |
| {"instruction": "Co je JSON?", "input": "", "output": "JSON je textový formát pro data: objekty `{}`, pole `[]`, řetězce, čísla, true/false/null. Používá se v API a konfiguracích."} | |
| {"instruction": "Kolik je 22 × 9?", "input": "", "output": "22 × 9 = 198"} | |
| {"instruction": "Kolik je 28 - 8?", "input": "", "output": "28 - 8 = 20"} | |
| {"instruction": "Spočítej: 14 + 13 = ?", "input": "", "output": "14 + 13 = 27"} | |
| {"instruction": "Spočítej: 22 + 2 = ?", "input": "", "output": "22 + 2 = 24"} | |
| {"instruction": "Co je refaktoring?", "input": "", "output": "Refaktoring vylepšuje strukturu kódu bez změny vnějšího chování."} | |
| {"instruction": "Ahoj!", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Proč tento kód padá?\n```python\nimport json\njson.loads(\"{a:1}\")\n```", "input": "", "output": "JSON vyžaduje uvozovky u klíčů: `json.loads('{\"a\": 1}')`."} | |
| {"instruction": "Kolik je 16 - 8?", "input": "", "output": "16 - 8 = 8"} | |
| {"instruction": "Co je proměnná? (stručně)", "input": "", "output": "Proměnná je pojmenované místo pro hodnotu v paměti, např."} | |
| {"instruction": "Jak se správně vítá v obchodním e-mailu česky?", "input": "", "output": "Běžně: „Dobrý den,“ a na konci „S pozdravem“ + jméno. Mezi známými lze „Ahoj,“."} | |
| {"instruction": "Napiš příklad fetch v moderním JavaScriptu.", "input": "", "output": "```javascript\nconst res = await fetch(\"/api/items\");\nif (!res.ok) throw new Error(`HTTP ${res.status}`);\nconst data = await res.json();\n```"} | |
| {"instruction": "Kolik je 15 - 13?", "input": "", "output": "15 - 13 = 2"} | |
| {"instruction": "Implementuj `group_by` v Pythonu — seskupí list dictů podle klíče.", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} | |
| {"instruction": "Jaký je rozdíl mezi frontend a backend?", "input": "", "output": "Frontend je to, co vidí uživatel (HTML/CSS/JS, UI). Backend je serverová logika, databáze a API, které frontend volá."} | |
| {"instruction": "Kolik je 10 × 10?", "input": "", "output": "10 × 10 = 100"} | |
| {"instruction": "Spočítej: 19 + 11 = ?", "input": "", "output": "19 + 11 = 30"} | |
| {"instruction": "Kolik je 12 × 10?", "input": "", "output": "12 × 10 = 120"} | |
| {"instruction": "Díky!", "input": "", "output": "Není zač. Kdybys něco potřeboval, klidně napiš."} | |
| {"instruction": "Přelož do angličtiny: Zítra jdu k lékaři.", "input": "", "output": "Tomorrow I'm going to the doctor."} | |
| {"instruction": "Uživatel se ptá na Python. Nejdřív pozdrav a zeptej se, co přesně řeší.", "input": "", "output": "Ahoj! Jasně, s Pythonem rád pomůžu. Co přesně potřebuješ — syntax, bug, návrh API, nebo něco jiného?"} | |
| {"instruction": "Kolik je 14 × 12?", "input": "", "output": "14 × 12 = 168"} | |
| {"instruction": "Kolik je 23 - 7?", "input": "", "output": "23 - 7 = 16"} | |
| {"instruction": "jsi kokot?", "input": "", "output": "Ne. Pojďme zůstat u věcné diskuze — s čím pomoct?"} | |
| {"instruction": "Čau!", "input": "", "output": "Zdravím! Napiš úkol — rád pomůžu."} | |
| {"instruction": "Kolik je 2 × 13?", "input": "", "output": "2 × 13 = 26"} | |
| {"instruction": "Co je funkce?", "input": "", "output": "Funkce je pojmenovaný blok kódu, který bere vstupy a vrací výsledek. Umožňuje znovupoužití logiky."} | |
| {"instruction": "Ukaž čistý Python kód: chunk list.", "input": "", "output": "```python\ndef chunked(xs, n):\n return [xs[i:i+n] for i in range(0, len(xs), n)]\n```"} | |
| {"instruction": "Hello tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Kolik je 28 × 7?", "input": "", "output": "28 × 7 = 196"} | |
| {"instruction": "Napiš SQL: vyber 8 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 8;\n```"} | |
| {"instruction": "Kolik je 16 × 12?", "input": "", "output": "16 × 12 = 192"} | |
| {"instruction": "Kolik je 6 × 9?", "input": "", "output": "6 × 9 = 54"} | |
| {"instruction": "Napiš funkci v Pythonu: flatten nested list one level.", "input": "", "output": "```python\ndef flatten(xs):\n out = []\n for x in xs:\n if isinstance(x, list):\n out.extend(x)\n else:\n out.append(x)\n return out\n```"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..4.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 4}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Napiš SQL: vyber 7 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 7;\n```"} | |
| {"instruction": "Kolik je 20 - 12?", "input": "", "output": "20 - 12 = 8"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..3.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 3}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Kolik je 12 - 6?", "input": "", "output": "12 - 6 = 6"} | |
| {"instruction": "Spočítej: 22 + 14 = ?", "input": "", "output": "22 + 14 = 36"} | |
| {"instruction": "Ukaž čistý Python kód: clamp value.", "input": "", "output": "```python\ndef clamp(x, lo, hi):\n return max(lo, min(hi, x))\n```"} | |
| {"instruction": "Kolik je 16 × 3?", "input": "", "output": "16 × 3 = 48"} | |
| {"instruction": "Spočítej: 9 + 3 = ?", "input": "", "output": "9 + 3 = 12"} | |
| {"instruction": "Jaké jsou základní datové typy v Pythonu?", "input": "", "output": "int, float, bool, str, list, tuple, dict, set, NoneType. Od 3.9+ i type hints jako list[int], dict[str, Any]."} | |
| {"instruction": "Potřebuju Python helper `last_n`: vrátí posledních n prvků.", "input": "", "output": "```python\ndef last_n(xs: list, n: int) -> list:\n return xs[-n:] if n else []\n```"} | |
| {"instruction": "Spočítej: 28 + 14 = ?", "input": "", "output": "28 + 14 = 42"} | |
| {"instruction": "Spočítej: 15 + 9 = ?", "input": "", "output": "15 + 9 = 24"} | |
| {"instruction": "Oprav kód:\n```python\nprint 'hello'\n```", "input": "", "output": "V Pythonu 3 musíš volat funkci: `print('hello')`.\n\nOpravená verze podle vysvětlení výše."} | |
| {"instruction": "Kolik je 10 × 8?", "input": "", "output": "10 × 8 = 80"} | |
| {"instruction": "Spočítej: 28 + 2 = ?", "input": "", "output": "28 + 2 = 30"} | |
| {"instruction": "Ahoj! tam?", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Jak commitnu změny v Gitu?", "input": "", "output": "```bash\ngit add .\ngit commit -m \"Popis změny\"\ngit push\n```\nNejdřív zkontroluj `git status` a piš srozumitelnou zprávu."} | |
| {"instruction": "Implementuj `sum_list` v Pythonu — sečte čísla v seznamu.", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} | |
| {"instruction": "Oprav češtinu: mel bych jit domu", "input": "", "output": "Měl bych jít domů."} | |
| {"instruction": "Hey", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Kolik je 14 - 6?", "input": "", "output": "14 - 6 = 8"} | |
| {"instruction": "Spočítej: 6 + 12 = ?", "input": "", "output": "6 + 12 = 18"} | |
| {"instruction": "Vysvětli async/await jednoduše.", "input": "", "output": "Async umožní čekat na I/O (síť, disk) bez blokování celého programu. `await` pozastaví funkci, dokud operace neskončí, a mezitím běží jiné úlohy."} | |
| {"instruction": "Vysvětli IDE?", "input": "", "output": "IDE je vývojové prostředí s editorem, debuggerem a nástroji (VS Code, PyCharm)."} | |
| {"instruction": "Kolik je 18 × 8?", "input": "", "output": "18 × 8 = 144"} | |
| {"instruction": "Co je IDE?", "input": "", "output": "IDE je vývojové prostředí s editorem, debuggerem a nástroji (VS Code, PyCharm)."} | |
| {"instruction": "Spočítej: 19 + 14 = ?", "input": "", "output": "19 + 14 = 33"} | |
| {"instruction": "Zdravím", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Napiš v Pythonu unique preserve order.", "input": "", "output": "```python\ndef unique(seq):\n seen = set()\n out = []\n for x in seq:\n if x not in seen:\n seen.add(x)\n out.append(x)\n return out\n```"} | |
| {"instruction": "ještě jednou", "input": "", "output": "Zopakuju rád. Pošli prosím znovu otázku nebo kousek kódu, ať trefim přesně."} | |
| {"instruction": "Co je knihovna? (stručně)", "input": "", "output": "Knihovna je sada funkcí/modulů, které použiješ ve svém kódu (requests, numpy)."} | |
| {"instruction": "Napiš FastAPI CRUD kostru pro poznámky (in-memory).", "input": "", "output": "```python\nfrom fastapi import FastAPI, HTTPException\nfrom pydantic import BaseModel\n\napp = FastAPI()\nDB: dict[int, dict] = {}\n_seq = 0\n\nclass NoteIn(BaseModel):\n text: str\n\n@app.get(\"/notes\")\ndef list_notes():\n return list(DB.values())\n\n@app.post(\"/notes\")\ndef create_note(body: NoteIn):\n global _seq\n _seq += 1\n DB[_seq] = {\"id\": _seq, \"text\": body.text}\n return DB[_seq]\n\n@app.get(\"/notes/{note_id}\")\ndef get_note(note_id: int):\n if note_id not in DB:\n raise HTTPException(404)\n return DB[note_id]\n```"} | |
| {"instruction": "Ukaž čistý kód: zavolá fn max n-krát při výjimce. Pojmenuj funkci `retry`.", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..15.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 15}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Přelož do češtiny: Please review my pull request.", "input": "", "output": "Prosím o review mého pull requestu."} | |
| {"instruction": "Spočítej: 11 + 13 = ?", "input": "", "output": "11 + 13 = 24"} | |
| {"instruction": "Kolik je 2 × 5?", "input": "", "output": "2 × 5 = 10"} | |
| {"instruction": "Ahoj", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Translate to English: Server neběží / je vypnutý.", "input": "", "output": "The server is down."} | |
| {"instruction": "Spočítej: 11 + 10 = ?", "input": "", "output": "11 + 10 = 21"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..8.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 8}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Kolik je 24 × 8?", "input": "", "output": "24 × 8 = 192"} | |
| {"instruction": "Dobrý den", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Implementuj v Pythonu reverse string.", "input": "", "output": "```python\ndef rev(s: str) -> str:\n return s[::-1]\n```"} | |
| {"instruction": "Kolik je 23 - 3?", "input": "", "output": "23 - 3 = 20"} | |
| {"instruction": "Napiš SQL: vyber 3 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 3;\n```"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..6.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 6}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Vysvětli merge?", "input": "", "output": "Merge spojuje změny z jedné větve do druhé a může vyžadovat řešení konfliktů."} | |
| {"instruction": "Napiš funkci word_count(text) → dict frekvencí slov.", "input": "", "output": "```python\nfrom collections import Counter\nimport re\n\ndef word_count(text: str) -> dict[str, int]:\n words = re.findall(r\"\\w+\", text.lower())\n return dict(Counter(words))\n```"} | |
| {"instruction": "Kolik je 24 - 8?", "input": "", "output": "24 - 8 = 16"} | |
| {"instruction": "Vysvětli databáze?", "input": "", "output": "Databáze ukládá strukturovaná data tak, aby šla spolehlivě číst, zapisovat a dotazovat."} | |
| {"instruction": "Kolik je 28 - 14?", "input": "", "output": "28 - 14 = 14"} | |
| {"instruction": "Spočítej: 7 + 11 = ?", "input": "", "output": "7 + 11 = 18"} | |
| {"instruction": "Napiš Python: najdi maximum bez použití max().", "input": "", "output": "```python\ndef my_max(nums: list[int]) -> int:\n if not nums:\n raise ValueError(\"prázdný seznam\")\n m = nums[0]\n for x in nums[1:]:\n if x > m:\n m = x\n return m\n```"} | |
| {"instruction": "Kolik je 15 - 9?", "input": "", "output": "15 - 9 = 6"} | |
| {"instruction": "Dobrý den", "input": "", "output": "Ahoj! Co potřebuješ vyřešit?"} | |
| {"instruction": "Write a Python function `write_text` that zapíše text do souboru.", "input": "", "output": "```python\ndef write_text(path: str, text: str) -> None:\n with open(path, \"w\", encoding=\"utf-8\") as f:\n f.write(text)\n```"} | |
| {"instruction": "Kolik je 4 × 12?", "input": "", "output": "4 × 12 = 48"} | |
| {"instruction": "Implementuj v Pythonu safe get nested dict.", "input": "", "output": "```python\ndef dig(d, *keys, default=None):\n cur = d\n for k in keys:\n if not isinstance(cur, dict) or k not in cur:\n return default\n cur = cur[k]\n return cur\n```"} | |
| {"instruction": "Ukaž čistý kód: načte řádky souboru. Pojmenuj funkci `read_lines`.", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} | |
| {"instruction": "Kolik je 23 - 13?", "input": "", "output": "23 - 13 = 10"} | |
| {"instruction": "Česky stručně: co dělá git clone?", "input": "", "output": "`git clone` zkopíruje vzdálený repozitář k tobě na disk včetně historie."} | |
| {"instruction": "Write a Python function `sum_list` that sečte čísla v seznamu.", "input": "", "output": "```python\ndef sum_list(xs: list[float]) -> float:\n return sum(xs)\n```"} | |
| {"instruction": "Spočítej: 3 + 12 = ?", "input": "", "output": "3 + 12 = 15"} | |
| {"instruction": "Spočítej: 20 + 4 = ?", "input": "", "output": "20 + 4 = 24"} | |
| {"instruction": "Spočítej: 13 + 8 = ?", "input": "", "output": "13 + 8 = 21"} | |
| {"instruction": "Kolik je 18 - 2?", "input": "", "output": "18 - 2 = 16"} | |
| {"instruction": "Napiš Python funkci: vrátí prvních n prvků (`first_n`).", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} | |
| {"instruction": "Spočítej: 21 + 9 = ?", "input": "", "output": "21 + 9 = 30"} | |
| {"instruction": "Fix: list = [1,2,3]; list.append(list)", "input": "", "output": "That creates a self-referential list (infinite nesting when printed). Append a copy or another value:\n```python\nlst = [1, 2, 3]\nlst.append(4)\n# or lst.extend([4, 5])\n```\nAlso avoid shadowing builtin `list`."} | |
| {"instruction": "Co je Docker?", "input": "", "output": "Docker balí aplikaci se závislostmi do kontejneru, který běží stejně na různých strojích. Image = šablona, container = běžící instance."} | |
| {"instruction": "Spočítej: 18 + 12 = ?", "input": "", "output": "18 + 12 = 30"} | |
| {"instruction": "Spočítej: 21 + 3 = ?", "input": "", "output": "21 + 3 = 24"} | |
| {"instruction": "Kolik je 6 - 4?", "input": "", "output": "6 - 4 = 2"} | |
| {"instruction": "Přepiš spisovně: potrebuju pomoct s pythonem", "input": "", "output": "Potřebuju pomoct s Pythonem."} | |
| {"instruction": "Implementuj v Pythonu bubble sort.", "input": "", "output": "```python\ndef bubble_sort(a: list[int]) -> list[int]:\n a = a[:]\n n = len(a)\n for i in range(n):\n for j in range(0, n - i - 1):\n if a[j] > a[j + 1]:\n a[j], a[j + 1] = a[j + 1], a[j]\n return a\n```"} | |
| {"instruction": "Odpověz pouze česky, stručně: kolik je 15 * 12?", "input": "", "output": "15 × 12 = 180."} | |
| {"instruction": "Kolik je 4 × 8?", "input": "", "output": "4 × 8 = 32"} | |
| {"instruction": "Spočítej: 13 + 11 = ?", "input": "", "output": "13 + 11 = 24"} | |
| {"instruction": "Kolik je 26 - 4?", "input": "", "output": "26 - 4 = 22"} | |
| {"instruction": "Kolik je 14 × 8?", "input": "", "output": "14 × 8 = 112"} | |
| {"instruction": "Implement `read_lines` in Python (načte řádky souboru).", "input": "", "output": "```python\ndef read_lines(path: str) -> list[str]:\n with open(path, encoding=\"utf-8\") as f:\n return f.read().splitlines()\n```"} | |
| {"instruction": "Spočítej: 20 + 13 = ?", "input": "", "output": "20 + 13 = 33"} | |
| {"instruction": "Implementuj `invert_dict` v Pythonu — prohodí klíče a hodnoty (unikátní).", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} | |
| {"instruction": "Kolik je 26 - 2?", "input": "", "output": "26 - 2 = 24"} | |
| {"instruction": "Spočítej: 13 + 2 = ?", "input": "", "output": "13 + 2 = 15"} | |
| {"instruction": "Spočítej: 12 + 6 = ?", "input": "", "output": "12 + 6 = 18"} | |
| {"instruction": "Napiš haiku o programování (česky).", "input": "", "output": "Kód v noci běží,\nchyba mizí po opravě —\ncommit, push, klid."} | |
| {"instruction": "Kolik je 19 - 3?", "input": "", "output": "19 - 3 = 16"} | |
| {"instruction": "Co je Git?", "input": "", "output": "Git je systém pro správu verzí kódu. Ukládá historii změn, větve a umožňuje spolupráci (commit, push, pull, merge)."} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..18.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 18}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Spočítej: 7 + 2 = ?", "input": "", "output": "7 + 2 = 9"} | |
| {"instruction": "Čau tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Potřebuju Python helper `invert_dict`: prohodí klíče a hodnoty (unikátní).", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} | |
| {"instruction": "Čau!", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Kolik je 29 - 9?", "input": "", "output": "29 - 9 = 20"} | |
| {"instruction": "Spočítej: 8 + 13 = ?", "input": "", "output": "8 + 13 = 21"} | |
| {"instruction": "Kolik je 27 - 11?", "input": "", "output": "27 - 11 = 16"} | |
| {"instruction": "kdo je debil?", "input": "", "output": "To nehodnotím. Můžu pomoct s programováním nebo otázkou."} | |
| {"instruction": "Kolik je 15 - 7?", "input": "", "output": "15 - 7 = 8"} | |
| {"instruction": "Implementuj `avg_list` v Pythonu — spočítej průměr.", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} | |
| {"instruction": "Kolik je 4 × 2?", "input": "", "output": "4 × 2 = 8"} | |
| {"instruction": "Spočítej: 23 + 7 = ?", "input": "", "output": "23 + 7 = 30"} | |
| {"instruction": "Write a Python function `invert_dict` that prohodí klíče a hodnoty (unikátní).", "input": "", "output": "```python\ndef invert_dict(d: dict) -> dict:\n return {v: k for k, v in d.items()}\n```"} | |
| {"instruction": "Spočítej: 7 + 14 = ?", "input": "", "output": "7 + 14 = 21"} | |
| {"instruction": "Kolik je 10 × 3?", "input": "", "output": "10 × 3 = 30"} | |
| {"instruction": "Ukaž čistý kód: vrátí True pokud je sudé. Pojmenuj funkci `is_even`.", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} | |
| {"instruction": "Spočítej: 13 + 5 = ?", "input": "", "output": "13 + 5 = 18"} | |
| {"instruction": "Odpověz pouze česky, stručně: voda vaří při jaké teplotě?", "input": "", "output": "Při standardním tlaku vaří voda při 100 °C."} | |
| {"instruction": "Co je branch?", "input": "", "output": "Branch je větev historie — oddělená linka vývoje, kterou pak sloučíš do main."} | |
| {"instruction": "Kolik je 21 - 5?", "input": "", "output": "21 - 5 = 16"} | |
| {"instruction": "Zdravím", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Co je merge? (stručně)", "input": "", "output": "Merge spojuje změny z jedné větve do druhé a může vyžadovat řešení konfliktů."} | |
| {"instruction": "Implementuj `is_even` v Pythonu — vrátí True pokud je sudé.", "input": "", "output": "```python\ndef is_even(n: int) -> bool:\n return n % 2 == 0\n```"} | |
| {"instruction": "Implement `retry` in Python (zavolá fn max n-krát při výjimce).", "input": "", "output": "```python\nimport time\n\ndef retry(fn, n=3, delay=0.1):\n last = None\n for _ in range(n):\n try:\n return fn()\n except Exception as e:\n last = e\n time.sleep(delay)\n raise last\n```"} | |
| {"instruction": "Kolik je 4 × 6?", "input": "", "output": "4 × 6 = 24"} | |
| {"instruction": "Kolik je 28 - 6?", "input": "", "output": "28 - 6 = 22"} | |
| {"instruction": "Kolik je 5 - 3?", "input": "", "output": "5 - 3 = 2"} | |
| {"instruction": "Write a Python function `first_n` that vrátí prvních n prvků.", "input": "", "output": "```python\ndef first_n(xs: list, n: int) -> list:\n return xs[:n]\n```"} | |
| {"instruction": "Kolik je 2 × 3?", "input": "", "output": "2 × 3 = 6"} | |
| {"instruction": "Kolik je 10 × 7?", "input": "", "output": "10 × 7 = 70"} | |
| {"instruction": "Kolik je 20 × 3?", "input": "", "output": "20 × 3 = 60"} | |
| {"instruction": "Kolik je 8 × 2?", "input": "", "output": "8 × 2 = 16"} | |
| {"instruction": "Co je proměnná?", "input": "", "output": "Proměnná je pojmenované místo pro hodnotu v paměti, např. `x = 10`."} | |
| {"instruction": "Kolik je 16 - 4?", "input": "", "output": "16 - 4 = 12"} | |
| {"instruction": "Napiš 3 tipy na produktivitu při programování.", "input": "", "output": "1) Rozděl problém na malé kroky.\n2) Piš testy nebo aspoň rychlé ověření.\n3) Commituj často a pojmenovávej změny srozumitelně."} | |
| {"instruction": "Spočítej: 12 + 9 = ?", "input": "", "output": "12 + 9 = 21"} | |
| {"instruction": "čau", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Spočítej: 22 + 5 = ?", "input": "", "output": "22 + 5 = 27"} | |
| {"instruction": "Kolik je 11 - 7?", "input": "", "output": "11 - 7 = 4"} | |
| {"instruction": "Napiš funkci v Pythonu: unique preserve order.", "input": "", "output": "```python\ndef unique(seq):\n seen = set()\n out = []\n for x in seq:\n if x not in seen:\n seen.add(x)\n out.append(x)\n return out\n```"} | |
| {"instruction": "Proč tento kód padá?\n```python\nd = {}\nprint(d['a'])\n```", "input": "", "output": "Klíč nemusí existovat — použij `d.get('a')` nebo `if 'a' in d`."} | |
| {"instruction": "Hey", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Kolik je 17 - 5?", "input": "", "output": "17 - 5 = 12"} | |
| {"instruction": "Kolik je 27 - 9?", "input": "", "output": "27 - 9 = 18"} | |
| {"instruction": "Spočítej: 13 + 14 = ?", "input": "", "output": "13 + 14 = 27"} | |
| {"instruction": "Mám pomalý Python kód v cyklu. Co zkusit první?", "input": "", "output": "1) Změř hotspoty (`cProfile`, `time`).\n2) Nahraď čisté Python smyčky NumPy/pandas, pokud jde o čísla.\n3) Cache opakované výpočty.\n4) Vyhni se zbytečným alokacím v těle smyčky."} | |
| {"instruction": "Zdravím tam?", "input": "", "output": "Ahoj! Jsem tu pro kód, vysvětlení i češtinu."} | |
| {"instruction": "Kolik je 20 - 4?", "input": "", "output": "20 - 4 = 16"} | |
| {"instruction": "Kolik je 12 × 6?", "input": "", "output": "12 × 6 = 72"} | |
| {"instruction": "Write a Python function `repeat_str` that zopakuje řetězec n-krát.", "input": "", "output": "```python\ndef repeat_str(s: str, n: int) -> str:\n return s * n\n```"} | |
| {"instruction": "Kolik je 12 × 13?", "input": "", "output": "12 × 13 = 156"} | |
| {"instruction": "co umíš?", "input": "", "output": "Pomáhám s programováním, vysvětlováním, češtinou, návrhem kódu a debugováním. Napiš konkrétní úkol."} | |
| {"instruction": "Kolik je 10 × 13?", "input": "", "output": "10 × 13 = 130"} | |
| {"instruction": "Ahoj! tam?", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Napiš JS: vrať pole čísel 1..17.", "input": "", "output": "```javascript\nconst nums = Array.from({length: 17}, (_, i) => i + 1);\n```"} | |
| {"instruction": "Potřebuju Python helper `avg_list`: spočítej průměr.", "input": "", "output": "```python\ndef avg_list(xs: list[float]) -> float:\n return sum(xs) / len(xs) if xs else 0.0\n```"} | |
| {"instruction": "Napiš motivující větu pro začátečníka v programování.", "input": "", "output": "Každý expert byl začátečník — piš malé programy denně a chyby ber jako učitele, ne jako prohru."} | |
| {"instruction": "Kolik je 12 × 5?", "input": "", "output": "12 × 5 = 60"} | |
| {"instruction": "Napiš funkci v Pythonu: fibonacci iterative.", "input": "", "output": "```python\ndef fib(n: int) -> int:\n if n < 0:\n raise ValueError\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a + b\n return a\n```"} | |
| {"instruction": "Vysvětli algoritmus?", "input": "", "output": "Algoritmus je přesný postup kroků k vyřešení úlohy."} | |
| {"instruction": "Napiš SQL: vyber 6 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 6;\n```"} | |
| {"instruction": "Spočítej: 14 + 4 = ?", "input": "", "output": "14 + 4 = 18"} | |
| {"instruction": "Kolik je 13 - 7?", "input": "", "output": "13 - 7 = 6"} | |
| {"instruction": "Jak ošetřit dělení nulou v Pythonu?", "input": "", "output": "```python\ndef safe_div(a, b):\n try:\n return a / b\n except ZeroDivisionError:\n return None # nebo raise vlastní chybu\n```"} | |
| {"instruction": "Napiš řešení v Pythonu: Valid parentheses.", "input": "", "output": "```python\ndef valid_parens(s: str) -> bool:\n pairs = {')':'(', ']':'[', '}':'{'}\n st = []\n for ch in s:\n if ch in '([{':\n st.append(ch)\n elif ch in pairs:\n if not st or st[-1] != pairs[ch]:\n return False\n st.pop()\n return not st\n```"} | |
| {"instruction": "Kolik je 16 × 8?", "input": "", "output": "16 × 8 = 128"} | |
| {"instruction": "Kolik je 16 × 10?", "input": "", "output": "16 × 10 = 160"} | |
| {"instruction": "Co je bug?", "input": "", "output": "Bug je chyba v programu, kvůli které se chová jinak, než autor chtěl."} | |
| {"instruction": "Vysvětli, co je rekurze, jednoduše česky.", "input": "", "output": "Rekurze je, když funkce volá sama sebe, dokud nedosáhne jednoduchého základního případu. Třeba výpočet faktoriálu: n! = n × (n-1)!, a 0! = 1."} | |
| {"instruction": "Kolik je 12 - 10?", "input": "", "output": "12 - 10 = 2"} | |
| {"instruction": "Napiš regex pro e-mail (jednoduchý).", "input": "", "output": "Jednoduchý vzor: `^[\\w.+-]+@[\\w-]+\\.[\\w.-]+$`. Pro produkci raději knihovnu/validátor — plná RFC regex je složitá."} | |
| {"instruction": "Napiš SQL: vyber 20 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 20;\n```"} | |
| {"instruction": "Kolik je 12 - 2?", "input": "", "output": "12 - 2 = 10"} | |
| {"instruction": "Napiš SQL migraci: tabulka todos.", "input": "", "output": "```sql\nCREATE TABLE todos (\n id SERIAL PRIMARY KEY,\n title TEXT NOT NULL,\n done BOOLEAN NOT NULL DEFAULT FALSE,\n created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()\n);\n```"} | |
| {"instruction": "Co je commit?", "input": "", "output": "Commit je uložený snímek změn v Gitu s popisem, co a proč se změnilo."} | |
| {"instruction": "Kolik je hodin?", "input": "", "output": "Nemám přístup k aktuálnímu času na tvém zařízení. Podívej se prosím na hodiny v systému nebo v prohlížeči."} | |
| {"instruction": "Napiš SQL: vyber 17 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 17;\n```"} | |
| {"instruction": "Kolik je 2 × 8?", "input": "", "output": "2 × 8 = 16"} | |
| {"instruction": "Napiš React komponentu Button s props label a onClick (TSX).", "input": "", "output": "```tsx\ntype Props = { label: string; onClick: () => void };\n\nexport function Button({ label, onClick }: Props) {\n return (\n <button type=\"button\" onClick={onClick}>\n {label}\n </button>\n );\n}\n```"} | |
| {"instruction": "Co je API?", "input": "", "output": "API je rozhraní, přes které spolu programy komunikují — často přes HTTP a JSON."} | |
| {"instruction": "Kolik je 8 × 9?", "input": "", "output": "8 × 9 = 72"} | |
| {"instruction": "Ukaž čistý Python kód: safe get nested dict.", "input": "", "output": "```python\ndef dig(d, *keys, default=None):\n cur = d\n for k in keys:\n if not isinstance(cur, dict) or k not in cur:\n return default\n cur = cur[k]\n return cur\n```"} | |
| {"instruction": "Kolik je 14 - 2?", "input": "", "output": "14 - 2 = 12"} | |
| {"instruction": "Potřebuju Python helper `group_by`: seskupí list dictů podle klíče.", "input": "", "output": "```python\nfrom collections import defaultdict\n\ndef group_by(rows, key):\n g = defaultdict(list)\n for r in rows:\n g[r[key]].append(r)\n return dict(g)\n```"} | |
| {"instruction": "Napiš Python class Stack s push/pop/peek.", "input": "", "output": "```python\nclass Stack:\n def __init__(self):\n self._data = []\n def push(self, x):\n self._data.append(x)\n def pop(self):\n if not self._data:\n raise IndexError(\"prázdný stack\")\n return self._data.pop()\n def peek(self):\n return self._data[-1]\n def __len__(self):\n return len(self._data)\n```"} | |
| {"instruction": "Kolik je 10 × 9?", "input": "", "output": "10 × 9 = 90"} | |
| {"instruction": "Python solution: Valid parentheses.", "input": "", "output": "```python\ndef valid_parens(s: str) -> bool:\n pairs = {')':'(', ']':'[', '}':'{'}\n st = []\n for ch in s:\n if ch in '([{':\n st.append(ch)\n elif ch in pairs:\n if not st or st[-1] != pairs[ch]:\n return False\n st.pop()\n return not st\n```"} | |
| {"instruction": "Napiš funkci is_palindrome(s) v Pythonu.", "input": "", "output": "```python\ndef is_palindrome(s: str) -> bool:\n cleaned = \"\".join(ch.lower() for ch in s if ch.isalnum())\n return cleaned == cleaned[::-1]\n```"} | |
| {"instruction": "Ukaž čistý Python kód: reverse string.", "input": "", "output": "```python\ndef rev(s: str) -> str:\n return s[::-1]\n```"} | |
| {"instruction": "Kolik je 18 - 4?", "input": "", "output": "18 - 4 = 14"} | |
| {"instruction": "Napiš SQL: vyber 5 nejnovějších objednávek z tabulky orders.", "input": "", "output": "```sql\nSELECT * FROM orders ORDER BY created_at DESC LIMIT 5;\n```"} | |
| {"instruction": "Čau", "input": "", "output": "Ahoj! Jak ti můžu pomoct?"} | |
| {"instruction": "Ukaž čistý kód: převod na velká písmena. Pojmenuj funkci `to_upper`.", "input": "", "output": "```python\ndef to_upper(s: str) -> str:\n return s.upper()\n```"} | |