Upload inspect_repo.py
Browse files- inspect_repo.py +29 -0
inspect_repo.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import urllib.request, json, textwrap
|
| 2 |
+
|
| 3 |
+
def fetch_raw(owner, repo, path):
|
| 4 |
+
url = f'https://raw.githubusercontent.com/{owner}/{repo}/main/{path}'
|
| 5 |
+
try:
|
| 6 |
+
with urllib.request.urlopen(url) as resp:
|
| 7 |
+
return resp.read().decode('utf-8')
|
| 8 |
+
except Exception as e:
|
| 9 |
+
return f'ERROR: {e}'
|
| 10 |
+
|
| 11 |
+
def show(owner, repo, path, limit=300):
|
| 12 |
+
content = fetch_raw(owner, repo, path)
|
| 13 |
+
print(f'\n{"="*70}')
|
| 14 |
+
print(f'{owner}/{repo}/{path}')
|
| 15 |
+
print('='*70)
|
| 16 |
+
lines = content.split('\n')
|
| 17 |
+
if len(lines) > limit:
|
| 18 |
+
print('\n'.join(lines[:limit]))
|
| 19 |
+
print(f'\n... [{len(lines) - limit} more lines] ...')
|
| 20 |
+
else:
|
| 21 |
+
print(content)
|
| 22 |
+
|
| 23 |
+
# Little Fig key files
|
| 24 |
+
show('ticketguy', 'littlefig', 'benchmark/benchmark_gpu.py', 400)
|
| 25 |
+
show('ticketguy', 'littlefig', 'cogmembench/runner.py', 300)
|
| 26 |
+
show('ticketguy', 'littlefig', 'cogmembench/scorer.py', 300)
|
| 27 |
+
show('ticketguy', 'littlefig', 'src/little_fig/engine/memory_fabric.py', 300)
|
| 28 |
+
show('ticketguy', 'littlefig', 'src/little_fig/engine/model.py', 300)
|
| 29 |
+
show('ticketguy', 'littlefig', 'pyproject.toml', 100)
|