completion_code stringclasses 3
values | incomplete_function_context stringclasses 3
values |
|---|---|
for (const item of items) {
if (predicate(item)) {
matching.push(item);
} else {
remaining.push(item);
}
}
return [matching, remaining];
} | function partition<T, S extends T>(
items: readonly T[],
predicate: (item: T) => item is S
): [S[], Exclude<T, S>[]] {
const matching: S[] = [];
const remaining: Exclude<T, S>[] = []; |
for (const item of items) {
const value = item[key];
if (!seen.has(value)) {
seen.add(value);
result.push(item);
}
}
return result;
} | function uniqueBy<T, K extends keyof T>(
items: readonly T[],
key: K
): T[] {
const seen = new Set<T[K]>();
const result: T[] = []; |
for (const item of updates) {
merged.set(item.id, item);
}
return Array.from(merged.values());
} | function mergeById<T extends { readonly id: string }>(
existing: readonly T[],
updates: readonly T[]
): T[] {
const merged = new Map<string, T>();
for (const item of existing) {
merged.set(item.id, item);
} |
Type-Constrained Function Code Completion Snippets
This collection pairs incomplete function snippets with continuation code, using type declarations, function signatures, or generic constraints as context. The examples form supervised context-to-implementation pairs that emphasize consistency between generated code and the provided type information. They can support code completion fine-tuning, function implementation generation, and evaluation of type-constraint adherence.
Technical Specifications
| Field | Type | Description |
|---|---|---|
| completion_code | string | Function body continuation code generated from the incomplete function context and intended to satisfy its type constraints. |
| incomplete_function_context | string | A code snippet containing type declarations, a function signature, or generic constraints, together with an incomplete function body. |
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
- 23