id stringlengths 25 25 | kind stringclasses 1
value | title stringlengths 17 17 | provisional bool 1
class | output_code stringlengths 60 4.12k | input_data_sample stringlengths 3 637 | output_data_sample unknown | transformation_instruction stringlengths 54 1.91k |
|---|---|---|---|---|---|---|---|
cmsx8ire8004kkup2f9xsd0kf | contributor_item | Submission XSD0KF | false | import csv, io, json
def infer_type(values):
def is_int(v):
try:
int(v)
return True
except ValueError:
return False
def is_float(v):
try:
float(v)
return True
except ValueError:
return False
if all(is_in... | id,price,label
1,9.99,shoe
2,14.50,hat
3,3.00,sock | {
"id": "int",
"price": "float",
"label": "str"
} | Given a plain CSV, output a JSON object reporting each column's name and its inferred type ('int', 'float', or 'str') based on scanning all rows. |
cmsx8ire9004nkup287dy24d5 | contributor_item | Submission DY24D5 | false | import json, re
def transform(text):
pattern = r'[\w.+-]+@[\w-]+\.[\w.-]+'
found = re.findall(pattern, text)
seen = []
for f in found:
if f not in seen:
seen.append(f)
return json.dumps(seen)
| Contact alice@example.com or bob@example.org for details. Cc: alice@example.com always. | [
"alice@example.com",
"bob@example.org"
] | Given a block of text containing email addresses scattered among other words, extract all valid email addresses into a JSON array, preserving order and removing duplicates. |
cmsx8ire9004okup2atgwmt0c | contributor_item | Submission GWMT0C | false | import json
def transform(text):
data = json.loads(text)
subtotal = sum(item['price'] * item['qty'] for item in data['items'])
tax = round(subtotal * 0.08, 2)
subtotal = round(subtotal, 2)
total = round(subtotal + tax, 2)
return json.dumps({"subtotal": subtotal, "tax": tax, "total": total})
| {"items": [{"name": "Book", "price": 12.99, "qty": 2}, {"name": "Pen", "price": 1.50, "qty": 3}]} | {
"subtotal": 30.48,
"tax": 2.44,
"total": 32.92
} | Given a JSON object representing a shopping cart ({items: [{name, price, qty}]}), compute the subtotal, a flat 8% tax, and the total, each rounded to 2 decimals, and return as JSON. |
cmsx8ire9004mkup2k37b7use | contributor_item | Submission 7B7USE | false | import json
from collections import defaultdict
def transform(text):
data = json.loads(text)
totals = defaultdict(int)
for d in data:
totals[d['sku']] += d['quantity']
return json.dumps(dict(totals))
| [{"sku": "A1", "warehouse": "east", "quantity": 10}, {"sku": "A1", "warehouse": "west", "quantity": 5}, {"sku": "B2", "warehouse": "east", "quantity": 7}] | {
"A1": 15,
"B2": 7
} | Given a JSON array of {sku, warehouse, quantity} records, produce a JSON object mapping sku to total quantity summed across all warehouses. |
cmsx8ire8004ekup2zwiyc1dk | contributor_item | Submission IYC1DK | false | import json
def transform(text):
data = json.loads(text)
pairs = sorted(data.items(), key=lambda kv: kv[1])
return json.dumps([list(p) for p in pairs])
| {"Widget": 19.99, "Gadget": 9.99, "Gizmo": 29.50} | [
[
"Gadget",
9.99
],
[
"Widget",
19.99
],
[
"Gizmo",
29.5
]
] | Given a JSON object mapping product names to prices, return a JSON array of [name, price] pairs sorted by price ascending. |
cmsx8ire8003nkup2c8k1gz1e | contributor_item | Submission K1GZ1E | false | import json
def flatten(d, prefix=''):
out = {}
for k, v in d.items():
key = f"{prefix}.{k}" if prefix else k
if isinstance(v, dict):
out.update(flatten(v, key))
else:
out[key] = v
return out
def transform(text):
data = json.loads(text)
return json.d... | {"user": {"name": "Dan", "address": {"city": "Austin", "zip": "78701"}}, "active": true} | {
"user.name": "Dan",
"user.address.city": "Austin",
"user.address.zip": "78701",
"active": true
} | Flatten a nested JSON object into a single-level dict with dot-separated keys. |
cmsx8ire8003rkup248o1zk5t | contributor_item | Submission O1ZK5T | false | import csv, io, json
from collections import defaultdict
def transform(text):
reader = csv.reader(io.StringIO(text.strip()))
rows = list(reader)[1:]
sums = defaultdict(float)
for cat, amt in rows:
sums[cat] += float(amt)
return json.dumps({k: round(v, 2) for k, v in sums.items()})
| category,amount
food,12.50
travel,45.00
food,7.25
utilities,60.00
travel,15.75 | {
"food": 19.75,
"travel": 60.75,
"utilities": 60
} | Group a CSV of (category,amount) rows by category and output JSON mapping category to the sum of amounts. |
cmsx8ire8003vkup2m8q4yqmo | contributor_item | Submission Q4YQMO | false | import csv, io
def transform(text):
reader = csv.reader(io.StringIO(text.strip()))
rows = list(reader)
header = rows[0]
age_idx = header.index('age')
filtered = [r for r in rows[1:] if int(r[age_idx]) >= 18]
out = io.StringIO()
writer = csv.writer(out, lineterminator='\n')
writer.writer... | name,age
Tom,15
Jerry,22
Spike,17
Tyke,19 | "name,age\nJerry,22\nTyke,19" | Filter rows of a CSV to only those where the 'age' column is 18 or older, keeping the header, and output as CSV. |
cmsx8ire8003ukup2inh4mljl | contributor_item | Submission H4MLJL | false | import json, csv, io
from collections import defaultdict
def transform(text):
data = json.loads(text)
regions = sorted(set(d['region'] for d in data))
products = sorted(set(d['product'] for d in data))
table = defaultdict(lambda: defaultdict(int))
for d in data:
table[d['region']][d['produc... | [{"region": "East", "product": "Widget", "sales": 100}, {"region": "East", "product": "Gadget", "sales": 50}, {"region": "West", "product": "Widget", "sales": 75}] | "region,Gadget,Widget\nEast,50,100\nWest,0,75" | Convert a JSON array of objects into a pivoted CSV: rows are unique 'region' values, columns are unique 'product' values, cells are 'sales' totals. |
cmsx8ire80041kup2odbl1uzu | contributor_item | Submission BL1UZU | false | import json
from urllib.parse import urlparse, parse_qs
def transform(text):
p = urlparse(text.strip())
query = {k: v[0] if len(v) == 1 else v for k, v in parse_qs(p.query).items()}
return json.dumps({
"scheme": p.scheme,
"netloc": p.netloc,
"path": p.path,
"query": query
... | https://shop.example.com/products/42?color=red&size=M | {
"scheme": "https",
"netloc": "shop.example.com",
"path": "/products/42",
"query": {
"color": "red",
"size": "M"
}
} | Parse a full URL into its components (scheme, netloc, path, query params as a JSON object) and return as JSON. |
cmsx8ire80045kup28o59hlu0 | contributor_item | Submission 59HLU0 | false | import json
def transform(text):
lines = [l for l in text.strip().split('\n') if l]
rows = []
for l in lines:
fields = {}
for pair in l.split(';'):
k, v = pair.split(':', 1)
fields[k.strip()] = v.strip()
rows.append(fields)
return json.dumps(rows)
| name:Alice;age:30;city:Reno
name:Bob;age:41;city:Provo | [
{
"name": "Alice",
"age": "30",
"city": "Reno"
},
{
"name": "Bob",
"age": "41",
"city": "Provo"
}
] | Convert semicolon-separated key:value pairs on each line into a JSON array of objects. |
cmsx8ire80048kup2dvselwaj | contributor_item | Submission SELWAJ | false | import json
def transform(text):
nums = json.loads(text)
return json.dumps({
"min": min(nums),
"max": max(nums),
"mean": round(sum(nums) / len(nums), 2),
"count": len(nums)
})
| [4, 8, 15, 16, 23, 42] | {
"min": 4,
"max": 42,
"mean": 18,
"count": 6
} | Given a JSON array of numbers, return a JSON object with min, max, mean (rounded to 2 decimals), and count. |
cmsx8ire8003pkup2dd530e6r | contributor_item | Submission 530E6R | false | import json, re
from collections import Counter
def transform(text):
lines = [l for l in text.strip().split('\n') if l]
levels = []
for l in lines:
m = re.match(r'\[(\w+)\]', l)
if m:
levels.append(m.group(1))
return json.dumps(dict(Counter(levels)))
| [INFO] server started
[ERROR] connection failed
[INFO] retrying
[WARN] slow response
[ERROR] timeout | {
"INFO": 2,
"ERROR": 2,
"WARN": 1
} | Parse a block of log lines like '[LEVEL] message' and return a JSON object counting occurrences of each level. |
cmsx8ire8003skup287b1cifu | contributor_item | Submission B1CIFU | false | import json
from collections import Counter
def transform(text):
words = json.loads(text)
counts = Counter(w.lower() for w in words)
return json.dumps(dict(counts))
| ["Apple", "banana", "apple", "Cherry", "banana", "apple"] | {
"apple": 3,
"banana": 2,
"cherry": 1
} | Convert a JSON array of word strings into a JSON object mapping each unique word (lowercased) to its frequency count. |
cmsx8ire8003qkup2y46w1tql | contributor_item | Submission 6W1TQL | false | import json
def transform(text):
lines = [l for l in text.split('\n') if l.strip()]
rows = []
for l in lines:
name = l[0:10].strip()
age = l[10:15].strip()
city = l[15:25].strip()
rows.append({"name": name, "age": int(age), "city": city})
return json.dumps(rows)
| Alice 30 Chicago
Bob 45 Denver
Cara 27 Miami | [
{
"name": "Alice",
"age": 30,
"city": "Chicago"
},
{
"name": "Bob",
"age": 45,
"city": "Denver"
},
{
"name": "Cara",
"age": 27,
"city": "Miami"
}
] | Convert a fixed-width text table (columns: name 10 chars, age 5 chars, city 10 chars) into JSON array of objects. |
cmsx8ire8003xkup2nuorsv6f | contributor_item | Submission ORSV6F | false | import csv, io
def transform(text):
reader = csv.reader(io.StringIO(text.strip()))
rows = list(reader)
header, body = rows[0], rows[1:]
seen = set()
unique = []
for r in body:
key = tuple(r)
if key not in seen:
seen.add(key)
unique.append(r)
out = io.... | sku,qty
A1,5
A2,3
A1,5
A3,7
A2,3 | "sku,qty\nA1,5\nA2,3\nA3,7" | Remove duplicate rows from a CSV (matching on all columns), keeping only the first occurrence, output as CSV. |
cmsx8ire8003ykup24iww1cge | contributor_item | Submission WW1CGE | false | import json, re
def to_snake(name):
return re.sub(r'(?<!^)(?=[A-Z])', '_', name).lower()
def transform(text):
data = json.loads(text)
return json.dumps({to_snake(k): v for k, v in data.items()})
| {"firstName": "Ann", "lastLoginTime": "2026-01-01T00:00:00Z", "isActive": true} | {
"first_name": "Ann",
"last_login_time": "2026-01-01T00:00:00Z",
"is_active": true
} | Convert JSON object keys from camelCase to snake_case, preserving values, for a flat JSON object. |
cmsx8ire80046kup212siekac | contributor_item | Submission SIEKAC | false | import json, re
def transform(text):
lines = [l.strip() for l in text.strip().split('\n') if l.strip()]
name, street, last = lines[0], lines[1], lines[2]
m = re.match(r'(.+),\s*(\w{2})\s+(\d{5})', last)
city, state, zip_code = m.group(1), m.group(2), m.group(3)
return json.dumps({
"name": n... | Jane Doe
123 Maple St
Springfield, IL 62704 | {
"name": "Jane Doe",
"street": "123 Maple St",
"city": "Springfield",
"state": "IL",
"zip": "62704"
} | Parse a multi-line US-style address block (name, street, 'city, state zip') into a structured JSON object. |
cmsx8ire80043kup2ix0cl37b | contributor_item | Submission 0CL37B | false | import json
from datetime import datetime
def transform(text):
lines = [l for l in text.strip().split('\n') if l]
result = []
for l in lines:
dt = datetime.fromisoformat(l.replace('Z', '+00:00'))
if 9 <= dt.hour < 17:
result.append(l)
return json.dumps(result)
| 2026-04-01T08:00:00Z
2026-04-01T10:15:00Z
2026-04-01T16:59:00Z
2026-04-01T18:00:00Z | [
"2026-04-01T10:15:00Z",
"2026-04-01T16:59:00Z"
] | Given a block of ISO 8601 timestamps (one per line), filter to only those between 09:00 and 17:00 UTC and return as a JSON array of the original strings. |
cmsx8ire8004fkup2ol72svnh | contributor_item | Submission 72SVNH | false | import csv, io
def transform(text):
reader = csv.DictReader(io.StringIO(text.strip()))
rows = []
for row in reader:
first, last = row['full_name'].split(' ', 1)
rows.append({'first_name': first, 'last_name': last, 'email': row['email']})
out = io.StringIO()
writer = csv.DictWriter(o... | full_name,email
John Smith,john@example.com
Mary Ann Lee,mary@example.com | "first_name,last_name,email\nJohn,Smith,john@example.com\nMary,Ann Lee,mary@example.com" | Given a CSV with a 'full_name' column, split it into 'first_name' and 'last_name' columns and output the modified CSV (dropping full_name). |
cmsx8ire8004gkup2rxx3t7jm | contributor_item | Submission X3T7JM | false | import json
def transform(text):
data = json.loads(text)
leaves = []
def walk(node):
children = node.get('children') or []
if not children:
leaves.append(node['name'])
else:
for c in children:
walk(c)
for root in data:
walk(root)
... | [{"name": "Electronics", "children": [{"name": "Phones", "children": []}, {"name": "Laptops", "children": [{"name": "Gaming", "children": []}]}]}] | [
"Phones",
"Gaming"
] | Given a JSON array of nested category trees ({name, children:[...]}), return a JSON array of all leaf node names (nodes with no children). |
cmsx8ire8004jkup2qlmbnnoj | contributor_item | Submission MBNNOJ | false | import json
from datetime import datetime
def transform(text):
data = json.loads(text)
data.sort(key=lambda d: datetime.fromisoformat(d['timestamp'].replace('Z', '+00:00')))
return json.dumps(data)
| [{"timestamp": "2026-02-01T12:00:00Z", "event": "logout"}, {"timestamp": "2026-02-01T08:00:00Z", "event": "login"}, {"timestamp": "2026-02-01T09:30:00Z", "event": "click"}] | [
{
"timestamp": "2026-02-01T08:00:00Z",
"event": "login"
},
{
"timestamp": "2026-02-01T09:30:00Z",
"event": "click"
},
{
"timestamp": "2026-02-01T12:00:00Z",
"event": "logout"
}
] | Given a JSON array of log event objects with 'timestamp' (ISO 8601) and 'event', sort them chronologically and return the sorted JSON array. |
cmsx8ire9004pkup233nj9h88 | contributor_item | Submission NJ9H88 | false | import json
from collections import Counter
def transform(text):
lines = [l for l in text.strip().split('\n') if l]
statuses = []
for l in lines:
parts = l.split()
statuses.append(parts[-1])
return json.dumps(dict(Counter(statuses)))
| 10.0.0.1 - GET /home 200
10.0.0.2 - POST /login 401
10.0.0.1 - GET /about 200
10.0.0.3 - GET /missing 404 | {
"200": 2,
"401": 1,
"404": 1
} | Given lines of 'IP - method path status' access-log entries, return a JSON object mapping each HTTP status code (as string) to the number of occurrences. |
cmsx8ire8003tkup2z6xdaheb | contributor_item | Submission XDAHEB | false | import csv, io
def transform(text):
reader = csv.reader(io.StringIO(text.strip()))
rows = list(reader)
header = rows[0]
lines = ['| ' + ' | '.join(header) + ' |']
lines.append('| ' + ' | '.join(['---'] * len(header)) + ' |')
for row in rows[1:]:
lines.append('| ' + ' | '.join(row) + ' |... | name,score
Alice,88
Bob,74 | "| name | score |\n| --- | --- |\n| Alice | 88 |\n| Bob | 74 |" | Convert a CSV table into a Markdown table string with a header separator row. |
cmsxm07z400mvkup2b1p6hw5r | contributor_item | Submission P6HW5R | false | import json
def transform(input):
lines = input.strip().splitlines()
import re
stats = {}
for line in lines:
m = re.search(r'service=(\w+) path=(\S+) status=(\d+) latency_ms=(\d+)', line)
if not m or m.group(2) == '/health':
continue
service, status, latency = m.grou... | 2026-08-18T10:00:01Z service=auth path=/login status=200 latency_ms=84
2026-08-18T10:00:02Z service=auth path=/login status=503 latency_ms=420
2026-08-18T10:00:03Z service=payments path=/charge status=201 latency_ms=190
2026-08-18T10:00:04Z service=payments path=/charge status=500 latency_ms=610
2026-08-18T10:00:05Z se... | {
"auth": {
"error_rate_pct": 50,
"avg_latency_ms": 252
},
"payments": {
"error_rate_pct": 33.3,
"avg_latency_ms": 318.3
}
} | Parse the supplied raw log text and compute error rate and latency by service, excluding health checks. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400n3kup2o8xf0rfy | contributor_item | Submission XF0RFY | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: [0, 0])
for line in lines:
f = dict(x.split('=', 1) for x in line.split())
key = (f['service'], f['phase']); d[key][0] += 1; d[key][1] += int(f['status']) >= ... | phase=before status=200 service=api
phase=before status=200 service=api
phase=before status=500 service=api
phase=after status=200 service=api
phase=after status=500 service=api
phase=after status=503 service=api
phase=before status=200 service=worker
phase=after status=200 service=worker | {
"api": {
"before_error_pct": 33.3,
"after_error_pct": 66.7,
"delta_points": 33.3
},
"worker": {
"before_error_pct": 0,
"after_error_pct": 0,
"delta_points": 0
}
} | Parse the supplied raw log text and compute deployment error regression compared with pre-deploy traffic. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400n5kup2b25pfpdj | contributor_item | Submission 5PFPDJ | false | import json
def transform(input):
lines = input.strip().splitlines()
from datetime import datetime
open_at = {}; totals = {}; episodes = {}
for line in lines:
stamp, cfield, sfield = line.split(); c = cfield.split('=')[1]; state = sfield.split('=')[1]
t = datetime.fromisoformat(stamp.re... | 2026-08-18T13:00:00Z circuit=payments state=CLOSED
2026-08-18T13:01:10Z circuit=payments state=OPEN
2026-08-18T13:02:00Z circuit=payments state=HALF_OPEN
2026-08-18T13:02:20Z circuit=payments state=CLOSED
2026-08-18T13:05:00Z circuit=search state=OPEN
2026-08-18T13:07:30Z circuit=search state=CLOSED | {
"payments": {
"open_episodes": 1,
"total_open_seconds": 70
},
"search": {
"open_episodes": 1,
"total_open_seconds": 150
}
} | Parse the supplied raw log text and compute circuit breaker open intervals and total outage seconds. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nkkup2l3u3zovm | contributor_item | Submission U3ZOVM | false | import json
def transform(input):
lines = input.strip().splitlines()
import os
from collections import defaultdict
groups = {'.jpg':'image','.png':'image','.js':'script','.html':'document'}
d = defaultdict(lambda: {'served': 0, 'client_error': 0})
for line in lines:
f = dict(x.split('='... | path=/img/a.jpg status=200 bytes=4000
path=/img/b.png status=404 bytes=220
path=/app/main.js status=200 bytes=9000
path=/app/old.js status=404 bytes=310
path=/docs/readme.html status=200 bytes=1500
path=/img/c.jpg status=206 bytes=1800 | {
"document": {
"served": 1500,
"client_error": 0
},
"image": {
"served": 5800,
"client_error": 220
},
"script": {
"served": 9000,
"client_error": 310
}
} | Parse the supplied raw log text and compute cDN bandwidth by content type and 4xx waste. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400n4kup2w7aer95n | contributor_item | Submission AER95N | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
seen = defaultdict(lambda: {'active': set(), 'buyers': set(), 'purchases': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); row = seen[f['campaign']]
row['acti... | campaign=spring user=u1 event=view
campaign=spring user=u1 event=buy
campaign=spring user=u2 event=view
campaign=spring user=u3 event=buy
campaign=summer user=u4 event=view
campaign=summer user=u5 event=view
campaign=summer user=u5 event=buy
campaign=summer user=u5 event=buy | {
"spring": {
"unique_users": 3,
"buyer_conversion_pct": 66.7,
"purchases": 2
},
"summer": {
"unique_users": 2,
"buyer_conversion_pct": 50,
"purchases": 2
}
} | Parse the supplied raw log text and compute unique active users and conversion rate by campaign. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400mykup28ied32fd | contributor_item | Submission ED32FD | false | import json
def transform(input):
lines = input.strip().splitlines()
import math
from collections import defaultdict
lat = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split())
if int(f['status']) < 500:
lat[f['endpoint']].append(int(f['lat... | endpoint=/search latency_ms=90 status=200
endpoint=/search latency_ms=120 status=200
endpoint=/search latency_ms=410 status=200
endpoint=/search latency_ms=230 status=504
endpoint=/export latency_ms=800 status=200
endpoint=/export latency_ms=1200 status=200
endpoint=/export latency_ms=950 status=500
endpoint=/export la... | {
"/export": {
"p95_ms": 1200,
"over_500ms": 3
},
"/search": {
"p95_ms": 410,
"over_500ms": 0
}
} | Parse the supplied raw log text and compute per-endpoint p95 and slow-request count. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400mzkup2kcctcgkf | contributor_item | Submission CTCGKF | false | import json
def transform(input):
lines = input.strip().splitlines()
from datetime import datetime
sessions = {}
for line in lines:
stamp, sfield, efield = line.split()
sid = sfield.split('=', 1)[1]; event = efield.split('=', 1)[1]
row = sessions.setdefault(sid, {'events': 0})
... | 2026-08-18T09:00:00Z session=s1 event=start
2026-08-18T09:00:12Z session=s1 event=click
2026-08-18T09:01:05Z session=s1 event=end
2026-08-18T09:02:00Z session=s2 event=start
2026-08-18T09:04:30Z session=s2 event=end
2026-08-18T09:05:00Z session=s3 event=start
2026-08-18T09:05:20Z session=s3 event=click | {
"s1": {
"duration_seconds": 65,
"events": 3
},
"s2": {
"duration_seconds": 150,
"events": 2
}
} | Parse the supplied raw log text and compute session duration and event count, excluding incomplete sessions. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500ndkup25y1hquzm | contributor_item | Submission 1HQUZM | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: [0, 0])
for line in lines:
f = dict(x.split('=', 1) for x in line.split())
if f['maintenance'] == 'true': continue
d[f['zone']][0] += 1; d[f['zone']][... | zone=a result=ok maintenance=false
zone=a result=fail maintenance=false
zone=a result=fail maintenance=true
zone=a result=ok maintenance=false
zone=b result=ok maintenance=false
zone=b result=ok maintenance=false
zone=b result=fail maintenance=false | {
"a": {
"eligible_checks": 3,
"availability_pct": 66.67
},
"b": {
"eligible_checks": 3,
"availability_pct": 66.67
}
} | Parse the supplied raw log text and compute availability by zone with maintenance excluded. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z700o5kup2evavef7b | contributor_item | Submission AVEF7B | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(dict)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['token']][f['event']] = int(f['ts'])
lifetimes = []; revoked = []
for events in d.values... | token=a event=issued ts=100
token=a event=revoked ts=460
token=b event=issued ts=200
token=b event=expired ts=800
token=c event=issued ts=300
token=c event=revoked ts=320 | {
"tokens_completed": 3,
"median_lifetime_s": 360,
"max_revocation_lag_s": 360
} | Parse the supplied raw log text and compute token issuance lifetime and revocation lag. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400n2kup2of5d25u9 | contributor_item | Submission 5D25U9 | false | import json
def transform(input):
lines = input.strip().splitlines()
import re
from collections import defaultdict
d = defaultdict(list)
for line in lines:
m = re.match(r'duration=(\d+)ms rows=(\d+) sql="(.+)"', line)
duration, sql = int(m.group(1)), m.group(3)
fingerprint =... | duration=42ms rows=1 sql="SELECT * FROM users WHERE id=17"
duration=380ms rows=1 sql="SELECT * FROM users WHERE id=22"
duration=510ms rows=80 sql="SELECT * FROM orders WHERE account_id=9"
duration=620ms rows=65 sql="SELECT * FROM orders WHERE account_id=14"
duration=75ms rows=1 sql="SELECT * FROM users WHERE id=31" | {
"SELECT * FROM orders WHERE account_id=?": {
"calls": 2,
"slow_calls": 2,
"max_ms": 620
},
"SELECT * FROM users WHERE id=?": {
"calls": 3,
"slow_calls": 1,
"max_ms": 380
}
} | Parse the supplied raw log text and compute database slow-query summary by normalized statement fingerprint. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400n8kup27r5fle0t | contributor_item | Submission 5FLE0T | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['request_id']].append((int(f['status']), f['host']))
dupes = {rid: rows for rid, rows in d.i... | request_id=r1 status=200 host=a
request_id=r2 status=500 host=a
request_id=r1 status=200 host=b
request_id=r3 status=201 host=b
request_id=r2 status=200 host=c
request_id=r4 status=404 host=a
request_id=r4 status=404 host=b | {
"duplicate_ids": [
"r1",
"r2",
"r4"
],
"conflicting_ids": [
"r2"
],
"duplicate_log_lines": 3
} | Parse the supplied raw log text and compute detect duplicate request IDs and conflicting outcomes. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nckup2kd7t2n81 | contributor_item | Submission 7T2N81 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[int(f['partition'])].append(int(f['lag']))
result = {str(p): {'peak_lag': max(v), 'net_change'... | time=1 partition=0 lag=120
time=2 partition=0 lag=90
time=3 partition=0 lag=40
time=1 partition=1 lag=20
time=2 partition=1 lag=85
time=3 partition=1 lag=60
time=1 partition=2 lag=0
time=2 partition=2 lag=0 | {
"0": {
"peak_lag": 120,
"net_change": -80,
"recovered_pct": 66.7
},
"1": {
"peak_lag": 85,
"net_change": 40,
"recovered_pct": 0
},
"2": {
"peak_lag": 0,
"net_change": 0,
"recovered_pct": 0
}
} | Parse the supplied raw log text and compute consumer lag recovery and peak by partition. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500ngkup2o6kdvoo1 | contributor_item | Submission KDVOO1 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import Counter
first = {}
for line in lines:
f = dict(x.split('=', 1) for x in line.split())
if f['payment'] not in first or int(f['attempt']) < int(first[f['payment']]['attempt']): first[f['payment']]... | payment=p1 attempt=1 outcome=decline reason=insufficient_funds
payment=p1 attempt=2 outcome=approved reason=none
payment=p2 attempt=1 outcome=decline reason=expired_card
payment=p3 attempt=1 outcome=approved reason=none
payment=p4 attempt=1 outcome=decline reason=insufficient_funds
payment=p4 attempt=2 outcome=decline ... | {
"first_attempt_declines": 3,
"reason_share_pct": {
"expired_card": 33.3,
"insufficient_funds": 66.7
}
} | Parse the supplied raw log text and compute payment authorization decline reason share, excluding retries. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nhkup2ge0yz0r5 | contributor_item | Submission 0YZ0R5 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'total': 0, 'malformed': 0, 'valid_bytes': 0})
for line in lines:
parts = [x.split('=', 1) for x in line.split() if '=' in x]; f = dict(parts); row = d.get(f.get('so... | source=app bytes=120 level=INFO
source=app bytes=oops level=ERROR
source=worker bytes=80 level=INFO
source=worker level=WARN
source=app bytes=220 level=ERROR
source=worker bytes=140 level=INFO | {} | Parse the supplied raw log text and compute log ingestion malformed-rate and valid byte totals by source. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nlkup2laghshh3 | contributor_item | Submission GHSHH3 | false | import json
def transform(input):
lines = input.strip().splitlines()
import statistics
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['priority']].append(int(f['delivered']) - int(f['promised']))
result =... | priority=high promised=100 delivered=95
priority=high promised=110 delivered=125
priority=high promised=120 delivered=145
priority=low promised=200 delivered=230
priority=low promised=220 delivered=210
priority=low promised=240 delivered=260 | {
"high": {
"median_delay": 15,
"late_pct": 66.7,
"worst_delay": 25
},
"low": {
"median_delay": 20,
"late_pct": 66.7,
"worst_delay": 30
}
} | Parse the supplied raw log text and compute median delivery delay and late share by priority. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500njkup2cdemxpwp | contributor_item | Submission EMXPWP | false | import json
def transform(input):
lines = input.strip().splitlines()
from datetime import datetime
breach = {}; delays = {}
for line in lines:
stamp, s, cpu, action = line.split(); service = s.split('=')[1]; value = int(cpu.split('=')[1]); act = action.split('=')[1]
t = datetime.fromiso... | 2026-08-18T14:00:00Z service=api cpu=72 action=none
2026-08-18T14:00:30Z service=api cpu=86 action=none
2026-08-18T14:01:10Z service=api cpu=91 action=scale_out
2026-08-18T14:02:00Z service=worker cpu=83 action=none
2026-08-18T14:03:45Z service=worker cpu=88 action=scale_out | {
"delay_seconds": {
"api": 40,
"worker": 105
},
"slowest_service": "worker"
} | Parse the supplied raw log text and compute autoscaling response delay from threshold breach to scale action. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z600ntkup2atga7all | contributor_item | Submission GA7ALL | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['queue']].append((f['id'], int(f['now']) - int(f['enqueued'])))
result = {}
for q, rows ... | now=1000 queue=orders id=a enqueued=990
now=1000 queue=orders id=b enqueued=920
now=1000 queue=orders id=c enqueued=600
now=1000 queue=users id=d enqueued=970
now=1000 queue=users id=e enqueued=850 | {
"orders": {
"age_buckets": {
"under_60s": 1,
"60_to_299s": 1,
"300s_plus": 1
},
"oldest_id": "c",
"oldest_age_s": 400
},
"users": {
"age_buckets": {
"under_60s": 1,
"60_to_299s": 1,
"300s_plus": 0
},
"oldest_id": "e",
"oldest_age_s": 150
}
} | Parse the supplied raw log text and compute dead-letter queue age buckets and oldest message. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z600nukup2lok9dvi6 | contributor_item | Submission K9DVI6 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: [0, 0, 0])
for line in lines:
f = dict(x.split('=', 1) for x in line.split())
if int(f['status']) != 200: continue
row = d[f['encoding']]; row[0] += i... | encoding=gzip raw=10000 sent=3200 status=200
encoding=gzip raw=8000 sent=2800 status=200
encoding=br raw=12000 sent=3000 status=200
encoding=br raw=5000 sent=0 status=304
encoding=identity raw=2000 sent=2000 status=200 | {
"br": {
"responses": 1,
"bytes_saved": 9000,
"reduction_pct": 75
},
"gzip": {
"responses": 2,
"bytes_saved": 12000,
"reduction_pct": 66.7
},
"identity": {
"responses": 1,
"bytes_saved": 0,
"reduction_pct": 0
}
} | Parse the supplied raw log text and compute compression savings by encoding. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z600nxkup2hkpi61xu | contributor_item | Submission PI61XU | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['pool']].append((int(f['used']), int(f['max'])))
result = {}
for pool, rows in sorted(d.... | pool=main used=7 max=10
pool=main used=9 max=10
pool=main used=10 max=10
pool=main used=8 max=10
pool=analytics used=4 max=5
pool=analytics used=5 max=5
pool=analytics used=5 max=5 | {
"analytics": {
"peak_utilization_pct": 100,
"saturation_samples": 2,
"episodes": 1
},
"main": {
"peak_utilization_pct": 100,
"saturation_samples": 1,
"episodes": 1
}
} | Parse the supplied raw log text and compute connection pool saturation episodes. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z600nykup2vq5n2qcx | contributor_item | Submission 5N2QCX | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
weights = {'express': 2, 'standard': 1}; d = defaultdict(lambda: {'shipments': 0, 'breaches': 0, 'weighted_delay': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); del... | carrier=x tier=express promised=2 actual=3
carrier=x tier=standard promised=5 actual=5
carrier=x tier=express promised=2 actual=6
carrier=y tier=express promised=2 actual=2
carrier=y tier=standard promised=5 actual=7 | {
"x": {
"breach_pct": 66.7,
"weighted_delay_days": 10
},
"y": {
"breach_pct": 50,
"weighted_delay_days": 2
}
} | Parse the supplied raw log text and compute shipping SLA breach by carrier and weighted delay. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z600nwkup2z0k3jyuh | contributor_item | Submission K3JYUH | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'lags': [], 'missing': 0, 'total': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); r = d[f['region']]; r['total'] += 1
if f['replica'... | tx=t1 primary=100 replica=108 region=east
tx=t2 primary=120 replica=155 region=east
tx=t3 primary=140 replica=- region=east
tx=t4 primary=200 replica=212 region=west
tx=t5 primary=220 replica=225 region=west | {
"east": {
"max_lag": 35,
"avg_lag": 21.5,
"missing_ack_pct": 33.3
},
"west": {
"max_lag": 12,
"avg_lag": 8.5,
"missing_ack_pct": 0
}
} | Parse the supplied raw log text and compute replication latency with missing acknowledgements. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z700o8kup2j3ywf7v4 | contributor_item | Submission YWF7V4 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
minutes = defaultdict(dict)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); minutes[int(f['minute'])][f['region']] = (int(f['requests']), int(f['errors']))
result = {... | minute=1 region=primary requests=900 errors=9
minute=1 region=secondary requests=100 errors=1
minute=2 region=primary requests=500 errors=20
minute=2 region=secondary requests=500 errors=5
minute=3 region=primary requests=100 errors=8
minute=3 region=secondary requests=900 errors=9 | {
"1": {
"secondary_traffic_pct": 10,
"secondary_error_pct": 1
},
"2": {
"secondary_traffic_pct": 50,
"secondary_error_pct": 1
},
"3": {
"secondary_traffic_pct": 90,
"secondary_error_pct": 1
},
"shift_points": 80
} | Parse the supplied raw log text and compute regional failover traffic shift. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z700o4kup2vyallc2z | contributor_item | Submission ALLC2Z | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'tp': 0, 'fp': 0, 'fn': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); r = d[f['rule']]
r['tp'] += f['decision'] == 'block' and f['r... | rule=velocity decision=block review=fraud
rule=velocity decision=block review=legit
rule=velocity decision=allow review=fraud
rule=geo decision=block review=fraud
rule=geo decision=block review=fraud
rule=geo decision=allow review=legit | {
"geo": {
"precision_pct": 100,
"recall_pct": 100
},
"velocity": {
"precision_pct": 50,
"recall_pct": 50
}
} | Parse the supplied raw log text and compute fraud rule precision on reviewed decisions. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nnkup2f5l9m7gz | contributor_item | Submission L9M7GZ | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); event = (int(f['term']), f['leader'])
if not d[f['cluster']] or d[f['cluster']][-1] != event... | cluster=c1 term=7 leader=n1
cluster=c1 term=8 leader=n2
cluster=c1 term=9 leader=n1
cluster=c2 term=3 leader=n4
cluster=c2 term=3 leader=n4
cluster=c2 term=4 leader=n5 | {
"c1": {
"elections": 2,
"unique_leaders": 2,
"latest_term": 9
},
"c2": {
"elections": 1,
"unique_leaders": 2,
"latest_term": 4
}
} | Parse the supplied raw log text and compute leader election instability by cluster. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z600nvkup22tsge1s1 | contributor_item | Submission SGE1S1 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['user']].append(f['event'])
locked = [u for u, e in d.items() if 'lock' in e]
post_lock_... | user=a event=fail ip=1.1.1.1
user=a event=fail ip=1.1.1.1
user=a event=lock ip=1.1.1.1
user=a event=fail ip=1.1.1.1
user=b event=fail ip=2.2.2.2
user=b event=success ip=2.2.2.2
user=c event=lock ip=3.3.3.3
user=c event=success ip=3.3.3.3 | {
"locked_users": [
"a",
"c"
],
"post_lock_attempts": 2,
"post_lock_successes": 1
} | Parse the supplied raw log text and compute authentication lockout effectiveness. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z700o1kup2sip5vv6y | contributor_item | Submission P5VV6Y | false | import json
def transform(input):
lines = input.strip().splitlines()
import re
from collections import defaultdict
d = defaultdict(lambda: {'total': 0, 'zero': 0, 'lat': []})
for line in lines:
m = re.match(r'query="([^"]+)" results=(\d+) latency=(\d+)', line); words = len(m.group(1).split(... | query="red shoes" results=12 latency=50
query="red hat" results=0 latency=40
query="wireless noise cancelling headphones" results=4 latency=120
query="very specific antique brass fixture" results=0 latency=150
query="pen" results=0 latency=15 | {
"long": {
"zero_result_pct": 50,
"avg_latency_ms": 135
},
"short": {
"zero_result_pct": 66.7,
"avg_latency_ms": 35
}
} | Parse the supplied raw log text and compute search zero-result rate by normalized query length bucket. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z700o6kup2rj42yb73 | contributor_item | Submission 42YB73 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'play': 0, 'stall': 0, 'sessions': 0, 'bad': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); r = d[f['device']]; play = int(f['play_ms']); st... | device=mobile session=s1 play_ms=60000 stall_ms=3000
device=mobile session=s2 play_ms=30000 stall_ms=0
device=tv session=s3 play_ms=120000 stall_ms=12000
device=tv session=s4 play_ms=90000 stall_ms=4500 | {
"mobile": {
"stall_ratio_pct": 3.33,
"bad_sessions": 0,
"sessions": 2
},
"tv": {
"stall_ratio_pct": 7.86,
"bad_sessions": 1,
"sessions": 2
}
} | Parse the supplied raw log text and compute video playback stall ratio by device. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z700o2kup26vklncgg | contributor_item | Submission KLNCGG | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
order = {'compile': 0, 'test': 1, 'deploy': 2}; d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['build']].append(f)
result = {}
for buil... | build=b1 stage=compile duration=40 outcome=ok
build=b1 stage=test duration=80 outcome=fail
build=b1 stage=deploy duration=0 outcome=skipped
build=b2 stage=compile duration=35 outcome=ok
build=b2 stage=test duration=70 outcome=ok
build=b2 stage=deploy duration=25 outcome=ok | {
"b1": {
"completed_duration": 120,
"first_failed_stage": "test",
"success": false
},
"b2": {
"completed_duration": 130,
"first_failed_stage": null,
"success": true
}
} | Parse the supplied raw log text and compute build pipeline critical failure stage. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400mwkup2sdgtiern | contributor_item | Submission GTIERN | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'hits': 0, 'total': 0, 'saved': 0})
for line in lines:
fields = dict(token.split('=', 1) for token in line.split())
r = fields['region']; hit = fields['cache... | ts=10:01 region=us-east cache=HIT bytes=8400 origin_bytes=8400
ts=10:02 region=us-east cache=MISS bytes=1200 origin_bytes=1200
ts=10:03 region=eu-west cache=HIT bytes=5100 origin_bytes=5100
ts=10:04 region=eu-west cache=HIT bytes=3200 origin_bytes=3200
ts=10:05 region=eu-west cache=MISS bytes=700 origin_bytes=700
ts=10... | {
"eu-west": {
"hit_ratio": 0.667,
"origin_bytes_saved": 8300
},
"us-east": {
"hit_ratio": 0.667,
"origin_bytes_saved": 10900
}
} | Parse the supplied raw log text and compute cache hit ratio and bytes saved per region. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400mxkup24dozcxmu | contributor_item | Submission OZCXMU | false | import json
def transform(input):
lines = input.strip().splitlines()
requests = {}
for line in lines:
f = dict(x.split('=', 1) for x in line.split())
row = requests.setdefault(f['rid'], {'op': f['op'], 'attempts': 0, 'done': False})
row['attempts'] += 1
row['done'] = row['do... | rid=a1 op=read attempt=1 outcome=retry
rid=a1 op=read attempt=2 outcome=ok
rid=b2 op=write attempt=1 outcome=retry
rid=b2 op=write attempt=2 outcome=retry
rid=b2 op=write attempt=3 outcome=ok
rid=c3 op=read attempt=1 outcome=ok
rid=d4 op=write attempt=1 outcome=retry | {
"read": {
"completed": 2,
"retry_amplification": 1.5
},
"write": {
"completed": 1,
"retry_amplification": 3
}
} | Parse the supplied raw log text and compute retry amplification by operation, counting only completed request ids. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400n0kup2e6rziee5 | contributor_item | Submission RZIEE5 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import Counter
counts = Counter(line[:16] for line in lines)
peak = max(counts.values())
result = {'busiest_minute': min(k for k, v in counts.items() if v == peak), 'requests': peak, 'minutes_observed': len(counts... | 2026-08-18T11:00:01Z GET /a 200
2026-08-18T11:00:30Z GET /b 200
2026-08-18T11:01:02Z POST /c 201
2026-08-18T11:01:17Z GET /a 500
2026-08-18T11:01:45Z GET /a 200
2026-08-18T11:02:03Z GET /b 200
2026-08-18T11:02:44Z GET /b 200 | {
"busiest_minute": "2026-08-18T11:01",
"requests": 3,
"minutes_observed": 3
} | Parse the supplied raw log text and compute peak requests/minute and busiest minute with tie broken chronologically. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400n1kup2zv161s98 | contributor_item | Submission 161S98 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
series = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split())
series[f['queue']].append((int(f['depth']), int(f['limit'])))
result = {}
for q,... | time=12:00 queue=email depth=40 limit=100
time=12:01 queue=email depth=115 limit=100
time=12:02 queue=email depth=130 limit=100
time=12:03 queue=email depth=90 limit=100
time=12:00 queue=video depth=210 limit=200
time=12:01 queue=video depth=260 limit=200
time=12:02 queue=video depth=310 limit=200 | {
"email": {
"net_growth": 50,
"longest_breach_streak": 2
},
"video": {
"net_growth": 100,
"longest_breach_streak": 3
}
} | Parse the supplied raw log text and compute queue backlog growth and breach streak. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400n6kup2rpn5fvnn | contributor_item | Submission N5FVNN | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list); max_uptime = 0
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); max_uptime = max(max_uptime, int(f['uptime_ms']))
d[f['collector']].append(i... | uptime_ms=10000 collector=young pause_ms=12
uptime_ms=20000 collector=young pause_ms=18
uptime_ms=30000 collector=full pause_ms=240
uptime_ms=40000 collector=young pause_ms=15
uptime_ms=50000 collector=full pause_ms=310 | {
"full": {
"events": 2,
"max_pause_ms": 310,
"uptime_share_pct": 1.1
},
"young": {
"events": 3,
"max_pause_ms": 18,
"uptime_share_pct": 0.09
}
} | Parse the supplied raw log text and compute gC pause share and maximum pause by collector. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z400n7kup250g5ggyf | contributor_item | Submission G5GGYF | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'total': 0, 'classes': defaultdict(int), 'success_bytes': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); row = d[f['method']]; status = int(... | method=GET status=200 bytes=400
method=GET status=304 bytes=0
method=GET status=404 bytes=120
method=POST status=201 bytes=80
method=POST status=400 bytes=90
method=POST status=503 bytes=40 | {
"GET": {
"class_counts": {
"2xx": 1,
"3xx": 1,
"4xx": 1
},
"success_bytes": 400
},
"POST": {
"class_counts": {
"2xx": 1,
"4xx": 1,
"5xx": 1
},
"success_bytes": 80
}
} | Parse the supplied raw log text and compute status-class distribution and success-weighted bytes. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nakup2k9nypzgt | contributor_item | Submission NYPZGT | false | import json
def transform(input):
lines = input.strip().splitlines()
import re
from collections import defaultdict
d = defaultdict(lambda: {'count': 0, 'hosts': set()})
for line in lines:
if 'level=ERROR' not in line: continue
host = re.search(r'host=(\w+)', line).group(1); message ... | host=web1 level=ERROR error="Timeout after 120ms" trace=t1
host=web2 level=ERROR error="Timeout after 450ms" trace=t2
host=web1 level=INFO msg="ready"
host=web3 level=ERROR error="KeyError user_184" trace=t3
host=web2 level=ERROR error="KeyError user_992" trace=t4 | {
"KeyError user_#": {
"count": 2,
"hosts": [
"web2",
"web3"
]
},
"Timeout after #ms": {
"count": 2,
"hosts": [
"web1",
"web2"
]
}
} | Parse the supplied raw log text and compute exception fingerprints with affected hosts. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500n9kup25tzog9n3 | contributor_item | Submission ZOG9N3 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['pid']].append(int(f['rss_mb']))
result = {}
for pid, values in sorted(d.items()):
... | t=1 pid=api rss_mb=220
t=2 pid=worker rss_mb=310
t=3 pid=api rss_mb=245
t=4 pid=worker rss_mb=295
t=5 pid=api rss_mb=330
t=6 pid=worker rss_mb=410 | {
"api": {
"high_water_mb": 330,
"largest_increase_mb": 85,
"net_change_mb": 110
},
"worker": {
"high_water_mb": 410,
"largest_increase_mb": 115,
"net_change_mb": 100
}
} | Parse the supplied raw log text and compute memory high-water mark and largest positive delta by process. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nbkup2xwvx605p | contributor_item | Submission VX605P | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['tenant']].append((int(f['minute']), int(f['used']), int(f['limit'])))
result = {}
for t... | minute=0 tenant=alpha used=100 limit=1000
minute=10 tenant=alpha used=240 limit=1000
minute=20 tenant=alpha used=410 limit=1000
minute=0 tenant=beta used=50 limit=500
minute=10 tenant=beta used=90 limit=500
minute=20 tenant=beta used=150 limit=500 | {
"alpha": {
"current_pct": 41,
"projected_exhaustion_minute": 58.1
},
"beta": {
"current_pct": 30,
"projected_exhaustion_minute": 90
}
} | Parse the supplied raw log text and compute aPI quota consumption and projected exhaustion. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nekup2cfcn8bm5 | contributor_item | Submission CN8BM5 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['stream']].append((int(f['seq']), int(f['ts'])))
result = {}
for stream, rows in sorted(... | stream=orders ts=100 seq=1
stream=orders ts=108 seq=2
stream=orders ts=105 seq=3
stream=orders ts=120 seq=4
stream=users ts=50 seq=1
stream=users ts=45 seq=2
stream=users ts=41 seq=3 | {
"orders": {
"out_of_order_events": 1,
"largest_regression": 3
},
"users": {
"out_of_order_events": 2,
"largest_regression": 5
}
} | Parse the supplied raw log text and compute out-of-order event count and largest timestamp regression per stream. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nfkup23lz2ae0a | contributor_item | Submission Z2AE0A | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'exposed': set(), 'converted': set()})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); key = 'exposed' if f['event'] == 'expose' else 'converted'... | variant=control user=u1 event=expose
variant=control user=u1 event=convert
variant=control user=u2 event=expose
variant=test user=u3 event=expose
variant=test user=u4 event=expose
variant=test user=u4 event=convert
variant=test user=u5 event=expose
variant=test user=u5 event=convert | {
"exposures": {
"control": 2,
"test": 3
},
"conversion_pct": {
"control": 50,
"test": 66.7
},
"test_lift_points": 16.7
} | Parse the supplied raw log text and compute feature flag exposure imbalance and conversion lift. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nikup2ossrxx91 | contributor_item | Submission SRXX91 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'elapsed': 0, 'processed': 0, 'failed': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); row = d[f['job']]
for key in ('elapsed_s', 'p... | job=import batch=1 elapsed_s=10 processed=500 failed=5
job=import batch=2 elapsed_s=15 processed=750 failed=15
job=export batch=1 elapsed_s=20 processed=600 failed=0
job=export batch=2 elapsed_s=25 processed=900 failed=9 | {
"export": {
"throughput_per_s": 33.33,
"failed_pct": 0.6000000000000001
},
"import": {
"throughput_per_s": 50,
"failed_pct": 1.6
}
} | Parse the supplied raw log text and compute batch job throughput and failed-record rate. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nmkup2f1qovtq7 | contributor_item | Submission QOVTQ7 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['sensor']].append(float(f['value']))
result = {}
for sensor, values in sorted(d.items())... | sensor=a value=20.0
sensor=a value=21.0
sensor=a value=20.5
sensor=a value=29.0
sensor=a value=21.5
sensor=b value=10.0
sensor=b value=10.5
sensor=b value=11.0
sensor=b value=12.0 | {
"a": {
"anomaly_samples": [
4
],
"range": 9
},
"b": {
"anomaly_samples": [],
"range": 2
}
} | Parse the supplied raw log text and compute rolling three-sample temperature anomaly count. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nqkup2v87icgge | contributor_item | Submission 7ICGGE | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: defaultdict(set))
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['provider']][f['event']].add(f['id'])
result = {}
for provider, e in... | id=m1 event=queued provider=a
id=m1 event=delivered provider=a
id=m1 event=open provider=a
id=m2 event=queued provider=a
id=m2 event=bounced provider=a
id=m3 event=queued provider=b
id=m3 event=delivered provider=b
id=m3 event=open provider=b
id=m3 event=open provider=b | {
"a": {
"delivery_pct": 50,
"unique_open_pct_of_delivered": 100,
"bounces": 1
},
"b": {
"delivery_pct": 100,
"unique_open_pct_of_delivered": 100,
"bounces": 0
}
} | Parse the supplied raw log text and compute email delivery funnel with unique message ids. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500npkup2ygx5o2hs | contributor_item | Submission X5O2HS | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['trace']].append(f)
result = {}
for trace, spans in sorted(d.items()):
roots = [... | trace=t1 span=root parent=- start=0 end=120
trace=t1 span=db parent=root start=10 end=80
trace=t1 span=cache parent=root start=85 end=100
trace=t2 span=db parent=root start=5 end=55
trace=t2 span=render parent=root start=60 end=90 | {
"t1": {
"complete_root": true,
"missing_parents": [],
"observed_duration_ms": 120
},
"t2": {
"complete_root": false,
"missing_parents": [
"root"
],
"observed_duration_ms": 85
}
} | Parse the supplied raw log text and compute trace completeness and critical path duration. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nokup2dhgopmw1 | contributor_item | Submission GOPMW1 | false | import json
def transform(input):
lines = input.strip().splitlines()
windows = {}
target = None
for line in lines:
f = dict(x.split('=', 1) for x in line.split())
if 'window' in f: windows[f['window']] = (int(f['good']), int(f['total']))
else: target = float(f['target'])
bud... | window=5m good=940 total=1000
window=1h good=11900 total=12000
service=checkout target=99.9 | {
"burn_rate": {
"1h": 8.33,
"5m": 60
},
"page": true
} | Parse the supplied raw log text and compute sLO burn rate across short and long windows. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nrkup2pg95f25i | contributor_item | Submission 95F25I | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'reserve': 0, 'release': 0, 'commit': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['sku']][f['action']] += int(f['qty'])
result = ... | sku=A order=o1 action=reserve qty=3
sku=A order=o1 action=release qty=1
sku=A order=o1 action=commit qty=2
sku=A order=o2 action=reserve qty=5
sku=B order=o3 action=reserve qty=4
sku=B order=o3 action=commit qty=3
sku=B order=o3 action=release qty=1 | {
"A": {
"reserved": 8,
"accounted": 3,
"leaked": 5
},
"B": {
"reserved": 4,
"accounted": 4,
"leaked": 0
}
} | Parse the supplied raw log text and compute inventory reservation leakage. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z500nskup20attr1jk | contributor_item | Submission TTR1JK | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'total': 0, 'failed': 0, 'versions': defaultdict(int), 'ok_ms': []})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); r = d[f['host']]; r['total']... | host=api tls=1.3 outcome=ok ms=35
host=api tls=1.2 outcome=ok ms=55
host=api tls=1.2 outcome=fail ms=80
host=cdn tls=1.3 outcome=ok ms=20
host=cdn tls=1.3 outcome=ok ms=22
host=cdn tls=1.2 outcome=fail ms=100 | {
"api": {
"failure_pct": 33.3,
"version_mix": {
"1.2": 2,
"1.3": 1
},
"avg_success_ms": 45
},
"cdn": {
"failure_pct": 33.3,
"version_mix": {
"1.2": 1,
"1.3": 2
},
"avg_success_ms": 21
}
} | Parse the supplied raw log text and compute tLS handshake version mix and failure rate. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z700nzkup2ingw1lze | contributor_item | Submission GW1LZE | false | import json
def transform(input):
lines = input.strip().splitlines()
from datetime import datetime
from collections import defaultdict
d = defaultdict(list)
for line in lines:
stamp, w = line.split(); d[w.split('=')[1]].append(datetime.fromisoformat(stamp.replace('Z', '+00:00')))
result... | 2026-08-18T15:00:00Z worker=w1
2026-08-18T15:00:30Z worker=w1
2026-08-18T15:02:10Z worker=w1
2026-08-18T15:00:05Z worker=w2
2026-08-18T15:00:50Z worker=w2
2026-08-18T15:01:35Z worker=w2 | {
"w1": {
"max_gap_seconds": 100,
"gaps_over_60s": 1
},
"w2": {
"max_gap_seconds": 45,
"gaps_over_60s": 0
}
} | Parse the supplied raw log text and compute worker heartbeat gaps. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z700o0kup2rk246m5p | contributor_item | Submission 246M5P | false | import json
def transform(input):
lines = input.strip().splitlines()
from decimal import Decimal
from collections import defaultdict
d = defaultdict(lambda: {'gross': Decimal('0'), 'fees': Decimal('0'), 'count': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split())
... | currency=USD refund=100.00 fee=2.50 outcome=settled
currency=USD refund=40.00 fee=1.00 outcome=failed
currency=USD refund=25.00 fee=0.75 outcome=settled
currency=EUR refund=80.00 fee=2.00 outcome=settled
currency=EUR refund=20.00 fee=0.50 outcome=settled | {
"EUR": {
"settled": 2,
"net": "97.50",
"fee_pct": 2.5
},
"USD": {
"settled": 2,
"net": "121.75",
"fee_pct": 2.6
}
} | Parse the supplied raw log text and compute refund net amount by currency after fees. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z700o3kup2nlgfiifl | contributor_item | Submission GFIIFL | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'hits': 0, 'total': 0, 'lat': []})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); r = d[f['type']]; r['total'] += 1; r['hits'] += f['cache'] == ... | type=A cache=hit latency_ms=2
type=A cache=miss latency_ms=40
type=A cache=hit latency_ms=3
type=AAAA cache=miss latency_ms=55
type=AAAA cache=miss latency_ms=60
type=AAAA cache=hit latency_ms=4 | {
"A": {
"hit_pct": 66.7,
"mean_latency_ms": 15
},
"AAAA": {
"hit_pct": 33.3,
"mean_latency_ms": 39.7
}
} | Parse the supplied raw log text and compute dNS resolver cache effectiveness by record type. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm07z700o7kup2jpubjj8b | contributor_item | Submission UBJJ8B | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['phase']].append(int(f['wait_ms']))
result = {phase: {'avg_wait_ms': round(sum(v) / len(v), ... | phase=before query=q1 wait_ms=5
phase=before query=q2 wait_ms=8
phase=during query=q3 wait_ms=450
phase=during query=q4 wait_ms=700
phase=during query=q5 wait_ms=20
phase=after query=q6 wait_ms=12
phase=after query=q7 wait_ms=9 | {
"after": {
"avg_wait_ms": 10.5,
"blocked_over_100ms": 0
},
"before": {
"avg_wait_ms": 6.5,
"blocked_over_100ms": 0
},
"during": {
"avg_wait_ms": 390,
"blocked_over_100ms": 2
},
"migration_added_avg_ms": 383.5
} | Parse the supplied raw log text and compute schema migration lock impact. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00ogkup2v7y510ku | contributor_item | Submission Y510KU | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
weights = {'low':1,'medium':2,'high':3}; d = defaultdict(lambda: {'drifted': [], 'score': 0, 'total': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); r = d[f['env']];... | env=prod key=timeout expected=30 actual=60 severity=high
env=prod key=retries expected=3 actual=3 severity=medium
env=stage key=timeout expected=30 actual=25 severity=high
env=stage key=region expected=us actual=us severity=low
env=stage key=debug expected=false actual=true severity=medium | {
"prod": {
"drift_pct": 50,
"weighted_score": 3,
"keys": [
"timeout"
]
},
"stage": {
"drift_pct": 66.7,
"weighted_score": 5,
"keys": [
"debug",
"timeout"
]
}
} | Parse the supplied raw log text and compute configuration drift by environment and key severity. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00oskup237ei9pun | contributor_item | Submission EI9PUN | false | import json
def transform(input):
lines = input.strip().splitlines()
import sqlite3
db=sqlite3.connect(':memory:'); db.execute('create table logs(region text, amount integer, outcome text)')
for line in lines:
f=dict(x.split('=',1) for x in line.split()); db.execute('insert into logs values(?,?... | region=us amount=120 outcome=commit
region=us amount=50 outcome=rollback
region=us amount=80 outcome=commit
region=eu amount=200 outcome=commit
region=eu amount=100 outcome=rollback | {
"eu": {
"transactions": 2,
"committed": 1,
"committed_amount": 200
},
"us": {
"transactions": 3,
"committed": 2,
"committed_amount": 200
}
} | Parse the supplied raw log text and compute sQL conditional aggregate for transaction outcomes. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00o9kup2qj1v52um | contributor_item | Submission 1V52UM | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'attempted': 0, 'protected': 0, 'ok_time': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); r = d[f['target']]; size = int(f['bytes']); r['att... | target=db outcome=ok bytes=500 duration_s=50
target=db outcome=fail bytes=200 duration_s=40
target=files outcome=ok bytes=900 duration_s=120
target=files outcome=ok bytes=600 duration_s=90
target=files outcome=fail bytes=300 duration_s=60 | {
"db": {
"byte_success_pct": 71.4,
"successful_throughput": 10
},
"files": {
"byte_success_pct": 83.3,
"successful_throughput": 7.14
}
} | Parse the supplied raw log text and compute backup reliability weighted by protected bytes. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00owkup2n4laskp0 | contributor_item | Submission LASKP0 | false | import json
def transform(input):
lines = input.strip().splitlines()
import sqlite3
db=sqlite3.connect(':memory:');db.execute('create table logs(source text,severity text)')
for line in lines:
f=dict(x.split('=',1) for x in line.split());db.execute('insert into logs values(?,?)',(f['source'],f[... | source=cpu severity=warn
source=cpu severity=critical
source=cpu severity=critical
source=disk severity=warn
source=disk severity=info
source=network severity=critical | [
{
"source": "cpu",
"total": 3,
"critical": 2,
"critical_pct": 66.7
},
{
"source": "network",
"total": 1,
"critical": 1,
"critical_pct": 100
}
] | Parse the supplied raw log text and compute sQL group/HAVING for noisy alert sources. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00obkup2o6qpra12 | contributor_item | Submission QPRA12 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['device']].append((int(f['minute']), int(f['battery'])))
result = {}
for device, rows in... | device=d1 minute=0 battery=90
device=d1 minute=30 battery=75
device=d1 minute=60 battery=48
device=d2 minute=0 battery=50
device=d2 minute=20 battery=19
device=d2 minute=40 battery=15 | {
"d1": {
"drain_pct_per_hour": 42,
"first_below_20_minute": null
},
"d2": {
"drain_pct_per_hour": 52.5,
"first_below_20_minute": 20
}
} | Parse the supplied raw log text and compute battery drain and low-battery crossings by device. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00ohkup2cxvefzy1 | contributor_item | Submission VEFZY1 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'clients': set(), 'reconnects': 0})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); r = d[f['version']]; r['clients'].add(f['client']); r['reconn... | version=1.0 client=a event=connect
version=1.0 client=a event=reconnect
version=1.0 client=b event=connect
version=1.0 client=b event=reconnect
version=2.0 client=c event=connect
version=2.0 client=d event=connect
version=2.0 client=d event=reconnect
version=2.0 client=d event=reconnect | {
"1.0": {
"clients": 2,
"reconnects_per_client": 1
},
"2.0": {
"clients": 2,
"reconnects_per_client": 1
}
} | Parse the supplied raw log text and compute webSocket reconnect burden by client version. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00ofkup252igcsu3 | contributor_item | Submission IGCSU3 | false | import json
def transform(input):
lines = input.strip().splitlines()
result = {}
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); read = int(f['read_mb']); written = int(f['written_mb'])
result[f['shard']] = {'reclaimed_mb': int(f['before_mb']) - int(f['after_mb']), 'writ... | shard=s1 read_mb=500 written_mb=650 before_mb=900 after_mb=600
shard=s2 read_mb=400 written_mb=300 before_mb=700 after_mb=550
shard=s3 read_mb=0 written_mb=0 before_mb=200 after_mb=200 | {
"s1": {
"reclaimed_mb": 300,
"write_amplification": 1.3
},
"s2": {
"reclaimed_mb": 150,
"write_amplification": 0.75
},
"s3": {
"reclaimed_mb": 0,
"write_amplification": null
}
} | Parse the supplied raw log text and compute storage compaction amplification and reclaimed space. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00omkup2ilr2thfg | contributor_item | Submission R2THFG | false | import json
def transform(input):
lines = input.strip().splitlines()
result={}
for line in lines:
f=dict(x.split('=',1) for x in line.split()); space=int(f['used_gb'])/int(f['total_gb']); inode=int(f['used_inodes'])/int(f['total_inodes']); limiting='space' if space>=inode else 'inodes'
resu... | mount=/data used_gb=850 total_gb=1000 used_inodes=40 total_inodes=100
mount=/tmp used_gb=20 total_gb=100 used_inodes=95 total_inodes=100
mount=/logs used_gb=450 total_gb=500 used_inodes=88 total_inodes=100 | {
"/data": {
"space_pct": 85,
"inode_pct": 40,
"limiting_resource": "space",
"alert": false
},
"/logs": {
"space_pct": 90,
"inode_pct": 88,
"limiting_resource": "space",
"alert": true
},
"/tmp": {
"space_pct": 20,
"inode_pct": 95,
"limiting_resource": "inodes",
... | Parse the supplied raw log text and compute filesystem capacity risk using both bytes and inodes. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00oqkup21u82s5g3 | contributor_item | Submission 82S5G3 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d=defaultdict(lambda:defaultdict(int))
for line in lines:
f=dict(x.split('=',1) for x in line.split()); d[f['version']][f['session']]+=f['event']=='crash'
result={v:{'sessions':len(s),'c... | version=3.1 session=a event=start
version=3.1 session=a event=crash
version=3.1 session=b event=start
version=3.2 session=c event=start
version=3.2 session=d event=start
version=3.2 session=d event=crash
version=3.2 session=d event=crash | {
"3.1": {
"sessions": 2,
"crash_free_pct": 50,
"crash_events": 1
},
"3.2": {
"sessions": 2,
"crash_free_pct": 50,
"crash_events": 2
}
} | Parse the supplied raw log text and compute crash-free sessions by application version. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00oukup2suc75nnz | contributor_item | Submission C75NNZ | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d=defaultdict(lambda:{'total':0,'fallback':0,'keys':[]})
for line in lines:
f=dict(x.split('=',1) for x in line.split()); r=d[f['locale']]; r['total']+=1
if f['source']!=f['locale']:... | locale=fr key=home.title source=fr
locale=fr key=home.cta source=en
locale=de key=home.title source=de
locale=de key=home.cta source=en
locale=de key=help source=en
locale=es key=home.title source=es | {
"de": {
"fallback_pct": 66.7,
"fallback_keys": [
"help",
"home.cta"
]
},
"es": {
"fallback_pct": 0,
"fallback_keys": []
},
"fr": {
"fallback_pct": 50,
"fallback_keys": [
"home.cta"
]
}
} | Parse the supplied raw log text and compute localization fallback rate by locale. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00ovkup2tdr6bkyj | contributor_item | Submission R6BKYJ | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d=defaultdict(lambda:{'requests':0,'errors':0,'clients':set()})
for line in lines:
f=dict(x.split('=',1) for x in line.split()); r=d[f['version']]; status=int(f['status']); r['requests']+=1;... | version=v1 status=200 client=a
version=v1 status=500 client=b
version=v1 status=200 client=a
version=v2 status=200 client=c
version=v2 status=201 client=d
version=v2 status=400 client=e | {
"v1": {
"traffic_share_pct": 50,
"error_pct": 33.3,
"unique_clients": 2
},
"v2": {
"traffic_share_pct": 50,
"error_pct": 33.3,
"unique_clients": 3
}
} | Parse the supplied raw log text and compute aPI-version adoption and error rate. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00ookup2epikg5vo | contributor_item | Submission IKG5VO | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d=defaultdict(lambda:{'delays':[],'missed':0})
for line in lines:
f=dict(x.split('=',1) for x in line.split()); r=d[f['job']]
if f['actual']=='-':r['missed']+=1
else:r['delay... | job=hourly scheduled=100 actual=105
job=hourly scheduled=200 actual=260
job=hourly scheduled=300 actual=-
job=daily scheduled=1000 actual=1010
job=daily scheduled=2000 actual=2005 | {
"daily": {
"missed": 0,
"max_lateness": 10,
"late_over_30": 0
},
"hourly": {
"missed": 1,
"max_lateness": 60,
"late_over_30": 1
}
} | Parse the supplied raw log text and compute scheduled-job lateness and missed-run detection. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00oakup2dv87z6qt | contributor_item | Submission 87Z6QT | false | import json
def transform(input):
lines = input.strip().splitlines()
rates = {}
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); allowed = int(f['allowed']); limited = int(f['limited'])
rates[f['client']] = allowed / (allowed + limited)
values = list(rates.values()); ... | client=a allowed=90 limited=10
client=b allowed=45 limited=5
client=c allowed=40 limited=40
client=d allowed=18 limited=2 | {
"allow_pct": {
"a": 90,
"b": 90,
"c": 50,
"d": 90
},
"jain_fairness": 0.9552,
"worst_client": "c"
} | Parse the supplied raw log text and compute rate-limit fairness across clients. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00otkup2mkwfcv3p | contributor_item | Submission WFCV3P | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d=defaultdict(lambda:{'bytes':0,'parts':0,'terminal':None})
for line in lines:
f=dict(x.split('=',1) for x in line.split()); r=d[f['upload']]
if f['state']=='stored':r['bytes']+=int(... | upload=u1 part=1 bytes=100 state=stored
upload=u1 part=2 bytes=120 state=stored
upload=u1 part=0 bytes=0 state=complete
upload=u2 part=1 bytes=200 state=stored
upload=u2 part=2 bytes=180 state=stored
upload=u3 part=1 bytes=90 state=stored
upload=u3 part=0 bytes=0 state=abort | {
"completed_bytes": 220,
"orphaned_bytes": 380,
"aborted_uploads": 1
} | Parse the supplied raw log text and compute multipart upload completion and orphaned-byte totals. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00ockup276m7zfts | contributor_item | Submission M7ZFTS | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(dict)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['request']][f['stage']] = int(f['ms'])
result = {}
for req, stages in sorted(d.items()):... | request=r1 stage=queue ms=20
request=r1 stage=compute ms=80
request=r1 stage=network ms=40
request=r2 stage=queue ms=60
request=r2 stage=compute ms=70
request=r2 stage=network ms=20 | {
"r1": {
"total_ms": 140,
"bottleneck": "compute",
"bottleneck_share_pct": 57.1
},
"r2": {
"total_ms": 150,
"bottleneck": "compute",
"bottleneck_share_pct": 46.7
}
} | Parse the supplied raw log text and compute request stage contribution to end-to-end latency. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00odkup22yfz5jqh | contributor_item | Submission FZ5JQH | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['hook']].append((int(f['attempt']), int(f['status'])))
result = {}
for hook, rows in sor... | hook=h1 attempt=1 status=500
hook=h1 attempt=2 status=200
hook=h2 attempt=1 status=429
hook=h2 attempt=2 status=503
hook=h2 attempt=3 status=204
hook=h3 attempt=1 status=400
hook=h3 attempt=2 status=400 | {
"h1": {
"delivered": true,
"attempts_to_delivery": 2,
"retryable_failures": 1
},
"h2": {
"delivered": true,
"attempts_to_delivery": 3,
"retryable_failures": 2
},
"h3": {
"delivered": false,
"attempts_to_delivery": null,
"retryable_failures": 0
}
} | Parse the supplied raw log text and compute webhook eventual success and attempts-to-delivery. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00oekup26pez9e6v | contributor_item | Submission EZ9E6V | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(list)
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); d[f['pod']].append((int(f['throttled_ms']), int(f['latency_ms'])))
result = {}
for pod, rows... | pod=a throttled_ms=0 latency_ms=80
pod=a throttled_ms=20 latency_ms=120
pod=a throttled_ms=40 latency_ms=180
pod=b throttled_ms=0 latency_ms=70
pod=b throttled_ms=10 latency_ms=75 | {
"a": {
"throttled_samples": 2,
"latency_increase_ms": 70
},
"b": {
"throttled_samples": 1,
"latency_increase_ms": 5
}
} | Parse the supplied raw log text and compute cPU throttling impact on latency. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00oikup20h99qukz | contributor_item | Submission 99QUKZ | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d = defaultdict(lambda: {'attempts': 0, 'denied': 0, 'actors': set()})
for line in lines:
f = dict(x.split('=', 1) for x in line.split()); kind = f['resource'].split('://')[0]; r=d[kind]; r[... | actor=u1 resource=s3://a action=read outcome=denied
actor=u1 resource=s3://b action=write outcome=denied
actor=u2 resource=db://orders action=read outcome=allowed
actor=u2 resource=db://users action=write outcome=denied
actor=u3 resource=s3://c action=read outcome=allowed | {
"db": {
"denial_pct": 50,
"affected_actors": [
"u2"
]
},
"s3": {
"denial_pct": 66.7,
"affected_actors": [
"u1"
]
}
} | Parse the supplied raw log text and compute permission-denied concentration by resource class. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00ojkup2imj8tf6s | contributor_item | Submission J8TF6S | false | import json
def transform(input):
lines = input.strip().splitlines()
from datetime import date
rows=[]
for line in lines:
f=dict(x.split('=',1) for x in line.split()); days=(date.fromisoformat(f['expires'])-date.fromisoformat(f['observed'])).days
rows.append({'host':f['host'],'days_rema... | observed=2026-08-18 host=api expires=2026-08-25 issuer=A
observed=2026-08-18 host=cdn expires=2026-10-01 issuer=B
observed=2026-08-18 host=old expires=2026-08-17 issuer=A | {
"certificates": [
{
"host": "old",
"days_remaining": -1,
"risk": "expired"
},
{
"host": "api",
"days_remaining": 7,
"risk": "urgent"
},
{
"host": "cdn",
"days_remaining": 44,
"risk": "normal"
}
],
"urgent_or_expired": 2
} | Parse the supplied raw log text and compute certificate expiry risk relative to observation time. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00olkup2wpjum25a | contributor_item | Submission JUM25A | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict,Counter
order=['cart','shipping','payment','complete']; d=defaultdict(set)
for line in lines:
f=dict(x.split('=',1) for x in line.split()); d[f['session']].add(f['event'])
abandon=Counte... | session=s1 event=cart
session=s1 event=shipping
session=s1 event=payment
session=s1 event=complete
session=s2 event=cart
session=s2 event=shipping
session=s3 event=cart
session=s3 event=shipping
session=s3 event=payment | {
"sessions": 3,
"completed": 1,
"abandoned_after": {
"shipping": 1,
"payment": 1
}
} | Parse the supplied raw log text and compute checkout funnel abandonment stage. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00okkup2fs4ni4yc | contributor_item | Submission 4NI4YC | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d=defaultdict(lambda:{'correct':0,'total':0,'lat':[]})
for line in lines:
f=dict(x.split('=',1) for x in line.split()); r=d[f['model']]; r['total']+=1; r['correct']+=f['prediction']==f['trut... | model=v1 prediction=cat truth=cat latency=40
model=v1 prediction=dog truth=cat latency=45
model=v1 prediction=dog truth=dog latency=50
model=v2 prediction=cat truth=cat latency=55
model=v2 prediction=dog truth=dog latency=60
model=v2 prediction=bird truth=bird latency=70 | {
"v1": {
"accuracy_pct": 66.7,
"median_latency_ms": 45
},
"v2": {
"accuracy_pct": 100,
"median_latency_ms": 60
}
} | Parse the supplied raw log text and compute inference accuracy proxy and latency by model version. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00opkup2n21qnh1a | contributor_item | Submission 1QNH1A | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d=defaultdict(lambda:[0,0,0,0.0])
for line in lines:
f=dict(x.split('=',1) for x in line.split()); r=d[f['campaign']]; vals=[int(f['impressions']),int(f['clicks']),int(f['conversions']),floa... | campaign=a impressions=1000 clicks=50 conversions=5 spend=100
campaign=a impressions=500 clicks=20 conversions=2 spend=40
campaign=b impressions=800 clicks=80 conversions=4 spend=160
campaign=b impressions=200 clicks=10 conversions=1 spend=30 | {
"a": {
"ctr_pct": 4.67,
"conversion_pct_of_clicks": 10,
"cost_per_conversion": 20
},
"b": {
"ctr_pct": 9,
"conversion_pct_of_clicks": 5.5600000000000005,
"cost_per_conversion": 38
}
} | Parse the supplied raw log text and compute advertising click-through and spend per conversion. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00onkup21n8t2vy3 | contributor_item | Submission 8T2VY3 | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
d=defaultdict(list); offenders=[]
for line in lines:
f=dict(x.split('=',1) for x in line.split()); offset=int(f['offset_ms']); d[f['source']].append(abs(offset))
if abs(offset)>50: o... | node=n1 offset_ms=12 source=ntp-a
node=n2 offset_ms=-85 source=ntp-a
node=n3 offset_ms=140 source=ntp-b
node=n4 offset_ms=-20 source=ntp-b | {
"by_source": {
"ntp-a": {
"mean_abs_skew_ms": 48.5,
"max_abs_skew_ms": 85
},
"ntp-b": {
"mean_abs_skew_ms": 80,
"max_abs_skew_ms": 140
}
},
"outside_50ms": [
"n2",
"n3"
]
} | Parse the supplied raw log text and compute clock-skew summary and nodes outside tolerance. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00orkup2s7pf8kul | contributor_item | Submission PF8KUL | false | import json
def transform(input):
lines = input.strip().splitlines()
from collections import defaultdict
starts={}; durations=defaultdict(list)
for line in lines:
f=dict(x.split('=',1) for x in line.split()); g=f['group']; t=int(f['ts'])
if f['event']=='rebalance_start':starts[g]=t
... | group=g1 event=rebalance_start ts=100
group=g1 event=rebalance_end ts=112
group=g1 event=rebalance_start ts=200
group=g1 event=rebalance_end ts=245
group=g2 event=rebalance_start ts=300
group=g2 event=rebalance_end ts=308 | {
"g1": {
"rebalances": 2,
"total_unavailable_s": 57,
"max_rebalance_s": 45
},
"g2": {
"rebalances": 1,
"total_unavailable_s": 8,
"max_rebalance_s": 8
}
} | Parse the supplied raw log text and compute broker consumer-group rebalance stability. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00oxkup2yrbxqlql | contributor_item | Submission BXQLQL | false | import json
def transform(input):
lines = input.strip().splitlines()
import sqlite3
db=sqlite3.connect(':memory:');db.execute('create table logs(product text,type text,amount integer)')
for line in lines:
f=dict(x.split('=',1) for x in line.split());db.execute('insert into logs values(?,?,?)',(... | product=a type=sale amount=100
product=a type=sale amount=80
product=a type=refund amount=30
product=b type=sale amount=200
product=b type=refund amount=50 | {
"a": {
"gross": 180,
"refunds": 30,
"net": 150,
"refund_pct": 16.7
},
"b": {
"gross": 200,
"refunds": 50,
"net": 150,
"refund_pct": 25
}
} | Parse the supplied raw log text and compute sQL revenue and refund net by product. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
cmsxm0nwe00oykup2j0my35xk | contributor_item | Submission MY35XK | false | import json
def transform(input):
lines = input.strip().splitlines()
import sqlite3
db=sqlite3.connect(':memory:');db.execute('create table logs(sensor text,ts integer,value integer)')
for line in lines:
f=dict(x.split('=',1) for x in line.split());db.execute('insert into logs values(?,?,?)',(f... | sensor=a ts=1 value=10
sensor=a ts=2 value=12
sensor=a ts=3 value=30
sensor=b ts=1 value=50
sensor=b ts=2 value=40
sensor=b ts=3 value=43 | {
"sensor": "a",
"timestamp": 3,
"delta": 18
} | Parse the supplied raw log text and compute sQL window function for largest reading jump. Ignore or specially handle the boundary cases encoded in the fixture, preserve deterministic ordering, and return the resulting metrics as a JSON string. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.