spark: add python file counter script and verification results

This commit is contained in:
spark committed 2026-10-31 09:02:08 +00:00
1 parent 83fd2284de
commit 7b4205014c
2 files changed
+45

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env python3
"""Count Python files in /root using find command for authoritative count."""
import subprocess
import json
# Use find command directly
result = subprocess.run(['find', '/root', '-name', '*.py'], capture_output=True, text=True)
find_files = result.stdout.strip().split('\n')
find_count = len(find_files)
sample_files = find_files[:10]
print(f"Python files found by 'find /root -name *.py': {find_count}")
print(f"Sample files (first 5):")
for f in sample_files[:5]:
print(f" {f}")
# Save the result
output = {
'count': find_count,
'sample_files': sample_files,
'method': 'find /root -name "*.py"'
}
result_path = '/root/.hermes/wizard-outputs/spark/python_count_result.json'
with open(result_path, 'w') as f:
json.dump(output, f, indent=2)
print(f"\nResult saved to: {result_path}")
print(f"Total count verified: {find_count}")
@@ -0,0 +1,16 @@
{
"count": 127055,
"sample_files": [
"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/encoding_rs-0.8.22/generate-encoding-data.py",
"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/unicode-normalization-0.1.12/scripts/unicode.py",
"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/idna-0.2.0/src/make_uts46_mapping_table.py",
"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/unicode-segmentation-1.6.0/scripts/unicode.py",
"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/unicode-segmentation-1.6.0/scripts/unicode_gen_breaktests.py",
"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jemalloc-sys-0.3.2/jemalloc/scripts/gen_run_tests.py",
"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jemalloc-sys-0.3.2/jemalloc/scripts/gen_travis.py",
"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jemalloc-sys-0.3.2/rep/scripts/gen_run_tests.py",
"/root/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jemalloc-sys-0.3.2/rep/scripts/gen_travis.py",
"/root/.cargo/registry/src/github.com-1ecc6299db9ec823/encoding_rs-0.8.22/generate-encoding-data.py"
],
"method": "find /root -name \"*.py\""
}