Open Interpretability Models Contributors Research Posts About

Qwen/Qwen2.5-1.5B · L21/N7513 · 20261111T115218Z

Experiment 1 of 1 on this neuron, most conclusive first · record

#1 · negative pole − NEEDS REVISION moderate evidence for · 0.90 self-reviewed counts toward status 2026-11-11 · 20261111T115218Z

A named-parameter (keyword-argument) feature for source code: the pole fires on argument-list boundary tokens where the model is set to write the next *named* parameter of a call or definition - the comma that opens the keyword-argument section (`numpy.array(x,|dtype=...)`, `subprocess.run(cmd,|check=...)`, `add_index(:communities, :abbreviation,|unique: true)`), the callee name immediately before the parenthesis when that call's parameters are named (`logging.basicConfig|(level=...)`, `...__init__|(**kwargs)`), and bare `name=value` parameter lists (`width=1800, height=600`, `stdin=None, input=None`). It stays near zero in prose, on bare identifiers, in bracketed non-call expressions (`[a, b]`, `{'a': 1}`), and in argument lists whose next argument is an ordinary variable rather than a named parameter (`foo(a, b)`, `os.path.join(a, b)`, `re.sub(a, b)`); its write direction promotes the `**` (double-star / kwargs-splat) token.

The whole hypothesis

A named-parameter (keyword-argument) feature for source code: the pole fires on argument-list boundary tokens where the model is set to write the next *named* parameter of a call or definition - the comma that opens the keyword-argument section (`numpy.array(x,|dtype=...)`, `subprocess.run(cmd,|check=...)`, `add_index(:communities, :abbreviation,|unique: true)`), the callee name immediately before the parenthesis when that call's parameters are named (`logging.basicConfig|(level=...)`, `...__init__|(**kwargs)`), and bare `name=value` parameter lists (`width=1800, height=600`, `stdin=None, input=None`). It stays near zero in prose, on bare identifiers, in bracketed non-call expressions (`[a, b]`, `{'a': 1}`), and in argument lists whose next argument is an ordinary variable rather than a named parameter (`foo(a, b)`, `os.path.join(a, b)`, `re.sub(a, b)`); its write direction promotes the `**` (double-star / kwargs-splat) token.

Hard negatives 10/13 rejected · holdouts 6/7 fired (independent observations; 20 probes) · P(useful) 0.95

Balanced accuracy
0.81
Sufficiency
0.91
Necessity
0.91
Lookahead KL
0.0066
✓ enough hard negatives ✓ enough holdouts ✗ specificity ✓ sensitivity ✓ counterfactual reproduction ✓ lookahead consistent ✓ independent review ✓ beats confound baseline ✓ not default on

specificity 0.77 · sensitivity 0.86 · counterfactual reproduction 1.00 · protocol v0.8

init__(',,.basicConfig(self**kwargs()),(cmd path

Adversarial review

hard_negative: 10/13 passed; positive_holdout: 6/7 passed; counterfactual: 8/8 passed; lookahead_consistency: 1/1 passed. Failed gates: specificity.

Hard negatives 10/13 stay below Positive holdouts 6/7 reach it threshold 5.09 (25% of max) → active passed · 0.131 (1% of max) The report ends with a bold caveat, **Warning:** deleting a workspace also removes its snapshots. passed · 0.188 (1% of max) The committee met on Monday, reviewed the proposal, argued for hours, and then, without a vote, adjourned. passed · 0.271 (1% of max) assert 2 ** 10 == 1024 and 3 ** 4 == 81 passed · 0.277 (1% of max) hint = "pass unique: true to skip duplicate rows" passed · 0.515 (3% of max) The stylesheet declares a fixed card size: .card { width: 1800px; height: 600px; padding: 12px; } passed · 0.520 (3% of max) pytest -q --maxfail=1 --disable-warnings tests/ passed · 0.642 (3% of max) steps = ['build', 'test', 'package', 'publish'] passed · 1.281 (6% of max) data_path = os.path.join(root, 'data', 'images') passed · 3.488 (17% of max) status = subprocess.check_call(cmd_list) passed · 4.493 (22% of max) super().__init__() failed · 5.682 (28% of max) # logging.basicConfig(level=DEBUG) must run before any logger is created failed · 6.742 (33% of max) options = {'depth': 4, 'verbose': False, 'cache': True} failed · 7.788 (38% of max) def partial_wrap(func, *args): failed · 1.750 (9% of max) fun configure(host: String = "localhost", port: Int = 5432, secure: Boolean = false) { passed · 6.956 (34% of max) To tune the downloader, pass retries=3, backoff=1.5, jitter=True when constructing the client. passed · 9.128 (45% of max) link_to('Home', root_path, class: 'nav-link', aria_label: 'Home page') passed · 13.573 (67% of max) def request(self, url, data=None, **options): passed · 14.956 (74% of max) parser = argparse.ArgumentParser(description='Train the model', epilog='See docs') passed · 14.998 (74% of max) Deploying the analytics service has become routine, but the details still matter. The team starts every release by freezing the main branch, tagging the comm… passed · 20.703 (102% of max) table = pandas.read_csv('sales.csv', sep=';', header=0, encoding='utf-8') 0 max 20.34
passed failed Each probe's peak negative-pole strength. The shaded side of the line counts as active. Hover a dot for its prompt.
All 29 probes
TestInputExpectedObserved
✓ hard negative assert 2 ** 10 == 1024 and 3 ** 4 == 81
The ** token appears as arithmetic exponentiation, a different sense from the kwargs splat the write direction is claimed to promote, and there is no argument-list boundary, so the hypothesis predicts silence.
inactive 0.271
✓ hard negative The report ends with a bold caveat, **Warning:** deleting a workspace also removes its snapshots.
Markdown bold **Warning:** in prose keeps the ** token but in a delimiter sense with no splat or argument list, and the hypothesis says the pole stays near zero in prose.
inactive 0.131
✓ hard negative steps = ['build', 'test', 'package', 'publish']
Commas separate string literals inside a Python list literal, the bracketed non-call expression the hypothesis explicitly says stays near zero.
inactive 0.642
✗ hard negative options = {'depth': 4, 'verbose': False, 'cache': True}
Commas separate quoted keys in a dict literal, the {'a': 1} non-call case the hypothesis excludes; no call or definition parameters are present.
inactive 6.742
✓ hard negative data_path = os.path.join(root, 'data', 'images')
The hypothesis names os.path.join(a, b) explicitly as an argument list whose next argument is an ordinary variable, so it predicts silence.
inactive 1.281
✓ hard negative status = subprocess.check_call(cmd_list)
A subprocess call with one ordinary positional variable and no named parameters, so the hypothesis's named-parameter callee rule predicts silence even though it echoes the shape of example 6.
inactive 3.488
✓ hard negative The committee met on Monday, reviewed the proposal, argued for hours, and then, without a vote, adjourned.
A prose sentence with many commas and no code at all; the hypothesis says the pole stays near zero in prose.
inactive 0.188
✓ hard negative super().__init__()
Keeps the __init__ callee and its .__ prefix but calls it with an empty parameter list, so the hypothesis's callee rule for calls whose parameters are named predicts silence.
inactive 4.493
✗ hard negative # logging.basicConfig(level=DEBUG) must run before any logger is created
A named-argument call placed inside a Python comment, a syntactic role outside the hypothesis's call/definition boundary, so it predicts silence.
inactive 5.682
✓ hard negative hint = "pass unique: true to skip duplicate rows"
Named-parameter text unique: true appears inside a string literal rather than at an argument-list boundary, so the hypothesis predicts silence.
inactive 0.277
✗ hard negative def partial_wrap(func, *args):
The comma opens a positional-splat parameter section, whose next parameter is not a named or keyword parameter, so the hypothesis's next-named-parameter rule predicts silence.
inactive 7.788
✓ hard negative The stylesheet declares a fixed card size: .card { width: 1800px; height: 600px; padding: 12px; }
CSS property declarations in a brace block are colon/semicolon separated rather than call arguments, a bracketed non-call expression in another language that the hypothesis excludes.
inactive 0.515
✓ hard negative pytest -q --maxfail=1 --disable-warnings tests/
--maxfail=1 is a command-line option in a shell command, not a named parameter of a call or definition, so the hypothesis predicts silence.
inactive 0.520
✗ positive holdout fun configure(host: String = "localhost", port: Int = 5432, secure: Boolean = false) {
Kotlin, a language absent from the examples, defines a function with named parameters and defaults, a cross-language holdout for the definition-boundary claim.
active 1.750
✓ positive holdout table = pandas.read_csv('sales.csv', sep=';', header=0, encoding='utf-8')
The comma after the positional argument opens a keyword-argument section in a call from a new library and topic, testing the call-boundary claim.
active 20.703
✓ positive holdout parser = argparse.ArgumentParser(description='Train the model', epilog='See docs')
A callee name sits immediately before a parenthesis whose parameters are named, testing the .basicConfig rule in a new context.
active 14.956
✓ positive holdout link_to('Home', root_path, class: 'nav-link', aria_label: 'Home page')
A Ruby call with hash-style keyword arguments, another language's named-parameter idiom, testing the claimed language-independent feature.
active 9.128
✓ positive holdout To tune the downloader, pass retries=3, backoff=1.5, jitter=True when constructing the client.
A bare comma-separated name=value parameter list embedded in a sentence, which the hypothesis's bare-list clause (width=1800, height=600) predicts fires despite the prose exclusion.
active 6.956
✓ positive holdout Deploying the analytics service has become routine, but the details still matter. The team starts every release by freezing the main branch, tagging the commit, and announcing the window in the operations channel. A release engineer then pulls the artifacts from the staging registry, verifies their signatures, and copies them to the production mirror. Nobody edits files on the production hosts; everything ships as an immutable image, and the deployment tool only swaps the running container once the health check passes. The first stage of the pipeline builds the image. Builds are reproducible because the base layer is pinned by digest, the dependency lock file is committed, and the compiler flags come from a checked-in configuration rather than from someone's shell history. When the build finishes, the script uploads the result to the registry and prints the digest, which the release notes record. A second stage runs the integration tests against a disposable database, and a third stage replays a small sample of production traffic through the new version before any user sees it. Rolling the change out takes about twenty minutes. The load balancer drains one host at a time, the new container warms its caches, and the probe endpoint confirms that the database connection pool is healthy. If anything fails, the controller reverts to the previous image and alerts the on-call engineer, who decides whether to investigate immediately or wait for the morning. Most incidents, in practice, turn out to be configuration drift: a stale environment variable, an expired certificate, or a feature flag that was flipped in the wrong order. Observability deserves its own paragraph because it is easy to neglect. Every request gets a trace identifier, every span is sampled at a low rate, and the dashboards show latency percentiles rather than averages. Alerts fire on symptoms, not on causes, and each alert links to a runbook that explains what to check first. Logs are shipped to a central store, indexed for a week, and archived for a year. The team reviews incidents on Fridays, writes a short postmortem, and assigns follow-up work; the postmortem template asks for a timeline, an impact estimate, and at least one concrete mitigation. Tooling has improved a great deal over the past two years. The old deployment script, which was several hundred lines of shell, has been replaced by a small Python helper that wraps the container runtime. The helper assembles the command line, runs it, and raises an error if the exit status is non-zero. A typical invocation looks like this: result = subprocess.run(build_cmd, check=True, capture_output=True, text=True) print(result.stdout) The helper is intentionally boring. It does not retry, it does not parse output, and it does not guess at defaults. Everything the operator needs to know is in the arguments, and everything that could go wrong is visible in the exit code.
A keyword-argument call sits deep inside a long deployment document, testing that the boundary feature survives a passage well beyond 512 tokens.
active 14.998
✓ positive holdout def request(self, url, data=None, **options):
A Python method definition mixes a named default with a ** splat, testing the definition-boundary claim and the claimed ** (kwargs) promotion in a new context.
active 13.573
✓ counterfactual subprocess.run(cmd, check) -> subprocess.run(cmd) Δ 0.67 Δ 0.67
✓ counterfactual numpy.array(x, y) -> foo.bar(x, y) Δ 0.92 Δ 0.91
✓ counterfactual subprocess.run(cmd, check) -> run(cmd, check) Δ 0.63 Δ 0.63
✓ counterfactual name='x', mode='r', encoding=utf8 -> name, mode, encoding Δ 0.38 Δ 0.38
✓ counterfactual stdin=None, input=None -> stdin, input Δ 0.41 Δ 0.41
✓ counterfactual width=1800, height=600 -> width, height, depth Δ 0.23 Δ 0.23
✓ counterfactual numpy.array(x, y) -> numpy.array(a, b) Δ 0.06 Δ 0.06
✓ counterfactual logging.basicConfig(level=1) -> logging.basicConfig(level=2) Δ 0.00 Δ 0.00
✓ lookahead consistency subprocess.run(cmd, check); numpy.array(x, y); subprocess.run(cmd, check); name='x', mode='r', encoding=utf8; stdin=None, input=None; width=1800, height=600; numpy.array(x, y); logging.basicConfig(level=1)
claimed retrospective; measured retrospective (KL=0.006557, tokens=[' dtype', ',', ' check', ' copy', 'shell'])

Minimal pairs

Pair 2 Sufficiency: 1.00 · effect 0.034 (matched |effect| median 4.86e-05, max 0.00193) numpy.array(x, y) → foo.bar(x, y) Necessity: 1.00 · effect 0.0887 (matched |effect| median 7.28e-05, max 0.00861) numpy.array(x, y) → foo.bar(x, y) Pair 4 Sufficiency: 0.91 · effect 0.000369 (matched |effect| median 7.5e-05, max 0.00279) name='x', mode='r', encoding=utf8 → name, mode, encoding Necessity: 0.91 · effect 0.000369 (matched |effect| median 8.18e-05, max 0.000763) name='x', mode='r', encoding=utf8 → name, mode, encoding Pair 5 Sufficiency: 0.91 · effect 0.00115 (matched |effect| median 0.000291, max 0.00755) stdin=None, input=None → stdin, input Necessity: 0.91 · effect 0.0003 (matched |effect| median 6.82e-05, max 0.000648) stdin=None, input=None → stdin, input Pair 6 Sufficiency: 0.88 · effect 0.000252 (matched |effect| median 2.92e-05, max 0.000769) width=1800, height=600 → width, height, depth Necessity: 0.91 · effect 0.000364 (matched |effect| median 6.99e-05, max 0.000811) width=1800, height=600 → width, height, depth Pair 7 Sufficiency: 0.94 · effect 0.000484 (matched |effect| median 4.12e-05, max 0.00101) numpy.array(x, y) → numpy.array(a, b) Necessity: 0.94 · effect 0.000575 (matched |effect| median 4.6e-05, max 0.00102) numpy.array(x, y) → numpy.array(a, b) Median (score) Sufficiency: 0.91 · median of 5 pairs 0.91 Necessity: 0.91 · median of 5 pairs 0.91 0.5 = a typical matched neuron 0 0.25 0.5 0.75 1
sufficiency (clean → corrupted) necessity (corrupted → clean) Hover a bar for its effect and prompts.
#Base → counterfactualExpected ΔObserved ΔSufficiencyNecessity
1 subprocess.run(cmd, check)
→ subprocess.run(cmd)
0.67 0.67 — —
2 numpy.array(x, y)
→ foo.bar(x, y)
0.92 0.91 1.00
effect 0.034
matched 4.86e-05 / 0.00193
1.00
effect 0.0887
matched 7.28e-05 / 0.00861
3 subprocess.run(cmd, check)
→ run(cmd, check)
0.63 0.63 — —
4 name='x', mode='r', encoding=utf8
→ name, mode, encoding
0.38 0.38 0.91
effect 0.000369
matched 7.5e-05 / 0.00279
0.91
effect 0.000369
matched 8.18e-05 / 0.000763
5 stdin=None, input=None
→ stdin, input
0.41 0.41 0.91
effect 0.00115
matched 0.000291 / 0.00755
0.91
effect 0.0003
matched 6.82e-05 / 0.000648
6 width=1800, height=600
→ width, height, depth
0.23 0.23 0.88
effect 0.000252
matched 2.92e-05 / 0.000769
0.91
effect 0.000364
matched 6.99e-05 / 0.000811
7 numpy.array(x, y)
→ numpy.array(a, b)
0.06 0.06 0.94
effect 0.000484
matched 4.12e-05 / 0.00101
0.94
effect 0.000575
matched 4.6e-05 / 0.00102
8 logging.basicConfig(level=1)
→ logging.basicConfig(level=2)
0.00 0.00 — —
Read more

Δ is the base prompt's peak negative-pole strength minus the counterfactual's, as a fraction of the max activation.

Each causal score ranks the pole's patch effect among the 32 same-layer neurons that change as much between each pair, so 0.5 is typical. Sufficiency patches clean into corrupted, and necessity corrupted into clean. The score is the median over 5 non-control pairs, on next-token KL. Median effect 0.000484 (sufficiency) and 0.000369 (necessity). In the table, each cell gives the percentile, the pole's signed effect, and the matched neurons' median and largest |effect|, in nats of KL. Self-repair (the hydra effect) was mitigated by freezing downstream MLP outputs.

Top-activating examples

Hover a token for its value.

  1. 20.34 … '↵ cards = {}↵↵ def __init__(self, **kwargs):↵ self.ra_dialog = None↵ super(HistoryScreen, self).__init__(**kwargs)↵ self.menu_actions = [ …
    All 700 tokens

    from weakref import ref↵from decimal import Decimal↵import re↵import datetime↵import traceback, sys↵↵from kivy.app import App↵from kivy.cache import Cache↵from kivy.clock import Clock↵from kivy.compat import string_types↵from kivy.properties import (ObjectProperty, DictProperty, NumericProperty,↵ ListProperty, StringProperty)↵↵from kivy.uix.label import Label↵↵from kivy.lang import Builder↵from kivy.factory import Factory↵from kivy.utils import platform↵↵from electrum_dgb.util import profiler, parse_URI, format_time, InvalidPassword, NotEnoughFunds↵from electrum_dgb import bitcoin↵from electrum_dgb.util import timestamp_to_datetime↵from electrum_dgb.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED↵↵from context_menu import ContextMenu↵↵↵from electrum_dgb_gui.kivy.i18n import _↵↵class EmptyLabel(Factory.Label):↵ pass↵↵class CScreen(Factory.Screen):↵ __events__ = ('on_activate', 'on_deactivate', 'on_enter', 'on_leave')↵ action_view = ObjectProperty(None)↵ loaded = False↵ kvname = None↵ context_menu = None↵ menu_actions = []↵ app = App.get_running_app()↵↵ def _change_action_view(self):↵ app = App.get_running_app()↵ action_bar = app.root.manager.current_screen.ids.action_bar↵ _action_view = self.action_view↵↵ if (not _action_view) or _action_view.parent:↵ return↵ action_bar.clear_widgets()↵ action_bar.add_widget(_action_view)↵↵ def on_enter(self):↵ # FIXME: use a proper event don't use animation time of screen↵ Clock.schedule_once(lambda dt: self.dispatch('on_activate'), .25)↵ pass↵↵ def update(self):↵ pass↵↵ @profiler↵ def load_screen(self):↵ self.screen = Builder.load_file('gui/kivy/uix/ui_screens/' + self.kvname + '.kv')↵ self.add_widget(self.screen)↵ self.loaded = True↵ self.update()↵ setattr(self.app, self.kvname + '_screen', self)↵↵ def on_activate(self):↵ if self.kvname and not self.loaded:↵ self.load_screen()↵ #Clock.schedule_once(lambda dt: self._change_action_view())↵↵ def on_leave(self):↵ self.dispatch('on_deactivate')↵↵ def on_deactivate(self):↵ self.hide_menu()↵↵ def hide_menu(self):↵ if self.context_menu is not None:↵ self.remove_widget(self.context_menu)↵ self.context_menu = None↵↵ def show_menu(self, obj):↵ self.hide_menu()↵ self.context_menu = ContextMenu(obj, self.menu_actions)↵ self.add_widget(self.context_menu)↵↵↵TX_ICONS = [↵ "close",↵ "close",↵ "close",↵ "unconfirmed",↵ "close",↵ "clock1",↵ "clock2",↵ "clock3",↵ "clock4",↵ "clock5",↵ "confirmed",↵]↵↵class HistoryScreen(CScreen):↵↵ tab = ObjectProperty(None)↵ kvname = 'history'↵ cards = {}↵↵ def __init__(self, **kwargs):↵ self.ra_dialog = None↵ super(HistoryScreen, self).__init__(**kwargs)↵ self.menu_actions = [ ('Lab

    Values
    TokenNegative-pole strength
    '↵0.518
    1.462
    cards0.527
    =0.000
    {}↵↵0.428
    0.223
    def0.027
    __0.000
    init3.554
    __(2.694
    self8.294
    ,10.669
    **4.900
    kwargs3.969
    ):↵1.124
    3.669
    self1.498
    .ra0.000
    _dialog0.623
    =0.000
    None0.269
    ↵1.283
    2.689
    super0.244
    (H0.100
    istory0.001
    Screen0.000
    ,1.203
    self2.755
    ).__2.171
    init20.341
    __(18.561
    **1.151
    kwargs2.950
    )↵0.466
    1.185
    self0.853
    .menu0.048
    _actions0.000
    =0.000
    [0.000
  2. 12.18 … </title>↵ <meta name="viewport" content="width=device-width, initial-scale=1">↵ <link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet …
    All 165 tokens

    <!DOCTYPE html>↵<html>↵ <head>↵ <title>K|F|D</title>↵ <meta name="viewport" content="width=device-width, initial-scale=1">↵ <link href="{{ url_for('static', filename='css/style.css') }}" rel="stylesheet" type="text/css">↵ <script src="{{ url_for('static', filename='js/jquery.js') }}"></script>↵ </head>↵ <body>↵ <div id="wrap">↵ <div id="main-text">KYLE|FROST|DESIGN</div>↵ <div id="coming-soon">COMING SOON.</div>↵ </div>↵ <script src="{{ url_for('static', filename='js/main.js') }}"></script>↵ </body>↵</html>

    Values
    TokenNegative-pole strength
    </0.000
    title0.000
    >↵0.039
    0.650
    <0.045
    meta0.000
    name0.000
    ="0.014
    viewport0.000
    "0.000
    content0.046
    ="0.000
    width0.096
    =device0.000
    -width0.000
    ,0.130
    initial0.084
    -scale0.131
    =0.000
    10.033
    ">↵0.405
    0.766
    <0.269
    link0.275
    href0.321
    ="{{0.000
    url0.000
    _for0.000
    ('0.000
    static0.000
    ',12.183
    filename0.000
    ='0.000
    css0.052
    /style0.106
    .css0.000
    ')0.000
    }}"0.531
    rel0.005
    ="0.000
    stylesheet0.000
  3. 9.81 … ↵import omero.columns↵import omero.tables↵import logging↵import Ice↵↵from library import TestCase↵from path import path↵↵↵logging.basicConfig(level=logging.CRITICAL)↵↵↵class MockAdapter(object):↵ …
    All 752 tokens

    #!/usr/bin/env python↵# -*- coding: utf-8 -*-↵↵"""↵ Test of the HDF storage for the Tables API.↵↵ Copyright 2009-2014 Glencoe Software, Inc. All rights reserved.↵ Use is subject to license terms supplied in LICENSE.txt↵↵"""↵↵import time↵import pytest↵import omero.columns↵import omero.tables↵import logging↵import Ice↵↵from library import TestCase↵from path import path↵↵↵logging.basicConfig(level=logging.CRITICAL)↵↵↵class MockAdapter(object):↵ def __init__(self, ic):↵ self.ic = ic↵↵ def getCommunicator(self):↵ return self.ic↵↵↵class TestHdfStorage(TestCase):↵↵ def setup_method(self, method):↵ TestCase.setup_method(self, method)↵ self.ic = Ice.initialize()↵ self.current = Ice.Current()↵ self.current.adapter = MockAdapter(self.ic)↵↵ for of in omero.columns.ObjectFactories.values():↵ of.register(self.ic)↵↵ def cols(self):↵ a = omero.columns.LongColumnI('a', 'first', None)↵ b = omero.columns.LongColumnI('b', 'first', None)↵ c = omero.columns.LongColumnI('c', 'first', None)↵ return [a, b, c]↵↵ def init(self, hdf, meta=False):↵ if meta:↵ m = {"analysisA": 1, "analysisB": "param", "analysisC": 4.1}↵ else:↵ m = None↵ hdf.initialize(self.cols(), m)↵↵ def append(self, hdf, map):↵ cols = self.cols()↵ for col in cols:↵ try:↵ col.values = [map[col.name]]↵ except KeyError:↵ col.values = []↵ hdf.append(cols)↵↵ def hdfpath(self):↵ tmpdir = self.tmpdir()↵ return path(tmpdir) / "test.h5"↵↵ def testInvalidFile(self):↵ pytest.raises(omero.ApiUsageException, omero.tables.HdfStorage, None)↵ pytest.raises(omero.ApiUsageException, omero.tables.HdfStorage, '')↵ bad = path(self.tmpdir()) / "doesntexist" / "test.h5"↵ pytest.raises(omero.ApiUsageException, omero.tables.HdfStorage, bad)↵↵ def testValidFile(self):↵ hdf = omero.tables.HdfStorage(self.hdfpath())↵ hdf.cleanup()↵↵ def testLocking(self):↵ tmp = str(self.hdfpath())↵ hdf1 = omero.tables.HdfStorage(tmp)↵ try:↵ omero.tables.HdfStorage(tmp)↵ assert False, "should be locked"↵ except omero.LockTimeout:↵ pass↵ hdf1.cleanup()↵ hdf3 = omero.tables.HdfStorage(tmp)↵ hdf3.cleanup()↵↵ def testSimpleCreation(self):↵ hdf = omero.tables.HdfStorage(self.hdfpath())↵ self.init(hdf, False)↵ hdf.cleanup()↵↵ def testCreationWithMetadata(self):↵ hdf = omero.tables.HdfStorage(self.hdfpath())↵ self.init(hdf, True)↵ hdf.cleanup()↵↵ def testAddSingleRow(self):↵ hdf = omero.tables.HdfStorage(self.hdfpath())↵ self.init(hdf, True)↵ self.append(hdf, {"a": 1, "b": 2, "c": 3})↵ hdf.cleanup()↵↵ def testModifyRow(self):↵ hdf = omero.tables.HdfStorage(self.hdfpath())↵ self.init(hdf, True

    Values
    TokenNegative-pole strength
    ↵0.000
    import0.000
    o0.000
    mer0.150
    o0.000
    .columns0.000
    ↵0.000
    import0.000
    o0.191
    mer0.150
    o0.002
    .tables0.000
    ↵0.000
    import0.000
    logging0.000
    ↵0.000
    import0.000
    Ice0.000
    ↵↵0.000
    from0.000
    library0.000
    import0.000
    TestCase0.152
    ↵0.000
    from0.000
    path0.000
    import0.000
    path0.000
    ↵↵↵0.000
    logging0.000
    .basicConfig9.809
    (level0.000
    =logging0.264
    .CR0.000
    ITICAL1.112
    )↵↵↵0.013
    class0.000
    Mock0.026
    Adapter0.000
    (object0.558
    ):↵0.329
  4. 5.46 … 5 Oslo, NO 1.0↵↵↵If you set exact = TRUE then FindReplace will only replace exact pattern matches. Also, you can set vector = TRUE to return only a vector of the …
    All 774 tokens

    ## 6 December 2013↵↵### Three Quick and Simple Data Cleaning Helper Functions (December 2013)↵↵As I go about cleaning and merging data sets with R I often end up creating and using simple functions over and over. When this happens, I stick them in the DataCombine package. This makes it easier for me to remember how to do an operation and others can possibly benefit from simplified and (hopefully) more intuitive code.↵↵I've talked about some of the commands in DataCombine in previous posts. In this post I'll give examples for a few more that I've added over the past couple of months. Note: these examples are based on DataCombine version 0.1.11.↵↵Here is a brief run down of the functions covered in this post:↵↵• FindReplace: a function to replace multiple patterns found in a character string column of a data frame.↵↵• MoveFront: moves variables to the front of a data frame. This can be useful if you have a data frame with many variables and want to move a variable or variables to the front.↵↵• rmExcept: removes all objects from a work space except those specified by the user.↵↵# FindReplace↵↵Recently I needed to replace many patterns in a column of strings. Here is a short example. Imagine we have a data frame like this:↵↵ABData <- data.frame(a = c("London, UK", "Oxford, UK", "Berlin, DE", "Hamburg, DE", "Oslo, NO"), b = c(8, 0.1, 3, 2, 1))↵↵↵Ok, now I want to replace the UK and DE parts of the strings with England and Germany. So I create a data frame with two columns. The first records the pattern and the second records what I want to replace the pattern with:↵↵Replaces <- data.frame(from = c("UK", "DE"), to = c("England", "Germany"))↵↵↵Now I can just use FindReplace to make the replacements all at once:↵↵library(DataCombine)↵↵ABNewDF <- FindReplace(data = ABData, Var = "a", replaceData = Replaces, from = "from", to = "to", exact = FALSE)↵↵# Show changes↵ABNewDF↵↵## a b↵## 1 London, England 8.0↵## 2 Oxford, England 0.1↵## 3 Berlin, Germany 3.0↵## 4 Hamburg, Germany 2.0↵## 5 Oslo, NO 1.0↵↵↵If you set exact = TRUE then FindReplace will only replace exact pattern matches. Also, you can set vector = TRUE to return only a vector of the column you replaced (the Var column), rather than the whole data frame.↵↵# MoveFront↵↵On occasion I've wanted to move a few variables to the front of a data frame. The MoveFront function makes this pretty simple. It only has two arguments: data and Var. Data is the data frame and Var is a character vector with the columns I want to move to the front of the data frame in the order that I want them. Here is an example:↵↵# Create dummy data↵A <- B <- C <- 1:50↵OldOrder <- data.frame(A, B, C)↵↵names(OldOrder)↵↵## [1] "A" "B" "C"↵↵# Move B and A to the front↵NewOrder2 <- MoveFront(OldOrder, c("B", "A"))↵names(NewOrder2)↵↵## [1] "B" "A" "C"↵↵↵# rmExcept↵↵Finally, sometimes I want to clean up my work space and only keep specific objects. I want to remove everything else. This is straightforward wi

    Values
    TokenNegative-pole strength
    50.131
    0.005
    Oslo0.000
    ,0.000
    NO0.068
    0.000
    10.060
    .0.012
    00.037
    ↵↵↵0.000
    If0.000
    you0.000
    set4.567
    exact0.125
    =0.000
    TRUE0.000
    then0.000
    Find0.000
    Replace0.006
    will0.000
    only0.065
    replace0.065
    exact0.157
    pattern0.065
    matches0.070
    .0.000
    Also0.000
    ,0.000
    you0.000
    can0.000
    set5.457
    vector1.740
    =0.000
    TRUE0.000
    to0.000
    return0.000
    only0.210
    a0.000
    vector0.038
    of0.000
    the0.000
  5. 5.14 … .string :abbreviation↵ end↵ ↵ add_index(:communities, :name, unique: true)↵ add_index(:communities, :abbreviation, unique: true)↵ end↵ ↵ def down …
    All 98 tokens

    class CreateCommunity < ActiveRecord::Migration↵ def up↵ create_table :communities do |t|↵ t.belongs_to :campground↵ t.string :name↵ t.string :location↵ t.string :abbreviation↵ end↵ ↵ add_index(:communities, :name, unique: true)↵ add_index(:communities, :abbreviation, unique: true)↵ end↵ ↵ def down↵ drop_table :communities↵ end↵end

    Values
    TokenNegative-pole strength
    .string0.000
    :0.000
    abbreviation0.000
    ↵0.000
    0.022
    end0.056
    ↵ ↵0.000
    0.015
    add0.450
    _index0.077
    (:0.038
    comm0.000
    unities0.046
    ,0.351
    :0.000
    name0.288
    ,4.239
    unique0.000
    :0.015
    true1.128
    )↵0.000
    0.002
    add0.474
    _index0.000
    (:0.110
    comm0.000
    unities0.000
    ,0.741
    :0.000
    abbreviation0.170
    ,5.138
    unique0.000
    :0.000
    true0.278
    )↵0.000
    0.000
    end0.000
    ↵ ↵0.000
    0.226
    def0.003
    down0.679
  6. 4.66 … self._checkBin()↵↵ def _checkBin(self):↵ cmd = ['which', self.bbin]↵ try:↵ chk = subprocess.call(cmd)↵ print(str(chk))↵ #wx …
    All 191 tokens

    #!/usr/bin/env python↵# -*- coding: utf-8 -*-↵↵import subprocess↵↵import wx↵↵class checkBin:↵ def __init__(self, parent, blenderbin):↵ self.prnt = parent↵ self.bbin = blenderbin↵↵ self._checkBin()↵↵ def _checkBin(self):↵ cmd = ['which', self.bbin]↵ try:↵ chk = subprocess.call(cmd)↵ print(str(chk))↵ #wx.MessageDialog(self.prnt, 'Le test a réussi!', 'Succès', wx.OK|wx.ICON_INFORMATION)↵ except OSError as err:↵ #wx.MessageDialog(self.prnt, "Le test a échoué! Infos erreur:\n\nNuméro: %s\nFichier: %s\nMessage %s" % (err.errno, err.filename, err.strerror), 'Erreur', wx.OK|wx.ICON_ERROR)↵ print("nok")

    Values
    TokenNegative-pole strength
    self0.000
    ._0.000
    check0.054
    Bin0.194
    ()↵↵0.000
    0.352
    def0.161
    _0.127
    check0.000
    Bin0.000
    (self4.041
    ):↵0.000
    0.005
    cmd0.000
    =0.000
    ['0.711
    which0.000
    ',0.000
    self0.004
    .b0.005
    bin0.000
    ]↵0.018
    0.031
    try0.000
    :↵0.000
    0.000
    chk0.000
    =0.000
    subprocess0.000
    .call2.404
    (cmd4.663
    )↵0.000
    0.000
    print0.000
    (str0.000
    (ch0.000
    k0.024
    ))↵0.000
    0.000
    #0.000
    wx0.000
  7. 4.27 … this.expandInstrument(i))↵ .do(this.defaultSubscriber);↵ }↵ historical(symbol: string, interval: string, span: string = 'day', bounds?: string): Observable<M.IHistoricalQuote …
    All 662 tokens

    import { Injectable } from '@angular/core';↵import { Http, Response, Headers } from '@angular/http';↵import { Observable } from 'rxjs/Observable';↵import { ApiService } from './api';↵import { LoginAPI } from './login.api';↵import * as M from '.././models/responses';↵↵@Injectable()↵export class AccountsAPI extends ApiService {↵↵ private _myAccount: M.IAccount;↵ private _myPortfolio: M.IPorfolio;↵ private _myPositions: any;↵↵ constructor(public http: Http, public authSvc: LoginAPI) {↵ super(http, authSvc);↵ }↵ get MyAccount(): Observable<M.IAccount> {↵ return this._myAccount ?↵ Observable.of(this._myAccount) :↵ this.accounts()↵ .map(acc => acc.results[0])↵ .do(x => this._myAccount = x);↵ }↵ get MyPortfolio(): Observable<M.IPorfolio> {↵ return this._myPortfolio ?↵ Observable.of(this._myPortfolio) :↵ this.MyAccount↵ .mergeMap(acc => this.portfolio(acc.account_number))↵ .do(x => this._myPortfolio = x);↵ }↵ get MyPositions(): Observable<M.IPositionsResponse> {↵ return this._myPositions ?↵ Observable.of(this._myPositions) :↵ this.MyAccount↵ .mergeMap(acc => this.getPositions(acc.positions)↵ .do((x) => this._myPositions = x));↵ }↵ positions(account: string): Observable<M.IPositionsResponse> {↵ return this.get(`${this.ApiUrl}accounts/${account}/positions/`)↵ .do(this.defaultSubscriber);↵ }↵ accounts(): Observable<M.IAccountResponse> {↵ return this.get(`${this.ApiUrl}accounts`)↵ .do(this.defaultSubscriber);↵ }↵ portfolio(account: string): Observable<M.IPorfolio> {↵ return this.get(`${this.ApiUrl}accounts/${account}/portfolio/`)↵ .do(this.defaultSubscriber);↵ }↵ instruments(): Observable<M.IPageCollection> {↵ return this.get(`${this.ApiUrl}instruments`)↵↵ .do(this.defaultSubscriber);↵ }↵ instrument(guid: string): Observable<M.IInstrument> {↵ return this.get(`${this.ApiUrl}instruments/${guid}`)↵ .mergeMap(i => this.expandInstrument(i))↵ .do(this.defaultSubscriber);↵ }↵ historical(symbol: string, interval: string, span: string = 'day', bounds?: string): Observable<M.IHistoricalQuote> {↵ return this.get(`${this.ApiUrl}quotes/historicals/${symbol}/?interval=${interval}`);↵ //TODO to enum↵ //interval=week|day|10minute|5minute|null(all) span=day|week|year|5year|all bounds=extended|regular|trading↵ }↵ getPositions(url: string): Observable<M.IPositionsResponse> {↵ return this.get(url)↵ .mergeMap(r => this.expandPositions(r));↵ }↵ getInstrument(url: string): Observable<M.IInstrument> {↵ return this.get(url)↵ .mergeMap(i => this.expandInstrument(i));↵ }↵ expandPositions(r: M.IPageCollection) {↵ return Observable.from(r.results)↵

    Values
    TokenNegative-pole strength
    this0.195
    .expand0.000
    Instrument0.000
    (i0.000
    ))↵0.000
    0.126
    .0.000
    do0.114
    (this0.097
    .default0.000
    Subscriber0.000
    );↵0.000
    0.000
    }↵0.020
    0.000
    historical0.000
    (symbol0.315
    :0.000
    string1.117
    ,1.916
    interval0.000
    :0.000
    string0.430
    ,2.625
    span0.000
    :0.000
    string0.458
    =0.225
    '0.006
    day0.000
    ',4.266
    bounds0.000
    ?:0.000
    string0.000
    ):0.000
    Observable0.000
    <M0.210
    .I0.002
    Histor0.000
    ical0.007
    Quote0.000
  8. 3.47 module Rosendo↵ class Response↵ attr_accessor :status, :headers, :body↵ def initialize(io)↵ @io = io↵ @ …
    All 174 tokens

    module Rosendo↵ class Response↵ attr_accessor :status, :headers, :body↵ def initialize(io)↵ @io = io↵ @headers = {}↵ end↵ ↵ def status↵ @status || 200↵ end↵ ↵ def body↵ @body || ''↵ end↵ ↵ def respond↵ @io.puts status_line↵ @io.puts header_lines↵ @io.puts↵ @io.write body # write instead of puts for no extra newline↵ @io.close↵ end↵↵ def status_line↵ "HTTP/1.1 #{status}"↵ end↵↵ def header_lines↵ {'Content-Length' => body.size}.merge(@headers).map { |k, v| "#{k}: #{v}" }.join("\n")↵ end↵↵ end↵end

    Values
    TokenNegative-pole strength
    module0.099
    Ros0.124
    endo0.000
    ↵0.020
    0.191
    class0.303
    Response0.006
    ↵0.000
    0.108
    attr0.000
    _accessor0.000
    :0.561
    status0.049
    ,0.468
    :0.613
    headers0.285
    ,0.269
    :1.076
    body0.115
    ↵0.022
    0.181
    def0.406
    initialize3.467
    (io0.957
    )↵0.000
    0.000
    @0.000
    io0.102
    =0.000
    io0.251
    ↵0.000
    0.000
    @0.018
  9. 3.18 … the Free Software Foundation, either version 3 of the License, or↵ * (at your option) any later version.↵ *↵ * This program is distributed in the hope that it will be useful,↵ * …
    All 301 tokens

    /*↵ * SCUBA smart card framework.↵ *↵ * Copyright (C) 2011 The SCUBA team.↵ *↵ * This program is free software: you can redistribute it and/or modify↵ * it under the terms of the GNU General Public License as published by↵ * the Free Software Foundation, either version 3 of the License, or↵ * (at your option) any later version.↵ *↵ * This program is distributed in the hope that it will be useful,↵ * but WITHOUT ANY WARRANTY; without even the implied warranty of↵ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the↵ * GNU General Public License for more details.↵ *↵ * You should have received a copy of the GNU General Public License↵ * along with this program. If not, see <http://www.gnu.org/licenses/>.↵ *↵ * $Id: $↵ */↵↵package net.sourceforge.scuba.smartcards;↵↵import java.util.EventListener;↵↵/**↵ * Interface for terminal addition and removal event observers.↵ *↵ * @author Pim Vullers (██████)↵ *↵ * @version $Revision: $↵ */↵public interface TerminalFactoryListener extends EventListener↵{↵ /**↵ * Called when terminal added.↵ *↵ * @param cte addition event↵ */↵ void cardTerminalAdded(CardTerminalEvent cte);↵↵ /**↵ * Called when terminal removed.↵ *↵ * @param cte removal event↵ */↵ void cardTerminalRemoved(CardTerminalEvent cte);↵}

    Values
    TokenNegative-pole strength
    the0.400
    Free0.000
    Software0.000
    Foundation0.000
    ,0.107
    either0.000
    version0.178
    0.000
    30.000
    of0.044
    the0.000
    License0.000
    ,0.169
    or0.000
    ↵0.117
    *0.146
    (0.008
    at0.058
    your0.092
    option0.000
    )0.000
    any0.000
    later0.000
    version0.000
    .↵0.000
    *↵0.000
    *0.000
    This0.105
    program0.000
    is0.158
    distributed3.178
    in0.006
    the0.000
    hope0.000
    that0.000
    it0.000
    will0.004
    be0.099
    useful0.232
    ,↵0.000
    *0.072
  10. 3.03 … string↵ */↵ protected $originalID;↵↵ /**↵ * Overrides Entity::__construct().↵ */↵ public function __construct(array $values, $entity_type) {↵ parent::__construct($values …
    All 717 tokens

    <?php↵↵/**↵ * @file↵ * Definition of Drupal\Core\Config\Entity\ConfigEntityBase.↵ */↵↵namespace Drupal\Core\Config\Entity;↵↵use Drupal\Core\Entity\Entity;↵use Drupal\Core\TypedData\ContextAwareInterface;↵↵/**↵ * Defines a base configuration entity class.↵ */↵abstract class ConfigEntityBase extends Entity implements ConfigEntityInterface {↵↵ /**↵ * The original ID of the configuration entity.↵ *↵ * The ID of a configuration entity is a unique string (machine name). When a↵ * configuration entity is updated and its machine name is renamed, the↵ * original ID needs to be known.↵ *↵ * @var string↵ */↵ protected $originalID;↵↵ /**↵ * Overrides Entity::__construct().↵ */↵ public function __construct(array $values, $entity_type) {↵ parent::__construct($values, $entity_type);↵↵ // Backup the original ID, if any.↵ // Configuration entity IDs are strings, and '0' is a valid ID.↵ $original_id = $this->id();↵ if ($original_id !== NULL && $original_id !== '') {↵ $this->setOriginalID($original_id);↵ }↵ }↵↵ /**↵ * Implements ConfigEntityInterface::getOriginalID().↵ */↵ public function getOriginalID() {↵ return $this->originalID;↵ }↵↵ /**↵ * Implements ConfigEntityInterface::setOriginalID().↵ */↵ public function setOriginalID($id) {↵ $this->originalID = $id;↵ }↵↵ /**↵ * Overrides Entity::isNew().↵ *↵ * EntityInterface::enforceIsNew() is only supported for newly created↵ * configuration entities but has no effect after saving, since each↵ * configuration entity is unique.↵ */↵ final public function isNew() {↵ // Configuration entity IDs are strings, and '0' is a valid ID.↵ return !empty($this->enforceIsNew) || $this->id() === NULL || $this->id() === '';↵ }↵↵ /**↵ * Overrides Entity::get().↵ *↵ * EntityInterface::get() implements support for fieldable entities, but↵ * configuration entities are not fieldable.↵ */↵ public function get($property_name, $langcode = NULL) {↵ // @todo: Add support for translatable properties being not fields.↵ return isset($this->{$property_name}) ? $this->{$property_name} : NULL;↵ }↵↵ /**↵ * Overrides Entity::set().↵ *↵ * EntityInterface::set() implements support for fieldable entities, but↵ * configuration entities are not fieldable.↵ */↵ public function set($property_name, $value, $langcode = NULL) {↵ // @todo: Add support for translatable properties being not fields.↵ $this->{$property_name} = $value;↵ }↵↵ /**↵ * Overrides Entity::createDuplicate().↵ */↵ public function createDuplicate() {↵ $duplicate = parent::createDuplicate();↵ // Prevent the new duplicate from being misinterpreted as a rename.↵ $duplicate->setOriginalID(NULL);↵ return $duplicate;↵ }↵↵ /**↵ * Helper callback for uasort() to sort configuration entities by weight and label.↵ */↵ public static function sort($a, $b) {↵ $a_weight = isset($a->weight) ? $a->weight : 0;↵ $b_weight = isset($b->weight) ? $b->weight :

    Values
    TokenNegative-pole strength
    string0.464
    ↵0.000
    0.000
    */↵0.054
    0.173
    protected0.403
    $0.000
    original0.000
    ID0.000
    ;↵↵0.000
    0.048
    /**↵0.110
    0.002
    *0.150
    Overrides0.261
    Entity0.117
    ::__0.020
    construct0.000
    ().↵0.125
    0.000
    */↵0.000
    0.000
    public0.031
    function0.068
    __0.000
    construct0.000
    (array0.147
    $0.000
    values0.004
    ,0.639
    $3.027
    entity0.000
    _type0.005
    )0.165
    {↵0.000
    0.000
    parent0.000
    ::__0.000
    construct0.123
    ($0.000
    values0.000
  11. 2.12 … cover_image: coverImage {↵ cropped(width: 1800, height: 600, version: "wide") {↵ url↵ }↵ }↵ currency↵ description …
    All 411 tokens

    export const saleV2Query = `↵ query saleQuery($saleId: String!) {↵ sale(id: $saleId) {↵ _id: internalID↵ id: slug↵ associated_sale: associatedSale {↵ cover_image: coverImage {↵ cropped(width: 260, height: 110) {↵ url↵ }↵ }↵ end_at: endAt↵ href↵ id: slug↵ is_closed: isClosed↵ is_live_open: isLiveOpen↵ is_preview: isPreview↵ live_start_at: liveStartAt↵ name↵ start_at: startAt↵ }↵ auction_state: status↵ cover_image: coverImage {↵ cropped(width: 1800, height: 600, version: "wide") {↵ url↵ }↵ }↵ currency↵ description↵ eligible_sale_artworks_count: eligibleSaleArtworksCount↵ end_at: endAt↵ is_auction: isAuction↵ is_closed: isClosed↵ is_live_open: isLiveOpen↵ is_open: isOpen↵ live_start_at: liveStartAt↵ name↵ promoted_sale: promotedSale {↵ id: slug↵ name↵ saleArtworksConnection(first: 25) {↵ edges {↵ node {↵ artwork {↵ id: slug↵ title↵ date↵ sale_message: saleMessage↵ is_in_auction: isInAuction↵ image {↵ placeholder↵ url↵ aspect_ratio: aspectRatio↵ }↵ artists {↵ id: slug↵ href↵ name↵ }↵ partner {↵ name↵ }↵ href↵ is_acquireable: isAcquireable↵ }↵ }↵ }↵ }↵ }↵ registration_ends_at: registrationEndsAt↵ requireIdentityVerification↵ start_at: startAt↵ status↵ symbol↵ }↵ }↵`

    Values
    TokenNegative-pole strength
    cover0.000
    _image0.000
    :0.022
    cover0.000
    Image0.259
    {↵0.000
    0.535
    cropped1.541
    (width0.000
    :0.000
    0.000
    10.000
    80.000
    00.292
    00.781
    ,0.012
    height0.000
    :0.106
    0.005
    60.000
    00.189
    00.803
    ,1.113
    version0.000
    :0.005
    "0.000
    wide0.019
    ")0.151
    {↵0.000
    1.134
    url2.121
    ↵0.000
    0.187
    }↵0.000
    0.077
    }↵0.000
    0.304
    currency0.001
    ↵0.000
    0.144
    description0.129
  12. 2.12 … and tested.↵↵## Proposed solution↵↵The code used to model the solution above is presented here:↵↵prisoners.needed <- function(bottles.to.test, hours.remaining, venom.time, accuracy) {↵ …
    All 733 tokens

    ## Introduction↵↵The blog Analytics Vidhya has published in October the following puzzle:↵↵You are the ruler of an empire and you are about to have a celebration tomorrow.The celebration is the most important party you have ever hosted. You’ve got 1000 bottles of wine you were planning to open for the celebration, but you find out that one of them has been poisoned by your enemy. The poison exhibits no symptoms until death and the death occurs within fifteen hours of consuming even a diluted sample.↵↵I propose hereafter a solution for the puzzle.↵↵## Logic of the solution↵↵It is known that the venom kills within 15 hours. As such, if I give venom to the same prisoner at different times I can know if the bottle is venomous by checking if he died 15 hours later. As an example to illustrate this:↵↵• if I give venom to a prisoner at time t = 0h = 0min, he will die at time t = 15h = 900min↵• if I give it at time t = 1h = 60 min he will die at time t = 15h = 960min↵• if I give it at time t = 1h30 = 90 min he will die at time t = 15h = 990min↵↵Whatever happens, venom can not be administered later than 15h before the party starts, as otherwise I will only be able to check if it had an effect after the party has started, which is a no-no.↵↵If wine is given to a prisoner from a different bottle each time in given intervals of time, it will be enough to check if the prisoner died 15 hours later to identify which bottle was the cause: if a prisoner dies at 17h20 it is quite likely that the wine with venom was provided to him at 02h20.↵↵The problem is that the venom will not kill in exactly 15 hours, but in a window of time: it will sometimes take 14.5 hours, other times 15.3 hours… Thus, there is some inaccuracy associated with the time it takes to kill which must be taken into account in the calculations.↵↵The slaves in this scheme would be in charge to administer the wine to prisoners, execute the strategy, keep a close eye on prisoners to check when they die as well as keep the boring housekeeping records on which bottles have been administered and tested.↵↵## Proposed solution↵↵The code used to model the solution above is presented here:↵↵prisoners.needed <- function(bottles.to.test, hours.remaining, venom.time, accuracy) {↵min.remaining <- (hours.remaining - venom.time) * 60↵bottles.per.prisoner <- floor(min.remaining/(accuracy*2))↵prisoners.needed <- ceiling(bottles.to.test / bottles.per.prisoner)↵prisoners.needed↵}↵↵Inputs for the function are explained below:↵↵• bottles.to.test: How many bottles must be tested for venom?↵• hours.remaining (in hours): how many hours are left before the party starts?↵• venom.time (in hours): how much time does the venom take to have an effect?↵• accuracy (in minutes): how precise is the estimation of venom effects? this implies that a person ingesting the venom will die with 100% probability within (venom.time*60-interval, venom.time*60+interval) minutes of its administration↵↵The code calculates first how many minute

    Values
    TokenNegative-pole strength
    and0.000
    tested0.185
    .↵↵0.000
    ##0.092
    Proposed0.089
    solution0.145
    ↵↵0.000
    The0.017
    code0.135
    used0.111
    to0.392
    model0.000
    the0.120
    solution0.232
    above0.211
    is0.268
    presented0.102
    here0.122
    :↵↵0.255
    pr0.039
    ison0.039
    ers0.180
    .0.000
    needed0.056
    <-0.000
    function0.705
    (b0.000
    ott0.000
    les0.250
    .to0.003
    .test2.117
    ,0.488
    hours0.000
    .remaining0.275
    ,0.532
    venom0.000
    .time0.563
    ,1.016
    accuracy0.115
    )0.000
    {↵0.026
Read more

Each token is shaded by negative-pole strength, as a fraction of the neuron's max activation. Each window shows up to 30 tokens before the peak and 10 after it.

Explanation scores on held-out text

How well a judge with only the hypothesis predicts the unit on new text. 0.5 is chance.

Read more

The judge reads 32-token windows of corpus text that the proposer never saw. Detection: it picks the windows that activate the unit. Fuzzing: it checks whether the marked tokens are the active ones. Recorded, not gated.

Detection
0.60
Fuzzing
0.50
Embedding AUROC
0.80

Detection recall by activation strength

0.00
0.00
0.00
1.00
0.00
weakeststrongest

False alarms on inactive windows: 0%.

Judge
deepseek-flash
Held-out windows
7 active of 4,000
Judged
10 detection · 3 fuzzing
Detection outcomes
4 missed · 0 false alarm · 1 hit · 5 correct rejection
Seed
3466361265 · mixed-v5 (9 presets, 500 docs, seed 1299840433)
Detection windows (10), the explanation's mistakes first
  1. missed 12.30 · sim 0.11 1,19.78581], [49.23597,19.78933]], "type
  2. missed 8.10 · sim 0.19 .txt", "w")` code block creates a new file named "passwords.txt" if it doesn't already exist, and writes the generated passwords to the
  3. missed 6.61 · sim 0.15 _F2"]}],↵ "F3": [{"Modifiers": [], "Keys": ["KEY_F3"]}],↵ "F4": [{"Modifiers": [], "
  4. missed 5.76 · sim 0.10 49.21142,19.76023], [49.21529,19.7
  5. hit 8.35 · sim -0.09 ="string", length = 3, nullable = true)↵ */↵ private $code;↵↵ /**↵ * @ManyToOne(targetEntity="Country", cascade={"all
  6. correct rejection 0.46 · sim 0.09 semilinear heat equations,, J. Math. Anal. Appl., 316 (2006), 538. doi: 1
  7. correct rejection 0.30 · sim 0.05 kiến thức, chuẩn mực quốc tế, giúp vận dụng linh hoạt vào trong công việc.↵Đặc biệt, khi là học viên hay hội viên của
  8. correct rejection 0.29 · sim 0.05 authors could be multiplied, but for present purposes just one more, but a particularly significant one, needs to be cited: Joseph von Eichendorff.↵Joseph
  9. correct rejection 0.20 · sim 0.02 and dolphins swimming together that equals great entertainment in her eyes. My kid watched this entire film happily after being strapped into her car seat for more than three hours.↵
  10. correct rejection 0.13 · sim 0.02 to engage in wars or support the military.↵↵Today, Quakers can be found around the world, with the largest concentration in the United States and the United Kingdom
Fuzzing windows (3), dashed tokens were marked for the judge
  1. marks right · judged wrong RQ"]}],↵ "PRINTSCR": [{"Modifiers": [], "Keys": ["KEY_SYSRQ"]}],↵ "SCROLLLOCK": [{"Modifiers":
  2. marks wrong · judged wrong }],↵ "SHIFT": [{"Modifiers": ["MOD_LEFT_SHIFT"], "Keys": []}],↵ "LEFT_SHIFT": [{"Modifiers": ["MOD_LEFT_SHIFT"], "
  3. marks wrong · judged wrong 中条さんが男装をしているバージョンもありますし、「ドコモ」のCMでは歌を歌っていたり、踊っていたりするのでインパ

Activation and mechanism

Activation distribution

[0, 0.678): 199353 [0.678, 1.36): 434 [1.36, 2.03): 63 [2.03, 2.71): 29 [2.71, 3.39): 28 [3.39, 4.07): 21 [4.07, 4.75): 15 [4.75, 5.42): 16 [5.42, 6.1): 6 [6.1, 6.78): 3 [6.78, 7.46): 2 [7.46, 8.14): 1 [8.14, 8.81): 1 [8.81, 9.49): 0 [9.49, 10.2): 1 [10.2, 10.8): 1 [10.8, 11.5): 2 [11.5, 12.2): 1 [12.2, 12.9): 0 [12.9, 13.6): 0 [13.6, 14.2): 0 [14.2, 14.9): 0 [14.9, 15.6): 0 [15.6, 16.3): 0 [16.3, 17): 0 [17, 17.6): 0 [17.6, 18.3): 0 [18.3, 19): 1 [19, 19.7): 0 [19.7, 20.3): 1 0.00 20.34

Negative-pole strength per token; bar height is log(1 + count).

Mechanism

Claimed retrospective: responds to tokens already in context.

Input attribution

0 back
14%
1 back
6%
2–4 back
11%
5–16 back
17%
17–64 back
30%
65+ back
21%
  • #1 at init: ).__-1 0.12__(-21 0.04 self-2 0.04kwargs-17 0.03(H-6 0.03
  • #2 at ',: ',0 0.33_for-3 0.31="{{-5 -0.13 url-4 0.10('-2 0.09
  • #3 at .basicConfig: .basicConfig0 0.34logging-1 0.16 o-28 -0.12 logging-16 0.06 TestCase-8 0.04
  • #4 (not converged) at set: can-350 -0.21 you-2 -0.13 This-351 -0.12 set-18 0.12 be-349 0.11
  • #5 at ,: _index-21 0.28 Create-74 0.16 add-22 0.12_index-7 0.11,0 -0.10

Shares of the gap to <|endoftext|> at every position but the first · converged on 4 of 5 · mean 74.0 tokens back · agreement with replacing one token at a time ρ = 0.10 · reported, not gated

Vocabulary projection

The tokens that this unit's output raises and lowers most.

Jacobian lens

␣** · z = +10.60 · #1 promoted ␣** (** · z = +9.04 · #2 promoted (** ** · z = +8.26 · #3 promoted ** ,** · z = +7.63 · #4 promoted ,** ␣(** · z = +7.43 · #5 promoted ␣(** ␣*** · z = +7.40 · #6 promoted ␣*** ␣**) · z = +7.25 · #7 promoted ␣**) **↵↵ · z = +7.22 · #8 promoted **↵↵ ␣**↵ · z = +6.93 · #9 promoted ␣**↵ )** · z = +6.83 · #10 promoted )** }while · z = -4.34 · #10 suppressed }while },' · z = -4.39 · #9 suppressed },' ("$ · z = -4.43 · #8 suppressed ("$ _| · z = -4.45 · #7 suppressed _| |$ · z = -4.55 · #6 suppressed |$ ]," · z = -4.70 · #5 suppressed ]," ],[- · z = -4.77 · #4 suppressed ],[- 接着 · z = -4.84 · #3 suppressed 接着 '],' · z = -4.89 · #2 suppressed '],' ],[ · z = -5.43 · #1 suppressed ],[ -15 -10 -5 0 +5 +10 +15

Logit lens

␣** · z = +9.40 · #1 promoted ␣** (** · z = +8.25 · #2 promoted (** ** · z = +7.77 · #3 promoted ** ,** · z = +7.34 · #4 promoted ,** ␣**↵ · z = +6.65 · #5 promoted ␣**↵ ␣(** · z = +6.27 · #6 promoted ␣(** ␣**) · z = +6.04 · #7 promoted ␣**) ␣*** · z = +5.98 · #8 promoted ␣*** *** · z = +5.90 · #9 promoted *** **, · z = +5.88 · #10 promoted **, }," · z = -4.29 · #10 suppressed }," ␣gener · z = -4.41 · #9 suppressed ␣gener Named · z = -4.41 · #8 suppressed Named FTER · z = -4.42 · #7 suppressed FTER 生成 · z = -4.44 · #6 suppressed 生成 ],[- · z = -4.46 · #5 suppressed ],[- ␣opinión · z = -4.50 · #4 suppressed ␣opinión ],[ · z = -4.59 · #3 suppressed ],[ 湣 · z = -4.72 · #2 suppressed 湣 _| · z = -4.78 · #1 suppressed _| -15 -10 -5 0 +5 +10 +15
promotes suppresses Hover a bar for its value.
Values
#Jacobian lens promotessuppressesLogit lens promotessuppresses
1 ** +10.60 ],[ -5.43 ** +9.40 _| -4.78
2 (** +9.04 '],' -4.89 (** +8.25 湣 -4.72
3 ** +8.26 接着 -4.84 ** +7.77 ],[ -4.59
4 ,** +7.63 ],[- -4.77 ,** +7.34 opinión -4.50
5 (** +7.43 ]," -4.70 ** +6.65 ],[- -4.46
6 *** +7.40 |$ -4.55 (** +6.27 生成 -4.44
7 **) +7.25 _| -4.45 **) +6.04 FTER -4.42
8 ** +7.22 ("$ -4.43 *** +5.98 Named -4.41
9 ** +6.93 },' -4.39 *** +5.90 gener -4.41
10 )** +6.83 }while -4.34 **, +5.88 }," -4.29

Top-10 overlap 80% · cos(w, J·w) 0.82 · kurtosis 3.8 (Jacobian) / 3.5 (logit) · 100 prompts

Read more

The output direction is read through the final norm and the unembedding. The Jacobian lens first carries it to the last layer. Bar length is the token's z-score over the vocabulary, and ␣ marks a space. A kurtosis near 3 means no specific set of tokens.

Patchscope

The model's own description of this unit's output, with no examples.

Read more

The unit's direction replaces the residual stream after the named layer, at the ? of each prompt. It is scaled to each multiple of the norm it replaces, and the model continues greedily. The control injects a random direction, so text that both rows share comes from the prompt. Read after the proposer answered, and shown to neither agent. Reported, not gated.

PromptLayer ×1×2×4
category 2 unit nopoliticspolitics
control furniturepoliticspolitics
category 21 unit technologytechnology?
control ???
meaning 2 unit ____________
control ____.____.:
meaning 21 unit ____.____.____.
control ____.____.____.

Hover a prompt's name for its text.

Steering

What the model writes with this pole ablated, untouched, and clamped. Text that matches the baseline is faded.

Read more

The prompts are neutral. The clamp is a multiple of the top activation in the scan (20.34), at every token, and decoding is greedy. Drift at ×1 or ×2 shows what the pole makes the model write. Drift only at ×4 is off-distribution. At most 24 new tokens. Taken after the proposer answered, and shown to neither agent. Reported, not gated.

The weather today is …
Ablated

very hot. The temperature is 30 degrees Celsius. If the temperature increases by 5 degrees Celsius tomorrow, what

Baseline

very hot. The temperature is 30 degrees Celsius. If the temperature increases by 5 degrees Celsius tomorrow, what

Clamped ×1

very hot. The temperature is 38 degrees Celsius. If the temperature increases by 5 degrees every hour, how

Clamped ×2

________ and the temperature is ________. A. sunny; hot B. sunny; warm C. hot

Clamped ×4

____( ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **

I went to the shop and bought …
Ablated

a new pair of shoes. I put them on and walked out of the store. I was so happy that I had

Baseline

a new pair of shoes. I put them on and walked out of the store. I was so happy that I had

Clamped ×1

a new pair of shoes. I also bought a new shirt and a new pair of socks. I paid $10

Clamped ×2

a few things. I paid for them and left. I was happy with my shopping. I was happy with my shopping

Clamped ×4

a **** **** **** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **

The best way to learn is …
Ablated

to do. The best way to do is to practice. The best way to practice is to play. The best way

Baseline

to do. The best way to do is to practice. The best way to practice is to play. The best way

Clamped ×1

to do it yourself. The best way to learn is to do it yourself. The best way to learn is to do

Clamped ×2

to ask questions. The best way to ask questions is to ask questions that are interesting and relevant to the topic you are

Clamped ×4

to ask questions. **\***\***\***\***\***\***\***\***\***\

Once upon a time, …
Ablated

there was a little girl named Lily. She lived in a small village with her parents and grandparents. One day, Lily

Baseline

there was a little girl named Lily. She lived in a small village with her parents and grandparents. One day, Lily

Clamped ×1

there was a little girl named Lily. She lived in a small village with her parents and grandparents. One day, Lily

Clamped ×2

there was a little girl named Lily who loved to play outside. She would run around the park, climb trees, and

Clamped ×4

there was a **** **\*** \***\*\*\*\*\*\*\*\*\*\*\*\*\*\

The report concluded that …
Ablated

the number of people who died in the 2010 earthquake was 22,000, with

Baseline

the number of people who died in the 2010 earthquake was 22,000, with

Clamped ×1

the government had failed to protect the environment and that the country was "at risk of a major environmental disaster". The report

Clamped ×2

the government had failed to protect the environment and that the country was "at risk of a major environmental disaster". The report

Clamped ×4

the **** **** **** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **

Wiring

The units that write most directly into this pole (upstream) and read most directly from it (downstream).

Read more

"Directly" means along the residual stream, through no other unit. Linked units have pages in the registry. Reported, not gated.

From the weights. Virtual weights, with each norm's gain folded in. They rank units but have no absolute scale. Each number is how much one unit reads of the other's write. It is signed when one vector reads another (+ means a positive activation raises the read), and a norm otherwise. Heads count through their OV circuit upstream, and through their Q, K and V reads downstream. Channels are on hover.

From activations. Averaged over this pole's peak on 14 of the review's prompts where it fired. Upstream: the first-order change in its strength when a unit's direct write is removed (+ excites). Downstream: the change in a later unit when this pole's write is removed from that unit's input alone (one of Q, K or V for a head).

From the weights

Upstream neurons
L19/N2569 up +0.238
L20/N8046 up -0.202
L11/N277 gate +0.165
L16/N1671 gate -0.152
L18/N7131 gate -0.152
L1/N8723 up -0.148
L20/N4817 up -0.148
L17/N6328 gate -0.141
L19/N1976 up -0.139
L1/N2282 gate -0.136
Upstream heads
L17/H11 gate +0.997
L17/H7 gate +0.905
L21/H2 gate +0.729
L17/H10 gate +0.682
L17/H6 up +0.642
L19/H8 up +0.609
L21/H5 gate +0.586
L20/H10 gate +0.576
L20/H7 gate +0.574
L21/H9 gate +0.555
Downstream neurons
L27/N6896 gate +0.408
L26/N1208 gate +0.251
L27/N3616 up +0.235
L25/N8168 gate -0.229
L22/N4146 gate +0.227
L26/N2908 up -0.226
L27/N6757 gate +0.225
L25/N3241 gate -0.223
L22/N52 up -0.222
L26/N7520 up -0.217
Downstream heads
L27/H6 v +0.691
L27/H7 v +0.691
L27/H8 v +0.691
L27/H9 v +0.691
L27/H10 v +0.691
L27/H11 v +0.691
L26/H6 v +0.662
L26/H7 v +0.662
L26/H8 v +0.662
L26/H9 v +0.662

From activations

Upstream neurons
L19/N2569 +1.88
L6/N7152 +1.1
L19/N7358 +0.775
L20/N6066 +0.541
L9/N6650 +0.504
L20/N4817 +0.472
L19/N6631 +0.46
L8/N7866 +0.424
L20/N647 -0.421
L15/N4615 -0.408
Upstream heads
L21/H2 +1.17
L19/H6 -1.08
L19/H8 +0.979
L21/H0 -0.839
L9/H0 -0.693
L13/H4 -0.674
L16/H1 -0.644
L9/H3 +0.555
L20/H8 +0.554
L0/H6 -0.53
Downstream neurons
L24/N7306 -1.89
L24/N3674 +1.64
L24/N2764 +1.53
L26/N1208 -1.27
L23/N4718 +1.2
L22/N4146 -1.17
L23/N6841 -1.08
L23/N2901 +1.05
L23/N6639 -1.03
L27/N3240 +1.01
Downstream heads
L22/H6 q +1.46
L25/H3 v +1.37
L27/H9 v +1.3
L27/H2 v +1.26
L27/H11 v +1.2
L27/H6 v +1.07
L22/H8 q +1.05
L27/H8 v +1.04
L27/H10 v +1.04
L27/H1 v +1

Covariance and confounds

Confounds

Token identity R²
0.37
Position R²
0.01
Frequency r
0.11
Language R² · MI
0.09 · 0.090 bits
Source R² · MI
0.03 · 0.027 bits
Programming language R² · MI
0.04 · 0.051 bits
Syntax node R² · MI
0.01 · 0.025 bits
Bracket depth R² · MI
0.01 · 0.028 bits
Round depth R² · MI
0.01 · 0.002 bits
Indent depth R² · MI
0.00 · 0.029 bits
Syntax construct R² · MI
0.03 · 0.053 bits
Personal data R² · MI
0.00 · 0.000 bits
Toxicity R² · MI
0.00 · 0.000 bits
Hate speech R² · MI
0.00 · 0.000 bits
Names R² · MI
0.00 · 0.002 bits
Postal addresses R² · MI
0.00 · 0.000 bits
Best trivial baseline
never active · 0.46
Hypothesis
0.81 ✓

__(pathinitself(self_screen',(tmp.load(),<body=""

Co-activating neuron poles

Pole Lift ≥ Both ρ r
N4712+ 55.5 22 -0.05 +0.01
N8952− 41.8 18 -0.02 -0.05
N112+ 38.7 17 -0.04 +0.09
N3417+ 38.7 17 -0.02 +0.07
N6046+ 38.7 17 +0.00 +0.08
N6892+ 35.7 16 -0.02 +0.06
N2357− 35.7 16 +0.00 -0.03
N5529− 32.7 15 +0.03 -0.04
N7971− 32.7 15 -0.03 -0.05
N846− 32.7 15 +0.02 -0.08
Read more

Ranked by the 95% lower bound of co-activation lift: how much more often a pole fires when this one does, with chance coincidences discounted. ρ ranks the values, so heavy tails don't sway it.

Joint ablation

Partners
N4712, N8952, N112
KL pole alone
1.18e-03
KL partners
1.22e-04
KL together
1.29e-03
Redundancy ratio
0.99

The partners don't change the pole's effect much.

Run details

Submitted by
deepseek-flash
Reviewed by
deepseek-flash (same model as the proposer: not an independent review)
Reviewed at
2026-11-11 11:52 UTC
Max activation
20.3407
Selection
random (seed 2578387754)
Corpus
mixed-v5 (9 presets, 500 docs, seed 1299840433) · 199,979 tokens · seeded sample of 386/500 docs (≤ 200,000 tokens, seed 0) · licence HuggingFaceFW/fineweb-edu: odc-by; allenai/c4: odc-by; monology/pile-uncopyrighted: other; Salesforce/wikitext: cc-by-sa-3.0, gfdl; codeparrot/github-code-clean: apache-2.0; wikimedia/wikipedia: cc-by-sa-3.0, gfdl; open-web-math/open-web-math: odc-by; HuggingFaceH4/ultrachat_200k: mit; HuggingFaceFW/fineweb-2: odc-by
Languages
el 14% · ja 9% · ru 9% · zh 8% · uk 5% · ta 5% · de 5% · bn 5% · other 41%
Model revision
8faed761d45a · float32
Ran on
scan cuda:0 · review cuda:0 (streamed from disk)
Run cost
42.8 min (slowest: scan, 17.5 min) · peak 9.6 GB RAM · 4 LLM calls · 5,455,733 + 178,640 tokens · $0.14