| create_logger |
Ran ran on a synthesized input |
AI-Guru/MMM-JSB/source/logging.py code served (permissive licence) · get_code("8cf31e4865906735") 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 Logger. 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 logging
loggers_dict = {}
def create_logger(name: str):
global loggers_dict
if name in loggers_dict:
return loggers_dict[name]
else:
logger = logging.getLogger(name)
loggers_dict[name] = logger
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.propagate = False
return logger
ARGS = {
"name": "test_logger"
}
- 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 Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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_song_data |
Ran ran on a synthesized input |
AI-Guru/MMM-JSB/source/preprocess/encode.py code served (permissive licence) · get_code("129598d1deb4afec") 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 numpy as np
import random
random.seed(0)
np.random.seed(0)
# Construct track data with proper structure
def create_track_data(track_number, is_drums=False, num_bars=8):
bars = []
for bar_idx in range(num_bars):
events = []
if bar_idx % 3 != 0: # Most bars have events
events = [
{'type': 'NOTE_ON', 'pitch': 60},
{'type': 'TIME_DELTA', 'delta': 120},
{'type': 'NOTE_OFF', 'pitch': 60},
{'type': 'NOTE_ON', 'pitch': 64},
{'type': 'TIME_DELTA', 'delta': 120},
{'type': 'NOTE_OFF', 'pitch': 64},
]
else: # Some bars are fills
events = 'bar_fill'
bars.append({'events': events})
return {
'number': track_number,
'drums': is_drums,
'bars': bars
}
# Create song data with multiple tracks
song_data = {
'tracks': [
create_track_data(0, is_drums=False, num_bars=8),
create_track_data(1, is_drums=True, num_bars=8),
create_track_data(2, is_drums=False, num_bars=8),
]
}
# Set up parameters for encode_song_data
transpositions = [0, 5]
permute = True
window_size_bars = 4
hop_length_bars = 2
density_bins = np.array([2, 4, 6, 8, 10])
bar_fill = True
ARGS = {
'song_data': song_data,
'transpositions': transpositions,
'permute': permute,
'window_size_bars': window_size_bars,
'hop_length_bars': hop_length_bars,
'density_bins': density_bins,
'bar_fill': bar_fill
}
- 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 — 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
|
| encode_songs_data |
Ran ran on a synthesized input |
AI-Guru/MMM-JSB/source/preprocess/encode.py code served (permissive licence) · get_code("c0aa9297b2b8818c") 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 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.
import numpy as np
import random
random.seed(0)
np.random.seed(0)
# Helper function to create minimal song_data structure
def create_song_data(num_tracks=2, num_bars=8, num_events_per_bar=3):
tracks = []
for track_idx in range(num_tracks):
bars = []
for bar_idx in range(num_bars):
events = []
for event_idx in range(num_events_per_bar):
event_type = random.choice(['NOTE_ON', 'NOTE_OFF', 'TIME_DELTA'])
if event_type == 'NOTE_ON' or event_type == 'NOTE_OFF':
events.append({
'type': event_type,
'pitch': random.randint(60, 84)
})
else: # TIME_DELTA
events.append({
'type': event_type,
'delta': random.randint(1, 480)
})
bars.append({
'events': events
})
tracks.append({
'number': track_idx,
'drums': track_idx == 0, # First track is drums
'bars': bars
})
return {'tracks': tracks}
# Create multiple songs
songs_data = [
create_song_data(num_tracks=2, num_bars=8, num_events_per_bar=3),
create_song_data(num_tracks=2, num_bars=8, num_events_per_bar=3)
]
# Define arguments for encode_songs_data
ARGS = {
'songs_data': songs_data,
'transpositions': [0, 2, -2], # List of transposition values
'permute': True, # Whether to permute tracks
'window_size_bars': 4, # Window size in bars
'hop_length_bars': 2, # Hop length in bars
'density_bins': np.array([5, 10, 15, 20]), # Density bins for np.digitize
'bar_fill': False # Whether to include bar fill
}
- 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 2, 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_track_data |
Ran ran on a synthesized input |
AI-Guru/MMM-JSB/source/preprocess/encode.py code served (permissive licence) · get_code("33e98f4a06cc60b9") 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
# Define helper function that's used by encode_track_data
def encode_event_data(event_data, transposition):
if event_data['type'] == 'NOTE_ON':
return event_data['type'] + '=' + str(event_data['pitch'] + transposition)
elif event_data['type'] == 'NOTE_OFF':
return event_data['type'] + '=' + str(event_data['pitch'] + transposition)
elif event_data['type'] == 'TIME_DELTA':
return event_data['type'] + '=' + str(event_data['delta'])
def encode_bar_data(bar_data, transposition, bar_fill=False):
tokens = []
if not bar_fill:
tokens += ['BAR_START']
else:
tokens += ['FILL_START']
if bar_data['events'] == 'bar_fill':
tokens += ['FILL_IN']
else:
for event_data in bar_data['events']:
tokens += [encode_event_data(event_data, transposition)]
if not bar_fill:
tokens += ['BAR_END']
else:
tokens += ['FILL_END']
return tokens
# Create test data
track_data = {
'number': 5,
'drums': False,
'bars': [
{
'events': [
{'type': 'NOTE_ON', 'pitch': 60},
{'type': 'TIME_DELTA', 'delta': 480},
{'type': 'NOTE_OFF', 'pitch': 60},
]
},
{
'events': [
{'type': 'NOTE_ON', 'pitch': 64},
{'type': 'TIME_DELTA', 'delta': 240},
{'type': 'NOTE_OFF', 'pitch': 64},
]
},
{
'events': 'bar_fill'
}
]
}
density_bins = np.array([2, 5, 10, 20])
bar_start_index = 0
bar_end_index = 2
transposition = 12
ARGS = {
'track_data': track_data,
'density_bins': density_bins,
'bar_start_index': bar_start_index,
'bar_end_index': bar_end_index,
'transposition': transposition
}
- 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
|
| events_to_events_data |
Ran ran on a synthesized input |
AI-Guru/MMM-JSB/source/preprocess/preprocessutilities.py code served (permissive licence) · get_code("5920e9d4e94038f4") 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
def events_to_events_data(events):
events = sorted(events, key=lambda event: event[2])
events_data = []
for event_index, event, event_next in zip(range(len(events)), events, events[1:] + [None]):
if event_index == 0 and event[2] != 0.0:
event_data = {'type': 'TIME_DELTA', 'delta': event[2]}
events_data += [event_data]
event_data = {'type': event[0], 'pitch': event[1]}
events_data += [event_data]
if event_next is None:
continue
delta = event_next[2] - event[2]
assert delta >= 0, events
if delta != 0.0:
event_data = {'type': 'TIME_DELTA', 'delta': delta}
events_data += [event_data]
return events_data
# Construct valid events for the function
# Each event is a tuple: (type_str, pitch_value, time_value)
events = [
('NOTE_ON', 60, 0.0),
('NOTE_OFF', 60, 0.5),
('NOTE_ON', 64, 1.0),
('NOTE_OFF', 64, 1.5),
]
ARGS = {
'events': events
}
- 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
|
| generate |
Ran ran on a synthesized input |
AI-Guru/MMM-JSB/source/helpers/samplinghelpers.py code served (permissive licence) · get_code("573835f67b3e07a7") 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 torch
import torch.nn as nn
torch.manual_seed(0)
# Stand-in tokenizer class with encode and decode methods
class SimpleTokenizer:
def __init__(self, vocab_size=100):
self.vocab_size = vocab_size
def encode(self, text, return_tensors=None):
# Convert text to token ids
token_ids = [hash(text) % self.vocab_size for _ in range(5)]
tensor = torch.tensor([token_ids], dtype=torch.long)
if return_tensors == 'pt':
return tensor
return token_ids
def decode(self, token_ids):
# Convert token ids back to text
if isinstance(token_ids, torch.Tensor):
token_ids = token_ids.tolist()
return "generated text sample"
# Stand-in model class with generate method
class SimpleModel(nn.Module):
def __init__(self, vocab_size=100, hidden_size=8):
super().__init__()
self.vocab_size = vocab_size
self.hidden_size = hidden_size
self.embedding = nn.Embedding(vocab_size, hidden_size)
self.linear = nn.Linear(hidden_size, vocab_size)
def generate(self, input_ids, max_length=1000, temperature=0.9):
# Simulate generation by returning the input_ids padded with random tokens
batch_size = input_ids.shape[0]
# Return a tensor of shape (batch_size, some_length) with token ids
generated = torch.randint(0, self.vocab_size, (batch_size, 10), dtype=torch.long)
return generated
def forward(self, input_ids):
embeddings = self.embedding(input_ids)
logits = self.linear(embeddings)
return logits
# Create instances
model = SimpleModel(vocab_size=100, hidden_size=8)
tokenizer = SimpleTokenizer(vocab_size=100)
token_sequence = "hello world"
ARGS = {
"model": model,
"tokenizer": tokenizer,
"token_sequence": token_sequence
}
- 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 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_priming_token_sequence |
Ran ran on a synthesized input |
AI-Guru/MMM-JSB/source/helpers/samplinghelpers.py code served (permissive licence) · get_code("0d3f35802ce765a7") 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 random
import tempfile
import os
# Create a temporary data file with sample token sequences
temp_dir = tempfile.mkdtemp()
data_path = os.path.join(temp_dir, "tokens.txt")
# Write sample data with TRACK_END tokens
with open(data_path, 'w') as f:
f.write("token1 token2 TRACK_END token3 token4 TRACK_END token5\n")
f.write("hello world TRACK_END foo bar TRACK_END baz\n")
f.write("a b c TRACK_END d e f TRACK_END g\n")
ARGS = {
"data_path": data_path,
"stop_on_track_end": None,
"stop_after_n_tokens": None,
"return_original": 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 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
|
| note_sequence_to_bars |
Ran ran on a synthesized input |
AI-Guru/MMM-JSB/source/helpers/noteseqhelpers.py code served (permissive licence) · get_code("0aaab2ae2d7b40a7") 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 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.
import torch
import numpy as np
class Note:
def __init__(self, start_time, pitch, velocity, end_time):
self.start_time = start_time
self.pitch = pitch
self.velocity = velocity
self.end_time = end_time
class Tempo:
def __init__(self, qpm):
self.qpm = qpm
class NoteSequence:
def __init__(self, tempos, notes, total_time):
self.tempos = tempos
self.notes = notes
self.total_time = total_time
# Create a small stand-in NoteSequence
tempos = [Tempo(qpm=120.0)]
notes = [
Note(start_time=0.0, pitch=60, velocity=80, end_time=0.5),
Note(start_time=0.5, pitch=64, velocity=80, end_time=1.0),
Note(start_time=2.0, pitch=67, velocity=80, end_time=2.5),
Note(start_time=2.5, pitch=72, velocity=80, end_time=3.0),
]
total_time = 4.0
note_sequence = NoteSequence(tempos=tempos, notes=notes, total_time=total_time)
threshold = 0.1
ARGS = {
"note_sequence": note_sequence,
"threshold": threshold,
}
- 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 2, 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
|
| set_note_sequence_tempo |
Ran ran on a synthesized input |
AI-Guru/MMM-JSB/source/helpers/noteseqhelpers.py code served (permissive licence) · get_code("08b4219bbb9aebcc") 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 NoteSequence. 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.
class Tempo:
def __init__(self, time=0.0, qpm=120.0):
self.time = time
self.qpm = qpm
class Note:
def __init__(self, start_time=0.0, end_time=1.0, pitch=60, velocity=64):
self.start_time = start_time
self.end_time = end_time
self.pitch = pitch
self.velocity = velocity
class NoteSequence:
def __init__(self, tempos=None, notes=None, total_time=4.0):
self.tempos = tempos if tempos is not None else []
self.notes = notes if notes is not None else []
self.total_time = total_time
note_sequence = NoteSequence(
tempos=[Tempo(time=0.0, qpm=120.0)],
notes=[
Note(start_time=0.0, end_time=1.0, pitch=60, velocity=64),
Note(start_time=1.0, end_time=2.0, pitch=64, velocity=64),
],
total_time=4.0
)
target_tempo = 60.0
ARGS = {
"note_sequence": note_sequence,
"target_tempo": target_tempo,
}
- 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 NoteSequence — a NoteSequence output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoteSequence 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
|