<commit_before># coding=utf-8
from __future__ import division
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.integrate import ode

from core import (Function, integrate_function, calculate_function_matrix,
                  project_on_initial_functions)
from placeholder import Scalars, TestFunctions, Input, FieldVariable, EquationTerm, get_scalar_target
from utils import evaluate_approximation

__author__ = '<NAME>'


class SimulationInput(object):
    """
    base class for all objects that want to act as an input for the timestep simulation
    """
    __metaclass__ = ABCMeta

    def __init__(self):
        pass

    @abstractmethod
    def __call__(self, time, weights, **kwargs):
        """
        handle that will be used to retrieve input
        """
        pass

<commit_msg>added signal mixer for easier use of feedforward implementations in connection with controllers<commit_after># coding=utf-8
from __future__ import division
from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.integrate import ode

from core import (Function, integrate_function, calculate_function_matrix,
                  project_on_initial_functions)
from placeholder import Scalars, TestFunctions, Input, FieldVariable, EquationTerm, get_scalar_target
from utils import evaluate_approximation

__author__ = '<NAME>'


class SimulationInput(object):
    """
    base class for all objects that want to act as an input for the timestep simulation
    """
    __metaclass__ = ABCMeta

    def __init__(self):
        pass

    @abstractmethod
    def __call__(self, time, weights, **kwargs):
        """
        handle that will be used to retrieve input
        """
        pass


class Mixer(SimulationInput):
    """
    helper that represents a signal mixer
    """
    def __init__(self, inputs):
        SimulationInput.__init__(self)
        self._inputs = inputs

    def __call__(self, time, weights, **kwargs):
        outs = np.array([handle(time, weights) for handle in self._inputs])
        return np.sum(outs)


{'fraction_non_alphanumeric': 0.06841339155749636, 'fraction_numerical': 0.0009704027171276079, 'mean_word_length': 3.434408602150538, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5287859', 'n_tokens_mistral': 550, 'n_tokens_neox': 536, 'n_words': 198}