<commit_before>import enum
import numpy as np
from rig.place_and_route import Cores, SDRAM
import struct

from nengo_spinnaker.builder.model import InputPort
from nengo_spinnaker.builder.netlist import netlistspec
from nengo_spinnaker import regions
from nengo_spinnaker.regions.utils import Args, sizeof_regions_named
from nengo_spinnaker.regions.filters import make_filter_regions
from nengo_spinnaker.netlist import Vertex
from nengo_spinnaker.partition import divide_slice
from nengo_spinnaker.utils.application import get_application

from ..builder.connection import (EnsembleTransmissionParameters,
                                  PassthroughNodeTransmissionParameters)


class Regions(enum.IntEnum):
    """Region names, corresponding to those used in `value_sink.c`"""
    system = 1
    filters = 2
    filter_routing = 3
    recording = 15


class ValueSink(object):
    """Operator which receives and stores values across the SpiNNaker multicast
    network.

    Attributes
    ----------
    probe : Probe
        Nengo probe that is updated by this operator.
    size_in : int
        Number of packets to receive and store per timestep.
    sample_every : int
        Number of machine timesteps between taking samples.
    """
    def __init__(self, probe, dt, max_width=64):
        self.probe = probe
        self.size_in = probe.size_in
        self.max_width = max_width

        # Compute the sample period
        if probe.sample_every is None:
            self.sample_every = 1
        else:
            self.sample_every = int(np.round(probe.sample_every / dt))

    def make_vertices(self, model, n_steps):  # TODO remove n_steps
        """Construct the data which can be loaded into the memory of a
        SpiNNaker machine.
        """
        # Extract all the filters from the incoming connections to build the
        # filter regions.
        signals_conns = model.get_signals_to_object(self)[InputPort.standard]<commit_msg>Reduce width of value sink operator<commit_after>import enum
import numpy as np
from rig.place_and_route import Cores, SDRAM
import struct

from nengo_spinnaker.builder.model import InputPort
from nengo_spinnaker.builder.netlist import netlistspec
from nengo_spinnaker import regions
from nengo_spinnaker.regions.utils import Args, sizeof_regions_named
from nengo_spinnaker.regions.filters import make_filter_regions
from nengo_spinnaker.netlist import Vertex
from nengo_spinnaker.partition import divide_slice
from nengo_spinnaker.utils.application import get_application

from ..builder.connection import (EnsembleTransmissionParameters,
                                  PassthroughNodeTransmissionParameters)


class Regions(enum.IntEnum):
    """Region names, corresponding to those used in `value_sink.c`"""
    system = 1
    filters = 2
    filter_routing = 3
    recording = 15


class ValueSink(object):
    """Operator which receives and stores values across the SpiNNaker multicast
    network.

    Attributes
    ----------
    probe : Probe
        Nengo probe that is updated by this operator.
    size_in : int
        Number of packets to receive and store per timestep.
    sample_every : int
        Number of machine timesteps between taking samples.
    """
    def __init__(self, probe, dt, max_width=16):
        self.probe = probe
        self.size_in = probe.size_in
        self.max_width = max_width

        # Compute the sample period
        if probe.sample_every is None:
            self.sample_every = 1
        else:
            self.sample_every = int(np.round(probe.sample_every / dt))

    def make_vertices(self, model, n_steps):  # TODO remove n_steps
        """Construct the data which can be loaded into the memory of a
        SpiNNaker machine.
        """
        # Extract all the filters from the incoming connections to build the
        # filter regions.
        signals_conns = model.get_signals_to_object(self)[InputPort.standard]
{'fraction_non_alphanumeric': 0.060882800608828, 'fraction_numerical': 0.004058853373921867, 'mean_word_length': 3.015274949083503, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3385606', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1077, 'n_words': 352}