#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #996
Task: Write a Python function that lists all .py files in /Eden/CORE/ sorted by size descending
Generated: 2026-02-12T16:22:21.943030
"""

import os

def list_py_files_by_size():
    directory = "/Eden/CORE/"
    py_files = []
    
    # Check if directory exists
    if not os.path.exists(directory):
        print(f"Directory {directory} does not exist.")
        return
    
    # Walk through the directory and collect .py files
    for root, dirs, files in os.walk(directory):
        for file in files:
            if file.endswith(".py"):
                file_path = os.path.join(root, file)
                file_size = os.path.getsize(file_path)
                py_files.append((file_path, file_size))
    
    # Sort by size descending
    py_files.sort(key=lambda x: x[1], reverse=True)
    
    # Print the result
    for file_path, file_size in py_files:
        print(f"{file_path} - Size: {file_size} bytes")

if __name__ == '__main__':
    list_py_files_by_size()