CodeSearchNet Java: 496,677 functions + docstrings (100.1M tokens)
Browse filesFiles changed (9)
- README.mdAdded+84
- build_csn_java.pyAdded+146
- checksums.jsonAdded+9
- code_search_net_java.build.jsonAdded+19
- code_search_net_java.parquetAdded+3
- code_search_net_java.sample.jsonlAdded+12
- make_sample.pyAdded+87
- manifest.jsonAdded+52
- sample_licenses.jsonAdded+14
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384---license: otherlanguage:- entags:- code- java- code-search-net- function-documentationpretty_name: CodeSearchNet Java (496k functions + docstrings)size_categories:- 100K<n<1Mconfigs:- config_name: default data_files: - split: train path: code_search_net_java.parquet---
# CodeSearchNet Java — functions + docstrings
Private working copy (2026-12-05). Derived from the official[`code-search-net/code_search_net`](https://huggingface.co/datasets/code-search-net/code_search_net)Java configuration.
- **496,677 rows**, 4,769 repositories- **467,785,642 characters**, **100,146,183 tokens** (tiktoken `cl100k_base`)- parquet `255,565,671` bytes (zstd), 17 columns, one row per Java function- splits: train 454,440 · validation 15,328 · test 26,909
The parquet has one physical split (`train`); the original split is kept in the`split` column.
## Schema
```id, repo, path, func_name, url, split, language, docstring, code, text,token_count, doc_chars, code_chars, license_basis, source, added,record_sha256```
`text` = docstring + `\n\n` + code (or code alone when the docstring is empty).`id` is `sha1(repo|path|func_name|sha256(code))[:24]` (unique). `record_sha256`is the canonical SHA-256 of the row and is stored per row, so no giant JSONmanifest is needed.
## Collection
- Downloaded the three official Java parquet shards and concatenated them.- Filters: code ≥ 20 chars, text ≥ 100 chars, exact-code SHA-256 dedup (global). Dropped 11 short rows; 0 exact duplicates.- Re-tokenised with tiktoken `cl100k_base`; no text rewriting beyond stripping.
## Rights
- **Upstream**: CodeSearchNet, Apache-2.0 dataset; the card states that projects without a license, or whose license does not permit redistribution, were filtered out.- **Per-row license is not present upstream.** The parquet therefore carries a dataset-level `license_basis` only. The 12-row `sample` resolves the SPDX id of its 12 repositories via the GitHub licence API: Apache-2.0, EPL-2.0, LGPL-2.1, and `other`.- Every row keeps `repo` and `url`, so a per-repo audit is possible.- **Not release-ready**: per-row licenses for the remaining repositories, and the notice obligations of weak-copyleft repos (EPL/LGPL), are not verified. Treat as `release: None`.
## Files
- `code_search_net_java.parquet` — the data.- `code_search_net_java.sample.jsonl` — 12 deterministic records (`added, author, created, id, license, source, text, token_count`).- `code_search_net_java.build.json` — build counts and filters.- `manifest.json` — dataset SHA-256, schema, counts, per-file checksums.- `checksums.json` — SHA-256 of every file.- `sample_licenses.json`, `build_csn_java.py`, `make_sample.py` — provenance and reproducibility.
## Not checked
- Per-row licences for the other ~4,757 repositories.- EPL/LGPL notice obligations for redistributed functions.- Cross-corpus dedup against other code corpora.- Whether the upstream "permissive" filter is exhaustive.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146#!/usr/bin/env python"""Build a viewer-friendly Java dataset from CodeSearchNet Java.
Input : raw/java/{train,validation,test}-00000-of-00001.parquetOutput: code_search_net_java.parquet + code_search_net_java.build.json
Filters: non-empty code, text >= 100 chars, exact-code dedup (global).Per-row record_sha256 is stored in the parquet (no giant JSON manifest)."""import hashlibimport jsonimport timefrom collections import Counterfrom pathlib import Path
import pyarrow as paimport pyarrow.parquet as pqimport tiktoken
HERE = Path(__file__).resolve().parentRAW = HERE / "raw" / "java"OUT = HERE / "code_search_net_java.parquet"STATS = HERE / "code_search_net_java.build.json"
enc = tiktoken.get_encoding("cl100k_base")
SCHEMA = pa.schema([ ("id", pa.string()), ("repo", pa.string()), ("path", pa.string()), ("func_name", pa.string()), ("url", pa.string()), ("split", pa.string()), ("language", pa.string()), ("docstring", pa.string()), ("code", pa.string()), ("text", pa.string()), ("token_count", pa.int32()), ("doc_chars", pa.int32()), ("code_chars", pa.int32()), ("license_basis", pa.string()), ("source", pa.string()), ("added", pa.string()), ("record_sha256", pa.string()),])
COLS = ["repository_name", "func_path_in_repository", "func_name", "func_code_string", "func_documentation_string", "func_code_url"]LICENSE_BASIS = "CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)"
def canon(row): return json.dumps(row, ensure_ascii=False, sort_keys=True, separators=(",", ":")).encode("utf-8")
def main(): writer = pq.ParquetWriter(OUT, SCHEMA, compression="zstd") seen = set() stats = Counter() repos = set() splits = Counter() chars = tokens = kept = 0 t0 = time.time()
for split in ("train", "validation", "test"): f = RAW / f"{split}-00000-of-00001.parquet" table = pq.read_table(f, columns=COLS) stats["read"] += table.num_rows for batch in table.to_batches(max_chunksize=8192): d = batch.to_pydict() rows, texts = [], [] for i in range(len(d["repository_name"])): code = (d["func_code_string"][i] or "").strip() doc = (d["func_documentation_string"][i] or "").strip() if len(code) < 20: stats["drop_empty"] += 1 continue text = (doc + "\n\n" + code).strip() if doc else code if len(text) < 100: stats["drop_short"] += 1 continue h = hashlib.sha256(code.encode("utf-8")).hexdigest() if h in seen: stats["drop_dup"] += 1 continue seen.add(h) rid = hashlib.sha1( f"{d['repository_name'][i]}|{d['func_path_in_repository'][i]}|{d['func_name'][i]}".encode() ).hexdigest()[:16] rows.append({ "id": rid, "repo": d["repository_name"][i] or "", "path": d["func_path_in_repository"][i] or "", "func_name": d["func_name"][i] or "", "url": d["func_code_url"][i] or "", "split": split, "language": "java", "docstring": doc, "code": code, "text": text, "token_count": 0, "doc_chars": len(doc), "code_chars": len(code), "license_basis": LICENSE_BASIS, "source": "code_search_net", "added": "2026-12-05", "record_sha256": "", }) texts.append(text)
toks = enc.encode_batch(texts) if texts else [] for r, tk in zip(rows, toks): r["token_count"] = len(tk) payload = {k: v for k, v in r.items() if k != "record_sha256"} r["record_sha256"] = hashlib.sha256(canon(payload)).hexdigest() chars += len(r["text"]) tokens += r["token_count"] kept += 1 repos.add(r["repo"]) splits[split] += 1
if rows: writer.write_table(pa.Table.from_pylist(rows, schema=SCHEMA)) print(f"{split}: read={table.num_rows:,} kept={kept:,} " f"elapsed={time.time()-t0:.1f}s", flush=True)
writer.close() summary = dict(stats) summary.update({ "kept": kept, "chars": chars, "tokens": tokens, "repos": len(repos), "splits": dict(splits), "secs": round(time.time() - t0, 1), "tokenizer": "tiktoken:cl100k_base", "output": OUT.name, "bytes": OUT.stat().st_size, }) STATS.write_text(json.dumps(summary, indent=2, ensure_ascii=False), encoding="utf-8") print(json.dumps(summary, indent=2, ensure_ascii=False))
if __name__ == "__main__": main()123456789{
"code_search_net_java.parquet": "6c7ce799749dbd84240a86e9a8fbbbd5c582b820e6430b8f9c95463a955b9171",
"code_search_net_java.sample.jsonl": "b3299d34ae8a05281d144baf74bd67f00635cba9418579cbaeb614a30045df1b",
"code_search_net_java.build.json": "991969184306ba44824761d8b8cb18a3bfeb1a6bb1c96079eb71d68ea4a116fc",
"README.md": "6c0a5d3247a652e98b71a6bbf0df395717fa8cf34398505ae108ca2f3b8c67c4",
"build_csn_java.py": "fdd95cfabb97f226423a6fa2751183c43dd4b963aea90e0f39643e48d0c83c22",
"make_sample.py": "27e09c332ab1d6d6ab369153fe76e96e4b76ec98ac2ee3b3666857feedfcb9b7",
"sample_licenses.json": "aea61ff208e489b8a5ed43a04d88bea3c9eb12fcac77f77bc9d4b1cdaf000c82"
}12345678910111213141516171819{
"read": 496688,
"kept": 496677,
"drop_empty": 0,
"drop_short": 11,
"drop_dup": 0,
"chars": 467785642,
"tokens": 100146183,
"repos": 4769,
"splits": {
"train": 454440,
"validation": 15328,
"test": 26909
},
"unique_ids": 496677,
"tokenizer": "tiktoken:cl100k_base",
"output": "code_search_net_java.parquet",
"bytes": 255565671
}123version https://git-lfs.github.com/spec/v1oid sha256:6c7ce799749dbd84240a86e9a8fbbbd5c582b820e6430b8f9c95463a955b9171size 255565671123456789101112{"added": "2026-12-05", "author": "VoltDB/voltdb", "created": "2019", "id": "2968c0ec38754fc110240a2b", "license": "other", "source": "code_search_net", "text": "Check if the view could apply to the provided table unchanged.\n\npublic boolean compatibleWithTable(VoltTable table) {\n String candidateName = getTableName(table);\n // table can't have the same name as the view\n if (candidateName.equals(viewName)) {\n return false;\n }\n // view is for a different table\n if (candidateName.equals(srcTableName) == false) {\n return false;\n }\n\n try {\n // ignore ret value here - just looking to not throw\n int groupColIndex = table.getColumnIndex(groupColName);\n VoltType groupColType = table.getColumnType(groupColIndex);\n if (groupColType == VoltType.DECIMAL) {\n // no longer a good type to group\n return false;\n }\n\n // check the sum col is still value\n int sumColIndex = table.getColumnIndex(sumColName);\n VoltType sumColType = table.getColumnType(sumColIndex);\n if ((sumColType == VoltType.TINYINT) ||\n (sumColType == VoltType.SMALLINT) ||\n (sumColType == VoltType.INTEGER)) {\n return true;\n }\n else {\n // no longer a good type to sum\n return false;\n }\n }\n catch (IllegalArgumentException e) {\n // column index is bad\n return false;\n }\n }", "token_count": 284}
{"added": "2026-12-05", "author": "OpenLiberty/open-liberty", "created": "2019", "id": "dfbc6617a980457b98b80cb1", "license": "EPL-2.0", "source": "code_search_net", "text": "Utility method that gets the onError setting.\nThis method should be invoked every time it is needed in order to allow for\nchanges to the onError setting.\n\n@return the onError setting if configured. Otherwise the default value.\n\nprivate final OnError ignoreWarnOrFail(TraceComponent tc) {\n String value = null;\n try {\n VariableRegistry variableRegistry = variableRegistrySvcRef.getService();\n String key = \"${\" + OnErrorUtil.CFG_KEY_ON_ERROR + \"}\";\n value = variableRegistry.resolveString(key);\n if (!key.equals(value))\n return OnError.valueOf(value.trim().toUpperCase());\n } catch (Exception x) {\n if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())\n Tr.debug(tc, \"onError: \" + value, x);\n }\n return OnErrorUtil.getDefaultOnError();\n }", "token_count": 169}
{"added": "2026-12-05", "author": "JM-Lab/utils-java8", "created": "2019", "id": "c7003274b6f1da11207a110c", "license": "Apache-2.0", "source": "code_search_net", "text": "Gets cached buffered image of icon in os.\n\n@param path the path\n@return the cached buffered image of icon in os\n\npublic BufferedImage getCachedBufferedImageOfIconInOS(Path path) {\n\t\treturn getSpecialPathAsOpt(path)\n\t\t\t\t.map(getCachedBufferedImageFunction(path))\n\t\t\t\t.orElseGet(() -> buildCachedBufferedImageOfFileIconInOS(path));\n\t}", "token_count": 76}
{"added": "2026-12-05", "author": "JavaMoney/jsr354-ri", "created": "2019", "id": "13d4fa50736430054cadd1a6", "license": "other", "source": "code_search_net", "text": "Returns a new instance of {@link BuildableCurrencyUnit} and publishes it so it is\naccessible from the {@code Monetary} singleton.\n\n@param register if {@code true} the instance created is published so it is accessible from\nthe {@code Monetary} singleton.\n@param locale country Locale for making the currency for the given country.\n@return the new CurrencyUnit instance.\n@see javax.money.Monetary#getCurrency(String, String...)\n@see javax.money.Monetary#getCurrency(java.util.Locale, String...)\n\npublic CurrencyUnit build(boolean register, Locale locale) {\n BuildableCurrencyUnit cu = new BuildableCurrencyUnit(this);\n if (register) {\n ConfigurableCurrencyUnitProvider.registerCurrencyUnit(cu);\n ConfigurableCurrencyUnitProvider.registerCurrencyUnit(cu, locale);\n }\n return cu;\n }", "token_count": 165}
{"added": "2026-12-05", "author": "google/closure-compiler", "created": "2019", "id": "64b815a5b543858cfcd804ca", "license": "Apache-2.0", "source": "code_search_net", "text": "Normalizes the name and resolves it against the module roots.\n\nstatic String normalize(String path, Iterable<String> moduleRootPaths) {\n String normalizedPath = path;\n if (isAmbiguousIdentifier(normalizedPath)) {\n normalizedPath = MODULE_SLASH + normalizedPath;\n }\n\n // Find a moduleRoot that this URI is under. If none, use as is.\n for (String moduleRoot : moduleRootPaths) {\n if (normalizedPath.startsWith(moduleRoot)) {\n // Make sure that e.g. path \"foobar/test.js\" is not matched by module \"foo\", by checking for\n // a leading slash.\n String trailing = normalizedPath.substring(moduleRoot.length());\n if (trailing.startsWith(MODULE_SLASH)) {\n return trailing.substring(MODULE_SLASH.length());\n }\n }\n }\n // Not underneath any of the roots.\n return path;\n }", "token_count": 185}
{"added": "2026-12-05", "author": "aws/aws-sdk-java", "created": "2019", "id": "e5abab072364fa23f266358b", "license": "Apache-2.0", "source": "code_search_net", "text": "Asserts that the string represents a valid reference path expression.\n\n@param path Path expression to validate.\n@param propertyName Name of property.\n\npublic void assertIsValidReferencePath(String path, String propertyName) {\n if (path == null) {\n return;\n }\n if (path.isEmpty()) {\n problemReporter.report(new Problem(this, String.format(\"%s cannot be empty\", propertyName)));\n return;\n }\n }", "token_count": 84}
{"added": "2026-12-05", "author": "liferay/com-liferay-commerce", "created": "2019", "id": "ba48d8bcecda07479f1fef86", "license": "LGPL-2.1", "source": "code_search_net", "text": "Returns an ordered range of all the commerce tier price entries where commercePriceEntryId = ?.\n\n<p>\nUseful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CommerceTierPriceEntryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.\n</p>\n\n@param commercePriceEntryId the commerce price entry ID\n@param start the lower bound of the range of commerce tier price entries\n@param end the upper bound of the range of commerce tier price entries (not inclusive)\n@param orderByComparator the comparator to order the results by (optionally <code>null</code>)\n@return the ordered range of matching commerce tier price entries\n\n@Override\n\tpublic List<CommerceTierPriceEntry> findByCommercePriceEntryId(\n\t\tlong commercePriceEntryId, int start, int end,\n\t\tOrderByComparator<CommerceTierPriceEntry> orderByComparator) {\n\t\treturn findByCommercePriceEntryId(commercePriceEntryId, start, end,\n\t\t\torderByComparator, true);\n\t}", "token_count": 397}
{"added": "2026-12-05", "author": "katjahahn/PortEx", "created": "2019", "id": "686098dea962b619ff7cb7d0", "license": "Apache-2.0", "source": "code_search_net", "text": "Returns a description string of all pe headers (that is msdos header,\ncoff file header, optional header and section table).\n\n@return description string of all pe headers\n\npublic String getInfo() {\n ReportCreator reporter = new ReportCreator(this);\n return reporter.msdosHeaderReport() + reporter.coffHeaderReport() +\n reporter.optHeaderReport() + reporter.secTableReport();\n }", "token_count": 80}
{"added": "2026-12-05", "author": "bazaarvoice/emodb", "created": "2019", "id": "c62b0a761cf7d57b70fc2a35", "license": "Apache-2.0", "source": "code_search_net", "text": "Parse the persistent JSON object into an AstyanaxTable.\nIf the master placement doesn't belong to this datacenter, this method will:\na. try to find a facade for this table that belongs to this datacenter\nb. If no facade is found, it will return the table in the master placement.\n\n@VisibleForTesting\n Table tableFromJson(TableJson json) {\n if (json.isDropped()) {\n return null;\n }\n String name = json.getTable();\n Map<String, Object> attributes = json.getAttributeMap();\n Storage masterStorage = json.getMasterStorage();\n String masterPlacement = masterStorage.getPlacement();\n Collection<Storage> facades = json.getFacades();\n\n TableOptions options = new TableOptionsBuilder()\n .setPlacement(masterPlacement)\n .setFacades(ImmutableList.copyOf(Iterables.transform(facades, new Function<Storage, FacadeOptions>() {\n @Override\n public FacadeOptions apply(Storage facade) {\n return new FacadeOptions(facade.getPlacement());\n }\n })))\n .build();\n\n Storage storageForDc = masterStorage;\n boolean available = true;\n if (!_placementFactory.isAvailablePlacement(masterPlacement)) {\n available = false;\n // The master placement does not belong to this datacenter. Let's see if we have a\n // facade that belongs to this datacenter. If not, we'll stick with the masterStorage.\n for (Storage facade : facades) {\n if (_placementFactory.isAvailablePlacement(facade.getPlacement())) {\n if (storageForDc.isFacade()) {\n // We found multiple facades for the same datacenter.\n throw new TableExistsException(format(\"Multiple facades found for table %s in %s\", name, _selfDataCenter), name);\n }\n storageForDc = facade;\n available = true;\n }\n }\n }\n\n return newTable(name, options, attributes, available, storageForDc);\n }", "token_count": 419}
{"added": "2026-12-05", "author": "mapcode-foundation/mapcode-java", "created": "2019", "id": "8b78dbf9f632223147fecb64", "license": "Apache-2.0", "source": "code_search_net", "text": "Return the full international mapcode, including the full name of the territory and the mapcode code itself.\nThe format of the string is:\nfull-territory-name cde\n\nExample:\nNetherlands 49.4V (regular code)\nNetherlands 49.4V-K2 (high precision code)\n\n@param precision Precision specifier. Range: [0, 8].\n@param alphabet Alphabet.\n@return Full international mapcode.\n@throws IllegalArgumentException Thrown if precision is out of range (must be in [0, 8]).\n\n@Nonnull\n public String getCodeWithTerritoryFullname(final int precision, @Nullable final Alphabet alphabet) throws IllegalArgumentException {\n return territory.getFullName() + ' ' + getCode(precision, alphabet);\n }", "token_count": 154}
{"added": "2026-12-05", "author": "linkedin/linkedin-utils", "created": "2019", "id": "71e2c04192cfc8dd924b1905", "license": "Apache-2.0", "source": "code_search_net", "text": "Creates the proxy to check for shutdown.\n\n@param o\n@param interfaces restriction on which interface to apply the proxy on\n@param shutdown\n@return the proxy\n\npublic static Object createShutdownProxy(Object o,\n Class[] interfaces,\n Shutdown shutdown)\n {\n if(interfaces == null)\n interfaces = ReflectUtils.extractAllInterfaces(o);\n\n return Proxy.newProxyInstance(o.getClass().getClassLoader(),\n interfaces,\n new ShutdownProxy(o, shutdown));\n\n }", "token_count": 92}
{"added": "2026-12-05", "author": "Unidata/thredds", "created": "2019", "id": "f3ac9a61a6befa2fd32bf006", "license": "other", "source": "code_search_net", "text": "Create a latlon rectangle and split it into the equivalent\nProjectionRect using this LatLonProjection. The latlon rect is\nconstructed from 2 lat/lon points. The lon values are considered\ncoords in the latlonProjection, and so do not have to be +/- 180.\n\n@param lat0 lat of point 1\n@param lon0 lon of point 1\n@param lat1 lat of point 1\n@param lon1 lon of point 1\n@return 1 or 2 ProjectionRect. If it doesnt cross the seam,\nthe second rectangle is null.\n\npublic ProjectionRect[] latLonToProjRect(double lat0, double lon0, double lat1, double lon1) {\r\n\r\n double height = Math.abs(lat1 - lat0);\r\n lat0 = Math.min(lat1, lat0);\r\n double width = lon1 - lon0;\r\n if (width < 1.0e-8) {\r\n width = 360.0; // assume its the whole thing\r\n }\r\n lon0 = LatLonPointImpl.lonNormal(lon0, centerLon);\r\n lon1 = LatLonPointImpl.lonNormal(lon1, centerLon);\r\n\r\n ProjectionRect[] rects = new ProjectionRect[] {new ProjectionRect(), new ProjectionRect()};\r\n if (width >= 360.0) {\r\n rects[0].setRect(centerLon - 180.0, lat0, 360.0, height);\r\n rects[1] = null;\r\n } else if (lon0 < lon1) {\r\n rects[0].setRect(lon0, lat0, width, height);\r\n rects[1] = null;\r\n } else {\r\n double y = centerLon + 180 - lon0;\r\n rects[0].setRect(lon0, lat0, y, height);\r\n rects[1].setRect(lon1 - width + y, lat0, width - y, height);\r\n }\r\n return rects;\r\n }", "token_count": 407}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687#!/usr/bin/env python"""12-record deterministic sample in the DynaWord sample schema.
Picks one row from 12 seeded distinct row groups, forcing 12 distinct repos,then resolves each repo's SPDX id via the GitHub licence API (unauthenticated,12 calls). Falls back to "other" when unknown/rate-limited."""import jsonimport randomfrom pathlib import Path
import pyarrow.parquet as pqimport requests
HERE = Path(__file__).resolve().parentPARQUET = HERE / "code_search_net_java.parquet"OUT = HERE / "code_search_net_java.sample.jsonl"CACHE = HERE / "sample_licenses.json"
ADDED = "2026-12-05"CREATED = "2019"SOURCE = "code_search_net"
def gh_license(repo): try: r = requests.get( f"https://api.github.com/repos/{repo}/license", headers={"Accept": "application/vnd.github+json"}, timeout=20, ) if r.status_code == 200: spdx = (r.json().get("license") or {}).get("spdx_id") if spdx and spdx != "NOASSERTION": return spdx except Exception: pass return "other"
def main(): pf = pq.ParquetFile(PARQUET) groups = list(range(pf.num_row_groups)) rng = random.Random(0) rng.shuffle(groups)
picked, seen = [], set() for g in groups: if len(picked) >= 12: break table = pf.read_row_group( g, columns=["id", "repo", "text", "token_count"]) for r in table.to_pylist(): if r["repo"] not in seen: seen.add(r["repo"]) picked.append(r) break
licences = {} for r in picked: licences[r["repo"]] = gh_license(r["repo"])
with OUT.open("w", encoding="utf-8") as f: for r in picked[:12]: rec = { "added": ADDED, "author": r["repo"], "created": CREATED, "id": r["id"], "license": licences[r["repo"]], "source": SOURCE, "text": r["text"], "token_count": r["token_count"], } f.write(json.dumps(rec, ensure_ascii=False) + "\n")
CACHE.write_text(json.dumps(licences, indent=2, ensure_ascii=False), encoding="utf-8") print("records:", len(picked[:12])) print("repos:", [r["repo"] for r in picked[:12]]) print("licences:", licences) print("tokens:", sum(r["token_count"] for r in picked[:12])) print("size:", OUT.stat().st_size)
if __name__ == "__main__": main()12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152{
"dataset": "code_search_net_java",
"schema_version": "1.0",
"generated_at": "2026-12-05T05:52:33+00:00",
"source": {
"dataset": "code-search-net/code_search_net",
"config": "java",
"url": "https://huggingface.co/datasets/code-search-net/code_search_net",
"license": "other",
"license_note": "permissive-repo filter; per-row license absent upstream"
},
"dataset_file": "code_search_net_java.parquet",
"dataset_sha256": "6c7ce799749dbd84240a86e9a8fbbbd5c582b820e6430b8f9c95463a955b9171",
"dataset_bytes": 255565671,
"rows": 496677,
"columns": [
"id",
"repo",
"path",
"func_name",
"url",
"split",
"language",
"docstring",
"code",
"text",
"token_count",
"doc_chars",
"code_chars",
"license_basis",
"source",
"added",
"record_sha256"
],
"splits": {
"train": 454440,
"validation": 15328,
"test": 26909
},
"filters": {
"drop_empty": 0,
"drop_short": 11,
"drop_dup": 0
},
"tokens": 100146183,
"chars": 467785642,
"repos": 4769,
"tokenizer": "tiktoken:cl100k_base",
"per_row_hashes": "record_sha256 column",
"checksums_file": "checksums.json",
"checksums_sha256": "23e3b407dca7423266056798c8874bf4f281fe994cc36a4bd05e6b03c2362830"
}1234567891011121314{
"VoltDB/voltdb": "other",
"OpenLiberty/open-liberty": "EPL-2.0",
"JM-Lab/utils-java8": "Apache-2.0",
"JavaMoney/jsr354-ri": "other",
"google/closure-compiler": "Apache-2.0",
"aws/aws-sdk-java": "Apache-2.0",
"liferay/com-liferay-commerce": "LGPL-2.1",
"katjahahn/PortEx": "Apache-2.0",
"bazaarvoice/emodb": "Apache-2.0",
"mapcode-foundation/mapcode-java": "Apache-2.0",
"linkedin/linkedin-utils": "Apache-2.0",
"Unidata/thredds": "other"
}README.mdAdded+84
build_csn_java.pyAdded+146
checksums.jsonAdded+9
code_search_net_java.build.jsonAdded+19
code_search_net_java.parquetAdded+3
code_search_net_java.sample.jsonlAdded+12
make_sample.pyAdded+87
manifest.jsonAdded+52
sample_licenses.jsonAdded+14