| check_vocab_and_split |
Ran ran, violated the contract we drafted |
rsennrich/subword-nmt/subword_nmt/apply_bpe.py code served (permissive licence) · get_code("a0deb98db94ae939") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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
torch.manual_seed(0)
# The function expects:
# - orig: a list of segments (strings) representing a word split by BPE
# - bpe_codes: a dict mapping segments to their (left, right) split
# - vocab: a set or dict of valid vocabulary items
# - separator: a string separator (typically '@@')
# Create a simple BPE codes dictionary
# Maps merged segments to their (left, right) components
bpe_codes = {
'hel': ('h', 'el'),
'hello': ('hel', 'lo'),
'wor': ('w', 'or'),
'world': ('wor', 'ld'),
'test': ('te', 'st'),
'testing</w>': ('test', 'ing</w>'),
'te': ('t', 'e'),
}
# Create a vocabulary set with separator
# The function checks for "segment + separator" for non-final segments
# and just "segment" for final segments
separator = '@@'
vocab = {
'h@@',
'el@@',
'lo@@',
'w@@',
'or@@',
'ld',
't@@',
'e@@',
'st@@',
'ing',
}
# Create orig - a list of segments representing a tokenized word
# The last segment is treated specially (final=True)
orig = ['hel', 'lo']
ARGS = {
'orig': orig,
'bpe_codes': bpe_codes,
'vocab': vocab,
'separator': separator,
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- Imports
- 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
|
| create_parser |
Ran ran; our contract draft was wrong, not the code |
rsennrich/subword-nmt/subword_nmt/learn_bpe.py code served (permissive licence) · get_code("1dc5d59fd80a7419") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ArgumentParser. 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 argparse
import sys
from io import BytesIO
# Create a mock subparsers object if needed
# We'll test both with and without subparsers
# Option 1: Without subparsers (subparsers=None)
ARGS = {
'subparsers': None
}
# Option 2: With subparsers
# Create a parent parser and add subparsers to it
parent_parser = argparse.ArgumentParser()
subparsers_obj = parent_parser.add_subparsers()
# We can test with the subparsers object
ARGS = {
'subparsers': subparsers_obj
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| create_parser |
Ran ran; our contract draft was wrong, not the code |
rsennrich/subword-nmt/subword_nmt/apply_bpe.py code served (permissive licence) · get_code("f9d4ba98fc7a6214") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned ArgumentParser. 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 argparse
import io
# Create temporary file-like objects for the required file arguments
codes_content = b"""e n</w>
t h
th e</w>
"""
codes_file = io.BytesIO(codes_content)
input_content = b"""hello world
this is a test
"""
input_file = io.BytesIO(input_content)
output_file = io.BytesIO()
vocabulary_content = b"""hello 100
world 50
test 30
"""
vocabulary_file = io.BytesIO(vocabulary_content)
ARGS = {
'subparsers': None
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| create_parser |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/apply_bpe.py code served (permissive licence) · get_code("68576350e37086cd") 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 ArgumentParser. 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 sys
import argparse
import io
# Create mock file objects for required file arguments
mock_codes_file = io.StringIO("1 2\n3 4\n5 6\n")
mock_input_file = io.StringIO("hello world\ntest string\n")
mock_output_file = io.StringIO()
mock_vocab_file = io.StringIO("hello 10\nworld 8\ntest 5\n")
ARGS = {
'subparsers': None
}
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| create_parser |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/get_vocab.py code served (permissive licence) · get_code("640ae72885772256") 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 ArgumentParser. 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 sys
import argparse
import tempfile
import os
# Create temporary files for input and output
temp_input = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_input.write("sample vocabulary data\n")
temp_input.close()
temp_output = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_output.close()
# Open files in read and write modes as the function expects
input_file = open(temp_input.name, 'r')
output_file = open(temp_output.name, 'w')
ARGS = {
'subparsers': None
}
# Clean up will happen after function execution
# Store file handles for potential cleanup
_temp_files = [temp_input.name, temp_output.name, input_file, output_file]
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| create_parser |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/learn_bpe.py code served (permissive licence) · get_code("c330a23c53f2f1b3") 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 ArgumentParser. 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 sys
import argparse
import io
# Create file-like objects for input and output
input_file = io.StringIO("hello world\nfoo bar\n")
output_file = io.StringIO()
ARGS = {
'subparsers': None
}
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| create_parser |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/learn_joint_bpe_and_vocab.py code served (permissive licence) · get_code("e4ba5660a014dc1f") 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 ArgumentParser. 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 argparse
import tempfile
import io
# Create temporary file-like objects for input and output
input_file_1 = io.StringIO("hello world\nthis is a test\n")
input_file_2 = io.StringIO("another input file\nwith some text\n")
output_file = io.StringIO()
vocab_file_1 = io.StringIO()
vocab_file_2 = io.StringIO()
ARGS = {
'subparsers': None
}
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| create_parser |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/segment_char_ngrams.py code served (permissive licence) · get_code("3a29f95d3b790d29") 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 ArgumentParser. 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 sys
import argparse
from io import StringIO
import tempfile
# Create temporary file objects for vocab
vocab_content = "the 1000\na 500\nrare 10\nword 20\n"
vocab_file = StringIO(vocab_content)
# Create input file object
input_content = "the rare word example\n"
input_file = StringIO(input_content)
# Create output file object
output_file = StringIO()
ARGS = {
'subparsers': None
}
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| create_parser |
Ran ran on a synthesized input |
mozilla/subword-nmt/subword_nmt/apply_bpe.py code served (permissive licence) · get_code("3a18c84fbdddf7b4") 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 ArgumentParser. 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 sys
import argparse
import io
# Create temporary file-like objects for argparse.FileType arguments
codes_content = """0 1 100
2 3 99
4 5 98"""
codes_file = io.StringIO(codes_content)
vocab_content = """hello 1000
world 500
@@
test 200"""
vocab_file = io.StringIO(vocab_content)
input_file = io.StringIO("hello world test")
output_file = io.StringIO()
ARGS = {
'subparsers': None,
}
- 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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
|
| encode |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
rsennrich/subword-nmt/subword_nmt/apply_bpe.py code served (permissive licence) · get_code("932ffa4dce8fc503") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 random
# Set random seed for reproducibility
random.seed(0)
# Create a simple BPE setup
# bpe_codes: maps pairs to their merge rank
# For example, if we merge ('h', 'e') first, then ('he', 'l'), etc.
bpe_codes = {
('h', 'e'): 0,
('he', 'l'): 1,
('hel', 'l'): 2,
('hell', 'o'): 3,
('w', 'o'): 4,
('wo', 'r'): 5,
('wor', 'l'): 6,
('worl', 'd'): 7,
('world', '</w>'): 8,
('t', 'e'): 9,
('te', 's'): 10,
('tes', 't'): 11,
('test', '</w>'): 12,
}
# bpe_codes_reverse: maps merged segments back to their components
# This is used by check_vocab_and_split to reverse merges
bpe_codes_reverse = {
'he': ('h', 'e'),
'hel': ('he', 'l'),
'hell': ('hel', 'l'),
'hello': ('hell', 'o'),
'wo': ('w', 'o'),
'wor': ('wo', 'r'),
'worl': ('wor', 'l'),
'world': ('worl', 'd'),
'world</w>': ('world', '</w>'),
'te': ('t', 'e'),
'tes': ('te', 's'),
'test': ('tes', 't'),
'test</w>': ('test', '</w>'),
}
# vocab: set of valid vocabulary items (with separator)
vocab = {
'h@@',
'e@@',
'he@@',
'l@@',
'hel@@',
'o@@',
'w@@',
'wo@@',
'r@@',
'd',
'world',
't@@',
'te@@',
's@@',
'test',
}
# separator used in vocab
separator = '@@'
# version tuple
version = (0, 2)
# cache for memoization
cache = {}
# orig: the original word to encode
orig = 'hello'
# glossaries_regex: optional regex for glossary terms (None in this case)
glossaries_regex = None
# is_bytes: whether we're working with bytes
is_bytes = False
# dropout: BPE dropout rate
dropout = 0.0
ARGS = {
'orig': orig,
'bpe_codes': bpe_codes,
'bpe_codes_reverse': bpe_codes_reverse,
'vocab': vocab,
'separator': separator,
'version': version,
'cache': cache,
'glossaries_regex': glossaries_regex,
'is_bytes': is_bytes,
'dropout': dropout,
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- 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
|
| encode |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/apply_bpe.py code served (permissive licence) · get_code("049cda35c34e96c3") 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 random
# Build minimal BPE codes dictionary
# Maps pairs of tokens to their merge rank
bpe_codes = {
('h', 'e'): 0,
('he', 'l'): 1,
('hel', 'l'): 2,
('hell', 'o'): 3,
('c', 'a'): 4,
('ca', 't'): 5,
('h', 'i'): 6,
}
# Build reverse BPE codes (for recursive_split)
# Maps merged tokens back to their components
bpe_codes_reverse = {
'hello</w>': ('hell', 'o</w>'),
'hello': ('hell', 'o'),
'hell': ('hel', 'l'),
'hel': ('he', 'l'),
'he': ('h', 'e'),
'cat</w>': ('ca', 't</w>'),
'cat': ('ca', 't'),
'ca': ('c', 'a'),
'hi</w>': ('h', 'i</w>'),
'hi': ('h', 'i'),
}
# Build vocabulary with separator
separator = '@@'
vocab = {
'h@@',
'e@@',
'l@@',
'o',
'c@@',
'a@@',
't',
'i@@',
'hello',
'cat',
'hi',
}
# Test word to encode
orig = 'hello'
# Cache for storing encoded results
cache = {}
# BPE version
version = (0, 2)
# No glossaries regex
glossaries_regex = None
# No dropout
dropout = 0
ARGS = {
'orig': orig,
'bpe_codes': bpe_codes,
'bpe_codes_reverse': bpe_codes_reverse,
'vocab': vocab,
'separator': separator,
'version': version,
'cache': cache,
'glossaries_regex': glossaries_regex,
'dropout': dropout,
}
- 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
|
| extract_ngrams |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/chrF.py code served (permissive licence) · get_code("52bdb02fe848dfd2") 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 defaultdict. 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.
from collections import defaultdict
ARGS = {
"words": "hello world python",
"max_length": 4,
"spaces": False
}
- 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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
|
| f1 |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/chrF.py code served (permissive licence) · get_code("9b27e34636c16aac") 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 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
torch.manual_seed(0)
# Analyze the function:
# - correct: indexed by i in range(max_length), accessed as correct[i]
# - total_hyp: indexed by i in range(max_length), accessed as total_hyp[i]
# - total_ref: indexed by i in range(max_length), accessed as total_ref[i]
# - max_length: used in range(max_length)
# - beta: numeric parameter with default 3
# - smooth: numeric parameter with default 0
#
# The function treats correct, total_hyp, total_ref as indexable containers
# with max_length elements that support arithmetic operations (+, /)
max_length = 5
# Create indexable containers (lists of numbers work fine)
correct = [10, 8, 12, 9, 11]
total_hyp = [15, 10, 14, 12, 13]
total_ref = [12, 9, 11, 10, 14]
ARGS = {
"correct": correct,
"total_hyp": total_hyp,
"total_ref": total_ref,
"max_length": max_length,
"beta": 3,
"smooth": 0
}
- 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 tuple, ndim 1, 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
|
| get_correct |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/chrF.py code served (permissive licence) · get_code("e985a436f19df6e2") 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 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
torch.manual_seed(0)
# Analyze the function: it expects nested dicts where:
# - ngrams_ref is dict[rank] -> dict[chain] -> count
# - ngrams_test is dict[rank] -> dict[chain] -> count
# - correct is dict[rank] -> int
# - total is dict[rank] -> int
ngrams_ref = {
1: {"the": 5, "a": 3, "cat": 2},
2: {"the cat": 4, "a dog": 2, "the dog": 1},
}
ngrams_test = {
1: {"the": 4, "a": 2, "bird": 1},
2: {"the cat": 3, "a dog": 2, "the bird": 1},
}
correct = {
1: 0,
2: 0,
}
total = {
1: 0,
2: 0,
}
ARGS = {
"ngrams_ref": ngrams_ref,
"ngrams_test": ngrams_test,
"correct": correct,
"total": total,
}
- 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 tuple, ndim 1, 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
|
| get_pair_statistics |
Ran ran; our contract draft was wrong, not the code |
rsennrich/subword-nmt/subword_nmt/learn_bpe.py code served (permissive licence) · get_code("fe96394f96a9c638") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, 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.
vocab = [
(['h', 'e', 'l', 'l', 'o'], 5),
(['w', 'o', 'r', 'l', 'd'], 3),
(['h', 'e', 'l', 'l'], 2),
(['w', 'o', 'r', 'd'], 4),
]
ARGS = {
'vocab': vocab
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- 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 1, 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
|
| get_stats |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/bpe_toy.py code served (permissive licence) · get_code("e7b94766e4ee985e") 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 defaultdict. 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 collections
vocab = {'l o w</w>': 5, 'l o w e r</w>': 2, 'n e w e s t</w>': 6, 'w i d e s t</w>': 3}
def get_stats(vocab):
pairs = collections.defaultdict(int)
for word, freq in vocab.items():
symbols = word.split()
for i in range(len(symbols) - 1):
pairs[symbols[i], symbols[i + 1]] += freq
return pairs
ARGS = {
'vocab': {'l o w</w>': 5, 'l o w e r</w>': 2, 'n e w e s t</w>': 6, 'w i d e s t</w>': 3}
}
- 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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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_vocabulary |
Ran ran; our contract draft was wrong, not the code |
rsennrich/subword-nmt/subword_nmt/learn_bpe.py code served (permissive licence) · get_code("b83d785ca99bfc9f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Counter. 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 tempfile
import os
# Create a temporary text file with sample content
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, encoding='utf-8')
temp_file.write("hello world\n")
temp_file.write("hello python\n")
temp_file.write("world of code\n")
temp_file.close()
# Open the file for reading
fobj = open(temp_file.name, 'r', encoding='utf-8')
ARGS = {
'fobj': fobj,
'is_dict': False,
'is_bytes': False,
'num_workers': 1
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- 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 Counter — a Counter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Counter 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_vocabulary |
Ran ran; our contract draft was wrong, not the code |
mozilla/subword-nmt/subword_nmt/learn_bpe.py pointer only (licence: MIT); the stored copy get_code serves, from thinkwee/DPP_CNN_Summarization, is pointer only (licence: NONE) · get_code("bc7574327ea1f634") How it ranThe body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from thinkwee/DPP_CNN_Summarization, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| get_vocabulary |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/learn_bpe.py code served (permissive licence) · get_code("7d923800aaefd70c") 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 Counter. 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 tempfile
import io
from collections import Counter
# Create a temporary text file with sample vocabulary data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt', encoding='utf8')
temp_file.write("hello 5\nworld 3\ntest 2\n")
temp_file.flush()
temp_file.close()
# Open the file object for reading
fobj = open(temp_file.name, 'r', encoding='utf8')
ARGS = {
'fobj': fobj,
'is_dict': True,
'num_workers': 1
}
- 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 Counter — a Counter output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Counter 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
|
| load_merge_table |
Ran ran; our contract draft was wrong, not the code |
VProv/BPE-Dropout/bpe.py code served (permissive licence) · get_code("990d82424d309a3b") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 tempfile
import os
# Create a temporary file with merge table data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("hello\tworld\t100\n")
temp_file.write("foo\tbar\t200\n")
temp_file.write("test\ttoken\t50\n")
temp_file.close()
ARGS = {
'path': temp_file.name
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- 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
|
| load_subword_nmt_table |
Ran ran; our contract draft was wrong, not the code |
VProv/BPE-Dropout/bpe.py code served (permissive licence) · get_code("03e9a6a74a57cc23") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 tempfile
import os
# Create a temporary file with subword-nmt format merge table
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("#version: 0.2\n")
temp_file.write("e s\n")
temp_file.write("t h\n")
temp_file.write("es t\n")
temp_file.write("th e\n")
temp_file.close()
ARGS = {
'path': temp_file.name
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- 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
|
| merge_vocab |
Ran ran on a synthesized input |
PatxiofromAlphensign/subword-nmt-mods/subword_nmt/bpe_toy.py code served (permissive licence) · get_code("6428a14ec7b62a2c") 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 re
def merge_vocab(pair, v_in):
v_out = {}
bigram_pattern = re.escape(' '.join(pair))
p = re.compile('(?<!\\S)' + bigram_pattern + '(?!\\S)')
for word in v_in:
w_out = p.sub(''.join(pair), word)
v_out[w_out] = v_in[word]
return v_out
# Setup code
pair = ('hello', 'world')
v_in = {
'hello world': 5,
'hello there': 3,
'world peace': 2,
'goodbye world': 1
}
ARGS = {
'pair': pair,
'v_in': v_in
}
- 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
|
| tokenize_word |
Ran ran; our contract draft was wrong, not the code |
VProv/BPE-Dropout/bpe.py code served (permissive licence) · get_code("d7a0c20cde2f68a7") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 a simple merge_rules dictionary
# Keys are tuples of (token1, token2), values are merge priorities (lower = higher priority)
merge_rules = {
('h', 'e'): 0,
('l', 'l'): 1,
('he', 'l'): 2,
('hel', 'l'): 3,
('o', '$'): 4,
('^', 'h'): 5,
('^h', 'e'): 6,
('e', 'l'): 7,
('el', 'l'): 8,
('ell', 'o'): 9,
('ello', '$'): 10,
}
# A simple word to tokenize
word = "hello"
# Dropout rate
dropout = 0.1
# Random generator
random_generator = np.random.RandomState(42)
# Sentinels for beginning and end of word
sentinels = ['^', '$']
# Regime for BPE symbol placement
regime = 'begin'
# BPE symbol
bpe_symbol = '`'
# Always merge sentinels flag
always_merge_sentinels = True
ARGS = {
'merge_rules': merge_rules,
'word': word,
'dropout': dropout,
'random_generator': random_generator,
'sentinels': sentinels,
'regime': regime,
'bpe_symbol': bpe_symbol,
'always_merge_sentinels': always_merge_sentinels,
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- 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
|
| validate_ignore_ids |
Ran ran on a synthesized input |
VKCOM/YouTokenToMe/youtokentome/yttm_cli.py code served (permissive licence) · get_code("6a9c6917f21d9cd1") 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 int; 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 click
# Mock Click context and parameter objects
class MockParam:
def __init__(self, name="ignore_ids"):
self.name = name
class MockContext:
pass
# Set up arguments for validate_ignore_ids function
ctx = MockContext()
param = MockParam()
# Test case 1: Valid comma-separated integers
value = "1,2,3,5"
ARGS = {
"ctx": ctx,
"param": param,
"value": value
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- click — 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 int — 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
|