src/Zicht/Itertools/twig/Extension.php
public function groupBy($iterable, $strategy, $sort = true)
    {
        return Itertools\group_by($strategy, $iterable, $sort);
    }
public function groupBy($iterable, $strategy, $sort = true)
    {
        return Itertools\group_by($strategy, $iterable, $sort);
    }
Make an iterator that returns consecutive groups from the
$iterable.  Generally, the $iterable needs to already be sorted on
the same key function.

@param array|string|\Iterator $iterable
@param string|\Closure $strategy
@param boolean $sort
@return Itertools\lib\GroupbyIterator