| clustering_coef |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/metrics/unsupervised.py code served (permissive licence) · get_code("63aac8f5f179202d") 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 float64, ndim 0, 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 small adjacency matrix (undirected, weighted)
# 4 nodes, represented as a 4x4 symmetric matrix
adj = np.array([
[0, 1, 1, 0],
[1, 0, 1, 1],
[1, 1, 0, 1],
[0, 1, 1, 0]
], dtype=float)
# Create a community assignment matrix Z_pred
# Shape: (n_nodes, n_communities) = (4, 3)
# Each row is a node, each column is a community
# Soft assignments that will be converted to boolean
Z_pred = np.array([
[0.9, 0.1, 0.0],
[0.8, 0.2, 0.0],
[0.1, 0.9, 0.0],
[0.0, 0.1, 0.9]
], dtype=float)
ARGS = {
'Z_pred': Z_pred,
'adj': adj
}
- 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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- 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
|
| collate_fn |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/sampler.py code served (permissive licence) · get_code("320644b201489839") 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. 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
torch.manual_seed(0)
# The function expects batch[0] to be a tuple of (edges, nonedges)
# batch is a list-like structure where we can index it with [0]
edges = torch.randn(2, 4)
nonedges = torch.randn(3, 4)
batch = [(edges, nonedges)]
ARGS = {
"batch": batch
}
- 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 tuple — a tuple 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
|
| coms_list_to_matrix |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/utils.py code served (permissive licence) · get_code("8ccaf8d33fe9b54c") 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 ndarray, ndim 2, dtype family float, shape (5, 3) 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 numpy as np
# Create a small communities list where we have 3 communities
# Community 0: nodes [0, 1]
# Community 1: nodes [2, 4]
# Community 2: nodes [1, 3]
communities_list = [
[0, 1],
[2, 4],
[1, 3]
]
# num_nodes is explicitly set to ensure the matrix has correct shape
# even if some nodes are isolated
num_nodes = 5
ARGS = {
"communities_list": communities_list,
"num_nodes": num_nodes
}
- 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 ndarray, ndim 2, dtype family float, shape (5, 3) — shape (5, 3) 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
|
| coverage |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/metrics/unsupervised.py code served (permissive licence) · get_code("1a89f3b438368b8c") 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 Tensor, ndim 0, dtype family float, 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 torch
import scipy.sparse as sp
import numpy as np
torch.manual_seed(0)
# Create a small graph with 4 nodes
num_nodes = 4
num_communities = 2
# Z_pred: Binary community affiliation matrix (num_nodes x num_communities)
# Each row indicates which communities a node belongs to
Z_pred = torch.tensor([
[1, 0],
[1, 1],
[0, 1],
[1, 0]
], dtype=torch.float32)
# adj: Sparse adjacency matrix (unweighted, symmetric)
# Create a simple undirected graph
rows = np.array([0, 1, 1, 2, 2, 3, 3, 0])
cols = np.array([1, 0, 2, 1, 3, 2, 0, 3])
data = np.ones(len(rows))
adj = sp.csr_matrix((data, (rows, cols)), shape=(num_nodes, num_nodes))
ARGS = {
"Z_pred": Z_pred,
"adj": adj
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 0, dtype family float, 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
|
| evaluate_unsupervised |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/metrics/unsupervised.py code served (permissive licence) · get_code("9cf1d122d1665d09") 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 numpy as np
from scipy import sparse
# Create a small graph with 5 nodes
n_nodes = 5
n_communities = 2
# Create a simple sparse adjacency matrix (symmetric, unweighted)
# Edges: 0-1, 1-2, 2-3, 3-4, 0-4 (forming a cycle-like structure)
row = np.array([0, 1, 1, 2, 2, 3, 3, 4, 0, 4])
col = np.array([1, 0, 2, 1, 3, 2, 4, 3, 4, 0])
data = np.ones(len(row))
adj = sparse.csr_matrix((data, (row, col)), shape=(n_nodes, n_nodes))
# Create a community assignment matrix (binary)
# Node assignments to communities
# Community 0: nodes 0, 1, 2
# Community 1: nodes 3, 4
Z_pred = np.array([
[1, 0], # node 0 -> community 0
[1, 0], # node 1 -> community 0
[1, 0], # node 2 -> community 0
[0, 1], # node 3 -> community 1
[0, 1], # node 4 -> community 1
], dtype=np.float64)
ARGS = {
'Z_pred': Z_pred,
'adj': adj
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — 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
|
| generate_bigclam |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/generate.py code served (permissive licence) · get_code("598df91b8ace4a02") 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 ndarray, ndim 2, dtype family int, shape (5, 5) 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 numpy as np
# Set random seed for reproducibility
np.random.seed(0)
# Number of nodes and communities
N = 5 # number of nodes
K = 3 # number of communities
# F: community affiliation matrix [N, K]
# Nonnegative values indicating how much each node belongs to each community
F = np.array([
[0.8, 0.2, 0.0],
[0.0, 0.9, 0.1],
[0.7, 0.0, 0.3],
[0.1, 0.1, 0.8],
[0.5, 0.5, 0.0]
], dtype=float)
# B: compatibility matrix [K, K]
# Nonnegative values indicating edge probability between communities
B = np.array([
[1.0, 0.5, 0.2],
[0.5, 1.0, 0.6],
[0.2, 0.6, 1.0]
], dtype=float)
# D: degree vector [N]
# Nonnegative values for node degree scaling
D = np.array([2.0, 3.0, 1.5, 2.5, 2.0], dtype=float)
# p_no_comm: background edge probability (float between 0 and 1)
p_no_comm = 0.01
# seed: random seed for reproducibility
seed = 42
ARGS = {
'F': F,
'B': B,
'D': D,
'p_no_comm': p_no_comm,
'seed': seed
}
- 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 ndarray, ndim 2, dtype family int, shape (5, 5) — shape (5, 5) 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
|
| get_edge_sampler |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/sampler.py code served (permissive licence) · get_code("a510f83ef3a1c71a") 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 DataLoader. 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 torch
import torch.utils.data as data_utils
from scipy import sparse
torch.manual_seed(0)
np.random.seed(0)
# Create a small sparse adjacency matrix
# 5 nodes, some edges
rows = np.array([0, 1, 2, 3, 4, 0, 2])
cols = np.array([1, 2, 3, 4, 0, 3, 1])
data = np.ones(len(rows))
A = sparse.csr_matrix((data, (rows, cols)), shape=(5, 5))
ARGS = {
"A": A,
"num_pos": 10,
"num_neg": 10,
"num_workers": 0
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
|
| l2_reg_loss |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/utils.py code served (permissive licence) · get_code("9cad3e633573874e") 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 Tensor, ndim 0, dtype family float, 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 torch
import torch.nn as nn
torch.manual_seed(0)
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.linear1 = nn.Linear(4, 3)
self.linear2 = nn.Linear(3, 2)
def get_weights(self):
"""Return all weight parameters as a list of tensors."""
weights = []
for param in self.parameters():
weights.append(param)
return weights
def forward(self, x):
x = self.linear1(x)
x = self.linear2(x)
return x
model = SimpleModel()
ARGS = {
"model": model,
"scale": 1e-05
}
- 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 Tensor, ndim 0, dtype family float, 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
|
| load_dataset |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/data.py code served (permissive licence) · get_code("5998125a3750334b") 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 numpy as np
import scipy.sparse as sp
import tempfile
import os
# Create a temporary npz file with the required data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_graph.npz")
# Create small sparse matrices for adjacency, attributes, and labels
num_nodes = 5
num_attrs = 3
num_classes = 2
# Adjacency matrix (sparse)
A_data = np.array([1, 1, 1, 1], dtype=np.float32)
A_indices = np.array([1, 2, 0, 3], dtype=np.int32)
A_indptr = np.array([0, 2, 3, 3, 4, 4], dtype=np.int32)
A_shape = (num_nodes, num_nodes)
# Attribute matrix (sparse)
X_data = np.array([1, 1, 1, 1, 1], dtype=np.float32)
X_indices = np.array([0, 1, 2, 0, 1], dtype=np.int32)
X_indptr = np.array([0, 2, 3, 4, 5, 5], dtype=np.int32)
X_shape = (num_nodes, num_attrs)
# Labels matrix (sparse)
Z_data = np.array([1, 1, 1, 1], dtype=np.float32)
Z_indices = np.array([0, 1, 0, 1], dtype=np.int32)
Z_indptr = np.array([0, 1, 2, 3, 4, 4], dtype=np.int32)
Z_shape = (num_nodes, num_classes)
# Optional metadata
node_names = np.array(['node_0', 'node_1', 'node_2', 'node_3', 'node_4'], dtype=object)
attr_names = np.array(['attr_0', 'attr_1', 'attr_2'], dtype=object)
class_names = np.array(['class_0', 'class_1'], dtype=object)
# Save as npz file
np.savez(
temp_file,
**{
'adj_matrix.data': A_data,
'adj_matrix.indices': A_indices,
'adj_matrix.indptr': A_indptr,
'adj_matrix.shape': A_shape,
'attr_matrix.data': X_data,
'attr_matrix.indices': X_indices,
'attr_matrix.indptr': X_indptr,
'attr_matrix.shape': X_shape,
'labels.data': Z_data,
'labels.indices': Z_indices,
'labels.indptr': Z_indptr,
'labels.shape': Z_shape,
'node_names': node_names,
'attr_names': attr_names,
'class_names': class_names,
}
)
ARGS = {
'file_name': temp_file
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — 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
|
| overlapping_nmi |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/metrics/supervised.py code served (permissive licence) · get_code("01c6ec57467bf3c9") 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 float64, ndim 0, 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 two binary matrices for overlapping community detection
# X: shape [N, m] where N=samples, m=communities in first cover
# Y: shape [N, n] where N=samples, n=communities in second cover
# The function will transpose them internally, so we provide them as [N, m]
np.random.seed(0)
# Create small binary matrices
N = 5 # number of samples
m = 3 # number of communities in X
n = 4 # number of communities in Y
# Generate random binary matrices
X = np.random.randint(0, 2, size=(N, m)).astype(np.float64)
Y = np.random.randint(0, 2, size=(N, n)).astype(np.float64)
# Ensure at least some 0s and 1s in each matrix
X[0, 0] = 1
X[1, 1] = 0
Y[0, 0] = 1
Y[1, 1] = 0
ARGS = {
"X": X,
"Y": Y,
}
- 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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- 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
|
| sparse_or_dense_dropout |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/nn/gcn.py code served (permissive licence) · get_code("5dea505bf3016662") 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 Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch
import torch.nn.functional as F
torch.manual_seed(0)
# Test case 1: dense tensor
dense_tensor = torch.randn(2, 4)
# Test case 2: sparse tensor (CPU only)
indices = torch.tensor([[0, 1], [0, 1]])
values = torch.tensor([1.0, 2.0])
size = torch.Size([2, 4])
sparse_tensor = torch.sparse_coo_tensor(indices, values, size)
ARGS = {
"x": dense_tensor,
"p": 0.5,
"training": True
}
- 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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
|
| to_sparse_tensor |
Ran ran on a synthesized input |
shchur/overlapping-community-detection/nocd/utils.py code served (permissive licence) · get_code("e5d1964ba1474ffc") 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 Tensor. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 scipy.sparse as sp
import torch
torch.manual_seed(0)
# Create a small scipy sparse matrix (4x3 COO format)
row = np.array([0, 1, 2, 3])
col = np.array([0, 1, 2, 0])
data = np.array([1.0, 2.0, 3.0, 4.0])
sparse_matrix = sp.coo_matrix((data, (row, col)), shape=(4, 3))
ARGS = {
"matrix": sparse_matrix,
"cuda": False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, shape (4, 3) — shape (4, 3) as a later run recorded it
- 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
|