# ── 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, time as _time
import sys as _sys
_sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
_sys.path.insert(0, os.path.expanduser('~/.nexa/packages'))
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)

def _nexa_invoke_method(obj, method, *args, **kwargs):
    if isinstance(obj, list):
        if method == 'push': return obj.append(*args, **kwargs)
        if method == 'join': return (args[0] if args else '').join(str(x) for x in obj)
        if method == 'map': return list(map(args[0], obj))
        if method == 'filter': return list(filter(args[0], obj))
        if method == 'reduce': return functools.reduce(args[0], obj, *args[1:]) if len(args) > 1 else functools.reduce(args[0], obj)
    if isinstance(obj, dict) and method == 'keys': return list(obj.keys())
    if isinstance(obj, dict) and method == 'values': return list(obj.values())
    return getattr(obj, method)(*args, **kwargs)

def divide(a, b):
    if (b == 0):
        raise Exception('DivisionByZero')
    return (a / b)
try:
    result = divide(10, 0)
    print('Result:', result)
except Exception as e:
    print('Caught an error:', e)
