<commit_before>#ifndef PROVIDER_H
#define PROVIDER_H

#include "StreamError.h"

#include <memory>

template<typename T>
struct StreamProvider {
public:
    virtual std::shared_ptr<T> get() = 0;
    virtual bool advance() = 0;

    virtual std::pair<int, int> print(std::ostream& os, int indent) const = 0;

    class Iterator;

    Iterator begin();
    Iterator end();

protected:
    static void print_indent_arrow(std::ostream& os, int indent) {
        for(int i = 0; i < indent - 1; i++) {
            os << "  ";
        }
        if(indent != 0) {
            os << "> ";
        }
    }


};

#include "StreamProviderIteratorImpl.h"

template<typename T>
typename StreamProvider<T>::Iterator StreamProvider<T>::begin() {
    return Iterator::begin(this);
}

template<typename T>
typename StreamProvider<T>::Iterator StreamProvider<T>::end() {
    return Iterator::end(this);
}

template<typename T>
using StreamProviderPtr = std::unique_ptr<StreamProvider<T>>;

template<template<typename...> class Provider,
         typename T,
         typename... TemplateArgs,
         typename... ConstructorArgs>
StreamProviderPtr<T> make_stream_provider(ConstructorArgs&&... args) {
    return StreamProviderPtr<T>(<commit_msg>Whitespace fix<commit_after>#ifndef PROVIDER_H
#define PROVIDER_H

#include "StreamError.h"

#include <memory>

template<typename T>
struct StreamProvider {
public:
    virtual std::shared_ptr<T> get() = 0;
    virtual bool advance() = 0;

    virtual std::pair<int, int> print(std::ostream& os, int indent) const = 0;

    class Iterator;

    Iterator begin();
    Iterator end();

protected:
    static void print_indent_arrow(std::ostream& os, int indent) {
        for(int i = 0; i < indent - 1; i++) {
            os << "  ";
        }
        if(indent != 0) {
            os << "> ";
        }
    }
};

#include "StreamProviderIteratorImpl.h"

template<typename T>
typename StreamProvider<T>::Iterator StreamProvider<T>::begin() {
    return Iterator::begin(this);
}

template<typename T>
typename StreamProvider<T>::Iterator StreamProvider<T>::end() {
    return Iterator::end(this);
}

template<typename T>
using StreamProviderPtr = std::unique_ptr<StreamProvider<T>>;

template<template<typename...> class Provider,
         typename T,
         typename... TemplateArgs,
         typename... ConstructorArgs>
StreamProviderPtr<T> make_stream_provider(ConstructorArgs&&... args) {
    return StreamProviderPtr<T>(
{'fraction_non_alphanumeric': 0.13708690330477355, 'fraction_numerical': 0.004895960832313341, 'mean_word_length': 3.5073529411764706, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 39, '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': '3659835', 'n_tokens_mistral': 764, 'n_tokens_neox': 730, 'n_words': 178}