code_prefix stringclasses 3
values | completed_code stringclasses 3
values | reference_completion stringclasses 3
values |
|---|---|---|
from datetime import date
from collections.abc import Iterable
def allocate_fefo(
batches: Iterable[dict],
requested_units: int,
today: date,
) -> tuple[list[dict], int]:
if requested_units < 0:
raise ValueError("requested_units must be non-negative")
remaining = requested_units
alloca... | from datetime import date
from collections.abc import Iterable
def allocate_fefo(
batches: Iterable[dict],
requested_units: int,
today: date,
) -> tuple[list[dict], int]:
if requested_units < 0:
raise ValueError("requested_units must be non-negative")
remaining = requested_units
alloca... | if remaining == 0:
break
picked = min(batch["on_hand"], remaining)
allocations.append(
{
"batch_id": batch["batch_id"],
"quantity": picked,
"expires_on": batch["expires_on"],
}
)
remaining -= pic... |
from datetime import date
from collections.abc import Iterable
def reconcile_expired_batches(
batches: Iterable[dict],
as_of: date,
) -> tuple[list[dict], list[dict]]:
sellable = []
write_offs = []
for batch in batches:
quantity = batch["on_hand"]
expires_on = batch["expires_on"]
... | from datetime import date
from collections.abc import Iterable
def reconcile_expired_batches(
batches: Iterable[dict],
as_of: date,
) -> tuple[list[dict], list[dict]]:
sellable = []
write_offs = []
for batch in batches:
quantity = batch["on_hand"]
expires_on = batch["expires_on"]
... | write_offs.append(
{
"batch_id": batch["batch_id"],
"quantity": quantity,
"expires_on": expires_on,
"reason": "expired",
}
)
else:
sellable.append(dict(batch))
... |
from datetime import date, timedelta
from collections.abc import Iterable
def summarize_expiry_status(
batches: Iterable[dict],
today: date,
warning_window_days: int = 3,
) -> dict[str, list[dict]]:
if warning_window_days < 0:
raise ValueError("warning_window_days must be non-negative")
cu... | from datetime import date, timedelta
from collections.abc import Iterable
def summarize_expiry_status(
batches: Iterable[dict],
today: date,
warning_window_days: int = 3,
) -> dict[str, list[dict]]:
if warning_window_days < 0:
raise ValueError("warning_window_days must be non-negative")
cu... | quantity = batch["on_hand"]
if quantity <= 0:
continue
expires_on = batch["expires_on"]
record = {
"batch_id": batch["batch_id"],
"quantity": quantity,
"expires_on": expires_on,
}
if expires_on < today:
status["... |
Perishable Food Inventory Management Code Completion Dataset
This dataset contains code-completion examples for inventory management in specialty food retail, covering batch quantities, shelf-life dates, near-expiry status, and First-Expired, First-Out (FEFO) allocation logic. Each sample includes an incomplete code prefix, a reference continuation, and the concatenated complete code for supervised training and output verification. It supports supervised fine-tuning of code-generation models, code-completion training, and evaluation of inventory workflows for perishable goods.
Technical Specifications
| Field | Type | Description |
|---|---|---|
| code_prefix | string | An incomplete code snippet for perishable food inventory management, typically providing context about batch quantities, shelf-life dates, near-expiry status, or FEFO handling. |
| completed_code | string | The complete code formed by concatenating the incomplete prefix and reference continuation in their original order. |
| reference_completion | string | The reference code continuation used as the supervised target to complete the inventory logic in the prefix. |
Compliance Statement
| Authorization Type | CC-BY-NC-SA 4.0 (Attribution–NonCommercial–ShareAlike) |
| Commercial Use | Requires exclusive subscription or authorization contract (monthly or per-invocation charging) |
| Privacy and Anonymization | No PII, no real company names, simulated scenarios follow industry standards |
| Compliance System | Compliant with China's Data Security Law / EU GDPR / supports enterprise data access logs |
Source & Contact
- Downloads last month
- 31