<commit_before>import numpy as np


class JaggedArray(object):
    def __init__(self, values, values_per_row):
        self._values = np.array(values)
        self._number_of_rows = len(values_per_row)
        self._offsets = JaggedArray._offsets_from_values_per_row(values_per_row)

    @property
    def size(self):
        return len(self._values)

    @property<commit_msg>Added alternate constructor that takes an array of arrays.<commit_after>import numpy as np


class JaggedArray(object):
    def __init__(self, *args):
        """JaggedArray([row0, row1, ...])
        JaggedArray(values, values_per_row)
        """
        if len(args) == 1:
            values, values_per_row = (np.concatenate(args[0]),
                                      [len(row) for row in args[0]])
        else:
            values, values_per_row = (np.array(args[0]), args[1])

        self._values = values
        self._number_of_rows = len(values_per_row)
        self._offsets = JaggedArray._offsets_from_values_per_row(values_per_row)

    @property
    def size(self):
        return len(self._values)

    @property
{'fraction_non_alphanumeric': 0.1045045045045045, 'fraction_numerical': 0.006306306306306306, 'mean_word_length': 2.642622950819672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3193466', 'n_tokens_mistral': 352, 'n_tokens_neox': 342, 'n_words': 70}