@classmethod<EOL><INDENT>def decorator(cls, candidate, *exp_args, **exp_kwargs):<DEDENT>
def wrapper(control):<EOL><INDENT>@wraps(control)<EOL>def inner(*args, **kwargs):<EOL><INDENT>experiment = cls(*exp_args, **exp_kwargs)<EOL>experiment.control(control, args=args, kwargs=kwargs)<EOL>experiment.candidate(candidate, args=args, kwargs=kwargs)<EOL>return experiment.conduct()<EOL><DEDENT>return inner<EOL><DEDENT>return wrapper<EOL>
Decorate a control function in order to conduct an experiment when called.

:param callable candidate: your candidate function
:param iterable exp_args: positional arguments passed to :class:`Experiment`
:param dict exp_kwargs: keyword arguments passed to :class:`Experiment`

Usage::

    candidate_func = lambda: True

    @Experiment.decorator(candidate_func)
    def control_func():
        return True