<commit_before>import itertools
import reprlib
import numpy as np
from lazy import *


class TimeSeries:
    """
    A class to store time series data. Supports time series data of any type, including mixed type.
    Supports all sequence operations (__getitem__, __setitem__, __len__).
    
    Attributes
    ----------
    
    Parameters
    ----------
    times : list
        a sequence of floats
    values: list
        a sequence of floats

    Examples
    --------
    # Building a TimeSeries
    >>> times = list(range(10))
    >>> values = list(range(10, 20))
    >>> timeSeries = TimeSeries(times, values)
    >>> print(timeSeries)
    TimeSeries with 10 elements: ([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, ...], [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, ...])

    # Accessor methods
    >>> timeSeries = TimeSeries(range(5), range(5,10))
    >>> timeSeries.times()
    array([ 0.,  1.,  2.,  3.,  4.])
    >>> timeSeries.values()
    array([ 5.,  6.,  7.,  8.,  9.])
    >>> timeSeries.items()
    [(0.0, 5.0), (1.0, 6.0), (2.0, 7.0), (3.0, 8.0), (4.0, 9.0)]

    # Setting items
    >>> timeSeries[3]
    8.0
    >>> timeSeries[3] = 100
    >>> timeSeries[3]
    100.0

    # Interpolation
    >>> a = TimeSeries([0,5, 10], [1, 2, 3])
    >>> b = TimeSeries([2.5, 7.5], [100, -100])
    >>> a.interpolate([1])
    TimeSeries(times=([1.0], values=[1.2]))
    >>> a.interpolate(b.times())
    TimeSeries(times=([2.5, 7.5], values=[1.5, 2.5]))
    >>> a.interpolate([-100, 100])
    TimeSeries(times=([-100.0, 100.0], values=[1.0, 3.0]))

    # Lazy property
    >>> x = TimeSeries([1, 2, 3, 4],[1, 4, 9, 16])
    >>> x.lazy.eval()
    TimeSeries(times=([1, 2, 3, 4], values=[1, 4, 9, 16]))<commit_msg>more int to float errors in doctests<commit_after>import itertools
import reprlib
import numpy as np
from lazy import *


class TimeSeries:
    """
    A class to store time series data. Supports time series data of any type, including mixed type.
    Supports all sequence operations (__getitem__, __setitem__, __len__).
    
    Attributes
    ----------
    
    Parameters
    ----------
    times : list
        a sequence of floats
    values: list
        a sequence of floats

    Examples
    --------
    # Building a TimeSeries
    >>> times = list(range(10))
    >>> values = list(range(10, 20))
    >>> timeSeries = TimeSeries(times, values)
    >>> print(timeSeries)
    TimeSeries with 10 elements: ([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, ...], [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, ...])

    # Accessor methods
    >>> timeSeries = TimeSeries(range(5), range(5,10))
    >>> timeSeries.times()
    array([ 0.,  1.,  2.,  3.,  4.])
    >>> timeSeries.values()
    array([ 5.,  6.,  7.,  8.,  9.])
    >>> timeSeries.items()
    [(0.0, 5.0), (1.0, 6.0), (2.0, 7.0), (3.0, 8.0), (4.0, 9.0)]

    # Setting items
    >>> timeSeries[3]
    8.0
    >>> timeSeries[3] = 100
    >>> timeSeries[3]
    100.0

    # Interpolation
    >>> a = TimeSeries([0,5, 10], [1, 2, 3])
    >>> b = TimeSeries([2.5, 7.5], [100, -100])
    >>> a.interpolate([1])
    TimeSeries(times=([1.0], values=[1.2]))
    >>> a.interpolate(b.times())
    TimeSeries(times=([2.5, 7.5], values=[1.5, 2.5]))
    >>> a.interpolate([-100, 100])
    TimeSeries(times=([-100.0, 100.0], values=[1.0, 3.0]))

    # Lazy property
    >>> x = TimeSeries([1, 2, 3, 4],[1, 4, 9, 16])
    >>> x.lazy.eval()
    TimeSeries(times=([1.0, 2.0, 3.0, 4.0], values=[1.0, 4.0, 9.0, 16.0]))
{'fraction_non_alphanumeric': 0.2173786689915722, 'fraction_numerical': 0.0895088637024121, 'mean_word_length': 2.3064361191162344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 111, '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': '452212', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1291, 'n_words': 331}