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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7577253
 
 
 
 
 
 
 
be30e44
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
---
dataset_info:
- config_name: batchfile
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 2045841
    num_examples: 1232
  download_size: 1001806
  dataset_size: 2045841
- config_name: bitbake
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 1829963
    num_examples: 924
  download_size: 896539
  dataset_size: 1829963
- config_name: c
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 9257649
    num_examples: 4415
  download_size: 4722635
  dataset_size: 9257649
- config_name: clojure
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 5197211
    num_examples: 2191
  download_size: 2355097
  dataset_size: 5197211
- config_name: coffeescript
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 12309704
    num_examples: 5116
  download_size: 6302961
  dataset_size: 12309704
- config_name: cpp
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 4221179
    num_examples: 1748
  download_size: 2062159
  dataset_size: 4221179
- config_name: csharp
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 25876275
    num_examples: 8358
  download_size: 10794984
  dataset_size: 25876275
- config_name: css
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 7347599
    num_examples: 4705
  download_size: 3329463
  dataset_size: 7347599
- config_name: elixir
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 2220804
    num_examples: 1015
  download_size: 1060494
  dataset_size: 2220804
- config_name: emacs-lisp
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 1927538
    num_examples: 950
  download_size: 897645
  dataset_size: 1927538
- config_name: go
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 6201672
    num_examples: 2925
  download_size: 3261068
  dataset_size: 6201672
- config_name: groovy
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 2265571
    num_examples: 832
  download_size: 1044728
  dataset_size: 2265571
- config_name: haml
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 9185927
    num_examples: 4344
  download_size: 4510228
  dataset_size: 9185927
- config_name: handlebars
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 2961527
    num_examples: 1389
  download_size: 1351557
  dataset_size: 2961527
- config_name: haskell
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 3615995
    num_examples: 1385
  download_size: 1789317
  dataset_size: 3615995
- config_name: html
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 41405026
    num_examples: 18169
  download_size: 19752600
  dataset_size: 41405026
- config_name: htmlperb
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 22052913
    num_examples: 10438
  download_size: 10898322
  dataset_size: 22052913
- config_name: ini
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 16530607
    num_examples: 10295
  download_size: 8002911
  dataset_size: 16530607
- config_name: jade
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 2362320
    num_examples: 1096
  download_size: 1123028
  dataset_size: 2362320
- config_name: java
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 29512250
    num_examples: 9831
  download_size: 13118457
  dataset_size: 29512250
- config_name: javascript
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 119660227
    num_examples: 49310
  download_size: 59815431
  dataset_size: 119660227
- config_name: json
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 72402143
    num_examples: 38023
  download_size: 32519532
  dataset_size: 72402143
- config_name: jsx
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 5701814
    num_examples: 2048
  download_size: 2566131
  dataset_size: 5701814
- config_name: kotlin
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 4328618
    num_examples: 1607
  download_size: 1969473
  dataset_size: 4328618
- config_name: less
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 2397637
    num_examples: 1335
  download_size: 1060965
  dataset_size: 2397637
- config_name: markdown
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 116029791
    num_examples: 52258
  download_size: 67561822
  dataset_size: 116029791
- config_name: nix
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 3612197
    num_examples: 1551
  download_size: 1848385
  dataset_size: 3612197
- config_name: perl
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 3076256
    num_examples: 1435
  download_size: 1616285
  dataset_size: 3076256
- config_name: php
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 44822098
    num_examples: 17184
  download_size: 20505068
  dataset_size: 44822098
- config_name: python
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 96055923
    num_examples: 38700
  download_size: 47992077
  dataset_size: 96055923
- config_name: restructuredtext
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 13900148
    num_examples: 5978
  download_size: 7406376
  dataset_size: 13900148
- config_name: ruby
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 130463663
    num_examples: 58154
  download_size: 65921990
  dataset_size: 130463663
- config_name: rust
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 1224510
    num_examples: 533
  download_size: 603023
  dataset_size: 1224510
- config_name: scala
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 4585699
    num_examples: 1963
  download_size: 2175939
  dataset_size: 4585699
- config_name: scss
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 11992324
    num_examples: 6733
  download_size: 5456402
  dataset_size: 11992324
- config_name: shell
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 41069556
    num_examples: 23040
  download_size: 22922635
  dataset_size: 41069556
- config_name: slim
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 2201982
    num_examples: 1032
  download_size: 1055340
  dataset_size: 2201982
- config_name: sql
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 2376727
    num_examples: 1187
  download_size: 1058007
  dataset_size: 2376727
- config_name: swift
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 5223410
    num_examples: 1870
  download_size: 2323842
  dataset_size: 5223410
- config_name: text
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 53789856
    num_examples: 44266
  download_size: 28461696
  dataset_size: 53789856
- config_name: toml
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 5261671
    num_examples: 3368
  download_size: 2432541
  dataset_size: 5261671
- config_name: twig
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 3569609
    num_examples: 1477
  download_size: 1501079
  dataset_size: 3569609
- config_name: typescript
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 9139019
    num_examples: 3371
  download_size: 4344755
  dataset_size: 9139019
- config_name: unknown
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 2663593
    num_examples: 1445
  download_size: 1170410
  dataset_size: 2663593
- config_name: viml
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 1827434
    num_examples: 1062
  download_size: 940828
  dataset_size: 1827434
- config_name: xml
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 18438080
    num_examples: 7700
  download_size: 7544989
  dataset_size: 18438080
- config_name: yaml
  features:
  - name: instruction
    dtype: string
  - name: diff
    dtype: string
  - name: before
    dtype: string
  - name: after
    dtype: string
  - name: commit
    dtype: string
  splits:
  - name: train
    num_bytes: 163395155
    num_examples: 102934
  download_size: 85594626
  dataset_size: 163395155
configs:
- config_name: batchfile
  data_files:
  - split: train
    path: batchfile/train-*
- config_name: bitbake
  data_files:
  - split: train
    path: bitbake/train-*
- config_name: c
  data_files:
  - split: train
    path: c/train-*
- config_name: clojure
  data_files:
  - split: train
    path: clojure/train-*
- config_name: coffeescript
  data_files:
  - split: train
    path: coffeescript/train-*
- config_name: cpp
  data_files:
  - split: train
    path: cpp/train-*
- config_name: csharp
  data_files:
  - split: train
    path: csharp/train-*
- config_name: css
  data_files:
  - split: train
    path: css/train-*
- config_name: elixir
  data_files:
  - split: train
    path: elixir/train-*
- config_name: emacs-lisp
  data_files:
  - split: train
    path: emacs-lisp/train-*
- config_name: go
  data_files:
  - split: train
    path: go/train-*
- config_name: groovy
  data_files:
  - split: train
    path: groovy/train-*
- config_name: haml
  data_files:
  - split: train
    path: haml/train-*
- config_name: handlebars
  data_files:
  - split: train
    path: handlebars/train-*
- config_name: haskell
  data_files:
  - split: train
    path: haskell/train-*
- config_name: html
  data_files:
  - split: train
    path: html/train-*
- config_name: htmlperb
  data_files:
  - split: train
    path: htmlperb/train-*
- config_name: ini
  data_files:
  - split: train
    path: ini/train-*
- config_name: jade
  data_files:
  - split: train
    path: jade/train-*
- config_name: java
  data_files:
  - split: train
    path: java/train-*
- config_name: javascript
  data_files:
  - split: train
    path: javascript/train-*
- config_name: json
  data_files:
  - split: train
    path: json/train-*
- config_name: jsx
  data_files:
  - split: train
    path: jsx/train-*
- config_name: kotlin
  data_files:
  - split: train
    path: kotlin/train-*
- config_name: less
  data_files:
  - split: train
    path: less/train-*
- config_name: markdown
  data_files:
  - split: train
    path: markdown/train-*
- config_name: nix
  data_files:
  - split: train
    path: nix/train-*
- config_name: perl
  data_files:
  - split: train
    path: perl/train-*
- config_name: php
  data_files:
  - split: train
    path: php/train-*
- config_name: python
  data_files:
  - split: train
    path: python/train-*
- config_name: restructuredtext
  data_files:
  - split: train
    path: restructuredtext/train-*
- config_name: ruby
  data_files:
  - split: train
    path: ruby/train-*
- config_name: rust
  data_files:
  - split: train
    path: rust/train-*
- config_name: scala
  data_files:
  - split: train
    path: scala/train-*
- config_name: scss
  data_files:
  - split: train
    path: scss/train-*
- config_name: shell
  data_files:
  - split: train
    path: shell/train-*
- config_name: slim
  data_files:
  - split: train
    path: slim/train-*
- config_name: sql
  data_files:
  - split: train
    path: sql/train-*
- config_name: swift
  data_files:
  - split: train
    path: swift/train-*
- config_name: text
  data_files:
  - split: train
    path: text/train-*
- config_name: toml
  data_files:
  - split: train
    path: toml/train-*
- config_name: twig
  data_files:
  - split: train
    path: twig/train-*
- config_name: typescript
  data_files:
  - split: train
    path: typescript/train-*
- config_name: unknown
  data_files:
  - split: train
    path: unknown/train-*
- config_name: viml
  data_files:
  - split: train
    path: viml/train-*
- config_name: xml
  data_files:
  - split: train
    path: xml/train-*
- config_name: yaml
  data_files:
  - split: train
    path: yaml/train-*
---

# CodeEditSearchTrain

A code-edit retrieval training set, derived from [`bigcode/commitpackft`](https://huggingface.co/datasets/bigcode/commitpackft)
and decontaminated against the [`cassanof/CodeEditSearch`](https://huggingface.co/datasets/cassanof/CodeEditSearch) eval.

Each example contains an `instruction` (the commit message), a unified `diff`, and the `before`/`after` file contents, plus
the source `commit` SHA.

## How the dataset is built

We start from `bigcode/commitpackft`, a large collection of code-edit commits across many programming languages, and
keep every language with at least 1,000 commits — 47 languages in total. For each commit we keep the message as the
natural-language instruction, render a short unified diff between the file before and after the change, and store the
full file contents on both sides. Commits that don't have both a before and an after file, or that have an empty
message, are discarded.

The harder problem is making sure none of the kept commits leak into the
[`cassanof/CodeEditSearch`](https://huggingface.co/datasets/cassanof/CodeEditSearch) evaluation set. We apply three
filters, each catching something the previous one would miss:

1. **Same commit.** If a commit's SHA already appears in the eval, we drop it, because same git commit means same code change.
2. **Same text after normalization.** Two commits can describe the same change with different SHAs (cherry-picks,
   rebases, mirrored repos). We lowercase, normalize Unicode and collapse whitespace, then hash every text field with
   xxHash-64 and compare against the same hashes computed over the eval. Anything that collides is dropped.
3. **Near-duplicate text.** Even after normalization, paraphrased or partially edited versions slip through. We extract
   every 13-word sequence from each field and compute what fraction of them also appear in the eval (containment).
   If any field crosses 50% overlap, the commit is dropped.

Steps 2 and 3 follow the decontamination methodology described in our
[English models blog post](https://huggingface.co/blog/lightonai/denseon-lateon) ("Decontaminated BEIR" section) and our
[multilingual models blog post](https://huggingface.co/blog/lightonai/mdenseon-mlateon).

The eval only covers 13 languages, but the contamination index pools everything from those 13 into one big set, and we
check every commit in all 47 source languages against it, so a Python snippet that also appears verbatim in a YAML
commit message would still be caught.

**End result:** 678,295 source commits → 599,698 with both file contents → 578,203 after dropping shared SHAs →
573,593 after the exact-text filter → **560,922 kept** after the near-duplicate filter. Per-language numbers are in
the report below.

## Generation code

<details>
<summary>
  Python code to build and decontaminate the dataset
</summary>

```python
"""
Build a code-edit retrieval training set from `bigcode/commitpackft`,
deduped against `cassanof/CodeEditSearch` via (A) commit-SHA exclusion,
(B) normalized xxHash-64, and (C) 13-gram containment.
"""

from __future__ import annotations

import argparse
import difflib
import json
import logging
import os
import re
import sys
import unicodedata
import urllib.request
from pathlib import Path

import xxhash
from datasets import load_dataset, Dataset
from dotenv import load_dotenv
from tqdm import tqdm

logger = logging.getLogger(__name__)


# 13 languages covered by the cassanof/CodeEditSearch eval:
EVAL_LANGUAGES = [
    "c",
    "c++",
    "go",
    "java",
    "javascript",
    "php",
    "python",
    "ruby",
    "rust",
    "scala",
    "shell",
    "swift",
    "typescript",
]

SHUFFLE_SEED = 42
EVAL_DATASET = "cassanof/CodeEditSearch"
SOURCE_DATASET = "bigcode/commitpackft"
SIZE_API = "https://datasets-server.huggingface.co/size?dataset={dataset}"

REPORT_DIR = Path(__file__).resolve().parent / "output"

WHITESPACE_RE = re.compile(r"\s+")


def discover_languages(dataset: str, min_rows: int) -> list[str]:
    """Fetch all configs from HF datasets-server with at least `min_rows` rows."""
    url = SIZE_API.format(dataset=dataset)
    with urllib.request.urlopen(url) as resp:
        data = json.load(resp)
    configs = data["size"]["configs"]
    kept = [c["config"] for c in configs if c["num_rows"] >= min_rows]
    logger.info(
        "discovered %d/%d configs in %s with >= %d rows",
        len(kept), len(configs), dataset, min_rows,
    )
    return sorted(kept)


def collect_eval_shas(languages: list[str]) -> set[str]:
    """Pool every commit SHA appearing in the eval dataset across the given languages."""
    shas: set[str] = set()
    for lang in languages:
        try:
            ds = load_dataset(EVAL_DATASET, lang, split="train")
        except Exception as e:
            logger.warning("could not load eval for lang=%s: %s", lang, e)
            continue
        for row in ds:
            sha = row.get("commit")
            if sha:
                shas.add(sha)
    logger.info("collected %d eval commit SHAs across %d languages", len(shas), len(languages))
    return shas


def has_nonempty_contents(row: dict) -> bool:
    """True if both `old_contents` and `new_contents` are present and non-empty."""
    return bool(row.get("old_contents")) and bool(row.get("new_contents"))


def build_unified_diff(old: str, new: str, old_file: str = "a", new_file: str = "b") -> str:
    """Render a unified diff (3 lines of context) between two file contents."""
    return "".join(difflib.unified_diff(
        old.splitlines(keepends=True),
        new.splitlines(keepends=True),
        fromfile=old_file,
        tofile=new_file,
        n=3,
    ))


def normalize(text: str) -> str:
    """NFKD-fold, lowercase, and collapse whitespace runs to single spaces."""
    text = unicodedata.normalize("NFKD", text).lower()
    return WHITESPACE_RE.sub(" ", text).strip()


def hash64(text: str) -> int:
    """64-bit xxh64 of text bytes."""
    return xxhash.xxh64(text.encode("utf-8", errors="replace")).intdigest()


def word_ngrams(text: str, n: int = 13) -> set[str]:
    """Set of contiguous n-word phrases from whitespace-split text."""
    words = text.split()
    if len(words) < n:
        return set()
    return {" ".join(words[i:i + n]) for i in range(len(words) - n + 1)}


def field_hash(text: str) -> int | None:
    """Normalized hash of one field; None if the field is empty after normalization."""
    norm = normalize(text or "")
    if not norm:
        return None
    return hash64(norm)


def build_eval_overlap_index(languages: list[str], n: int = 13) -> tuple[set[int], set[str]]:
    """Index per-field normalized hashes and pooled per-field n-grams across all eval rows."""
    field_hashes: set[int] = set()
    ngram_set: set[str] = set()
    logger.info("building per-field contamination index over eval rows...")
    total = 0
    for lang in languages:
        try:
            ds = load_dataset(EVAL_DATASET, lang, split="train")
        except Exception:
            raise RuntimeError(f"failed to load eval dataset for lang={lang}; check that EVAL_LANGUAGES is correct and that the dataset is accessible")
        for row in tqdm(ds, desc=f"overlap-index[{lang}]"):
            fields = (
                (row.get("instruction") or "").strip(),
                row.get("diff") or "",
                row.get("before") or "",
                row.get("after") or "",
            )
            if not any(fields):
                continue
            for f in fields:
                h = field_hash(f)
                if h is not None:
                    field_hashes.add(h)
                ngram_set.update(word_ngrams(normalize(f), n=n))
            total += 1
    logger.info(
        "indexed %d eval rows: %d field-hashes, %d %d-grams",
        total, len(field_hashes), len(ngram_set), n,
    )
    return field_hashes, ngram_set


def contamination_reason(
    instruction: str,
    diff: str,
    old_contents: str,
    new_contents: str,
    eval_field_hashes: set[int],
    eval_ngrams: set[str],
    n: int = 13,
    threshold: float = 0.5,
) -> str:
    """Return "hash"/"ngram" if any of the 4 fields matches eval, else "" (clean)."""
    fields = (instruction, diff, old_contents, new_contents)
    for f in fields:
        h = field_hash(f)
        if h is not None and h in eval_field_hashes:
            return "hash"
    for f in fields:
        sample_ngrams = word_ngrams(normalize(f), n=n)
        if not sample_ngrams:
            continue
        if len(sample_ngrams & eval_ngrams) / len(sample_ngrams) >= threshold:
            return "ngram"
    return ""


def build_language(
    lang: str,
    eval_shas: set[str],
    eval_field_hashes: set[int],
    eval_ngrams: set[str],
    output_repo: str,
    max_per_lang: int | None,
    ngram_n: int = 13,
    overlap_threshold: float = 0.5,
) -> dict:
    """Filter one language of the source dataset against the eval, push to the Hub, and return its funnel."""
    logger.info("lang=%s loading source from %s", lang, SOURCE_DATASET)
    ds = load_dataset(
        "json",
        data_files=f"hf://datasets/{SOURCE_DATASET}/data/{lang}/data.jsonl",
        split="train",
    )
    source_rows = len(ds)

    ds = ds.shuffle(seed=SHUFFLE_SEED)
    ds = ds.filter(has_nonempty_contents)
    passed_nonempty = len(ds)
    logger.info(
        "lang=%s %d rows have both old+new contents (from %d)",
        lang, passed_nonempty, source_rows,
    )

    kept_rows: list[dict] = []
    passed_sha = passed_msg = passed_hash = passed_ngram = 0

    for row in tqdm(ds, desc=f"filter[{lang}]"):
        if row.get("commit") in eval_shas:
            continue
        passed_sha += 1

        instruction = (row.get("message") or "").strip()
        if not instruction:
            continue
        passed_msg += 1

        old_contents = row.get("old_contents") or ""
        new_contents = row.get("new_contents") or ""
        diff = build_unified_diff(
            old_contents,
            new_contents,
            old_file=row.get("old_file", "a"),
            new_file=row.get("new_file", "b"),
        )

        reason = contamination_reason(
            instruction, diff, old_contents, new_contents,
            eval_field_hashes, eval_ngrams,
            n=ngram_n, threshold=overlap_threshold,
        )
        if reason == "hash":
            continue
        passed_hash += 1
        if reason == "ngram":
            continue
        passed_ngram += 1

        if max_per_lang and len(kept_rows) >= max_per_lang:
            continue
        kept_rows.append({
            "instruction": instruction,
            "diff": diff,
            "before": old_contents,
            "after": new_contents,
            "commit": row.get("commit"),
        })

    logger.info(
        "lang=%s passed_nonempty=%d passed_sha=%d passed_msg=%d "
        "passed_hash=%d passed_ngram=%d kept=%d",
        lang, passed_nonempty, passed_sha, passed_msg,
        passed_hash, passed_ngram, len(kept_rows),
    )

    config_name = lang.replace("+", "p").replace("#", "sharp")
    logger.info("lang=%s pushing to %s (config=%s)", lang, output_repo, config_name)
    Dataset.from_list(kept_rows).push_to_hub(
        repo_id=output_repo,
        config_name=config_name,
        private=True,
    )

    return {
        "config": config_name,
        "funnel": {
            "source_rows": source_rows,
            "passed_nonempty": passed_nonempty,
            "passed_sha": passed_sha,
            "passed_nonempty_msg": passed_msg,
            "passed_hash": passed_hash,
            "passed_ngram": passed_ngram,
            "kept": len(kept_rows),
        },
    }


def main(argv: list[str] | None = None) -> int:
    """CLI entrypoint: build the decontaminated training set for each language and write the run report."""
    parser = argparse.ArgumentParser(description="Build CodeEditSearch training set.")
    parser.add_argument("--output-repo", default="lightonai/CodeEditSearchTrain",
                        help="HF Hub dataset repo to push to")
    parser.add_argument("--languages", nargs="+", default=None,
                        help="languages to build (default: auto-discover from source via --min-rows)")
    parser.add_argument("--min-rows", type=int, default=1000,
                        help="when auto-discovering, only include configs with >= this many rows (default: 1000)")
    parser.add_argument("--max-per-lang", type=int, default=None,
                        help="cap rows per language (default: no cap)")
    parser.add_argument("--overlap-threshold", type=float, default=0.5,
                        help="13-gram containment threshold (default 0.5)")
    parser.add_argument("--ngram-n", type=int, default=13, help="n-gram size (default 13)")
    args = parser.parse_args(argv)

    logging.basicConfig(
        level=logging.INFO,
        format="%(asctime)s %(levelname)s %(name)s: %(message)s",
        stream=sys.stderr,
    )

    load_dotenv()
    assert os.environ.get("HF_TOKEN"), "HF_TOKEN not set after load_dotenv(); add it to .env"

    if args.languages is None:
        args.languages = discover_languages(SOURCE_DATASET, args.min_rows)
    logger.info("building %d languages: %s", len(args.languages), args.languages)

    # The eval (cassanof/CodeEditSearch) only has the 13 EVAL_LANGUAGES configs,
    # so only query those — intersected with what the user requested.
    eval_overlap_langs = [l for l in args.languages if l in EVAL_LANGUAGES]
    eval_shas = collect_eval_shas(eval_overlap_langs)
    eval_field_hashes, eval_ngrams = build_eval_overlap_index(
        eval_overlap_langs, n=args.ngram_n,
    )

    report = {
        "source_dataset": SOURCE_DATASET,
        "eval_dataset": EVAL_DATASET,
        "shuffle_seed": SHUFFLE_SEED,
        "overlap_threshold": args.overlap_threshold,
        "ngram_n": args.ngram_n,
        "eval_shas_count": len(eval_shas),
        "eval_field_hashes_count": len(eval_field_hashes),
        "eval_ngrams_count": len(eval_ngrams),
        "languages": [],
    }
    for lang in args.languages:
        report["languages"].append(build_language(
            lang=lang,
            eval_shas=eval_shas,
            eval_field_hashes=eval_field_hashes,
            eval_ngrams=eval_ngrams,
            output_repo=args.output_repo,
            max_per_lang=args.max_per_lang,
            ngram_n=args.ngram_n,
            overlap_threshold=args.overlap_threshold,
        ))

    totals: dict[str, int] = {}
    for entry in report["languages"]:
        for k, v in entry["funnel"].items():
            totals[k] = totals.get(k, 0) + v
    report["totals"] = totals

    REPORT_DIR.mkdir(parents=True, exist_ok=True)
    report_path = REPORT_DIR / "report.json"
    report_path.write_text(json.dumps(report, indent=2))
    logger.info("wrote report to %s", report_path)
    logger.info("totals: %s", json.dumps(totals))
    logger.info("pushed to https://huggingface.co/datasets/%s", args.output_repo)
    return 0


if __name__ == "__main__":
    sys.exit(main())
```
</details>

## Filtering report

<details>
<summary>
  Per-language decontamination funnel
</summary>

```json
{
  "source_dataset": "bigcode/commitpackft",
  "eval_dataset": "cassanof/CodeEditSearch",
  "shuffle_seed": 42,
  "overlap_threshold": 0.5,
  "ngram_n": 13,
  "eval_shas_count": 21495,
  "eval_field_hashes_count": 84365,
  "eval_ngrams_count": 2887107,
  "languages": [
    {
      "config": "batchfile",
      "funnel": {
        "source_rows": 1466,
        "passed_nonempty": 1234,
        "passed_sha": 1234,
        "passed_nonempty_msg": 1234,
        "passed_hash": 1234,
        "passed_ngram": 1232,
        "kept": 1232
      }
    },
    {
      "config": "bitbake",
      "funnel": {
        "source_rows": 1308,
        "passed_nonempty": 924,
        "passed_sha": 924,
        "passed_nonempty_msg": 924,
        "passed_hash": 924,
        "passed_ngram": 924,
        "kept": 924
      }
    },
    {
      "config": "c",
      "funnel": {
        "source_rows": 8506,
        "passed_nonempty": 6925,
        "passed_sha": 5335,
        "passed_nonempty_msg": 5335,
        "passed_hash": 5027,
        "passed_ngram": 4415,
        "kept": 4415
      }
    },
    {
      "config": "csharp",
      "funnel": {
        "source_rows": 9346,
        "passed_nonempty": 8472,
        "passed_sha": 8472,
        "passed_nonempty_msg": 8472,
        "passed_hash": 8467,
        "passed_ngram": 8358,
        "kept": 8358
      }
    },
    {
      "config": "cpp",
      "funnel": {
        "source_rows": 4992,
        "passed_nonempty": 3855,
        "passed_sha": 2165,
        "passed_nonempty_msg": 2165,
        "passed_hash": 1967,
        "passed_ngram": 1748,
        "kept": 1748
      }
    },
    {
      "config": "clojure",
      "funnel": {
        "source_rows": 2403,
        "passed_nonempty": 2194,
        "passed_sha": 2194,
        "passed_nonempty_msg": 2194,
        "passed_hash": 2191,
        "passed_ngram": 2191,
        "kept": 2191
      }
    },
    {
      "config": "coffeescript",
      "funnel": {
        "source_rows": 5513,
        "passed_nonempty": 5131,
        "passed_sha": 5131,
        "passed_nonempty_msg": 5131,
        "passed_hash": 5129,
        "passed_ngram": 5116,
        "kept": 5116
      }
    },
    {
      "config": "css",
      "funnel": {
        "source_rows": 5049,
        "passed_nonempty": 4762,
        "passed_sha": 4762,
        "passed_nonempty_msg": 4762,
        "passed_hash": 4762,
        "passed_ngram": 4705,
        "kept": 4705
      }
    },
    {
      "config": "elixir",
      "funnel": {
        "source_rows": 1150,
        "passed_nonempty": 1016,
        "passed_sha": 1016,
        "passed_nonempty_msg": 1016,
        "passed_hash": 1015,
        "passed_ngram": 1015,
        "kept": 1015
      }
    },
    {
      "config": "emacs-lisp",
      "funnel": {
        "source_rows": 1015,
        "passed_nonempty": 950,
        "passed_sha": 950,
        "passed_nonempty_msg": 950,
        "passed_hash": 950,
        "passed_ngram": 950,
        "kept": 950
      }
    },
    {
      "config": "go",
      "funnel": {
        "source_rows": 5004,
        "passed_nonempty": 5001,
        "passed_sha": 3249,
        "passed_nonempty_msg": 3249,
        "passed_hash": 3097,
        "passed_ngram": 2925,
        "kept": 2925
      }
    },
    {
      "config": "groovy",
      "funnel": {
        "source_rows": 1486,
        "passed_nonempty": 1026,
        "passed_sha": 1026,
        "passed_nonempty_msg": 1026,
        "passed_hash": 1026,
        "passed_ngram": 832,
        "kept": 832
      }
    },
    {
      "config": "haml",
      "funnel": {
        "source_rows": 4415,
        "passed_nonempty": 4346,
        "passed_sha": 4346,
        "passed_nonempty_msg": 4346,
        "passed_hash": 4346,
        "passed_ngram": 4344,
        "kept": 4344
      }
    },
    {
      "config": "handlebars",
      "funnel": {
        "source_rows": 1429,
        "passed_nonempty": 1389,
        "passed_sha": 1389,
        "passed_nonempty_msg": 1389,
        "passed_hash": 1389,
        "passed_ngram": 1389,
        "kept": 1389
      }
    },
    {
      "config": "haskell",
      "funnel": {
        "source_rows": 1389,
        "passed_nonempty": 1389,
        "passed_sha": 1389,
        "passed_nonempty_msg": 1389,
        "passed_hash": 1388,
        "passed_ngram": 1385,
        "kept": 1385
      }
    },
    {
      "config": "html",
      "funnel": {
        "source_rows": 20214,
        "passed_nonempty": 18303,
        "passed_sha": 18303,
        "passed_nonempty_msg": 18303,
        "passed_hash": 18287,
        "passed_ngram": 18169,
        "kept": 18169
      }
    },
    {
      "config": "htmlperb",
      "funnel": {
        "source_rows": 10910,
        "passed_nonempty": 10458,
        "passed_sha": 10458,
        "passed_nonempty_msg": 10458,
        "passed_hash": 10456,
        "passed_ngram": 10438,
        "kept": 10438
      }
    },
    {
      "config": "ini",
      "funnel": {
        "source_rows": 11360,
        "passed_nonempty": 10626,
        "passed_sha": 10626,
        "passed_nonempty_msg": 10626,
        "passed_hash": 10553,
        "passed_ngram": 10295,
        "kept": 10295
      }
    },
    {
      "config": "jade",
      "funnel": {
        "source_rows": 1119,
        "passed_nonempty": 1098,
        "passed_sha": 1098,
        "passed_nonempty_msg": 1098,
        "passed_hash": 1097,
        "passed_ngram": 1096,
        "kept": 1096
      }
    },
    {
      "config": "java",
      "funnel": {
        "source_rows": 20635,
        "passed_nonempty": 13579,
        "passed_sha": 11823,
        "passed_nonempty_msg": 11823,
        "passed_hash": 11571,
        "passed_ngram": 9831,
        "kept": 9831
      }
    },
    {
      "config": "javascript",
      "funnel": {
        "source_rows": 52989,
        "passed_nonempty": 52235,
        "passed_sha": 50524,
        "passed_nonempty_msg": 50524,
        "passed_hash": 50124,
        "passed_ngram": 49310,
        "kept": 49310
      }
    },
    {
      "config": "json",
      "funnel": {
        "source_rows": 39777,
        "passed_nonempty": 38065,
        "passed_sha": 38065,
        "passed_nonempty_msg": 38065,
        "passed_hash": 38025,
        "passed_ngram": 38023,
        "kept": 38023
      }
    },
    {
      "config": "jsx",
      "funnel": {
        "source_rows": 2199,
        "passed_nonempty": 2056,
        "passed_sha": 2056,
        "passed_nonempty_msg": 2056,
        "passed_hash": 2056,
        "passed_ngram": 2048,
        "kept": 2048
      }
    },
    {
      "config": "kotlin",
      "funnel": {
        "source_rows": 2214,
        "passed_nonempty": 1838,
        "passed_sha": 1838,
        "passed_nonempty_msg": 1838,
        "passed_hash": 1837,
        "passed_ngram": 1607,
        "kept": 1607
      }
    },
    {
      "config": "less",
      "funnel": {
        "source_rows": 1360,
        "passed_nonempty": 1340,
        "passed_sha": 1340,
        "passed_nonempty_msg": 1340,
        "passed_hash": 1340,
        "passed_ngram": 1335,
        "kept": 1335
      }
    },
    {
      "config": "markdown",
      "funnel": {
        "source_rows": 62518,
        "passed_nonempty": 52850,
        "passed_sha": 52850,
        "passed_nonempty_msg": 52850,
        "passed_hash": 52825,
        "passed_ngram": 52258,
        "kept": 52258
      }
    },
    {
      "config": "nix",
      "funnel": {
        "source_rows": 1593,
        "passed_nonempty": 1551,
        "passed_sha": 1551,
        "passed_nonempty_msg": 1551,
        "passed_hash": 1551,
        "passed_ngram": 1551,
        "kept": 1551
      }
    },
    {
      "config": "perl",
      "funnel": {
        "source_rows": 2288,
        "passed_nonempty": 1453,
        "passed_sha": 1453,
        "passed_nonempty_msg": 1453,
        "passed_hash": 1451,
        "passed_ngram": 1435,
        "kept": 1435
      }
    },
    {
      "config": "php",
      "funnel": {
        "source_rows": 24791,
        "passed_nonempty": 20038,
        "passed_sha": 18293,
        "passed_nonempty_msg": 18293,
        "passed_hash": 17830,
        "passed_ngram": 17184,
        "kept": 17184
      }
    },
    {
      "config": "python",
      "funnel": {
        "source_rows": 56025,
        "passed_nonempty": 42537,
        "passed_sha": 40892,
        "passed_nonempty_msg": 40892,
        "passed_hash": 40393,
        "passed_ngram": 38700,
        "kept": 38700
      }
    },
    {
      "config": "restructuredtext",
      "funnel": {
        "source_rows": 6560,
        "passed_nonempty": 6011,
        "passed_sha": 6011,
        "passed_nonempty_msg": 6011,
        "passed_hash": 6010,
        "passed_ngram": 5978,
        "kept": 5978
      }
    },
    {
      "config": "ruby",
      "funnel": {
        "source_rows": 69413,
        "passed_nonempty": 62121,
        "passed_sha": 60504,
        "passed_nonempty_msg": 60504,
        "passed_hash": 59872,
        "passed_ngram": 58154,
        "kept": 58154
      }
    },
    {
      "config": "rust",
      "funnel": {
        "source_rows": 2996,
        "passed_nonempty": 2341,
        "passed_sha": 646,
        "passed_nonempty_msg": 646,
        "passed_hash": 598,
        "passed_ngram": 533,
        "kept": 533
      }
    },
    {
      "config": "scala",
      "funnel": {
        "source_rows": 5040,
        "passed_nonempty": 4255,
        "passed_sha": 2790,
        "passed_nonempty_msg": 2790,
        "passed_hash": 2287,
        "passed_ngram": 1963,
        "kept": 1963
      }
    },
    {
      "config": "scss",
      "funnel": {
        "source_rows": 6829,
        "passed_nonempty": 6796,
        "passed_sha": 6796,
        "passed_nonempty_msg": 6796,
        "passed_hash": 6796,
        "passed_ngram": 6733,
        "kept": 6733
      }
    },
    {
      "config": "shell",
      "funnel": {
        "source_rows": 31217,
        "passed_nonempty": 26026,
        "passed_sha": 24624,
        "passed_nonempty_msg": 24624,
        "passed_hash": 23969,
        "passed_ngram": 23040,
        "kept": 23040
      }
    },
    {
      "config": "slim",
      "funnel": {
        "source_rows": 1052,
        "passed_nonempty": 1034,
        "passed_sha": 1034,
        "passed_nonempty_msg": 1034,
        "passed_hash": 1033,
        "passed_ngram": 1032,
        "kept": 1032
      }
    },
    {
      "config": "sql",
      "funnel": {
        "source_rows": 2069,
        "passed_nonempty": 1211,
        "passed_sha": 1211,
        "passed_nonempty_msg": 1211,
        "passed_hash": 1206,
        "passed_ngram": 1187,
        "kept": 1187
      }
    },
    {
      "config": "swift",
      "funnel": {
        "source_rows": 4849,
        "passed_nonempty": 3955,
        "passed_sha": 2233,
        "passed_nonempty_msg": 2233,
        "passed_hash": 2079,
        "passed_ngram": 1870,
        "kept": 1870
      }
    },
    {
      "config": "text",
      "funnel": {
        "source_rows": 46588,
        "passed_nonempty": 44799,
        "passed_sha": 44799,
        "passed_nonempty_msg": 44799,
        "passed_hash": 44797,
        "passed_ngram": 44266,
        "kept": 44266
      }
    },
    {
      "config": "toml",
      "funnel": {
        "source_rows": 3424,
        "passed_nonempty": 3380,
        "passed_sha": 3380,
        "passed_nonempty_msg": 3380,
        "passed_hash": 3377,
        "passed_ngram": 3368,
        "kept": 3368
      }
    },
    {
      "config": "twig",
      "funnel": {
        "source_rows": 1610,
        "passed_nonempty": 1479,
        "passed_sha": 1479,
        "passed_nonempty_msg": 1479,
        "passed_hash": 1479,
        "passed_ngram": 1477,
        "kept": 1477
      }
    },
    {
      "config": "typescript",
      "funnel": {
        "source_rows": 5868,
        "passed_nonempty": 5328,
        "passed_sha": 3623,
        "passed_nonempty_msg": 3623,
        "passed_hash": 3488,
        "passed_ngram": 3371,
        "kept": 3371
      }
    },
    {
      "config": "unknown",
      "funnel": {
        "source_rows": 1597,
        "passed_nonempty": 1457,
        "passed_sha": 1457,
        "passed_nonempty_msg": 1457,
        "passed_hash": 1457,
        "passed_ngram": 1445,
        "kept": 1445
      }
    },
    {
      "config": "viml",
      "funnel": {
        "source_rows": 1063,
        "passed_nonempty": 1063,
        "passed_sha": 1063,
        "passed_nonempty_msg": 1063,
        "passed_hash": 1062,
        "passed_ngram": 1062,
        "kept": 1062
      }
    },
    {
      "config": "xml",
      "funnel": {
        "source_rows": 9337,
        "passed_nonempty": 8113,
        "passed_sha": 8113,
        "passed_nonempty_msg": 8113,
        "passed_hash": 8109,
        "passed_ngram": 7700,
        "kept": 7700
      }
    },
    {
      "config": "yaml",
      "funnel": {
        "source_rows": 114320,
        "passed_nonempty": 103688,
        "passed_sha": 103688,
        "passed_nonempty_msg": 103688,
        "passed_hash": 103666,
        "passed_ngram": 102934,
        "kept": 102934
      }
    }
  ],
  "totals": {
    "source_rows": 678295,
    "passed_nonempty": 599698,
    "passed_sha": 578203,
    "passed_nonempty_msg": 578203,
    "passed_hash": 573593,
    "passed_ngram": 560922,
    "kept": 560922
  }
}
```
</details>

## Licensing

This dataset is derived from `bigcode/commitpackft` and we keep all of the original licenses of the source data.

## Citation

If you use this dataset, please consider citing our work

```bibtex
@misc{sourty2026denseonlateonfullyopen,
  title         = {DenseOn with the LateOn: Fully Open Dense and Late-Interaction Models for Multilingual, Long-Context, and Code Search},
  author        = {Raphaël Sourty and Antoine Chaffin and Paulo Roberto Moura Junior and Amélie Chatelain},
  year          = {2026},
  eprint        = {2607.27178},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CL},
  url           = {https://arxiv.org/abs/2607.27178},
}
```