| 23 | |
| 24 | # Find all datasets that have a schema.cypher and copy.cypher file. |
| 25 | def find_valid_dataset_dirs(dataset_root): |
| 26 | valid_dirs = [] |
| 27 | |
| 28 | for root, dirs, files in os.walk(dataset_root): |
| 29 | # This script creates a tmp directory with the exported dbs, we should |
| 30 | # skip it in our search. |
| 31 | if "tmp" in root.split(os.sep): |
| 32 | continue |
| 33 | file_set = set(files) |
| 34 | |
| 35 | if "schema.cypher" in file_set: |
| 36 | valid_dirs.append(root) |
| 37 | |
| 38 | return valid_dirs |
| 39 | |
| 40 | |
| 41 | # Example scripts/export-dbs.py build/debug/tools/shell/lbug dataset. |