| add_timeline_deltas |
Ran ran; our contract draft was wrong, not the code |
amirzia/clpsych26-cuny/clpsych/task2/features.py code served (permissive licence) · get_code("26e051467dae8b26") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
# Examine the function to understand what it needs:
# - timeline: list[Post] where Post = dict[str, Any]
# - Each post dict needs keys: 'adaptive', 'maladaptive'
# - The function reads these values and adds 'abs_adaptive' and 'abs_maladaptive' keys
# Create a timeline with multiple posts containing adaptive and maladaptive presence values
timeline = [
{
'adaptive': 5,
'maladaptive': 3,
'id': 'post_1'
},
{
'adaptive': 7,
'maladaptive': 2,
'id': 'post_2'
},
{
'adaptive': 0,
'maladaptive': 4,
'id': 'post_3'
},
{
'adaptive': 6,
'maladaptive': 0,
'id': 'post_4'
},
{
'adaptive': 8,
'maladaptive': 5,
'id': 'post_5'
}
]
ARGS = {
'timeline': timeline
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| aggregate_results |
Ran ran; our contract draft was wrong, not the code |
amirzia/clpsych26-cuny/clpsych/task1/aggregate_results.py code served (permissive licence) · get_code("cf56af99be81271c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
# Create sample results for aggregate_results
# The function expects a list of lists of dicts, where each dict represents a post prediction
# First, create a single post prediction dict
def create_post_dict(post_id, timeline_id):
return {
'post_id': post_id,
'timeline_id': timeline_id,
'adaptive-state': {
'A': {'subelement': 1},
'B-O': {'subelement': 0},
'B-S': {'subelement': 1},
'C-O': {'subelement': 0},
'C-S': {'subelement': 1},
'D': {'subelement': 0},
'Presence': 3
},
'maladaptive-state': {
'A': {'subelement': 0},
'B-O': {'subelement': 1},
'B-S': {'subelement': 0},
'C-O': {'subelement': 1},
'C-S': {'subelement': 0},
'D': {'subelement': 1},
'Presence': 2
}
}
# Create multiple submissions (each submission is a list of post predictions)
submission1 = [
create_post_dict('post_001', 'timeline_A'),
create_post_dict('post_002', 'timeline_A')
]
submission2 = [
create_post_dict('post_001', 'timeline_A'),
create_post_dict('post_002', 'timeline_A')
]
submission3 = [
create_post_dict('post_001', 'timeline_A'),
create_post_dict('post_002', 'timeline_A')
]
# Vary some values slightly in submission2 and submission3 for meaningful majority voting
submission2[0]['adaptive-state']['A']['subelement'] = 1
submission2[0]['maladaptive-state']['Presence'] = 3
submission3[0]['adaptive-state']['A']['subelement'] = 0
submission3[0]['maladaptive-state']['Presence'] = 2
results = [submission1, submission2, submission3]
ARGS = {
'results': results
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| extract_json_block |
Ran ran; our contract draft was wrong, not the code |
amirzia/clpsych26-cuny/clpsych/common/utils.py code served (permissive licence) · get_code("cc69d4e7ee84e115") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
def extract_json_block(response: str) -> str:
if '```json' in response:
return re.findall('```json([\\s\\S]*?)```', response)[-1]
return response
# Test case 1: response with json code block
response_with_json = """
Some text before
json
{"key": "value", "number": 42}
Some text after
"""
# Test case 2: response without json code block
response_without_json = '{"key": "value"}'
ARGS = {
'response': response_with_json
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_subelement_index |
Ran ran, honoured the contract we drafted |
amirzia/clpsych26-cuny/clpsych/common/data_loader.py code served (permissive licence) · get_code("316491c48054c516") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import re
import math
def get_subelement_index(subelement: str) -> int:
index = int(re.match('\\(([0-9]*)\\)', subelement).group(1))
return math.ceil(index / 2)
ARGS = {
"subelement": "(5)"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| group_posts_by_timeline |
Ran ran; our contract draft was wrong, not the code |
amirzia/clpsych26-cuny/clpsych/task2/features.py code served (permissive licence) · get_code("79d8e6ab299a2a40") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
# Create a list of posts, each post is a dict with at least 'timeline_id'
posts = [
{'timeline_id': 1, 'content': 'post 1'},
{'timeline_id': 1, 'content': 'post 2'},
{'timeline_id': 2, 'content': 'post 3'},
{'timeline_id': 2, 'content': 'post 4'},
{'timeline_id': 3, 'content': 'post 5'},
]
ARGS = {
'posts': posts
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list — a list output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| inject_llm_presence |
Ran ran; our contract draft was wrong, not the code |
amirzia/clpsych26-cuny/clpsych/task2/predictions.py code served (permissive licence) · get_code("ddd736a0e6d55833") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import csv
from pathlib import Path
import tempfile
import os
# Create a temporary CSV file with test data
temp_dir = tempfile.mkdtemp()
csv_path = os.path.join(temp_dir, "test_results.csv")
# Write test CSV data
with open(csv_path, 'w', newline='') as f:
writer = csv.DictWriter(f, fieldnames=['post_id', 'llm_adaptive_presence', 'llm_maladaptive_presence'])
writer.writeheader()
writer.writerow({'post_id': 'post_1', 'llm_adaptive_presence': '1', 'llm_maladaptive_presence': '0'})
writer.writerow({'post_id': 'post_2', 'llm_adaptive_presence': '0', 'llm_maladaptive_presence': '1'})
writer.writerow({'post_id': 'post_3', 'llm_adaptive_presence': '1', 'llm_maladaptive_presence': '1'})
# Create timeline_posts list with some posts that match the CSV and some that don't
timeline_posts = [
{
'post_id': 'post_1',
'text': 'First post',
'adaptive': 0,
'maladaptive': 0,
'timestamp': '2023-01-01'
},
{
'post_id': 'post_2',
'text': 'Second post',
'adaptive': 1,
'maladaptive': 1,
'timestamp': '2023-01-02'
},
{
'post_id': 'post_not_in_csv',
'text': 'Third post',
'adaptive': 0,
'maladaptive': 0,
'timestamp': '2023-01-03'
},
{
'post_id': 'post_3',
'text': 'Fourth post',
'adaptive': 0,
'maladaptive': 1,
'timestamp': '2023-01-04'
}
]
ARGS = {
'timeline_posts': timeline_posts,
'csv_path': csv_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| make_pipeline |
Ran ran; our contract draft was wrong, not the code |
amirzia/clpsych26-cuny/clpsych/task2/classify.py code served (permissive licence) · get_code("3b375b85fbbaf8ed") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Pipeline. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.feature_extraction import DictVectorizer
# Create a simple classifier (LogisticRegression is a valid sklearn classifier)
clf = LogisticRegression(max_iter=100, random_state=0)
# Construct the arguments dictionary
ARGS = {
'clf': clf
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Pipeline — a Pipeline output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Pipeline output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| post_to_record |
Ran ran; our contract draft was wrong, not the code |
amirzia/clpsych26-cuny/clpsych/task2/data.py code served (permissive licence) · get_code("f8894a5bdf4b85c9") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
# Construct a minimal post dict with all required fields
post = {
'post_id': 'post_123',
'post_index': 0,
'Well-being': 5,
'Switch': True,
'Escalation': False,
'evidence': {
'adaptive-state': {
'Presence': 1,
'extra_key_1': 'value1',
'extra_key_2': 'value2'
},
'maladaptive-state': {
'Presence': 0,
'extra_key_1': 'value1'
}
}
}
timeline_id = 'timeline_001'
ARGS = {
'post': post,
'timeline_id': timeline_id
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| read_data_train |
Ran ran, honoured the contract we drafted |
amirzia/clpsych26-cuny/clpsych/common/data_loader.py code served (permissive licence) · get_code("bbdd7ac93901ff40") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
from pathlib import Path
# Create sample timeline data structures
sample_timeline_1 = {
'timeline_id': '306d938d4b',
'posts': [
{
'post_id': 'post_001',
'post_index': 0,
'date': '2023-01-01',
'post': 'Sample post content',
'Switch': '0',
'Escalation': '1',
'Well-being': 5,
'evidence': {
'adaptive-state': {
'Presence': 1,
'A': {
'highlighted_evidence': 'feeling good',
'Category': '(1)'
}
},
'maladaptive-state': {
'Presence': 1,
'B-O': {
'highlighted_evidence': 'negative behavior',
'Category': '(1)'
}
}
}
},
{
'post_id': 'post_002',
'post_index': 1,
'date': '2023-01-02',
'post': 'Another post',
'Switch': '1',
'Escalation': '0',
'Well-being': 3,
'evidence': {
'adaptive-state': {
'Presence': 1,
'C-S': {
'highlighted_evidence': 'positive thought',
'Category': '(2)'
}
},
'maladaptive-state': {
'Presence': 1,
'D': {
'highlighted_evidence': 'unwanted desire',
'Category': '(1)'
}
}
}
}
]
}
sample_timeline_2 = {
'timeline_id': '83997cd4e7',
'posts': [
{
'post_id': 'post_003',
'post_index': 0,
'date': '2023-01-03',
'post': 'Third post',
'Switch': '0',
'Escalation': '0',
'Well-being': 4,
'evidence': {
'adaptive-state': {
'Presence': 1,
'B-S': {
'highlighted_evidence': 'self behavior',
'Category': '(1)'
}
},
'maladaptive-state': {
'Presence': 1,
'C-O': {
'highlighted_evidence': 'other cognition',
'Category': '(2)'
}
}
}
}
]
}
sample_timeline_3 = {
'timeline_id': '7d9d2e0e0a',
'posts': [
{
'post_id': 'post_004',
'post_index': 0,
'date': '2023-01-04',
'post': 'Fourth post',
'Switch': '1',
'Escalation': '1',
'Well-being': 2,
'evidence': {
'adaptive-state': {
'Presence': 1,
'A': {
'highlighted_evidence': 'affect positive',
'Category': '(1)'
}
},
'maladaptive-state': {
'Presence': 1,
'B-O': {
'highlighted_evidence': 'behavior others neg',
'Category': '(2)'
}
}
}
}
]
}
# Create a minimal mock data path (will not actually be used for file I/O in setup)
data_path = Path('/tmp/data')
ARGS = {
'data_path': data_path,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| read_llm_presence |
Ran ran; our contract draft was wrong, not the code |
amirzia/clpsych26-cuny/clpsych/task2/predictions.py code served (permissive licence) · get_code("bc1d88eee5878f8f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import csv
from pathlib import Path
import tempfile
# Create a temporary CSV file with valid data
temp_dir = tempfile.TemporaryDirectory()
csv_path = Path(temp_dir.name) / "test_results.csv"
# Write a sample CSV file that matches the expected format
with open(csv_path, 'w', newline='') as f:
writer = csv.DictWriter(f, fieldnames=['post_id', 'llm_adaptive_presence', 'llm_maladaptive_presence'])
writer.writeheader()
writer.writerow({'post_id': 'post_001', 'llm_adaptive_presence': '1', 'llm_maladaptive_presence': '0'})
writer.writerow({'post_id': 'post_002', 'llm_adaptive_presence': '0', 'llm_maladaptive_presence': '1'})
writer.writerow({'post_id': 'post_003', 'llm_adaptive_presence': '1', 'llm_maladaptive_presence': '1'})
ARGS = {
'csv_path': csv_path
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| select_features |
Ran ran; our contract draft was wrong, not the code |
amirzia/clpsych26-cuny/clpsych/task2/features.py code served (permissive licence) · get_code("f880dd22c732296c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from typing import Any
Post = dict[str, Any]
# Define the ARGS dict with valid arguments for select_features
ARGS = {
"sequence": [
{
"user_id": 123,
"text": "hello world",
"timestamp": 1000,
"likes": 42,
"extra_field": "ignore_me"
},
{
"user_id": 456,
"text": "another post",
"timestamp": 2000,
"likes": 99,
"extra_field": "also_ignore_me"
}
],
"feature_labels": {
"user_id": 1,
"text": 1,
"timestamp": 1,
"likes": 1
}
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| load_timeline |
Not yet run unverified (harvested, no recorded run) |
amirzia/clpsych26-cuny/clpsych/common/data_loader.py code served (permissive licence) · get_code("c7f342bad945e394") How it ran |