<commit_before>from pacman103.lib import graph
import nengo


class NengoEdge(graph.Edge):
    def __init__(self, conn, pre, post, constraints=None, label=None,
                 filter_is_accumulatory=True):
        super(NengoEdge, self).__init__(
            pre, post, constraints=constraints, label=label
        )
        self.index = None  # Used in generating routing keys
        self.conn = conn   # Handy reference
        self._filter_is_accumulatory = filter_is_accumulatory

    @property
    def width(self):
        if isinstance(self.conn.post, nengo.Ensemble):
            return self.conn.post.dimensions
        elif isinstance(self.conn.post, nengo.Node):
            return self.conn.post.size_in

    def __getattr__(self, name):
        """Redirect missed attributes to the connection."""
        return getattr(self.conn, name)


class DecoderEdge(NengoEdge):
    """Edge representing a connection from an Ensemble."""
    pass


class InputEdge(NengoEdge):
    """Edge representing a connection from a Node via an ReceiveVertex."""
    pass<commit_msg>Allowed edges to just have an int for a connection<commit_after>from pacman103.lib import graph
import nengo


class NengoEdge(graph.Edge):
    def __init__(self, conn, pre, post, constraints=None, label=None,
                 filter_is_accumulatory=True):
        super(NengoEdge, self).__init__(
            pre, post, constraints=constraints, label=label
        )
        self.index = None  # Used in generating routing keys
        self.conn = conn   # Handy reference
        self._filter_is_accumulatory = filter_is_accumulatory

    @property
    def width(self):
        if isinstance(self.conn, int):
            return self.conn
        elif isinstance(self.conn.post, nengo.Ensemble):
            return self.conn.post.dimensions
        elif isinstance(self.conn.post, nengo.Node):
            return self.conn.post.size_in

    def __getattr__(self, name):
        """Redirect missed attributes to the connection."""
        return getattr(self.conn, name)


class DecoderEdge(NengoEdge):
    """Edge representing a connection from an Ensemble."""
    pass


class InputEdge(NengoEdge):
    """Edge representing a connection from a Node via an ReceiveVertex."""
    pass
{'fraction_non_alphanumeric': 0.08934099955771782, 'fraction_numerical': 0.0026536930561698365, 'mean_word_length': 2.8145025295109614, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1517974', 'n_tokens_mistral': 653, 'n_tokens_neox': 611, 'n_words': 179}