<commit_before>#include <reactive/bridge.hpp>
#include <reactive/ptr_observable.hpp>
#include <reactive/tuple.hpp>
#include <reactive/transform.hpp>
#include <reactive/while.hpp>
#include <reactive/finite_state_machine.hpp>
#include <reactive/filter.hpp>
#include <reactive/timer.hpp>
#include <reactive/total_consumer.hpp>
#include <SDL2/SDL.h>
#include <boost/system/system_error.hpp>
#include <boost/scope_exit.hpp>
#include <boost/variant.hpp>

namespace
{
	void throw_error()
	{
		throw std::runtime_error(std::string("SDL error :") + SDL_GetError());
	}

	void check_sdl(int rc)
	{
		if (rc < 0)
		{
			throw_error();
		}
	}

	struct window_destructor
	{
		void operator()(SDL_Window *w) const
		{
			SDL_DestroyWindow(w);<commit_msg>design a delay constructor<commit_after>#include <reactive/bridge.hpp>
#include <reactive/ptr_observable.hpp>
#include <reactive/tuple.hpp>
#include <reactive/transform.hpp>
#include <reactive/while.hpp>
#include <reactive/finite_state_machine.hpp>
#include <reactive/filter.hpp>
#include <reactive/timer.hpp>
#include <reactive/total_consumer.hpp>
#include <SDL2/SDL.h>
#include <boost/system/system_error.hpp>
#include <boost/scope_exit.hpp>
#include <boost/variant.hpp>

namespace rx
{
	template <class Input>
	auto delay(Input &&input, boost::asio::io_service &io, boost::posix_time::time_duration duration)
	{
		typedef typename Input::element_type element_type;
		auto delaying_timer = make_wrapped<timer>(io, duration);
		auto unpack = [](std::tuple<timer_elapsed, element_type> value)
		{
			return std::move(std::get<1>(value));
		};
		return transform(make_tuple(delaying_timer, std::forward<Input>(input)), unpack);
	}
}

namespace
{
	void throw_error()
	{
		throw std::runtime_error(std::string("SDL error :") + SDL_GetError());
	}

	void check_sdl(int rc)
	{
		if (rc < 0)
		{
			throw_error();
		}
	}

	struct window_destructor
	{
		void operator()(SDL_Window *w) const
		{
			SDL_DestroyWindow(w);
{'fraction_non_alphanumeric': 0.14856557377049182, 'fraction_numerical': 0.0025614754098360654, 'mean_word_length': 5.711340206185567, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 34, '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': '187481', 'n_tokens_mistral': 761, 'n_tokens_neox': 683, 'n_words': 127}