id
stringlengths
12
12
task_type
stringclasses
10 values
difficulty
stringclasses
4 values
prompt
stringlengths
227
393
response
stringclasses
32 values
metadata
dict
pygod_000101
bugfix
medium
Fix a subtle bug in a Python module used for log processing. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include docstrings, must provide clear error messages. Difficulty: medium. Handle empty inputs and malformed records gracefully.
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000102
bugfix
easy
Fix a subtle bug in a Python module used for time series. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include type hints, must handle Windows paths safely. Difficulty: easy. Avoid quadratic behavior on large inputs.
Deliverable: implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str) -> Path: "...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000103
bugfix
easy
Fix a subtle bug in a Python module used for parsing. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must handle Windows paths safely, must include tests. Difficulty: easy. Guarantee deterministic output ordering.
Deliverable: corrected code and verification tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str)...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000104
bugfix
medium
Fix a subtle bug in a Python module used for validation. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must be streaming-friendly, must include docstrings, must handle Windows paths safely, must include tests. Difficulty: medium. Avoid quadratic behavior on lar...
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000105
bugfix
easy
Fix a subtle bug in a Python module used for rate limiting. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must avoid global state, must be easy to extend. Difficulty: easy. Guarantee deterministic output ordering.
Deliverable: corrected code and verification tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str)...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000106
bugfix
hard
Fix a subtle bug in a Python module used for parsing. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include docstrings, must be streaming-friendly, must handle Windows paths safely, must avoid global state. Difficulty: hard. Support both Windows and POSIX ...
Deliverable: implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str) -> Path: "...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000107
bugfix
hard
Fix a subtle bug in a Python module used for log processing. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must be memory-efficient, must include docstrings. Difficulty: hard. Ensure the API is testable via dependency injection.
Deliverable: implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str) -> Path: "...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000108
bugfix
medium
Fix a subtle bug in a Python module used for validation. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include docstrings, must handle Windows paths safely. Difficulty: medium. Include a small CLI example if relevant.
Deliverable: corrected code and verification tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str)...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000109
bugfix
medium
Fix a subtle bug in a Python module used for telemetry ingestion. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include type hints, stdlib-only. Difficulty: medium. Guarantee deterministic output ordering.
Deliverable: corrected code and verification tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str)...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000110
bugfix
hard
Fix a subtle bug in a Python module used for report generation. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must be streaming-friendly, must include tests, must avoid global state, must be memory-efficient. Difficulty: hard. Support both Windows and POSIX pat...
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000111
bugfix
expert
Fix a subtle bug in a Python module used for log processing. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include tests, must be streaming-friendly, must include type hints. Difficulty: expert. Handle empty inputs and malformed records gracefully.
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000112
bugfix
easy
Fix a subtle bug in a Python module used for ETL pipelines. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include type hints, must be easy to extend, must include docstrings. Difficulty: easy. Provide helpful exceptions with actionable messages.
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000113
bugfix
hard
Fix a subtle bug in a Python module used for report generation. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include type hints, must be easy to extend, must provide clear error messages, must include tests. Difficulty: hard. Avoid quadratic behavior on l...
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000114
bugfix
expert
Fix a subtle bug in a Python module used for validation. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include docstrings, must include tests, must be memory-efficient, must handle Windows paths safely. Difficulty: expert. Provide helpful exceptions with a...
Deliverable: production-ready reference solution. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str) -...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000115
bugfix
expert
Fix a subtle bug in a Python module used for log processing. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include type hints, must avoid global state. Difficulty: expert. Include a small CLI example if relevant.
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000116
bugfix
expert
Fix a subtle bug in a Python module used for time series. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must handle Windows paths safely, must include tests. Difficulty: expert. Handle empty inputs and malformed records gracefully.
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000117
bugfix
hard
Fix a subtle bug in a Python module used for rate limiting. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include tests, must avoid global state, stdlib-only. Difficulty: hard. Provide helpful exceptions with actionable messages.
Deliverable: implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str) -> Path: "...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000118
bugfix
medium
Fix a subtle bug in a Python module used for data modeling. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: stdlib-only, must avoid global state, must include type hints, must provide clear error messages. Difficulty: medium. Provide helpful exceptions with actio...
Deliverable: production-ready reference solution. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str) -...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000119
bugfix
easy
Fix a subtle bug in a Python module used for report generation. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must avoid global state, must be easy to extend, must provide clear error messages, must include type hints. Difficulty: easy. Include a small CLI exam...
Deliverable: production-ready reference solution. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str) -...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000120
refactor
medium
Refactor a Python module used for telemetry ingestion into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: stdlib-only, must avoid global state. Difficulty: medium. Support both Windows and POSIX paths correctly.
Deliverable: API + reference implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import datacl...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000121
refactor
easy
Refactor a Python module used for caching layer into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must include docstrings, must be easy to extend, must include tests, must provide clear error messages. Difficulty: easy. Ensure t...
Deliverable: implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass from pathlib...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000122
refactor
easy
Refactor a Python module used for validation into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must include type hints, must include tests. Difficulty: easy. Ensure the API is testable via dependency injection.
Deliverable: production-ready reference solution. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000123
refactor
hard
Refactor a Python module used for CLI tooling into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must include type hints, must avoid global state. Difficulty: hard. Include a small CLI example if relevant.
Deliverable: implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass from pathlib...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000124
refactor
easy
Refactor a Python module used for metrics aggregation into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: stdlib-only, must include docstrings, must handle Windows paths safely. Difficulty: easy. Support both Windows and POSIX pat...
Deliverable: API + reference implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import datacl...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000125
refactor
medium
Refactor a Python module used for caching layer into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must be easy to extend, must include type hints. Difficulty: medium. Ensure the API is testable via dependency injection.
Deliverable: production-ready reference solution. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000126
refactor
medium
Refactor a Python module used for time series into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must include type hints, must be streaming-friendly, must be memory-efficient. Difficulty: medium. Guarantee deterministic output or...
Deliverable: production-ready reference solution. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000127
refactor
expert
Refactor a Python module used for CLI tooling into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: stdlib-only, must include tests, must include type hints. Difficulty: expert. Avoid quadratic behavior on large inputs.
Deliverable: implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass from pathlib...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000128
refactor
medium
Refactor a Python module used for validation into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must be easy to extend, must be streaming-friendly, must include type hints, stdlib-only. Difficulty: medium. Handle empty inputs and...
Deliverable: implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass from pathlib...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000129
refactor
expert
Refactor a Python module used for time series into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: stdlib-only, must include tests, must avoid global state, must be easy to extend. Difficulty: expert. Ensure the API is testable via...
Deliverable: implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass from pathlib...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000130
refactor
expert
Refactor a Python module used for metrics aggregation into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must be easy to extend, must be streaming-friendly. Difficulty: expert. Guarantee deterministic output ordering.
Deliverable: production-ready reference solution. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000131
refactor
medium
Refactor a Python module used for metrics aggregation into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must be memory-efficient, stdlib-only, must provide clear error messages, must include tests. Difficulty: medium. Guarantee ...
Deliverable: implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass from pathlib...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000132
refactor
easy
Refactor a Python module used for event dispatching into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must include docstrings, must handle Windows paths safely, must include type hints. Difficulty: easy. Support both Windows and...
Deliverable: production-ready reference solution. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000133
refactor
easy
Refactor a Python module used for rate limiting into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must include tests, must be memory-efficient, must include type hints, must be easy to extend. Difficulty: easy. Avoid quadratic b...
Deliverable: implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass from pathlib...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000134
refactor
expert
Refactor a Python module used for time series into a clean, extensible design. Requirements: outline the new architecture briefly, then provide the refactored code and tests. Constraints: must include docstrings, must avoid global state, must include tests. Difficulty: expert. Support both Windows and POSIX paths corre...
Deliverable: implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass from pathlib...
{ "tags": [ "python", "architecture", "clean-code" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000135
tests
easy
Write a thorough test suite for a Python component used for log processing. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must include tests, must include docstrings. Difficulty: easy. Ensure the API is testable via dependency injection.
Deliverable: implementation + tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x)) == module_under...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000136
tests
expert
Write a thorough test suite for a Python component used for task scheduling. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must include type hints, must handle Windows paths safely. Difficulty: expert. Include a small CLI example if relevant.
Deliverable: API + reference implementation + tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x))...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000137
tests
easy
Write a thorough test suite for a Python component used for configuration loading. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must handle Windows paths safely, must include tests, must be streaming-friendly, must avoid global state. Difficulty: easy. Ensure the API is testable...
Deliverable: corrected code and verification tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x)) ...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000138
tests
easy
Write a thorough test suite for a Python component used for ETL pipelines. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: stdlib-only, must be streaming-friendly, must include docstrings. Difficulty: easy. Support both Windows and POSIX paths correctly.
Deliverable: API + reference implementation + tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x))...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000139
tests
hard
Write a thorough test suite for a Python component used for ETL pipelines. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must be easy to extend, must include type hints. Difficulty: hard. Include a small CLI example if relevant.
Deliverable: implementation + tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x)) == module_under...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000140
tests
hard
Write a thorough test suite for a Python component used for validation. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must be memory-efficient, must include type hints, must handle Windows paths safely, stdlib-only. Difficulty: hard. Include a small CLI example if relevant.
Deliverable: API + reference implementation + tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x))...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000141
tests
medium
Write a thorough test suite for a Python component used for metrics aggregation. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must be streaming-friendly, must include tests. Difficulty: medium. Include a small CLI example if relevant.
Deliverable: production-ready reference solution. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x)) ==...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000142
tests
hard
Write a thorough test suite for a Python component used for event dispatching. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must include docstrings, must be easy to extend. Difficulty: hard. Guarantee deterministic output ordering.
Deliverable: API + reference implementation + tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x))...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000143
tests
hard
Write a thorough test suite for a Python component used for ETL pipelines. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must be streaming-friendly, must include docstrings, must avoid global state. Difficulty: hard. Provide helpful exceptions with actionable messages.
Deliverable: corrected code and verification tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x)) ...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000144
tests
medium
Write a thorough test suite for a Python component used for rate limiting. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must include tests, stdlib-only. Difficulty: medium. Guarantee deterministic output ordering.
Deliverable: corrected code and verification tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x)) ...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000145
tests
easy
Write a thorough test suite for a Python component used for log processing. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must avoid global state, must provide clear error messages, must include tests, stdlib-only. Difficulty: easy. Support both Windows and POSIX paths correctly.
Deliverable: API + reference implementation + tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x))...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000146
tests
hard
Write a thorough test suite for a Python component used for parsing. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must handle Windows paths safely, stdlib-only, must be easy to extend. Difficulty: hard. Include a small CLI example if relevant.
Deliverable: corrected code and verification tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x)) ...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000147
tests
expert
Write a thorough test suite for a Python component used for file synchronization. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must provide clear error messages, must avoid global state. Difficulty: expert. Handle empty inputs and malformed records gracefully.
Deliverable: production-ready reference solution. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x)) ==...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000148
tests
expert
Write a thorough test suite for a Python component used for caching layer. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must provide clear error messages, stdlib-only. Difficulty: expert. Handle empty inputs and malformed records gracefully.
Deliverable: production-ready reference solution. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x)) ==...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000149
tests
medium
Write a thorough test suite for a Python component used for parsing. Requirements: cover edge cases, invalid inputs, and behavior invariants. Constraints: must provide clear error messages, must be streaming-friendly. Difficulty: medium. Guarantee deterministic output ordering.
Deliverable: API + reference implementation + tests. ```python # tests (pytest-style) for a module providing: normalize(), parse_lines(), compute_stats() import math import pytest def test_normalize_idempotent(module_under_test): x = " A\tB " assert module_under_test.normalize(module_under_test.normalize(x))...
{ "tags": [ "python", "pytest_style", "unittesting" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000150
algorithms
hard
Design and implement an algorithm for configuration loading. Requirements: define inputs/outputs, implement solution with complexity analysis, and include tests. Constraints: must handle Windows paths safely, must include docstrings. Difficulty: hard. Guarantee deterministic output ordering.
Deliverable: production-ready reference solution. Problem: compute rolling sums over events (ts:int,value:int) with window W seconds. Events may be out-of-order. Complexity: sorting O(n log n); window maintenance O(n); memory O(k). ```python from __future__ import annotations from collections import deque from datacl...
{ "tags": [ "python", "complexity", "correctness" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000151
algorithms
medium
Design and implement an algorithm for time series. Requirements: define inputs/outputs, implement solution with complexity analysis, and include tests. Constraints: must avoid global state, must be easy to extend. Difficulty: medium. Ensure the API is testable via dependency injection.
Deliverable: production-ready reference solution. Problem: compute rolling sums over events (ts:int,value:int) with window W seconds. Events may be out-of-order. Complexity: sorting O(n log n); window maintenance O(n); memory O(k). ```python from __future__ import annotations from collections import deque from datacl...
{ "tags": [ "python", "complexity", "correctness" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000152
algorithms
easy
Design and implement an algorithm for parsing. Requirements: define inputs/outputs, implement solution with complexity analysis, and include tests. Constraints: must include type hints, must be streaming-friendly, must be easy to extend. Difficulty: easy. Include a small CLI example if relevant.
Deliverable: corrected code and verification tests. Problem: compute rolling sums over events (ts:int,value:int) with window W seconds. Events may be out-of-order. Complexity: sorting O(n log n); window maintenance O(n); memory O(k). ```python from __future__ import annotations from collections import deque from data...
{ "tags": [ "python", "complexity", "correctness" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000153
algorithms
hard
Design and implement an algorithm for log processing. Requirements: define inputs/outputs, implement solution with complexity analysis, and include tests. Constraints: stdlib-only, must be memory-efficient, must be easy to extend, must provide clear error messages. Difficulty: hard. Handle empty inputs and malformed re...
Deliverable: production-ready reference solution. Problem: compute rolling sums over events (ts:int,value:int) with window W seconds. Events may be out-of-order. Complexity: sorting O(n log n); window maintenance O(n); memory O(k). ```python from __future__ import annotations from collections import deque from datacl...
{ "tags": [ "python", "complexity", "correctness" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000154
algorithms
expert
Design and implement an algorithm for telemetry ingestion. Requirements: define inputs/outputs, implement solution with complexity analysis, and include tests. Constraints: must include tests, must handle Windows paths safely. Difficulty: expert. Handle empty inputs and malformed records gracefully.
Deliverable: API + reference implementation + tests. Problem: compute rolling sums over events (ts:int,value:int) with window W seconds. Events may be out-of-order. Complexity: sorting O(n log n); window maintenance O(n); memory O(k). ```python from __future__ import annotations from collections import deque from dat...
{ "tags": [ "python", "complexity", "correctness" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000155
algorithms
medium
Design and implement an algorithm for rate limiting. Requirements: define inputs/outputs, implement solution with complexity analysis, and include tests. Constraints: must be easy to extend, must avoid global state, must be memory-efficient. Difficulty: medium. Avoid quadratic behavior on large inputs.
Deliverable: implementation + tests. Problem: compute rolling sums over events (ts:int,value:int) with window W seconds. Events may be out-of-order. Complexity: sorting O(n log n); window maintenance O(n); memory O(k). ```python from __future__ import annotations from collections import deque from dataclasses import ...
{ "tags": [ "python", "complexity", "correctness" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000156
algorithms
hard
Design and implement an algorithm for telemetry ingestion. Requirements: define inputs/outputs, implement solution with complexity analysis, and include tests. Constraints: must handle Windows paths safely, must be streaming-friendly, must include docstrings, must provide clear error messages. Difficulty: hard. Handle ...
Deliverable: corrected code and verification tests. Problem: compute rolling sums over events (ts:int,value:int) with window W seconds. Events may be out-of-order. Complexity: sorting O(n log n); window maintenance O(n); memory O(k). ```python from __future__ import annotations from collections import deque from data...
{ "tags": [ "python", "complexity", "correctness" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000157
algorithms
easy
Design and implement an algorithm for configuration loading. Requirements: define inputs/outputs, implement solution with complexity analysis, and include tests. Constraints: must include type hints, stdlib-only, must handle Windows paths safely. Difficulty: easy. Include a small CLI example if relevant.
Deliverable: implementation + tests. Problem: compute rolling sums over events (ts:int,value:int) with window W seconds. Events may be out-of-order. Complexity: sorting O(n log n); window maintenance O(n); memory O(k). ```python from __future__ import annotations from collections import deque from dataclasses import ...
{ "tags": [ "python", "complexity", "correctness" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000158
algorithms
hard
Design and implement an algorithm for telemetry ingestion. Requirements: define inputs/outputs, implement solution with complexity analysis, and include tests. Constraints: must be memory-efficient, must handle Windows paths safely, must include type hints, must include tests. Difficulty: hard. Avoid quadratic behavior...
Deliverable: implementation + tests. Problem: compute rolling sums over events (ts:int,value:int) with window W seconds. Events may be out-of-order. Complexity: sorting O(n log n); window maintenance O(n); memory O(k). ```python from __future__ import annotations from collections import deque from dataclasses import ...
{ "tags": [ "python", "complexity", "correctness" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000159
algorithms
hard
Design and implement an algorithm for event dispatching. Requirements: define inputs/outputs, implement solution with complexity analysis, and include tests. Constraints: must avoid global state, must include docstrings. Difficulty: hard. Ensure the API is testable via dependency injection.
Deliverable: corrected code and verification tests. Problem: compute rolling sums over events (ts:int,value:int) with window W seconds. Events may be out-of-order. Complexity: sorting O(n log n); window maintenance O(n); memory O(k). ```python from __future__ import annotations from collections import deque from data...
{ "tags": [ "python", "complexity", "correctness" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000160
typing
hard
Improve typing and robustness of a Python module used for time series. Requirements: provide type-safe APIs (generics/protocols where appropriate) and include tests. Constraints: must include type hints, must handle Windows paths safely. Difficulty: hard. Ensure the API is testable via dependency injection.
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Generic, Iterable, Protocol, TypeVar T = TypeVar("T") R = TypeVar("R") class Mapper(Protocol[T, R]): def __call__(self, x: T) -> R: ... @dataclass(froze...
{ "tags": [ "python", "mypy", "typing" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000161
typing
expert
Improve typing and robustness of a Python module used for validation. Requirements: provide type-safe APIs (generics/protocols where appropriate) and include tests. Constraints: must be easy to extend, must include docstrings, must include tests, must handle Windows paths safely. Difficulty: expert. Provide helpful exc...
Deliverable: implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Generic, Iterable, Protocol, TypeVar T = TypeVar("T") R = TypeVar("R") class Mapper(Protocol[T, R]): def __call__(self, x: T) -> R: ... @dataclass(frozen=True, slots=Tr...
{ "tags": [ "python", "mypy", "typing" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000162
typing
expert
Improve typing and robustness of a Python module used for configuration loading. Requirements: provide type-safe APIs (generics/protocols where appropriate) and include tests. Constraints: must include type hints, must handle Windows paths safely, must avoid global state. Difficulty: expert. Guarantee deterministic out...
Deliverable: implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Generic, Iterable, Protocol, TypeVar T = TypeVar("T") R = TypeVar("R") class Mapper(Protocol[T, R]): def __call__(self, x: T) -> R: ... @dataclass(frozen=True, slots=Tr...
{ "tags": [ "python", "mypy", "typing" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000163
typing
expert
Improve typing and robustness of a Python module used for event dispatching. Requirements: provide type-safe APIs (generics/protocols where appropriate) and include tests. Constraints: must include type hints, must avoid global state, must be streaming-friendly, must include docstrings. Difficulty: expert. Include a sm...
Deliverable: corrected code and verification tests. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Generic, Iterable, Protocol, TypeVar T = TypeVar("T") R = TypeVar("R") class Mapper(Protocol[T, R]): def __call__(self, x: T) -> R: ... @dataclass(frozen...
{ "tags": [ "python", "mypy", "typing" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000164
typing
medium
Improve typing and robustness of a Python module used for caching layer. Requirements: provide type-safe APIs (generics/protocols where appropriate) and include tests. Constraints: must avoid global state, must be streaming-friendly, must be easy to extend. Difficulty: medium. Guarantee deterministic output ordering.
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Generic, Iterable, Protocol, TypeVar T = TypeVar("T") R = TypeVar("R") class Mapper(Protocol[T, R]): def __call__(self, x: T) -> R: ... @dataclass(froze...
{ "tags": [ "python", "mypy", "typing" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000165
typing
medium
Improve typing and robustness of a Python module used for telemetry ingestion. Requirements: provide type-safe APIs (generics/protocols where appropriate) and include tests. Constraints: must be memory-efficient, must avoid global state, must include tests, must include type hints. Difficulty: medium. Provide helpful e...
Deliverable: implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Generic, Iterable, Protocol, TypeVar T = TypeVar("T") R = TypeVar("R") class Mapper(Protocol[T, R]): def __call__(self, x: T) -> R: ... @dataclass(frozen=True, slots=Tr...
{ "tags": [ "python", "mypy", "typing" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000166
typing
hard
Improve typing and robustness of a Python module used for telemetry ingestion. Requirements: provide type-safe APIs (generics/protocols where appropriate) and include tests. Constraints: must avoid global state, must be streaming-friendly, must provide clear error messages. Difficulty: hard. Handle empty inputs and mal...
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Generic, Iterable, Protocol, TypeVar T = TypeVar("T") R = TypeVar("R") class Mapper(Protocol[T, R]): def __call__(self, x: T) -> R: ... @dataclass(froze...
{ "tags": [ "python", "mypy", "typing" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000167
typing
expert
Improve typing and robustness of a Python module used for ETL pipelines. Requirements: provide type-safe APIs (generics/protocols where appropriate) and include tests. Constraints: must be streaming-friendly, must be memory-efficient, must include type hints, must provide clear error messages. Difficulty: expert. Handl...
Deliverable: implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Generic, Iterable, Protocol, TypeVar T = TypeVar("T") R = TypeVar("R") class Mapper(Protocol[T, R]): def __call__(self, x: T) -> R: ... @dataclass(frozen=True, slots=Tr...
{ "tags": [ "python", "mypy", "typing" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000168
typing
expert
Improve typing and robustness of a Python module used for report generation. Requirements: provide type-safe APIs (generics/protocols where appropriate) and include tests. Constraints: must be streaming-friendly, must include docstrings, must handle Windows paths safely. Difficulty: expert. Ensure the API is testable v...
Deliverable: corrected code and verification tests. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Generic, Iterable, Protocol, TypeVar T = TypeVar("T") R = TypeVar("R") class Mapper(Protocol[T, R]): def __call__(self, x: T) -> R: ... @dataclass(frozen...
{ "tags": [ "python", "mypy", "typing" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000169
typing
expert
Improve typing and robustness of a Python module used for event dispatching. Requirements: provide type-safe APIs (generics/protocols where appropriate) and include tests. Constraints: stdlib-only, must be memory-efficient, must handle Windows paths safely. Difficulty: expert. Support both Windows and POSIX paths corre...
Deliverable: implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Generic, Iterable, Protocol, TypeVar T = TypeVar("T") R = TypeVar("R") class Mapper(Protocol[T, R]): def __call__(self, x: T) -> R: ... @dataclass(frozen=True, slots=Tr...
{ "tags": [ "python", "mypy", "typing" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000170
performance
expert
Optimize a Python workflow for time series. Requirements: provide an optimized implementation and a small benchmark harness. Constraints: must avoid global state, must be memory-efficient. Difficulty: expert. Include a small CLI example if relevant.
Deliverable: corrected code and verification tests. Strategy: - Avoid repeated parsing; precompile regex if needed; use local variables; stream processing. ```python from __future__ import annotations from dataclasses import dataclass from typing import Iterable import time @dataclass(frozen=True, slots=True) class S...
{ "tags": [ "python", "profiling", "optimization" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000171
performance
medium
Optimize a Python workflow for caching layer. Requirements: provide an optimized implementation and a small benchmark harness. Constraints: must be memory-efficient, stdlib-only, must avoid global state, must provide clear error messages. Difficulty: medium. Guarantee deterministic output ordering.
Deliverable: implementation + tests. Strategy: - Avoid repeated parsing; precompile regex if needed; use local variables; stream processing. ```python from __future__ import annotations from dataclasses import dataclass from typing import Iterable import time @dataclass(frozen=True, slots=True) class Stats: count...
{ "tags": [ "python", "profiling", "optimization" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000172
performance
hard
Optimize a Python workflow for ETL pipelines. Requirements: provide an optimized implementation and a small benchmark harness. Constraints: must handle Windows paths safely, must be streaming-friendly, must include docstrings, must provide clear error messages. Difficulty: hard. Guarantee deterministic output ordering.
Deliverable: implementation + tests. Strategy: - Avoid repeated parsing; precompile regex if needed; use local variables; stream processing. ```python from __future__ import annotations from dataclasses import dataclass from typing import Iterable import time @dataclass(frozen=True, slots=True) class Stats: count...
{ "tags": [ "python", "profiling", "optimization" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000173
performance
hard
Optimize a Python workflow for CLI tooling. Requirements: provide an optimized implementation and a small benchmark harness. Constraints: must be streaming-friendly, must avoid global state. Difficulty: hard. Provide helpful exceptions with actionable messages.
Deliverable: corrected code and verification tests. Strategy: - Avoid repeated parsing; precompile regex if needed; use local variables; stream processing. ```python from __future__ import annotations from dataclasses import dataclass from typing import Iterable import time @dataclass(frozen=True, slots=True) class S...
{ "tags": [ "python", "profiling", "optimization" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000174
performance
hard
Optimize a Python workflow for validation. Requirements: provide an optimized implementation and a small benchmark harness. Constraints: must provide clear error messages, stdlib-only, must include tests, must be streaming-friendly. Difficulty: hard. Include a small CLI example if relevant.
Deliverable: API + reference implementation + tests. Strategy: - Avoid repeated parsing; precompile regex if needed; use local variables; stream processing. ```python from __future__ import annotations from dataclasses import dataclass from typing import Iterable import time @dataclass(frozen=True, slots=True) class ...
{ "tags": [ "python", "profiling", "optimization" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000175
performance
easy
Optimize a Python workflow for task scheduling. Requirements: provide an optimized implementation and a small benchmark harness. Constraints: must provide clear error messages, must be streaming-friendly, must be easy to extend. Difficulty: easy. Handle empty inputs and malformed records gracefully.
Deliverable: API + reference implementation + tests. Strategy: - Avoid repeated parsing; precompile regex if needed; use local variables; stream processing. ```python from __future__ import annotations from dataclasses import dataclass from typing import Iterable import time @dataclass(frozen=True, slots=True) class ...
{ "tags": [ "python", "profiling", "optimization" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000176
performance
expert
Optimize a Python workflow for event dispatching. Requirements: provide an optimized implementation and a small benchmark harness. Constraints: must be streaming-friendly, must include type hints. Difficulty: expert. Guarantee deterministic output ordering.
Deliverable: implementation + tests. Strategy: - Avoid repeated parsing; precompile regex if needed; use local variables; stream processing. ```python from __future__ import annotations from dataclasses import dataclass from typing import Iterable import time @dataclass(frozen=True, slots=True) class Stats: count...
{ "tags": [ "python", "profiling", "optimization" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000177
performance
medium
Optimize a Python workflow for telemetry ingestion. Requirements: provide an optimized implementation and a small benchmark harness. Constraints: must be memory-efficient, stdlib-only. Difficulty: medium. Ensure the API is testable via dependency injection.
Deliverable: corrected code and verification tests. Strategy: - Avoid repeated parsing; precompile regex if needed; use local variables; stream processing. ```python from __future__ import annotations from dataclasses import dataclass from typing import Iterable import time @dataclass(frozen=True, slots=True) class S...
{ "tags": [ "python", "profiling", "optimization" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000178
concurrency
easy
Implement a concurrent Python solution for report generation. Requirements: choose appropriate concurrency model, handle cancellation/timeouts, include tests. Constraints: must be memory-efficient, stdlib-only, must be easy to extend. Difficulty: easy. Provide helpful exceptions with actionable messages.
Deliverable: production-ready reference solution. ```python from __future__ import annotations import asyncio from dataclasses import dataclass from typing import Awaitable, Callable, Iterable, Optional @dataclass(frozen=True, slots=True) class JobResult: ok: bool value: Optional[int] error: Optional[str] ...
{ "tags": [ "python", "asyncio", "threading" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000179
concurrency
medium
Implement a concurrent Python solution for metrics aggregation. Requirements: choose appropriate concurrency model, handle cancellation/timeouts, include tests. Constraints: must be streaming-friendly, must handle Windows paths safely, must include tests. Difficulty: medium. Handle empty inputs and malformed records gr...
Deliverable: implementation + tests. ```python from __future__ import annotations import asyncio from dataclasses import dataclass from typing import Awaitable, Callable, Iterable, Optional @dataclass(frozen=True, slots=True) class JobResult: ok: bool value: Optional[int] error: Optional[str] async def ru...
{ "tags": [ "python", "asyncio", "threading" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000180
concurrency
hard
Implement a concurrent Python solution for time series. Requirements: choose appropriate concurrency model, handle cancellation/timeouts, include tests. Constraints: must provide clear error messages, must be easy to extend. Difficulty: hard. Avoid quadratic behavior on large inputs.
Deliverable: production-ready reference solution. ```python from __future__ import annotations import asyncio from dataclasses import dataclass from typing import Awaitable, Callable, Iterable, Optional @dataclass(frozen=True, slots=True) class JobResult: ok: bool value: Optional[int] error: Optional[str] ...
{ "tags": [ "python", "asyncio", "threading" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000181
concurrency
hard
Implement a concurrent Python solution for report generation. Requirements: choose appropriate concurrency model, handle cancellation/timeouts, include tests. Constraints: must include docstrings, must be memory-efficient, must be streaming-friendly, must avoid global state. Difficulty: hard. Support both Windows and P...
Deliverable: corrected code and verification tests. ```python from __future__ import annotations import asyncio from dataclasses import dataclass from typing import Awaitable, Callable, Iterable, Optional @dataclass(frozen=True, slots=True) class JobResult: ok: bool value: Optional[int] error: Optional[str...
{ "tags": [ "python", "asyncio", "threading" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000182
concurrency
hard
Implement a concurrent Python solution for telemetry ingestion. Requirements: choose appropriate concurrency model, handle cancellation/timeouts, include tests. Constraints: must be streaming-friendly, must avoid global state, must provide clear error messages, must include tests. Difficulty: hard. Include a small CLI ...
Deliverable: implementation + tests. ```python from __future__ import annotations import asyncio from dataclasses import dataclass from typing import Awaitable, Callable, Iterable, Optional @dataclass(frozen=True, slots=True) class JobResult: ok: bool value: Optional[int] error: Optional[str] async def ru...
{ "tags": [ "python", "asyncio", "threading" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000183
concurrency
hard
Implement a concurrent Python solution for caching layer. Requirements: choose appropriate concurrency model, handle cancellation/timeouts, include tests. Constraints: must provide clear error messages, must handle Windows paths safely, must include type hints, must include tests. Difficulty: hard. Guarantee determinis...
Deliverable: corrected code and verification tests. ```python from __future__ import annotations import asyncio from dataclasses import dataclass from typing import Awaitable, Callable, Iterable, Optional @dataclass(frozen=True, slots=True) class JobResult: ok: bool value: Optional[int] error: Optional[str...
{ "tags": [ "python", "asyncio", "threading" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000184
concurrency
medium
Implement a concurrent Python solution for validation. Requirements: choose appropriate concurrency model, handle cancellation/timeouts, include tests. Constraints: must include type hints, must be easy to extend, must avoid global state, must provide clear error messages. Difficulty: medium. Guarantee deterministic ou...
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations import asyncio from dataclasses import dataclass from typing import Awaitable, Callable, Iterable, Optional @dataclass(frozen=True, slots=True) class JobResult: ok: bool value: Optional[int] error: Optional[st...
{ "tags": [ "python", "asyncio", "threading" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000185
api_design
easy
Design a small, production-grade Python API for parsing. Requirements: define data models and interfaces, implement reference version, include tests. Constraints: must be streaming-friendly, must provide clear error messages. Difficulty: easy. Support both Windows and POSIX paths correctly.
Deliverable: corrected code and verification tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import datacla...
{ "tags": [ "python", "interfaces", "dataclasses" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000186
api_design
hard
Design a small, production-grade Python API for data modeling. Requirements: define data models and interfaces, implement reference version, include tests. Constraints: must be easy to extend, must provide clear error messages, must include tests, must include docstrings. Difficulty: hard. Provide helpful exceptions wi...
Deliverable: production-ready reference solution. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass...
{ "tags": [ "python", "interfaces", "dataclasses" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000187
api_design
easy
Design a small, production-grade Python API for CLI tooling. Requirements: define data models and interfaces, implement reference version, include tests. Constraints: must handle Windows paths safely, must be easy to extend. Difficulty: easy. Support both Windows and POSIX paths correctly.
Deliverable: implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass from pathlib...
{ "tags": [ "python", "interfaces", "dataclasses" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000188
api_design
easy
Design a small, production-grade Python API for ETL pipelines. Requirements: define data models and interfaces, implement reference version, include tests. Constraints: must be easy to extend, stdlib-only. Difficulty: easy. Provide helpful exceptions with actionable messages.
Deliverable: implementation + tests. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass from pathlib...
{ "tags": [ "python", "interfaces", "dataclasses" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000189
api_design
medium
Design a small, production-grade Python API for metrics aggregation. Requirements: define data models and interfaces, implement reference version, include tests. Constraints: must avoid global state, stdlib-only, must include tests. Difficulty: medium. Guarantee deterministic output ordering.
Deliverable: production-ready reference solution. Architecture: - Public facade class coordinating concerns (parsing, validation, persistence) - Small pure functions for testability - No global state; dependency injection for filesystem I/O ```python from __future__ import annotations from dataclasses import dataclass...
{ "tags": [ "python", "interfaces", "dataclasses" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000190
packaging
medium
Create a small, production-ready Python package for configuration loading. Requirements: include module code, CLI entrypoint, logging, and a minimal pyproject.toml. Constraints: stdlib-only, must be easy to extend, must be streaming-friendly. Difficulty: medium. Include a small CLI example if relevant.
Deliverable: implementation + tests. Package layout: - mypkg/core.py - mypkg/cli.py - pyproject.toml ```python # mypkg/core.py from __future__ import annotations from dataclasses import dataclass from typing import Iterable import logging log = logging.getLogger(__name__) @dataclass(frozen=True, slots=True) class Re...
{ "tags": [ "python", "cli", "pyproject" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000191
packaging
expert
Create a small, production-ready Python package for telemetry ingestion. Requirements: include module code, CLI entrypoint, logging, and a minimal pyproject.toml. Constraints: must be streaming-friendly, must include type hints. Difficulty: expert. Ensure the API is testable via dependency injection.
Deliverable: implementation + tests. Package layout: - mypkg/core.py - mypkg/cli.py - pyproject.toml ```python # mypkg/core.py from __future__ import annotations from dataclasses import dataclass from typing import Iterable import logging log = logging.getLogger(__name__) @dataclass(frozen=True, slots=True) class Re...
{ "tags": [ "python", "cli", "pyproject" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000192
packaging
medium
Create a small, production-ready Python package for time series. Requirements: include module code, CLI entrypoint, logging, and a minimal pyproject.toml. Constraints: stdlib-only, must be memory-efficient, must be streaming-friendly. Difficulty: medium. Ensure the API is testable via dependency injection.
Deliverable: API + reference implementation + tests. Package layout: - mypkg/core.py - mypkg/cli.py - pyproject.toml ```python # mypkg/core.py from __future__ import annotations from dataclasses import dataclass from typing import Iterable import logging log = logging.getLogger(__name__) @dataclass(frozen=True, slot...
{ "tags": [ "python", "cli", "pyproject" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000193
packaging
medium
Create a small, production-ready Python package for CLI tooling. Requirements: include module code, CLI entrypoint, logging, and a minimal pyproject.toml. Constraints: must be memory-efficient, stdlib-only, must provide clear error messages, must include type hints. Difficulty: medium. Guarantee deterministic output or...
Deliverable: implementation + tests. Package layout: - mypkg/core.py - mypkg/cli.py - pyproject.toml ```python # mypkg/core.py from __future__ import annotations from dataclasses import dataclass from typing import Iterable import logging log = logging.getLogger(__name__) @dataclass(frozen=True, slots=True) class Re...
{ "tags": [ "python", "cli", "pyproject" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000194
packaging
hard
Create a small, production-ready Python package for task scheduling. Requirements: include module code, CLI entrypoint, logging, and a minimal pyproject.toml. Constraints: must include tests, must be memory-efficient, must provide clear error messages. Difficulty: hard. Guarantee deterministic output ordering.
Deliverable: production-ready reference solution. Package layout: - mypkg/core.py - mypkg/cli.py - pyproject.toml ```python # mypkg/core.py from __future__ import annotations from dataclasses import dataclass from typing import Iterable import logging log = logging.getLogger(__name__) @dataclass(frozen=True, slots=T...
{ "tags": [ "python", "cli", "pyproject" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000195
security_safe
expert
Write secure, defensive Python code for ETL pipelines. Requirements: input validation, safe file handling, prevent path traversal, include tests. Constraints: must be easy to extend, must be memory-efficient, must include type hints. Difficulty: expert. Include a small CLI example if relevant.
Deliverable: production-ready reference solution. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str) -...
{ "tags": [ "python", "security", "validation" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000196
security_safe
medium
Write secure, defensive Python code for data modeling. Requirements: input validation, safe file handling, prevent path traversal, include tests. Constraints: must include docstrings, must be easy to extend, must be streaming-friendly. Difficulty: medium. Provide helpful exceptions with actionable messages.
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str...
{ "tags": [ "python", "security", "validation" ], "has_code": true, "requires_thinking": false, "seed": 1337 }
pygod_000197
security_safe
expert
Write secure, defensive Python code for task scheduling. Requirements: input validation, safe file handling, prevent path traversal, include tests. Constraints: must include type hints, must be memory-efficient, must be easy to extend, must handle Windows paths safely. Difficulty: expert. Guarantee deterministic output...
Deliverable: production-ready reference solution. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str) -...
{ "tags": [ "python", "security", "validation" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000198
security_safe
expert
Write secure, defensive Python code for parsing. Requirements: input validation, safe file handling, prevent path traversal, include tests. Constraints: must be easy to extend, must avoid global state, must include type hints. Difficulty: expert. Ensure the API is testable via dependency injection.
Deliverable: implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str) -> Path: "...
{ "tags": [ "python", "security", "validation" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000199
security_safe
hard
Write secure, defensive Python code for telemetry ingestion. Requirements: input validation, safe file handling, prevent path traversal, include tests. Constraints: must include type hints, must include docstrings, stdlib-only. Difficulty: hard. Guarantee deterministic output ordering.
Deliverable: corrected code and verification tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str)...
{ "tags": [ "python", "security", "validation" ], "has_code": true, "requires_thinking": true, "seed": 1337 }
pygod_000200
bugfix
hard
Fix a subtle bug in a Python module used for ETL pipelines. Requirements: explain root cause briefly, provide corrected code, and add regression tests. Constraints: must include tests, stdlib-only, must be streaming-friendly, must avoid global state. Difficulty: hard. Avoid quadratic behavior on large inputs.
Deliverable: API + reference implementation + tests. ```python from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Iterable import json class ValidationError(ValueError): """Raised when input validation fails.""" def safe_join(base: Path, *parts: str...
{ "tags": [ "python", "debugging", "tests" ], "has_code": true, "requires_thinking": true, "seed": 1337 }