|
Download code/code200.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 1.75 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/3c88a0fb05e4b97a2e7d2149907a657465f5d400/code/code200.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm@3c88a0fb05e4b97a2e7d2149907a657465f5d400/code/code200.jsonl
-
curl -L -o code200.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/3c88a0fb05e4b97a2e7d2149907a657465f5d400/code/code200.jsonl
1.75 kB
| {"type": "session", "harness": "deepseek-harness", "id": "code200", "name": "Python async/await patterns"} | |
| {"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": "How do I properly use async/await in Python?"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "**Async/Await Basics:**\n- `async def` defines a coroutine\n- `await` pauses until coroutine completes\n- `asyncio.run()` runs top-level coroutine\n- `asyncio.gather()` runs multiple concurrently\n\n**Common Patterns:**\n```python\nimport asyncio\n\nasync def fetch_data(url):\n async with aiohttp.ClientSession() as session:\n async with session.get(url) as resp:\n return await resp.json()\n\nasync def main():\n urls = [\"https://api.example.com/1\", \"https://api.example.com/2\"]\n results = await asyncio.gather(*[fetch_data(u) for u in urls])\n return results\n\nasyncio.run(main())\n```\n\n**Error Handling:**\n```python\ntry:\n result = await risky_operation()\nexcept Exception as e:\n logger.error(f\"Failed: {e}\")\n result = fallback()\n```\n\n**Tips:**\n- Don't mix blocking and async code\n- Use `asyncio.to_thread()` for blocking calls\n- Avoid `asyncio.run()` inside async functions\n- Use `async with` for context managers\n- Consider `asyncio.Semaphore` for rate limiting"}} | |