# ── Generated by Nexa Transpiler ──────────────────────────────
# This file was auto-generated from a .nexa source file.
# Do not edit directly — regenerate with: nexa compile <file>
# ─────────────────────────────────────────────────────────────
from __future__ import annotations
import asyncio, math, json, os, random, functools, sys, time as _time
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from nexa_lang.builtins import BUILTINS

# ── Nexa runtime stubs ───────────────────────────────────────
_nexa_modules = {}
def _nexa_opt_access(obj, attr):
    if obj is None: return None
    if isinstance(obj, dict): return obj.get(attr)
    return getattr(obj, attr, None)

print('=== Nexa v10 Showcase ===')
print('\n--- 1. Destructured Imports ---')
from test_module import secret_value, public_value
print('Imported secret_value:', secret_value)
print('Imported public_value:', public_value)
assert secret_value == 42
print('\n--- 2. Default super() for OOP ---')
class Animal:
    def speak(self):
        return 'I am an animal'
class Dog(Animal):
    def speak(self):
        base_speak = super().speak()
        return (base_speak + ', but specifically a Dog! Woof!')
d = Dog()
s = d.speak()
print(s)
assert s == 'I am an animal, but specifically a Dog! Woof!'
print('\n--- 3. File System Module (fs) ---')
fs = BUILTINS['fs']
test_file = 'test_fs_v10.txt'
fs.write_text(test_file, 'Hello from Nexa v10 FS!')
content = fs.read_text(test_file)
print('Read content:', content)
assert content == 'Hello from Nexa v10 FS!'
exists = fs.exists(test_file)
print('File exists:', exists)
assert exists == True
files = fs.list_dir('.')
print('Directory listing check success.')
fs.delete(test_file)
print('\n--- 4. HTTP Module Extensions ---')
http = BUILTINS['http']
print('Testing HTTP GET...')
respGet = http.get('https://httpbin.org/get')
print('GET status:', respGet['status'])
print('Testing HTTP POST...')
respPost = http.post('https://httpbin.org/post', {'name': 'Nexa v10'})
print('POST status:', respPost['status'])
print('Testing HTTP PUT...')
respPut = http.put('https://httpbin.org/put', {'name': 'Nexa v10 updated'})
print('PUT status:', respPut['status'])
assert respPut['status'] == 200
print('Testing HTTP DELETE...')
respDel = http.delete('https://httpbin.org/delete')
print('DELETE status:', respDel['status'])
assert respDel['status'] == 200
print('\n✅ All Nexa v10 features successfully verified!')
