Add chunks_by.
Merge pull request #1630 from Raynes/chunks_by

Add chunks_by