Datasets:

Modalities:
Text
Formats:
json
Languages:
English
Libraries:
Datasets
pandas
License:
michaelmior commited on
Commit
fc9d99a
·
verified ·
1 Parent(s): 9cbc94c

Exclude some additional schemas

Browse files
data/test.jsonl.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f2e81c3efee377cc879ea4c839e18e856ce36df1ea9638aad4ae2907438ee44a
3
- size 3540592
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e29f0f20dba83e0a15297f0411ec1d8644b174bb48fcdea0ce1d83d0abb92c40
3
+ size 1118078
data/train.jsonl.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6bbdc698f998f9665f296041dcab6fa5d44177a0fb532d8be3193d849a97a2f6
3
- size 10943729
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07aa22ac52077d44ab69d39efc391414707f21bb3ea49ded7a0bd477efebd9f0
3
+ size 14192760
data/validation.jsonl.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f423bd6a83aecc03e4ff761dbf1f14a4cd2c020c5a9cc53e90f9950f865f4b31
3
- size 2745523
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:80a44f0d51e8215789f6288f56e9a6da45d57e794f772084797a28e6445ce90c
3
+ size 1807245
train_split.py CHANGED
@@ -22,9 +22,7 @@ def files_list(licenses):
22
  files = [
23
  f
24
  for f in data_path.rglob("*.json")
25
- if f.is_file()
26
- and "node_modules" not in f.parts
27
- and licenses["/".join(f.parts[1:3])] in PERMISSIVE_LICENSES
28
  ]
29
  return files
30
 
@@ -164,7 +162,7 @@ def main(similarity, split, seed, commits_file, licenses_file, languages_file):
164
  if __name__ == "__main__":
165
  parser = argparse.ArgumentParser()
166
  parser.add_argument("--similarity", default=None, type=float)
167
- parser.add_argument("--seed", default=282, type=int)
168
  parser.add_argument("--split", default=0.8, type=float)
169
  parser.add_argument("--commits_file", default="commits.json")
170
  parser.add_argument("--licenses_file", default="licenses.json")
 
22
  files = [
23
  f
24
  for f in data_path.rglob("*.json")
25
+ if f.is_file() and licenses["/".join(f.parts[1:3])] in PERMISSIVE_LICENSES
 
 
26
  ]
27
  return files
28
 
 
162
  if __name__ == "__main__":
163
  parser = argparse.ArgumentParser()
164
  parser.add_argument("--similarity", default=None, type=float)
165
+ parser.add_argument("--seed", default=38, type=int)
166
  parser.add_argument("--split", default=0.8, type=float)
167
  parser.add_argument("--commits_file", default="commits.json")
168
  parser.add_argument("--licenses_file", default="licenses.json")
validate_schemas.py CHANGED
@@ -8,6 +8,16 @@ import jsonschema
8
  from tqdm.contrib.concurrent import process_map
9
 
10
 
 
 
 
 
 
 
 
 
 
 
11
  def process_file(schema_file):
12
  # Calculate the path of the new file
13
  new_schema_file = Path("valid_data", *schema_file.parts[1:])
@@ -16,11 +26,20 @@ def process_file(schema_file):
16
  if not schema_file.is_file() and not new_schema_file.is_file():
17
  return
18
 
 
 
 
 
 
19
  try:
20
  schema = json5.load(open(schema_file))
21
  except ValueError:
22
  return
23
 
 
 
 
 
24
  vcls = jsonschema.validators.validator_for(schema)
25
  try:
26
  vcls.check_schema(schema)
 
8
  from tqdm.contrib.concurrent import process_map
9
 
10
 
11
+ IGNORE_PATHS = [
12
+ "node_modules",
13
+ "site-packages",
14
+ "draft2019-09",
15
+ "draft2020-12",
16
+ "draft-next",
17
+ "vendor",
18
+ ]
19
+
20
+
21
  def process_file(schema_file):
22
  # Calculate the path of the new file
23
  new_schema_file = Path("valid_data", *schema_file.parts[1:])
 
26
  if not schema_file.is_file() and not new_schema_file.is_file():
27
  return
28
 
29
+ # Skip files in ignored directories
30
+ for path in IGNORE_PATHS:
31
+ if path in schema_file.parts or path in new_schema_file.parts:
32
+ return
33
+
34
  try:
35
  schema = json5.load(open(schema_file))
36
  except ValueError:
37
  return
38
 
39
+ # Skip meta schemas
40
+ if schema.get("$id").startswith("https://json-schema.org/"):
41
+ continue
42
+
43
  vcls = jsonschema.validators.validator_for(schema)
44
  try:
45
  vcls.check_schema(schema)