def batch_pairs
import qasim-bend-kit@0.1.0.2/libs/JSON.bend as JSONimport Base
1254def batch_pairs(trees: List<&2, Batch>) -> List<&2, Batch>:
1255 match trees:
1256 case Nil{}:
1257 Nil{}
1258 case tree <> Nil{}:
1259 tree <> Nil{}
1260 case left <> right <> tail:
1261 Documents{left, right} <> batch_pairs(tail)