|
Download code/code020.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 1.91 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/code/code020.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm/code/code020.jsonl
-
curl -L -o code020.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/main/code/code020.jsonl
1.91 kB
| {"type": "session", "harness": "deepseek-harness", "id": "code020", "name": "Python best practices"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}} | |
| {"type": "message", "message": {"role": "user", "content": "What are Python best practices I should follow?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "**Code Style (PEP 8):**\n- 4 spaces indentation (not tabs)\n- 79 character line limit\n- Two blank lines between functions\n- One blank line between methods\n- Use snake_case for variables/functions\n- Use CamelCase for classes\n\n**Naming Conventions:**\n```python\n# Bad\nx = 42\nmyVar = \"hello\"\n```\n\n**Pythonic Code:**\n```python\n# Bad\nfor i in range(len(items)):\n print(items[i])\n\n# Good\nfor item in items:\n print(item)\n\n# Use enumerate when index needed\nfor i, item in enumerate(items):\n print(f\"{i}: {item}\")\n```\n\n**Best Practices:**\n- Use list comprehensions: [x for x in items if x > 0]\n- Use context managers: with open('f') as f:\n- Use f-strings: f\"Hello {name}\"\n- Use type hints: def greet(name: str) -> str:\n- Use virtual environments for each project\n- Use requirements.txt for dependencies\n\n**Error Handling:**\n```python\n# Bad\ntry:\n do_something()\nexcept:\n pass\n\n# Good\ntry:\n do_something()\nexcept ValueError as e:\n logger.error(f\"Failed: {e}\")\n raise\n```\n\n**Imports:**\n```python\n# Order: stdlib, third-party, local\nimport os\nfrom pathlib import Path\n\nimport requests\n\nfrom myproject import utils\n```"}} | |