| base_sampler |
Ran ran on a synthesized input |
marinang/lauztat/lauztat/config.py code served (permissive licence) · get_code("4567cc0c7f8af255") 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 torch.nn as nn
torch.manual_seed(0)
class Parameter:
def __init__(self, name):
self.name = name
class MockModel(nn.Module):
def __init__(self, name, is_extended=False):
super().__init__()
self.name = name
self.is_extended = is_extended
self._dependents = [
Parameter("param_a"),
Parameter("param_b"),
Parameter("param_c"),
]
def get_dependents(self):
return self._dependents
def create_sampler(self, n=None, fixed_params=None):
return {
"model": self.name,
"n": n,
"fixed_params": [p.name for p in fixed_params] if fixed_params else []
}
model1 = MockModel("model_1", is_extended=False)
model2 = MockModel("model_2", is_extended=True)
floating_params = [
Parameter("param_a"),
Parameter("param_b"),
]
ARGS = {
"models": [model1, model2],
"floatting_params": floating_params,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, 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
|
| digest |
Ran ran on a synthesized input |
scikit-hep/pyhf/src/pyhf/utils.py code served (permissive licence) · get_code("6a59e15cb403d720") 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 hashlib
import json
# Test with a simple JSON-serializable object
obj = {'a': 2.0, 'b': 3.0, 'c': 1.0}
# Test with a valid algorithm from hashlib
algorithm = 'sha256'
ARGS = {
'obj': obj,
'algorithm': algorithm,
}
- 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
|
| eval_pdf |
Ran ran on a synthesized input |
marinang/lauztat/lauztat/util.py code served (permissive licence) · get_code("050b59bd76145e6a") 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; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
from unittest.mock import Mock, MagicMock
import zfit
torch.manual_seed(0)
# Create a mock zfit model
class MockZfitModel:
def __init__(self):
self.dependents_list = []
self.yield_value = 2.5
def pdf(self, x):
# Return a mock tensor-like object
return torch.ones(2, 4) * 0.5
def get_yield(self):
return self.yield_value
def get_dependents(self):
return self.dependents_list
def __class__(self):
return type('zfit.pdf.BasePDF', (), {})
# Create a mock parameter with set_value context manager
class MockParameter:
def __init__(self, name, value):
self.name = name
self.value = value
def set_value(self, value):
from contextlib import contextmanager
@contextmanager
def _set_value(val):
old_value = self.value
self.value = val
try:
yield
finally:
self.value = old_value
return _set_value(value)
# Build model
model = MockZfitModel()
# Create mock parameters and add to model
param1 = MockParameter("param1", 1.0)
param2 = MockParameter("param2", 2.0)
model.dependents_list = [param1, param2]
# Patch the class name to include 'zfit'
model.__class__ = type('zfit.pdf.BasePDF', (), {})
# Create x input
x = torch.randn(2, 4)
# Create params dictionary
params = {
param1: {'value': 1.5},
param2: {'value': 2.5}
}
# Mock zfit.run to return a tensor
original_run = zfit.run if hasattr(zfit, 'run') else None
zfit.run = lambda x: x if isinstance(x, torch.Tensor) else torch.tensor(x, dtype=torch.float32)
ARGS = {
'model': model,
'x': x,
'params': params
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch, zfit — 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 — no output shape is stated: observe_signature.py could not observe it (fixture:ModuleNotFoundError)
- 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
|
| interpret_rootname |
Ran ran on a synthesized input |
scikit-hep/pyhf/src/pyhf/compat.py code served (permissive licence) · get_code("0960e8c1c472df88") 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 interpret_rootname(rootname):
"""
Interprets a ROOT-generated name as best as possible.
Possible properties of a ROOT parameter are:
* ``"constrained"``: :obj:`bool` representing if parameter is a member of a
constrained paramset.
* ``"is_scalar"``: :obj:`bool` representing if parameter is a member of a
scalar paramset.
* ``"name"``: The name of the param set.
* ``"element"``: The index in a non-scalar param set.
It is possible that some of the parameter names might not be determinable
and will then hold the string value ``"n/a"``.
Args:
rootname (:obj:`str`): The ROOT-generated name of the parameter.
Returns:
:obj:`dict`: The interpreted key-value pairs.
Example:
>>> import pyhf
>>> interpreted_name = pyhf.compat.interpret_rootname("gamma_foo_0")
>>> pyhf.compat.interpret_rootname("gamma_foo_0")
{'constrained': 'n/a', 'is_scalar': False, 'name': 'foo', 'element': 0}
>>> pyhf.compat.interpret_rootname("alpha_foo")
{'constrained': True, 'is_scalar': True, 'name': 'foo', 'element': 'n/a'}
>>> pyhf.compat.interpret_rootname("Lumi")
{'constrained': False, 'is_scalar': True, 'name': 'lumi', 'element': 'n/a'}
"""
interpretation = {'constrained': 'n/a', 'is_scalar': 'n/a', 'name': 'n/a', 'element': 'n/a'}
if rootname.startswith('gamma_'):
interpretation['is_scalar'] = False
match = re.search('^gamma_(.+)_(\\d+)$', rootname)
if not match:
msg = f'confusing rootname {rootname}. Please report as a bug.'
raise ValueError(msg)
interpretation['name'] = match.group(1)
interpretation['element'] = int(match.group(2))
else:
interpretation['is_scalar'] = True
if rootname.startswith('alpha_'):
interpretation['constrained'] = True
match = re.search('^alpha_(.+)$', rootname)
if not match:
msg = f'confusing rootname {rootname}. Please report as a bug.'
raise ValueError(msg)
interpretation['name'] = match.group(1)
if not rootname.startswith(('alpha_', 'gamma_')):
interpretation['constrained'] = False
interpretation['name'] = rootname
if rootname == 'Lumi':
interpretation['name'] = 'lumi'
return interpretation
ARGS = {
'rootname': 'gamma_foo_0'
}
- 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
|
| options_from_eqdelimstring |
Ran ran on a synthesized input |
scikit-hep/pyhf/src/pyhf/utils.py code served (permissive licence) · get_code("1fbc22da336c71ba") 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 yaml
# Construct valid arguments for options_from_eqdelimstring
# The function takes opts parameter which should be an iterable of strings
# in the format "key=value". It splits each on '=' and constructs a YAML document.
# Example with various valid option formats
opts = [
"learning_rate=0.001",
"batch_size=32",
"epochs=10",
"model_name=resnet50",
"debug=true",
"layers=4"
]
ARGS = {
"opts": opts
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- yaml — 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
|
| profileLikelihood |
Ran ran on a synthesized input |
marinang/lauztat/lauztat/config.py code served (permissive licence) · get_code("63cf2e95c02f262a") 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 float, 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 Variable:
def __init__(self, initial_value):
self.value = initial_value
self.floating = True
def set_value(self, new_value):
return self._ContextManager(self, new_value)
class _ContextManager:
def __init__(self, var, new_value):
self.var = var
self.new_value = new_value
self.old_value = None
def __enter__(self):
self.old_value = self.var.value
self.var.value = self.new_value
return self.new_value
def __exit__(self, *args):
self.var.value = self.old_value
class SimpleLoss(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 1)
def forward(self):
return torch.tensor(1.5)
class SimpleMinimizer:
def __init__(self):
pass
def minimize(self, loss):
return self.Result()
class Result:
def __init__(self):
self.fmin = 0.42
minimizer = SimpleMinimizer()
loss = SimpleLoss()
var = Variable(initial_value=torch.tensor(2.5))
value = torch.tensor(3.7)
ARGS = {
"minimizer": minimizer,
"loss": loss,
"var": var,
"value": value
}
- 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 float, 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
|
| register |
Ran ran on a synthesized input |
scikit-hep/pyhf/src/pyhf/events.py code served (permissive licence) · get_code("ca0999c2f2915b3a") 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 function. 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 weakref
from collections.abc import Callable
from typing import TypeVar, cast
TCallable = TypeVar('TCallable', bound=Callable)
# Simple test function to use as the event parameter
def simple_event_name():
"""A simple event name string"""
return "test_event"
# Construct the ARGS dictionary for the register function
ARGS = {
'event': 'my_test_event'
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
|
| resolver_factory |
Ran ran on a synthesized input |
scikit-hep/pyhf/src/pyhf/readxml.py code served (permissive licence) · get_code("1f778be5293c8f84") 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 function. 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 pathlib import Path
ARGS = {
"rootdir": Path("/root"),
"mounts": [
(Path("/host/data"), Path("/mnt/data")),
(Path("/host/models"), Path("/mnt/models")),
],
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
|
| subscribe |
Ran ran on a synthesized input |
scikit-hep/pyhf/src/pyhf/events.py code served (permissive licence) · get_code("e85b7ce4d8826886") 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 function. 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 weakref
from collections.abc import Callable
# Define the Callables class and subscribe function (as provided)
class Callables:
def __init__(self):
self._callbacks = []
@property
def callbacks(self):
self._flush()
return self._callbacks
def append(self, callback):
try:
callback_ref = (weakref.ref(callback.__func__), weakref.ref(callback.__self__))
except AttributeError:
callback_ref = (weakref.ref(callback), None)
self._callbacks.append(callback_ref)
def _flush(self):
_callbacks = []
for func, arg in self._callbacks:
if arg is not None:
arg_ref = arg()
if arg_ref is None:
continue
_callbacks.append((func, arg))
self._callbacks = _callbacks
def __call__(self, *args, **kwargs):
for func, arg in self._callbacks:
if arg is not None:
arg_ref = arg()
if arg_ref is not None:
func()(arg_ref, *args, **kwargs)
else:
func()(*args, **kwargs)
self._flush()
def __iter__(self):
return iter(self.callbacks)
def __getitem__(self, index):
return self.callbacks[index]
def __len__(self):
return len(self.callbacks)
def __repr__(self):
return f'Callables({self.callbacks})'
__events = {}
def subscribe(event: str):
global __events
def __decorator(func):
__events.setdefault(event, Callables()).append(func)
return func
return __decorator
# Setup code to construct valid arguments for subscribe
def sample_callback():
"""A simple callable to be used as a decorated function."""
pass
# The subscribe function takes only one parameter: event (a string)
ARGS = {
'event': 'test_event'
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
|
| trigger |
Ran ran on a synthesized input |
scikit-hep/pyhf/src/pyhf/events.py code served (permissive licence) · get_code("ba507604a93852b6") 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 function. 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 weakref
# Set up the global state that trigger() depends on
__events = {}
__disabled_events = set()
class Callables:
def __init__(self):
self._callbacks = []
@property
def callbacks(self):
self._flush()
return self._callbacks
def append(self, callback):
try:
callback_ref = (weakref.ref(callback.__func__), weakref.ref(callback.__self__))
except AttributeError:
callback_ref = (weakref.ref(callback), None)
self._callbacks.append(callback_ref)
def _flush(self):
_callbacks = []
for func, arg in self._callbacks:
if arg is not None:
arg_ref = arg()
if arg_ref is None:
continue
_callbacks.append((func, arg))
self._callbacks = _callbacks
def __call__(self, *args, **kwargs):
for func, arg in self._callbacks:
if arg is not None:
arg_ref = arg()
if arg_ref is not None:
func()(arg_ref, *args, **kwargs)
else:
func()(*args, **kwargs)
self._flush()
def __iter__(self):
return iter(self.callbacks)
def __getitem__(self, index):
return self.callbacks[index]
def __len__(self):
return len(self.callbacks)
def __repr__(self):
return f'Callables({self.callbacks})'
def noop(*args, **kwargs):
pass
def trigger(event: str) -> Callables:
global __events, __disabled_events, noop
is_noop = bool(event in __disabled_events or event not in __events)
return noop if is_noop else __events.get(event)
# Setup: populate __events with a test event
test_callables = Callables()
__events['test_event'] = test_callables
# Define ARGS for the trigger function
ARGS = {
'event': 'test_event'
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
|
| citation |
Not yet run unverified (harvested, no recorded run) |
scikit-hep/pyhf/src/pyhf/utils.py code served (permissive licence) · get_code("75e7346d2188320d") How it ran |
| convert_dataset |
Not yet run unverified (harvested, no recorded run) |
marinang/lauztat/lauztat/util.py code served (permissive licence) · get_code("ad90d751a535e7d5") How it ran |
| generate_asymov_dataset |
Not yet run unverified (harvested, no recorded run) |
marinang/lauztat/lauztat/calculators/asymptotic_calculator.py code served (permissive licence) · get_code("cb165cb8f52a43f6") How it ran |
| get_q_0A |
Not yet run unverified (harvested, no recorded run) |
vladov3000/pyrs/asymptotic.py pointer only (licence: NONE) · get_code("bb635e5530eb786f") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, vladov3000/pyrs 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. No invocation recorded. |
| get_q_muA |
Not yet run unverified (harvested, no recorded run) |
vladov3000/pyrs/asymptotic.py pointer only (licence: NONE) · get_code("59045034d006ca0b") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, vladov3000/pyrs 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. No invocation recorded. |
| paramset_to_rootnames |
Not yet run unverified (harvested, no recorded run) |
scikit-hep/pyhf/src/pyhf/compat.py code served (permissive licence) · get_code("23c47714c7bf45d9") How it ran |
| pdf_mu0 |
Not yet run unverified (harvested, no recorded run) |
vladov3000/pyrs/asymptotic.py pointer only (licence: NONE) · get_code("6aa96c6d2a13dfcd") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, vladov3000/pyrs 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. No invocation recorded. |