<commit_before><?php

namespace Zicht\Itertools\lib;

use Closure;
use Countable;
use InvalidArgumentException;
use Iterator;
use MultipleIterator;
use Zicht\Itertools\lib\Traits\CountableTrait;
use Zicht\Itertools\lib\Traits\DebugInfoTrait;

class MapIterator extends MultipleIterator implements Countable
{
    use CountableTrait;
    use DebugInfoTrait;

    private $valueFunc;
    private $keyFunc;

    public function __construct(Closure $valueFunc /* [Closure $keyFunc], \Iterator $iterable1, [\Iterator $iterable2, [...]] */)
    {
        parent::__construct(MultipleIterator::MIT_NEED_ALL| MultipleIterator::MIT_KEYS_NUMERIC);<commit_msg>MapIterator should allow ArrayAccess<commit_after><?php

namespace Zicht\Itertools\lib;

use ArrayAccess;
use Closure;
use Countable;
use InvalidArgumentException;
use Iterator;
use MultipleIterator;
use Zicht\Itertools\lib\Traits\ArrayAccessTrait;
use Zicht\Itertools\lib\Traits\CountableTrait;
use Zicht\Itertools\lib\Traits\DebugInfoTrait;

class MapIterator extends MultipleIterator implements Countable, ArrayAccess
{
    use ArrayAccessTrait;
    use CountableTrait;
    use DebugInfoTrait;

    private $valueFunc;
    private $keyFunc;

    public function __construct(Closure $valueFunc /* [Closure $keyFunc], \Iterator $iterable1, [\Iterator $iterable2, [...]] */)
    {
        parent::__construct(MultipleIterator::MIT_NEED_ALL| MultipleIterator::MIT_KEYS_NUMERIC);
{'fraction_non_alphanumeric': 0.0967741935483871, 'fraction_numerical': 0.002805049088359046, 'mean_word_length': 5.457013574660634, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1200073', 'n_tokens_mistral': 448, 'n_tokens_neox': 433, 'n_words': 95}