diff --git a/Makefile b/Makefile index 76bd9387..0bcc4591 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ upload_pypi: # helper command for the maintainer to refresh the docs files refresh_transcrypt_docs: - cd docs/examples/transcrypt; for x in `ls -d */`; do SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/examples/transcrypt" pyp5js compile $$x --refresh; done; + cd docs/examples/transcrypt; for x in `ls -d */`; do SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/examples/transcrypt/" pyp5js compile $$x --refresh --template "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/index.html.template"; done; refresh_pyodide_docs: - cd docs/examples/pyodide; for x in `ls -d */`; do SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/examples/pyodide" pyp5js compile $$x --refresh; done; + cd docs/examples/pyodide; for x in `ls -d */`; do SKETCHBOOK_DIR="/home/bernardo/envs/pyp5js/docs/examples/pyodide" pyp5js compile $$x --refresh --template "/home/bernardo/envs/pyp5js/docs/examples/pyodide/index.html.template"; done; diff --git a/docs/examples/transcrypt/sketch_001/index.html b/docs/examples/transcrypt/sketch_001/index.html index e50d79d9..82415809 100644 --- a/docs/examples/transcrypt/sketch_001/index.html +++ b/docs/examples/transcrypt/sketch_001/index.html @@ -49,9 +49,6 @@ # https://p5js.org/examples/interaction-wavemaker.html - -from pyp5js import * - t = 0 def setup(): diff --git a/docs/examples/transcrypt/sketch_001/sketch_001.py b/docs/examples/transcrypt/sketch_001/sketch_001.py index 358ce99e..1bd2af2a 100644 --- a/docs/examples/transcrypt/sketch_001/sketch_001.py +++ b/docs/examples/transcrypt/sketch_001/sketch_001.py @@ -1,8 +1,5 @@ # https://p5js.org/examples/interaction-wavemaker.html - -from pyp5js import * - t = 0 def setup(): diff --git a/docs/examples/transcrypt/sketch_001/target/org.transcrypt.__runtime__.js b/docs/examples/transcrypt/sketch_001/target/org.transcrypt.__runtime__.js index 08ab5a87..c53ac13e 100644 --- a/docs/examples/transcrypt/sketch_001/target/org.transcrypt.__runtime__.js +++ b/docs/examples/transcrypt/sketch_001/target/org.transcrypt.__runtime__.js @@ -1,10 +1,10 @@ -// Transcrypt'ed from Python, 2021-09-20 17:40:30 +// Transcrypt'ed from Python, 2021-10-14 12:26:15 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; -__envir__.transpiler_version = '3.7.16'; +__envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; @@ -38,15 +38,14 @@ export function __init__ (module) { } return module.__all__; }; -export var __proxy__ = false; -export function __get__ (self, func, quotedFuncName) { - if (self) { - if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) { +export function __get__ (aThis, func, quotedFuncName) { + if (aThis) { + if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { - Object.defineProperty (self, quotedFuncName, { + Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); - return func.apply (null, [self] .concat (args)); + return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, @@ -55,7 +54,7 @@ export function __get__ (self, func, quotedFuncName) { } return function () { var args = [] .slice.apply (arguments); - return func.apply (null, [self] .concat (args)); + return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { @@ -66,21 +65,21 @@ export function __get__ (self, func, quotedFuncName) { return func; } }; -export function __getcm__ (self, func, quotedFuncName) { - if (self.hasOwnProperty ('__class__')) { +export function __getcm__ (aThis, func, quotedFuncName) { + if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); - return func.apply (null, [self.__class__] .concat (args)); + return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); - return func.apply (null, [self] .concat (args)); + return func.apply (null, [aThis] .concat (args)); }; } }; -export function __getsm__ (self, func, quotedFuncName) { +export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { @@ -95,6 +94,9 @@ export var py_metatype = { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); + if (descrip == null) { + continue; + } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { @@ -125,7 +127,7 @@ export var object = { __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { - instance = new Proxy (instance, { + instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { @@ -145,6 +147,7 @@ export var object = { return true; } }) + instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; @@ -1830,10 +1833,13 @@ export var Exception = __class__ ('Exception', [BaseException], { var args = tuple (); } self.__args__ = args; - try { + if (kwargs.error != null) { self.stack = kwargs.error.stack; } - catch (__except0__) { + else if (Error) { + self.stack = new Error ().stack; + } + else { self.stack = 'No stack trace available'; } });}, diff --git a/docs/examples/transcrypt/sketch_001/target/org.transcrypt.__runtime__.py b/docs/examples/transcrypt/sketch_001/target/org.transcrypt.__runtime__.py index 87834491..8b06f7ba 100644 --- a/docs/examples/transcrypt/sketch_001/target/org.transcrypt.__runtime__.py +++ b/docs/examples/transcrypt/sketch_001/target/org.transcrypt.__runtime__.py @@ -19,9 +19,11 @@ class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args - try: + if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object - except: + elif Error: + self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one + else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') diff --git a/docs/examples/transcrypt/sketch_001/target/pyp5js.js b/docs/examples/transcrypt/sketch_001/target/pyp5js.js index b21444ee..a43f6c85 100644 --- a/docs/examples/transcrypt/sketch_001/target/pyp5js.js +++ b/docs/examples/transcrypt/sketch_001/target/pyp5js.js @@ -1,5 +1,5 @@ -// Transcrypt'ed from Python, 2021-09-20 17:40:30 -import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; +// Transcrypt'ed from Python, 2021-10-14 12:26:15 +import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; diff --git a/docs/examples/transcrypt/sketch_001/target/python_functions.js b/docs/examples/transcrypt/sketch_001/target/python_functions.js index 037d1e86..afb92d4e 100644 --- a/docs/examples/transcrypt/sketch_001/target/python_functions.js +++ b/docs/examples/transcrypt/sketch_001/target/python_functions.js @@ -1,5 +1,5 @@ -// Transcrypt'ed from Python, 2021-09-20 17:40:31 -import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; +// Transcrypt'ed from Python, 2021-10-14 12:26:16 +import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, diff --git a/docs/examples/transcrypt/sketch_001/target/sketch_001.js b/docs/examples/transcrypt/sketch_001/target/sketch_001.js deleted file mode 100644 index c8c9ab1a..00000000 --- a/docs/examples/transcrypt/sketch_001/target/sketch_001.js +++ /dev/null @@ -1,47 +0,0 @@ -// Transcrypt'ed from Python, 2021-09-20 17:40:31 -import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; -import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; -var __name__ = 'sketch_001'; -export var t = 0; -export var setup = function () { - if (arguments.length) { - var __ilastarg0__ = arguments.length - 1; - if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { - var __allkwargs0__ = arguments [__ilastarg0__--]; - for (var __attrib0__ in __allkwargs0__) { - } - } - } - else { - } - createCanvas (600, 600); - stroke (250); - strokeWeight (3); - fill (40, 200, 40); -}; -export var draw = function () { - if (arguments.length) { - var __ilastarg0__ = arguments.length - 1; - if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { - var __allkwargs0__ = arguments [__ilastarg0__--]; - for (var __attrib0__ in __allkwargs0__) { - } - } - } - else { - } - background (10, 10); - var xAngle = map (mouseX, 0, width, -(4) * PI, 4 * PI, true); - var yAngle = map (mouseY, 0, height, -(4) * PI, 4 * PI, true); - for (var x of range (0, width, 30)) { - for (var y of range (0, height, 30)) { - var angle = xAngle * (x / width) + yAngle * (y / height); - var myX = x + 20 * cos ((2 * PI) * t + angle); - var myY = y + 20 * sin ((2 * TWO_PI) * t + angle); - ellipse (myX, myY, 10); - } - } - t = t + 0.01; -}; - -//# sourceMappingURL=sketch_001.map \ No newline at end of file diff --git a/docs/examples/transcrypt/sketch_001/target/sketch_001.py b/docs/examples/transcrypt/sketch_001/target/sketch_001.py deleted file mode 100644 index 358ce99e..00000000 --- a/docs/examples/transcrypt/sketch_001/target/sketch_001.py +++ /dev/null @@ -1,31 +0,0 @@ -# https://p5js.org/examples/interaction-wavemaker.html - - -from pyp5js import * - -t = 0 - -def setup(): - createCanvas(600, 600) - stroke(250) - strokeWeight(3) - fill(40, 200, 40) - - -def draw(): - global t - background(10, 10) - - xAngle = map(mouseX, 0, width, -4 * PI, 4 * PI, True) - yAngle = map(mouseY, 0, height, -4 * PI, 4 * PI, True) - for x in range(0, width, 30): - for y in range(0, height, 30): - - angle = xAngle * (x / width) + yAngle * (y / height) - - myX = x + 20 * cos(2 * PI * t + angle) - myY = y + 20 * sin(2 * TWO_PI * t + angle) - - ellipse(myX, myY, 10) - - t = t + 0.01 diff --git a/docs/examples/transcrypt/sketch_001/target/target_sketch.js b/docs/examples/transcrypt/sketch_001/target/target_sketch.js index 5c610571..f125c40d 100644 --- a/docs/examples/transcrypt/sketch_001/target/target_sketch.js +++ b/docs/examples/transcrypt/sketch_001/target/target_sketch.js @@ -1,9 +1,92 @@ -// Transcrypt'ed from Python, 2021-09-20 17:40:30 -import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; -import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; -import * as source_sketch from './sketch_001.js'; +// Transcrypt'ed from Python, 2021-10-14 12:26:15 +import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; +import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; -export var event_functions = dict ([['deviceMoved', source_sketch.deviceMoved], ['deviceTurned', source_sketch.deviceTurned], ['deviceShaken', source_sketch.deviceShaken], ['keyPressed', source_sketch.keyPressed], ['keyReleased', source_sketch.keyReleased], ['keyTyped', source_sketch.keyTyped], ['mouseMoved', source_sketch.mouseMoved], ['mouseDragged', source_sketch.mouseDragged], ['mousePressed', source_sketch.mousePressed], ['mouseReleased', source_sketch.mouseReleased], ['mouseClicked', source_sketch.mouseClicked], ['doubleClicked', source_sketch.doubleClicked], ['mouseWheel', source_sketch.mouseWheel], ['touchStarted', source_sketch.touchStarted], ['touchMoved', source_sketch.touchMoved], ['touchEnded', source_sketch.touchEnded], ['windowResized', source_sketch.windowResized]]); -start_p5 (source_sketch.setup, source_sketch.draw, event_functions); +export var setup = function () { + if (arguments.length) { + var __ilastarg0__ = arguments.length - 1; + if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { + var __allkwargs0__ = arguments [__ilastarg0__--]; + for (var __attrib0__ in __allkwargs0__) { + } + } + } + else { + } + // pass; +}; +export var draw = function () { + if (arguments.length) { + var __ilastarg0__ = arguments.length - 1; + if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { + var __allkwargs0__ = arguments [__ilastarg0__--]; + for (var __attrib0__ in __allkwargs0__) { + } + } + } + else { + } + // pass; +}; +export var deviceMoved = null; +export var deviceTurned = null; +export var deviceShaken = null; +export var keyPressed = null; +export var keyReleased = null; +export var keyTyped = null; +export var mouseMoved = null; +export var mouseDragged = null; +export var mousePressed = null; +export var mouseReleased = null; +export var mouseClicked = null; +export var doubleClicked = null; +export var mouseWheel = null; +export var touchStarted = null; +export var touchMoved = null; +export var touchEnded = null; +export var windowResized = null; +export var t = 0; +var setup = function () { + if (arguments.length) { + var __ilastarg0__ = arguments.length - 1; + if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { + var __allkwargs0__ = arguments [__ilastarg0__--]; + for (var __attrib0__ in __allkwargs0__) { + } + } + } + else { + } + createCanvas (600, 600); + stroke (250); + strokeWeight (3); + fill (40, 200, 40); +}; +var draw = function () { + if (arguments.length) { + var __ilastarg0__ = arguments.length - 1; + if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { + var __allkwargs0__ = arguments [__ilastarg0__--]; + for (var __attrib0__ in __allkwargs0__) { + } + } + } + else { + } + background (10, 10); + var xAngle = map (mouseX, 0, width, -(4) * PI, 4 * PI, true); + var yAngle = map (mouseY, 0, height, -(4) * PI, 4 * PI, true); + for (var x = 0; x < width; x += 30) { + for (var y = 0; y < height; y += 30) { + var angle = xAngle * (x / width) + yAngle * (y / height); + var myX = x + 20 * cos ((2 * PI) * t + angle); + var myY = y + 20 * sin ((2 * TWO_PI) * t + angle); + ellipse (myX, myY, 10); + } + } + t = t + 0.01; +}; +export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized}); +start_p5 (setup, draw, event_functions); //# sourceMappingURL=target_sketch.map \ No newline at end of file diff --git a/docs/examples/transcrypt/sketch_001/target/target_sketch.project b/docs/examples/transcrypt/sketch_001/target/target_sketch.project index cfcc0fea..d220959f 100644 --- a/docs/examples/transcrypt/sketch_001/target/target_sketch.project +++ b/docs/examples/transcrypt/sketch_001/target/target_sketch.project @@ -1 +1 @@ -{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/sketch_001.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/sketch_001.js"}]} \ No newline at end of file +{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_001/__target__/python_functions.js"}]} \ No newline at end of file diff --git a/docs/examples/transcrypt/sketch_001/target/target_sketch.py b/docs/examples/transcrypt/sketch_001/target/target_sketch.py index 537b3fa4..99e9dc24 100644 --- a/docs/examples/transcrypt/sketch_001/target/target_sketch.py +++ b/docs/examples/transcrypt/sketch_001/target/target_sketch.py @@ -1,24 +1,79 @@ -import sketch_001 as source_sketch from pyp5js import * +def setup(): + pass + +def draw(): + pass + +deviceMoved = None +deviceTurned = None +deviceShaken = None +keyPressed = None +keyReleased = None +keyTyped = None +mouseMoved = None +mouseDragged = None +mousePressed = None +mouseReleased = None +mouseClicked = None +doubleClicked = None +mouseWheel = None +touchStarted = None +touchMoved = None +touchEnded = None +windowResized = None + + +# https://p5js.org/examples/interaction-wavemaker.html + +t = 0 + +def setup(): + createCanvas(600, 600) + stroke(250) + strokeWeight(3) + fill(40, 200, 40) + + +def draw(): + global t + background(10, 10) + + xAngle = map(mouseX, 0, width, -4 * PI, 4 * PI, True) + yAngle = map(mouseY, 0, height, -4 * PI, 4 * PI, True) + for x in range(0, width, 30): + for y in range(0, height, 30): + + angle = xAngle * (x / width) + yAngle * (y / height) + + myX = x + 20 * cos(2 * PI * t + angle) + myY = y + 20 * sin(2 * TWO_PI * t + angle) + + ellipse(myX, myY, 10) + + t = t + 0.01 + + + event_functions = { - "deviceMoved": source_sketch.deviceMoved, - "deviceTurned": source_sketch.deviceTurned, - "deviceShaken": source_sketch.deviceShaken, - "keyPressed": source_sketch.keyPressed, - "keyReleased": source_sketch.keyReleased, - "keyTyped": source_sketch.keyTyped, - "mouseMoved": source_sketch.mouseMoved, - "mouseDragged": source_sketch.mouseDragged, - "mousePressed": source_sketch.mousePressed, - "mouseReleased": source_sketch.mouseReleased, - "mouseClicked": source_sketch.mouseClicked, - "doubleClicked": source_sketch.doubleClicked, - "mouseWheel": source_sketch.mouseWheel, - "touchStarted": source_sketch.touchStarted, - "touchMoved": source_sketch.touchMoved, - "touchEnded": source_sketch.touchEnded, - "windowResized": source_sketch.windowResized, + "deviceMoved": deviceMoved, + "deviceTurned": deviceTurned, + "deviceShaken": deviceShaken, + "keyPressed": keyPressed, + "keyReleased": keyReleased, + "keyTyped": keyTyped, + "mouseMoved": mouseMoved, + "mouseDragged": mouseDragged, + "mousePressed": mousePressed, + "mouseReleased": mouseReleased, + "mouseClicked": mouseClicked, + "doubleClicked": doubleClicked, + "mouseWheel": mouseWheel, + "touchStarted": touchStarted, + "touchMoved": touchMoved, + "touchEnded": touchEnded, + "windowResized": windowResized, } -start_p5(source_sketch.setup, source_sketch.draw, event_functions) \ No newline at end of file +start_p5(setup, draw, event_functions) \ No newline at end of file diff --git a/docs/examples/transcrypt/sketch_002/index.html b/docs/examples/transcrypt/sketch_002/index.html index d3ccbe95..39a859f5 100644 --- a/docs/examples/transcrypt/sketch_002/index.html +++ b/docs/examples/transcrypt/sketch_002/index.html @@ -53,7 +53,6 @@ * * The camera lifts up (controlled by mouseY) while looking at the same point. """ -from pyp5js import * def setup(): createCanvas(640, 360, _P5_INSTANCE.WEBGL) diff --git a/docs/examples/transcrypt/sketch_002/sketch_002.py b/docs/examples/transcrypt/sketch_002/sketch_002.py index a95b031a..4313f4b5 100644 --- a/docs/examples/transcrypt/sketch_002/sketch_002.py +++ b/docs/examples/transcrypt/sketch_002/sketch_002.py @@ -4,7 +4,6 @@ * * The camera lifts up (controlled by mouseY) while looking at the same point. """ -from pyp5js import * def setup(): createCanvas(640, 360, _P5_INSTANCE.WEBGL) diff --git a/docs/examples/transcrypt/sketch_002/target/org.transcrypt.__runtime__.js b/docs/examples/transcrypt/sketch_002/target/org.transcrypt.__runtime__.js index 3153e1a3..eaae7387 100644 --- a/docs/examples/transcrypt/sketch_002/target/org.transcrypt.__runtime__.js +++ b/docs/examples/transcrypt/sketch_002/target/org.transcrypt.__runtime__.js @@ -1,10 +1,10 @@ -// Transcrypt'ed from Python, 2021-09-20 17:40:31 +// Transcrypt'ed from Python, 2021-10-14 12:26:16 var __name__ = 'org.transcrypt.__runtime__'; export var __envir__ = {}; __envir__.interpreter_name = 'python'; __envir__.transpiler_name = 'transcrypt'; __envir__.executor_name = __envir__.transpiler_name; -__envir__.transpiler_version = '3.7.16'; +__envir__.transpiler_version = '3.9.0'; export function __nest__ (headObject, tailNames, value) { var current = headObject; @@ -38,15 +38,14 @@ export function __init__ (module) { } return module.__all__; }; -export var __proxy__ = false; -export function __get__ (self, func, quotedFuncName) { - if (self) { - if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) { +export function __get__ (aThis, func, quotedFuncName) { + if (aThis) { + if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) { if (quotedFuncName) { - Object.defineProperty (self, quotedFuncName, { + Object.defineProperty (aThis, quotedFuncName, { value: function () { var args = [] .slice.apply (arguments); - return func.apply (null, [self] .concat (args)); + return func.apply (null, [aThis] .concat (args)); }, writable: true, enumerable: true, @@ -55,7 +54,7 @@ export function __get__ (self, func, quotedFuncName) { } return function () { var args = [] .slice.apply (arguments); - return func.apply (null, [self] .concat (args)); + return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args)); }; } else { @@ -66,21 +65,21 @@ export function __get__ (self, func, quotedFuncName) { return func; } }; -export function __getcm__ (self, func, quotedFuncName) { - if (self.hasOwnProperty ('__class__')) { +export function __getcm__ (aThis, func, quotedFuncName) { + if (aThis.hasOwnProperty ('__class__')) { return function () { var args = [] .slice.apply (arguments); - return func.apply (null, [self.__class__] .concat (args)); + return func.apply (null, [aThis.__class__] .concat (args)); }; } else { return function () { var args = [] .slice.apply (arguments); - return func.apply (null, [self] .concat (args)); + return func.apply (null, [aThis] .concat (args)); }; } }; -export function __getsm__ (self, func, quotedFuncName) { +export function __getsm__ (aThis, func, quotedFuncName) { return func; }; export var py_metatype = { @@ -95,6 +94,9 @@ export var py_metatype = { var base = bases [index]; for (var attrib in base) { var descrip = Object.getOwnPropertyDescriptor (base, attrib); + if (descrip == null) { + continue; + } Object.defineProperty (cls, attrib, descrip); } for (let symbol of Object.getOwnPropertySymbols (base)) { @@ -125,7 +127,7 @@ export var object = { __new__: function (args) { var instance = Object.create (this, {__class__: {value: this, enumerable: true}}); if ('__getattr__' in this || '__setattr__' in this) { - instance = new Proxy (instance, { + instance.__proxy__ = new Proxy (instance, { get: function (target, name) { let result = target [name]; if (result == undefined) { @@ -145,6 +147,7 @@ export var object = { return true; } }) + instance = instance.__proxy__ } this.__init__.apply (null, [instance] .concat (args)); return instance; @@ -1830,10 +1833,13 @@ export var Exception = __class__ ('Exception', [BaseException], { var args = tuple (); } self.__args__ = args; - try { + if (kwargs.error != null) { self.stack = kwargs.error.stack; } - catch (__except0__) { + else if (Error) { + self.stack = new Error ().stack; + } + else { self.stack = 'No stack trace available'; } });}, diff --git a/docs/examples/transcrypt/sketch_002/target/org.transcrypt.__runtime__.py b/docs/examples/transcrypt/sketch_002/target/org.transcrypt.__runtime__.py index 87834491..8b06f7ba 100644 --- a/docs/examples/transcrypt/sketch_002/target/org.transcrypt.__runtime__.py +++ b/docs/examples/transcrypt/sketch_002/target/org.transcrypt.__runtime__.py @@ -19,9 +19,11 @@ class Exception (BaseException): #__pragma__ ('kwargs') def __init__ (self, *args, **kwargs): self.__args__ = args - try: + if kwargs.error != None: self.stack = kwargs.error.stack # Integrate with JavaScript Error object - except: + elif Error: + self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one + else: self.stack = 'No stack trace available' #__pragma__ ('nokwargs') diff --git a/docs/examples/transcrypt/sketch_002/target/pyp5js.js b/docs/examples/transcrypt/sketch_002/target/pyp5js.js index 93a5ce00..c74a00f5 100644 --- a/docs/examples/transcrypt/sketch_002/target/pyp5js.js +++ b/docs/examples/transcrypt/sketch_002/target/pyp5js.js @@ -1,5 +1,5 @@ -// Transcrypt'ed from Python, 2021-09-20 17:40:31 -import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; +// Transcrypt'ed from Python, 2021-10-14 12:26:17 +import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; import {PythonFunctions} from './python_functions.js'; var __name__ = 'pyp5js'; export var _P5_INSTANCE = null; diff --git a/docs/examples/transcrypt/sketch_002/target/python_functions.js b/docs/examples/transcrypt/sketch_002/target/python_functions.js index abaffe38..b1cce4f4 100644 --- a/docs/examples/transcrypt/sketch_002/target/python_functions.js +++ b/docs/examples/transcrypt/sketch_002/target/python_functions.js @@ -1,5 +1,5 @@ -// Transcrypt'ed from Python, 2021-09-20 17:40:32 -import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; +// Transcrypt'ed from Python, 2021-10-14 12:26:17 +import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; var __name__ = 'python_functions'; export var PythonFunctions = __class__ ('PythonFunctions', [object], { __module__: __name__, diff --git a/docs/examples/transcrypt/sketch_002/target/sketch_002.js b/docs/examples/transcrypt/sketch_002/target/sketch_002.js deleted file mode 100644 index 322c5e89..00000000 --- a/docs/examples/transcrypt/sketch_002/target/sketch_002.js +++ /dev/null @@ -1,42 +0,0 @@ -// Transcrypt'ed from Python, 2021-09-20 17:40:32 -import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; -import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; -var __name__ = 'sketch_002'; -export var setup = function () { - if (arguments.length) { - var __ilastarg0__ = arguments.length - 1; - if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { - var __allkwargs0__ = arguments [__ilastarg0__--]; - for (var __attrib0__ in __allkwargs0__) { - } - } - } - else { - } - createCanvas (640, 360, _P5_INSTANCE.WEBGL); - fill (204); -}; -export var draw = function () { - if (arguments.length) { - var __ilastarg0__ = arguments.length - 1; - if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { - var __allkwargs0__ = arguments [__ilastarg0__--]; - for (var __attrib0__ in __allkwargs0__) { - } - } - } - else { - } - ambientLight (50); - directionalLight (255, 0, 0, 0.25, 0.25, 0); - background (0); - camera (30.0, mouseY, 220.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); - noStroke (); - box (90); - stroke (255); - line (-(100), 0, 0, 100, 0, 0); - line (0, -(100), 0, 0, 100, 0); - line (0, 0, -(100), 0, 0, 100); -}; - -//# sourceMappingURL=sketch_002.map \ No newline at end of file diff --git a/docs/examples/transcrypt/sketch_002/target/sketch_002.py b/docs/examples/transcrypt/sketch_002/target/sketch_002.py deleted file mode 100644 index a95b031a..00000000 --- a/docs/examples/transcrypt/sketch_002/target/sketch_002.py +++ /dev/null @@ -1,29 +0,0 @@ -""" - * Move Eye. - * by Simon Greenwold. - * - * The camera lifts up (controlled by mouseY) while looking at the same point. - """ -from pyp5js import * - -def setup(): - createCanvas(640, 360, _P5_INSTANCE.WEBGL) - fill(204) - - -def draw(): - ambientLight(50) - directionalLight(255, 0, 0, 0.25, 0.25, 0); - background(0) - - # Change height of the camera with mouseY - camera(30.0, mouseY, 220.0, # eyeX, eyeY, eyeZ - 0.0, 0.0, 0.0, # centerX, centerY, centerZ - 0.0, 1.0, 0.0) # upX, upY, upZ - - noStroke() - box(90) - stroke(255) - line(-100, 0, 0, 100, 0, 0) - line(0, -100, 0, 0, 100, 0) - line(0, 0, -100, 0, 0, 100) diff --git a/docs/examples/transcrypt/sketch_002/target/target_sketch.js b/docs/examples/transcrypt/sketch_002/target/target_sketch.js index f9f70d67..c9a387f3 100644 --- a/docs/examples/transcrypt/sketch_002/target/target_sketch.js +++ b/docs/examples/transcrypt/sketch_002/target/target_sketch.js @@ -1,9 +1,87 @@ -// Transcrypt'ed from Python, 2021-09-20 17:40:31 -import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; -import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; -import * as source_sketch from './sketch_002.js'; +// Transcrypt'ed from Python, 2021-10-14 12:26:17 +import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js'; +import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js'; var __name__ = '__main__'; -export var event_functions = dict ([['deviceMoved', source_sketch.deviceMoved], ['deviceTurned', source_sketch.deviceTurned], ['deviceShaken', source_sketch.deviceShaken], ['keyPressed', source_sketch.keyPressed], ['keyReleased', source_sketch.keyReleased], ['keyTyped', source_sketch.keyTyped], ['mouseMoved', source_sketch.mouseMoved], ['mouseDragged', source_sketch.mouseDragged], ['mousePressed', source_sketch.mousePressed], ['mouseReleased', source_sketch.mouseReleased], ['mouseClicked', source_sketch.mouseClicked], ['doubleClicked', source_sketch.doubleClicked], ['mouseWheel', source_sketch.mouseWheel], ['touchStarted', source_sketch.touchStarted], ['touchMoved', source_sketch.touchMoved], ['touchEnded', source_sketch.touchEnded], ['windowResized', source_sketch.windowResized]]); -start_p5 (source_sketch.setup, source_sketch.draw, event_functions); +export var setup = function () { + if (arguments.length) { + var __ilastarg0__ = arguments.length - 1; + if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { + var __allkwargs0__ = arguments [__ilastarg0__--]; + for (var __attrib0__ in __allkwargs0__) { + } + } + } + else { + } + // pass; +}; +export var draw = function () { + if (arguments.length) { + var __ilastarg0__ = arguments.length - 1; + if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { + var __allkwargs0__ = arguments [__ilastarg0__--]; + for (var __attrib0__ in __allkwargs0__) { + } + } + } + else { + } + // pass; +}; +export var deviceMoved = null; +export var deviceTurned = null; +export var deviceShaken = null; +export var keyPressed = null; +export var keyReleased = null; +export var keyTyped = null; +export var mouseMoved = null; +export var mouseDragged = null; +export var mousePressed = null; +export var mouseReleased = null; +export var mouseClicked = null; +export var doubleClicked = null; +export var mouseWheel = null; +export var touchStarted = null; +export var touchMoved = null; +export var touchEnded = null; +export var windowResized = null; +var setup = function () { + if (arguments.length) { + var __ilastarg0__ = arguments.length - 1; + if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { + var __allkwargs0__ = arguments [__ilastarg0__--]; + for (var __attrib0__ in __allkwargs0__) { + } + } + } + else { + } + createCanvas (640, 360, _P5_INSTANCE.WEBGL); + fill (204); +}; +var draw = function () { + if (arguments.length) { + var __ilastarg0__ = arguments.length - 1; + if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) { + var __allkwargs0__ = arguments [__ilastarg0__--]; + for (var __attrib0__ in __allkwargs0__) { + } + } + } + else { + } + ambientLight (50); + directionalLight (255, 0, 0, 0.25, 0.25, 0); + background (0); + camera (30.0, mouseY, 220.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); + noStroke (); + box (90); + stroke (255); + line (-(100), 0, 0, 100, 0, 0); + line (0, -(100), 0, 0, 100, 0); + line (0, 0, -(100), 0, 0, 100); +}; +export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized}); +start_p5 (setup, draw, event_functions); //# sourceMappingURL=target_sketch.map \ No newline at end of file diff --git a/docs/examples/transcrypt/sketch_002/target/target_sketch.project b/docs/examples/transcrypt/sketch_002/target/target_sketch.project index 428f3b6d..c08bdd50 100644 --- a/docs/examples/transcrypt/sketch_002/target/target_sketch.project +++ b/docs/examples/transcrypt/sketch_002/target/target_sketch.project @@ -1 +1 @@ -{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/sketch_002.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/sketch_002.js"}]} \ No newline at end of file +{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_002/__target__/python_functions.js"}]} \ No newline at end of file diff --git a/docs/examples/transcrypt/sketch_002/target/target_sketch.py b/docs/examples/transcrypt/sketch_002/target/target_sketch.py index 6dd8b40a..5bc8a558 100644 --- a/docs/examples/transcrypt/sketch_002/target/target_sketch.py +++ b/docs/examples/transcrypt/sketch_002/target/target_sketch.py @@ -1,24 +1,79 @@ -import sketch_002 as source_sketch from pyp5js import * +def setup(): + pass + +def draw(): + pass + +deviceMoved = None +deviceTurned = None +deviceShaken = None +keyPressed = None +keyReleased = None +keyTyped = None +mouseMoved = None +mouseDragged = None +mousePressed = None +mouseReleased = None +mouseClicked = None +doubleClicked = None +mouseWheel = None +touchStarted = None +touchMoved = None +touchEnded = None +windowResized = None + + +""" + * Move Eye. + * by Simon Greenwold. + * + * The camera lifts up (controlled by mouseY) while looking at the same point. + """ + +def setup(): + createCanvas(640, 360, _P5_INSTANCE.WEBGL) + fill(204) + + +def draw(): + ambientLight(50) + directionalLight(255, 0, 0, 0.25, 0.25, 0); + background(0) + + # Change height of the camera with mouseY + camera(30.0, mouseY, 220.0, # eyeX, eyeY, eyeZ + 0.0, 0.0, 0.0, # centerX, centerY, centerZ + 0.0, 1.0, 0.0) # upX, upY, upZ + + noStroke() + box(90) + stroke(255) + line(-100, 0, 0, 100, 0, 0) + line(0, -100, 0, 0, 100, 0) + line(0, 0, -100, 0, 0, 100) + + + event_functions = { - "deviceMoved": source_sketch.deviceMoved, - "deviceTurned": source_sketch.deviceTurned, - "deviceShaken": source_sketch.deviceShaken, - "keyPressed": source_sketch.keyPressed, - "keyReleased": source_sketch.keyReleased, - "keyTyped": source_sketch.keyTyped, - "mouseMoved": source_sketch.mouseMoved, - "mouseDragged": source_sketch.mouseDragged, - "mousePressed": source_sketch.mousePressed, - "mouseReleased": source_sketch.mouseReleased, - "mouseClicked": source_sketch.mouseClicked, - "doubleClicked": source_sketch.doubleClicked, - "mouseWheel": source_sketch.mouseWheel, - "touchStarted": source_sketch.touchStarted, - "touchMoved": source_sketch.touchMoved, - "touchEnded": source_sketch.touchEnded, - "windowResized": source_sketch.windowResized, + "deviceMoved": deviceMoved, + "deviceTurned": deviceTurned, + "deviceShaken": deviceShaken, + "keyPressed": keyPressed, + "keyReleased": keyReleased, + "keyTyped": keyTyped, + "mouseMoved": mouseMoved, + "mouseDragged": mouseDragged, + "mousePressed": mousePressed, + "mouseReleased": mouseReleased, + "mouseClicked": mouseClicked, + "doubleClicked": doubleClicked, + "mouseWheel": mouseWheel, + "touchStarted": touchStarted, + "touchMoved": touchMoved, + "touchEnded": touchEnded, + "windowResized": windowResized, } -start_p5(source_sketch.setup, source_sketch.draw, event_functions) \ No newline at end of file +start_p5(setup, draw, event_functions) \ No newline at end of file diff --git a/docs/examples/transcrypt/sketch_003/index.html b/docs/examples/transcrypt/sketch_003/index.html index b6e7f2bb..0ae6ccbb 100644 --- a/docs/examples/transcrypt/sketch_003/index.html +++ b/docs/examples/transcrypt/sketch_003/index.html @@ -48,7 +48,6 @@
              
 # 3d example
-from pyp5js import *
 
 
 def setup():
diff --git a/docs/examples/transcrypt/sketch_003/sketch_003.py b/docs/examples/transcrypt/sketch_003/sketch_003.py
index d54d9c12..3029b751 100644
--- a/docs/examples/transcrypt/sketch_003/sketch_003.py
+++ b/docs/examples/transcrypt/sketch_003/sketch_003.py
@@ -1,5 +1,4 @@
 # 3d example
-from pyp5js import *
 
 
 def setup():
diff --git a/docs/examples/transcrypt/sketch_003/target/org.transcrypt.__runtime__.js b/docs/examples/transcrypt/sketch_003/target/org.transcrypt.__runtime__.js
index 609ed93e..d95a5be5 100644
--- a/docs/examples/transcrypt/sketch_003/target/org.transcrypt.__runtime__.js
+++ b/docs/examples/transcrypt/sketch_003/target/org.transcrypt.__runtime__.js
@@ -1,10 +1,10 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:33
+// Transcrypt'ed from Python, 2021-10-14 12:26:18
 var __name__ = 'org.transcrypt.__runtime__';
 export var __envir__ = {};
 __envir__.interpreter_name = 'python';
 __envir__.transpiler_name = 'transcrypt';
 __envir__.executor_name = __envir__.transpiler_name;
-__envir__.transpiler_version = '3.7.16';
+__envir__.transpiler_version = '3.9.0';
 
 export function __nest__ (headObject, tailNames, value) {
     var current = headObject;
@@ -38,15 +38,14 @@ export function __init__ (module) {
     }
     return module.__all__;
 };
-export var __proxy__ = false;
-export function __get__ (self, func, quotedFuncName) {
-    if (self) {
-        if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) {
+export function __get__ (aThis, func, quotedFuncName) {
+    if (aThis) {
+        if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) {
             if (quotedFuncName) {
-                Object.defineProperty (self, quotedFuncName, {
+                Object.defineProperty (aThis, quotedFuncName, {
                     value: function () {
                         var args = [] .slice.apply (arguments);
-                        return func.apply (null, [self] .concat (args));
+                        return func.apply (null, [aThis] .concat (args));
                     },
                     writable: true,
                     enumerable: true,
@@ -55,7 +54,7 @@ export function __get__ (self, func, quotedFuncName) {
             }
             return function () {
                 var args = [] .slice.apply (arguments);
-                return func.apply (null, [self] .concat (args));
+                return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args));
             };
         }
         else {
@@ -66,21 +65,21 @@ export function __get__ (self, func, quotedFuncName) {
         return func;
     }
 };
-export function __getcm__ (self, func, quotedFuncName) {
-    if (self.hasOwnProperty ('__class__')) {
+export function __getcm__ (aThis, func, quotedFuncName) {
+    if (aThis.hasOwnProperty ('__class__')) {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self.__class__] .concat (args));
+            return func.apply (null, [aThis.__class__] .concat (args));
         };
     }
     else {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self] .concat (args));
+            return func.apply (null, [aThis] .concat (args));
         };
     }
 };
-export function __getsm__ (self, func, quotedFuncName) {
+export function __getsm__ (aThis, func, quotedFuncName) {
     return func;
 };
 export var py_metatype = {
@@ -95,6 +94,9 @@ export var py_metatype = {
             var base = bases [index];
             for (var attrib in base) {
                 var descrip = Object.getOwnPropertyDescriptor (base, attrib);
+                if (descrip == null) {
+                    continue;
+                }
                 Object.defineProperty (cls, attrib, descrip);
             }
             for (let symbol of Object.getOwnPropertySymbols (base)) {
@@ -125,7 +127,7 @@ export var object = {
     __new__: function (args) {
         var instance = Object.create (this, {__class__: {value: this, enumerable: true}});
         if ('__getattr__' in this || '__setattr__' in this) {
-            instance = new Proxy (instance, {
+            instance.__proxy__ = new Proxy (instance, {
                 get: function (target, name) {
                     let result = target [name];
                     if (result == undefined) {
@@ -145,6 +147,7 @@ export var object = {
                     return true;
                 }
             })
+			instance = instance.__proxy__
         }
         this.__init__.apply (null, [instance] .concat (args));
         return instance;
@@ -1830,10 +1833,13 @@ export var Exception =  __class__ ('Exception', [BaseException], {
 			var args = tuple ();
 		}
 		self.__args__ = args;
-		try {
+		if (kwargs.error != null) {
 			self.stack = kwargs.error.stack;
 		}
-		catch (__except0__) {
+		else if (Error) {
+			self.stack = new Error ().stack;
+		}
+		else {
 			self.stack = 'No stack trace available';
 		}
 	});},
diff --git a/docs/examples/transcrypt/sketch_003/target/org.transcrypt.__runtime__.py b/docs/examples/transcrypt/sketch_003/target/org.transcrypt.__runtime__.py
index 87834491..8b06f7ba 100644
--- a/docs/examples/transcrypt/sketch_003/target/org.transcrypt.__runtime__.py
+++ b/docs/examples/transcrypt/sketch_003/target/org.transcrypt.__runtime__.py
@@ -19,9 +19,11 @@ class Exception (BaseException):
     #__pragma__ ('kwargs')
     def __init__ (self, *args, **kwargs):
         self.__args__ = args
-        try:
+        if kwargs.error != None:
             self.stack = kwargs.error.stack # Integrate with JavaScript Error object
-        except:
+        elif Error:
+            self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one
+        else:
             self.stack = 'No stack trace available'
     #__pragma__ ('nokwargs')
         
diff --git a/docs/examples/transcrypt/sketch_003/target/pyp5js.js b/docs/examples/transcrypt/sketch_003/target/pyp5js.js
index b89a42eb..56b9ba0e 100644
--- a/docs/examples/transcrypt/sketch_003/target/pyp5js.js
+++ b/docs/examples/transcrypt/sketch_003/target/pyp5js.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:33
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:18
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 import {PythonFunctions} from './python_functions.js';
 var __name__ = 'pyp5js';
 export var _P5_INSTANCE = null;
diff --git a/docs/examples/transcrypt/sketch_003/target/python_functions.js b/docs/examples/transcrypt/sketch_003/target/python_functions.js
index c5be0318..8c26a94a 100644
--- a/docs/examples/transcrypt/sketch_003/target/python_functions.js
+++ b/docs/examples/transcrypt/sketch_003/target/python_functions.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:33
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:18
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 var __name__ = 'python_functions';
 export var PythonFunctions =  __class__ ('PythonFunctions', [object], {
 	__module__: __name__,
diff --git a/docs/examples/transcrypt/sketch_003/target/sketch_003.js b/docs/examples/transcrypt/sketch_003/target/sketch_003.js
deleted file mode 100644
index 3e382d1d..00000000
--- a/docs/examples/transcrypt/sketch_003/target/sketch_003.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:33
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-var __name__ = 'sketch_003';
-export var setup = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	createCanvas (600, 600, WEBGL);
-};
-export var draw = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	background (200);
-	translate (-(100), -(100), 0);
-	push ();
-	normalMaterial ();
-	rotateZ (frameCount * 0.01);
-	rotateX (frameCount * 0.01);
-	rotateY (frameCount * 0.01);
-	box (50, 70, 100);
-	py_pop ();
-};
-
-//# sourceMappingURL=sketch_003.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_003/target/sketch_003.py b/docs/examples/transcrypt/sketch_003/target/sketch_003.py
deleted file mode 100644
index d54d9c12..00000000
--- a/docs/examples/transcrypt/sketch_003/target/sketch_003.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# 3d example
-from pyp5js import *
-
-
-def setup():
-    createCanvas(600, 600, WEBGL)
-
-def draw():
-    background(200)
-    translate(-100, -100, 0)
-    push()
-    normalMaterial()
-    rotateZ(frameCount * 0.01)
-    rotateX(frameCount * 0.01)
-    rotateY(frameCount * 0.01)
-    box(50, 70, 100)
-    pop()
diff --git a/docs/examples/transcrypt/sketch_003/target/target_sketch.js b/docs/examples/transcrypt/sketch_003/target/target_sketch.js
index 3b384f2d..96a84c60 100644
--- a/docs/examples/transcrypt/sketch_003/target/target_sketch.js
+++ b/docs/examples/transcrypt/sketch_003/target/target_sketch.js
@@ -1,9 +1,85 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:33
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-import * as source_sketch from './sketch_003.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:18
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
 var __name__ = '__main__';
-export var event_functions = dict ([['deviceMoved', source_sketch.deviceMoved], ['deviceTurned', source_sketch.deviceTurned], ['deviceShaken', source_sketch.deviceShaken], ['keyPressed', source_sketch.keyPressed], ['keyReleased', source_sketch.keyReleased], ['keyTyped', source_sketch.keyTyped], ['mouseMoved', source_sketch.mouseMoved], ['mouseDragged', source_sketch.mouseDragged], ['mousePressed', source_sketch.mousePressed], ['mouseReleased', source_sketch.mouseReleased], ['mouseClicked', source_sketch.mouseClicked], ['doubleClicked', source_sketch.doubleClicked], ['mouseWheel', source_sketch.mouseWheel], ['touchStarted', source_sketch.touchStarted], ['touchMoved', source_sketch.touchMoved], ['touchEnded', source_sketch.touchEnded], ['windowResized', source_sketch.windowResized]]);
-start_p5 (source_sketch.setup, source_sketch.draw, event_functions);
+export var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var deviceMoved = null;
+export var deviceTurned = null;
+export var deviceShaken = null;
+export var keyPressed = null;
+export var keyReleased = null;
+export var keyTyped = null;
+export var mouseMoved = null;
+export var mouseDragged = null;
+export var mousePressed = null;
+export var mouseReleased = null;
+export var mouseClicked = null;
+export var doubleClicked = null;
+export var mouseWheel = null;
+export var touchStarted = null;
+export var touchMoved = null;
+export var touchEnded = null;
+export var windowResized = null;
+var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	createCanvas (600, 600, WEBGL);
+};
+var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	background (200);
+	translate (-(100), -(100), 0);
+	push ();
+	normalMaterial ();
+	rotateZ (frameCount * 0.01);
+	rotateX (frameCount * 0.01);
+	rotateY (frameCount * 0.01);
+	box (50, 70, 100);
+	py_pop ();
+};
+export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized});
+start_p5 (setup, draw, event_functions);
 
 //# sourceMappingURL=target_sketch.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_003/target/target_sketch.project b/docs/examples/transcrypt/sketch_003/target/target_sketch.project
index 5b4412aa..4eedbc45 100644
--- a/docs/examples/transcrypt/sketch_003/target/target_sketch.project
+++ b/docs/examples/transcrypt/sketch_003/target/target_sketch.project
@@ -1 +1 @@
-{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/sketch_003.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/sketch_003.js"}]}
\ No newline at end of file
+{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_003/__target__/python_functions.js"}]}
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_003/target/target_sketch.py b/docs/examples/transcrypt/sketch_003/target/target_sketch.py
index e752f6dc..a5972282 100644
--- a/docs/examples/transcrypt/sketch_003/target/target_sketch.py
+++ b/docs/examples/transcrypt/sketch_003/target/target_sketch.py
@@ -1,24 +1,67 @@
-import sketch_003 as source_sketch
 from pyp5js import *
 
+def setup():
+    pass
+
+def draw():
+    pass
+
+deviceMoved = None
+deviceTurned = None
+deviceShaken = None
+keyPressed = None
+keyReleased = None
+keyTyped = None
+mouseMoved = None
+mouseDragged = None
+mousePressed = None
+mouseReleased = None
+mouseClicked = None
+doubleClicked = None
+mouseWheel = None
+touchStarted = None
+touchMoved = None
+touchEnded = None
+windowResized = None
+
+
+# 3d example
+
+
+def setup():
+    createCanvas(600, 600, WEBGL)
+
+def draw():
+    background(200)
+    translate(-100, -100, 0)
+    push()
+    normalMaterial()
+    rotateZ(frameCount * 0.01)
+    rotateX(frameCount * 0.01)
+    rotateY(frameCount * 0.01)
+    box(50, 70, 100)
+    pop()
+
+
+
 event_functions = {
-    "deviceMoved": source_sketch.deviceMoved,
-    "deviceTurned": source_sketch.deviceTurned,
-    "deviceShaken": source_sketch.deviceShaken,
-    "keyPressed": source_sketch.keyPressed,
-    "keyReleased": source_sketch.keyReleased,
-    "keyTyped": source_sketch.keyTyped,
-    "mouseMoved": source_sketch.mouseMoved,
-    "mouseDragged": source_sketch.mouseDragged,
-    "mousePressed": source_sketch.mousePressed,
-    "mouseReleased": source_sketch.mouseReleased,
-    "mouseClicked": source_sketch.mouseClicked,
-    "doubleClicked": source_sketch.doubleClicked,
-    "mouseWheel": source_sketch.mouseWheel,
-    "touchStarted": source_sketch.touchStarted,
-    "touchMoved": source_sketch.touchMoved,
-    "touchEnded": source_sketch.touchEnded,
-    "windowResized": source_sketch.windowResized,
+    "deviceMoved": deviceMoved,
+    "deviceTurned": deviceTurned,
+    "deviceShaken": deviceShaken,
+    "keyPressed": keyPressed,
+    "keyReleased": keyReleased,
+    "keyTyped": keyTyped,
+    "mouseMoved": mouseMoved,
+    "mouseDragged": mouseDragged,
+    "mousePressed": mousePressed,
+    "mouseReleased": mouseReleased,
+    "mouseClicked": mouseClicked,
+    "doubleClicked": doubleClicked,
+    "mouseWheel": mouseWheel,
+    "touchStarted": touchStarted,
+    "touchMoved": touchMoved,
+    "touchEnded": touchEnded,
+    "windowResized": windowResized,
 }
 
-start_p5(source_sketch.setup, source_sketch.draw, event_functions)
\ No newline at end of file
+start_p5(setup, draw, event_functions)
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_004/index.html b/docs/examples/transcrypt/sketch_004/index.html
index 54282533..ecd75a33 100644
--- a/docs/examples/transcrypt/sketch_004/index.html
+++ b/docs/examples/transcrypt/sketch_004/index.html
@@ -50,8 +50,6 @@
 # From Prof. Claudio Esperança examples for BrythonIDE
 # https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py
 
-from pyp5js import *
-
 boids = [];
 
 def setup() :
diff --git a/docs/examples/transcrypt/sketch_004/sketch_004.py b/docs/examples/transcrypt/sketch_004/sketch_004.py
index 5d604f76..800f0811 100644
--- a/docs/examples/transcrypt/sketch_004/sketch_004.py
+++ b/docs/examples/transcrypt/sketch_004/sketch_004.py
@@ -1,8 +1,6 @@
 # From Prof. Claudio Esperança examples for BrythonIDE
 # https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py
 
-from pyp5js import *
-
 boids = [];
 
 def setup() :
diff --git a/docs/examples/transcrypt/sketch_004/target/org.transcrypt.__runtime__.js b/docs/examples/transcrypt/sketch_004/target/org.transcrypt.__runtime__.js
index ddd35f79..dd650ebc 100644
--- a/docs/examples/transcrypt/sketch_004/target/org.transcrypt.__runtime__.js
+++ b/docs/examples/transcrypt/sketch_004/target/org.transcrypt.__runtime__.js
@@ -1,10 +1,10 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:34
+// Transcrypt'ed from Python, 2021-10-14 12:26:19
 var __name__ = 'org.transcrypt.__runtime__';
 export var __envir__ = {};
 __envir__.interpreter_name = 'python';
 __envir__.transpiler_name = 'transcrypt';
 __envir__.executor_name = __envir__.transpiler_name;
-__envir__.transpiler_version = '3.7.16';
+__envir__.transpiler_version = '3.9.0';
 
 export function __nest__ (headObject, tailNames, value) {
     var current = headObject;
@@ -38,15 +38,14 @@ export function __init__ (module) {
     }
     return module.__all__;
 };
-export var __proxy__ = false;
-export function __get__ (self, func, quotedFuncName) {
-    if (self) {
-        if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) {
+export function __get__ (aThis, func, quotedFuncName) {
+    if (aThis) {
+        if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) {
             if (quotedFuncName) {
-                Object.defineProperty (self, quotedFuncName, {
+                Object.defineProperty (aThis, quotedFuncName, {
                     value: function () {
                         var args = [] .slice.apply (arguments);
-                        return func.apply (null, [self] .concat (args));
+                        return func.apply (null, [aThis] .concat (args));
                     },
                     writable: true,
                     enumerable: true,
@@ -55,7 +54,7 @@ export function __get__ (self, func, quotedFuncName) {
             }
             return function () {
                 var args = [] .slice.apply (arguments);
-                return func.apply (null, [self] .concat (args));
+                return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args));
             };
         }
         else {
@@ -66,21 +65,21 @@ export function __get__ (self, func, quotedFuncName) {
         return func;
     }
 };
-export function __getcm__ (self, func, quotedFuncName) {
-    if (self.hasOwnProperty ('__class__')) {
+export function __getcm__ (aThis, func, quotedFuncName) {
+    if (aThis.hasOwnProperty ('__class__')) {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self.__class__] .concat (args));
+            return func.apply (null, [aThis.__class__] .concat (args));
         };
     }
     else {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self] .concat (args));
+            return func.apply (null, [aThis] .concat (args));
         };
     }
 };
-export function __getsm__ (self, func, quotedFuncName) {
+export function __getsm__ (aThis, func, quotedFuncName) {
     return func;
 };
 export var py_metatype = {
@@ -95,6 +94,9 @@ export var py_metatype = {
             var base = bases [index];
             for (var attrib in base) {
                 var descrip = Object.getOwnPropertyDescriptor (base, attrib);
+                if (descrip == null) {
+                    continue;
+                }
                 Object.defineProperty (cls, attrib, descrip);
             }
             for (let symbol of Object.getOwnPropertySymbols (base)) {
@@ -125,7 +127,7 @@ export var object = {
     __new__: function (args) {
         var instance = Object.create (this, {__class__: {value: this, enumerable: true}});
         if ('__getattr__' in this || '__setattr__' in this) {
-            instance = new Proxy (instance, {
+            instance.__proxy__ = new Proxy (instance, {
                 get: function (target, name) {
                     let result = target [name];
                     if (result == undefined) {
@@ -145,6 +147,7 @@ export var object = {
                     return true;
                 }
             })
+			instance = instance.__proxy__
         }
         this.__init__.apply (null, [instance] .concat (args));
         return instance;
@@ -1830,10 +1833,13 @@ export var Exception =  __class__ ('Exception', [BaseException], {
 			var args = tuple ();
 		}
 		self.__args__ = args;
-		try {
+		if (kwargs.error != null) {
 			self.stack = kwargs.error.stack;
 		}
-		catch (__except0__) {
+		else if (Error) {
+			self.stack = new Error ().stack;
+		}
+		else {
 			self.stack = 'No stack trace available';
 		}
 	});},
diff --git a/docs/examples/transcrypt/sketch_004/target/org.transcrypt.__runtime__.py b/docs/examples/transcrypt/sketch_004/target/org.transcrypt.__runtime__.py
index 87834491..8b06f7ba 100644
--- a/docs/examples/transcrypt/sketch_004/target/org.transcrypt.__runtime__.py
+++ b/docs/examples/transcrypt/sketch_004/target/org.transcrypt.__runtime__.py
@@ -19,9 +19,11 @@ class Exception (BaseException):
     #__pragma__ ('kwargs')
     def __init__ (self, *args, **kwargs):
         self.__args__ = args
-        try:
+        if kwargs.error != None:
             self.stack = kwargs.error.stack # Integrate with JavaScript Error object
-        except:
+        elif Error:
+            self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one
+        else:
             self.stack = 'No stack trace available'
     #__pragma__ ('nokwargs')
         
diff --git a/docs/examples/transcrypt/sketch_004/target/pyp5js.js b/docs/examples/transcrypt/sketch_004/target/pyp5js.js
index 7d4da120..ee17e809 100644
--- a/docs/examples/transcrypt/sketch_004/target/pyp5js.js
+++ b/docs/examples/transcrypt/sketch_004/target/pyp5js.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:34
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:19
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 import {PythonFunctions} from './python_functions.js';
 var __name__ = 'pyp5js';
 export var _P5_INSTANCE = null;
diff --git a/docs/examples/transcrypt/sketch_004/target/python_functions.js b/docs/examples/transcrypt/sketch_004/target/python_functions.js
index fd5fa626..80e00b6c 100644
--- a/docs/examples/transcrypt/sketch_004/target/python_functions.js
+++ b/docs/examples/transcrypt/sketch_004/target/python_functions.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:34
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:20
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 var __name__ = 'python_functions';
 export var PythonFunctions =  __class__ ('PythonFunctions', [object], {
 	__module__: __name__,
diff --git a/docs/examples/transcrypt/sketch_004/target/sketch_004.js b/docs/examples/transcrypt/sketch_004/target/sketch_004.js
deleted file mode 100644
index b00c8435..00000000
--- a/docs/examples/transcrypt/sketch_004/target/sketch_004.js
+++ /dev/null
@@ -1,322 +0,0 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:34
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-var __name__ = 'sketch_004';
-export var boids = [];
-export var setup = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	createCanvas (720, 400);
-	for (var i = 0; i < 40; i++) {
-		boids.append (Boid (random (720), random (400)));
-	}
-};
-export var draw = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	background (51);
-	for (var boid of boids) {
-		boid.run (boids);
-	}
-};
-export var Boid =  __class__ ('Boid', [object], {
-	__module__: __name__,
-	get __init__ () {return __get__ (this, function (self, x, y) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-						case 'x': var x = __allkwargs0__ [__attrib0__]; break;
-						case 'y': var y = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		self.acceleration = createVector (0, 0);
-		self.velocity = p5.Vector.random2D ();
-		self.position = createVector (x, y);
-		self.r = 3.0;
-		self.maxspeed = 3;
-		self.maxforce = 0.05;
-	});},
-	get run () {return __get__ (this, function (self, boids) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-						case 'boids': var boids = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		self.flock (boids);
-		self.py_update ();
-		self.borders ();
-		self.render ();
-	});},
-	get applyForce () {return __get__ (this, function (self, force) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-						case 'force': var force = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		self.acceleration.add (force);
-	});},
-	get flock () {return __get__ (this, function (self, boids) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-						case 'boids': var boids = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		var sep = self.separate (boids);
-		var ali = self.align (boids);
-		var coh = self.cohesion (boids);
-		sep.mult (2.5);
-		ali.mult (1.0);
-		coh.mult (1.0);
-		self.applyForce (sep);
-		self.applyForce (ali);
-		self.applyForce (coh);
-	});},
-	get py_update () {return __get__ (this, function (self) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		self.velocity.add (self.acceleration);
-		self.velocity.limit (self.maxspeed);
-		self.position.add (self.velocity);
-		self.acceleration.mult (0);
-	});},
-	get seek () {return __get__ (this, function (self, target) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-						case 'target': var target = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		var desired = p5.Vector.sub (target, self.position);
-		desired.normalize ();
-		desired.mult (self.maxspeed);
-		var steer = p5.Vector.sub (desired, self.velocity);
-		steer.limit (self.maxforce);
-		return steer;
-	});},
-	get render () {return __get__ (this, function (self) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		fill (127, 127);
-		stroke (200);
-		ellipse (self.position.x, self.position.y, 16, 16);
-	});},
-	get borders () {return __get__ (this, function (self) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		if (self.position.x < -(self.r)) {
-			self.position.x = width + self.r;
-		}
-		if (self.position.y < -(self.r)) {
-			self.position.y = height + self.r;
-		}
-		if (self.position.x > width + self.r) {
-			self.position.x = -(self.r);
-		}
-		if (self.position.y > height + self.r) {
-			self.position.y = -(self.r);
-		}
-	});},
-	get separate () {return __get__ (this, function (self, boids) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-						case 'boids': var boids = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		var desiredseparation = 25.0;
-		var steer = createVector (0, 0);
-		var count = 0;
-		for (var i = 0; i < len (boids); i++) {
-			var d = p5.Vector.dist (self.position, boids [i].position);
-			if (d > 0 && d < desiredseparation) {
-				var diff = p5.Vector.sub (self.position, boids [i].position);
-				diff.normalize ();
-				diff.div (d);
-				steer.add (diff);
-				count += 1;
-			}
-		}
-		if (count > 0) {
-			steer.div (count);
-		}
-		if (steer.mag () > 0) {
-			steer.normalize ();
-			steer.mult (self.maxspeed);
-			steer.sub (self.velocity);
-			steer.limit (self.maxforce);
-		}
-		return steer;
-	});},
-	get align () {return __get__ (this, function (self, boids) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-						case 'boids': var boids = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		var neighbordist = 50;
-		var sum = createVector (0, 0);
-		var count = 0;
-		for (var i = 0; i < len (boids); i++) {
-			var d = p5.Vector.dist (self.position, boids [i].position);
-			if (d > 0 && d < neighbordist) {
-				sum.add (boids [i].velocity);
-				count += 1;
-			}
-		}
-		if (count > 0) {
-			sum.div (count);
-			sum.normalize ();
-			sum.mult (self.maxspeed);
-			var steer = p5.Vector.sub (sum, self.velocity);
-			steer.limit (self.maxforce);
-			return steer;
-		}
-		else {
-			return createVector (0, 0);
-		}
-	});},
-	get cohesion () {return __get__ (this, function (self, boids) {
-		if (arguments.length) {
-			var __ilastarg0__ = arguments.length - 1;
-			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-				var __allkwargs0__ = arguments [__ilastarg0__--];
-				for (var __attrib0__ in __allkwargs0__) {
-					switch (__attrib0__) {
-						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
-						case 'boids': var boids = __allkwargs0__ [__attrib0__]; break;
-					}
-				}
-			}
-		}
-		else {
-		}
-		var neighbordist = 50;
-		var sum = createVector (0, 0);
-		var count = 0;
-		for (var i = 0; i < len (boids); i++) {
-			var d = p5.Vector.dist (self.position, boids [i].position);
-			if (d > 0 && d < neighbordist) {
-				sum.add (boids [i].position);
-				count += 1;
-			}
-		}
-		if (count > 0) {
-			sum.div (count);
-			return self.seek (sum);
-		}
-		else {
-			return createVector (0, 0);
-		}
-	});}
-});
-
-//# sourceMappingURL=sketch_004.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_004/target/sketch_004.py b/docs/examples/transcrypt/sketch_004/target/sketch_004.py
deleted file mode 100644
index 5d604f76..00000000
--- a/docs/examples/transcrypt/sketch_004/target/sketch_004.py
+++ /dev/null
@@ -1,164 +0,0 @@
-# From Prof. Claudio Esperança examples for BrythonIDE
-# https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py
-
-from pyp5js import *
-
-boids = [];
-
-def setup() :
-  createCanvas(720, 400);
-
-  # Add an initial set of boids into the system
-  for i in range(40):
-    boids.append (Boid(random(720), random(400)))
-
-def draw() :
-  background(51);
-  # Run all the boids
-  for boid in boids: boid.run(boids)
-
-
-# Boid class
-# Methods for Separation, Cohesion, Alignment added
-class Boid (object):
-
-    def __init__(self, x, y) :
-        self.acceleration = createVector(0, 0);
-        self.velocity = p5.Vector.random2D();
-        self.position = createVector(x, y);
-        self.r = 3.0;
-        self.maxspeed = 3;    # Maximum speed
-        self.maxforce = 0.05; # Maximum steering force
-
-    def run (self, boids):
-        self.flock(boids);
-        self.update();
-        self.borders();
-        self.render();
-
-    # Forces go into acceleration
-    def applyForce (self,force):
-        self.acceleration.add(force);
-
-    # We accumulate a new acceleration each time based on three rules
-    def flock (self, boids) :
-        sep = self.separate(boids); # Separation
-        ali = self.align(boids);    # Alignment
-        coh = self.cohesion(boids); # Cohesion
-        # Arbitrarily weight these forces
-        sep.mult(2.5);
-        ali.mult(1.0);
-        coh.mult(1.0);
-        # Add the force vectors to acceleration
-        self.applyForce(sep);
-        self.applyForce(ali);
-        self.applyForce(coh);
-
-    # Method to update location
-    def update (self) :
-        # Update velocity
-        self.velocity.add(self.acceleration);
-        # Limit speed
-        self.velocity.limit(self.maxspeed);
-        self.position.add(self.velocity);
-        # Reset acceleration to 0 each cycle
-        self.acceleration.mult(0);
-
-    # A method that calculates and applies a steering force towards a target
-    # STEER = DESIRED MINUS VELOCITY
-    def seek (self,target):
-        desired = p5.Vector.sub(target, self.position); # A vector pointing from the location to the target
-        # Normalize desired and scale to maximum speed
-        desired.normalize();
-        desired.mult(self.maxspeed);
-        # Steering = Desired minus Velocity
-        steer = p5.Vector.sub(desired, self.velocity);
-        steer.limit(self.maxforce); # Limit to maximum steering force
-        return steer;
-
-    # Draw boid as a circle
-    def render (self) :
-        fill(127, 127);
-        stroke(200);
-        ellipse(self.position.x, self.position.y, 16, 16);
-
-    # Wraparound
-    def borders (self) :
-        if (self.position.x < -self.r): self.position.x = width + self.r;
-        if (self.position.y < -self.r): self.position.y = height + self.r;
-        if (self.position.x > width + self.r): self.position.x = -self.r;
-        if (self.position.y > height + self.r): self.position.y = -self.r;
-
-
-    # Separation
-    # Method checks for nearby boids and steers away
-    def separate (self, boids) :
-        desiredseparation = 25.0;
-        steer = createVector(0, 0);
-        count = 0;
-        # For every boid in the system, check if it's too close
-        for i in range(len(boids)):
-            d = p5.Vector.dist(self.position, boids[i].position);
-            # If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)
-            if ((d > 0) and (d < desiredseparation)) :
-              # Calculate vector pointing away from neighbor
-              diff = p5.Vector.sub(self.position, boids[i].position);
-              diff.normalize();
-              diff.div(d); # Weight by distance
-              steer.add(diff);
-              count+=1; # Keep track of how many
-        # Average -- divide by how many
-        if (count > 0) :
-            steer.div(count);
-
-
-        # As long as the vector is greater than 0
-        if (steer.mag() > 0) :
-            # Implement Reynolds: Steering = Desired - Velocity
-            steer.normalize();
-            steer.mult(self.maxspeed);
-            steer.sub(self.velocity);
-            steer.limit(self.maxforce);
-
-        return steer;
-
-
-    # Alignment
-    # For every nearby boid in the system, calculate the average velocity
-    def align (self, boids) :
-      neighbordist = 50;
-      sum = createVector(0, 0);
-      count = 0;
-      for i in range(len(boids)):
-        d = p5.Vector.dist(self.position, boids[i].position);
-        if ((d > 0) and (d < neighbordist)) :
-          sum.add(boids[i].velocity);
-          count+=1;
-
-      if (count > 0) :
-        sum.div(count);
-        sum.normalize();
-        sum.mult(self.maxspeed);
-        steer = p5.Vector.sub(sum, self.velocity);
-        steer.limit(self.maxforce);
-        return steer;
-      else:
-        return createVector(0, 0);
-
-    # Cohesion
-    # For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location
-    def cohesion  (self, boids) :
-      neighbordist = 50;
-      sum = createVector(0, 0); # Start with empty vector to accumulate all locations
-      count = 0;
-      for i in range(len(boids)):
-        d = p5.Vector.dist(self.position, boids[i].position);
-        if ((d > 0) and (d < neighbordist)) :
-          sum.add(boids[i].position); # Add location
-          count+=1;
-
-      if (count > 0) :
-        sum.div(count);
-        return self.seek(sum); # Steer towards the location
-      else:
-        return createVector(0, 0);
diff --git a/docs/examples/transcrypt/sketch_004/target/target_sketch.js b/docs/examples/transcrypt/sketch_004/target/target_sketch.js
index d23e3f96..1e0f9286 100644
--- a/docs/examples/transcrypt/sketch_004/target/target_sketch.js
+++ b/docs/examples/transcrypt/sketch_004/target/target_sketch.js
@@ -1,9 +1,367 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:34
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-import * as source_sketch from './sketch_004.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:19
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
 var __name__ = '__main__';
-export var event_functions = dict ([['deviceMoved', source_sketch.deviceMoved], ['deviceTurned', source_sketch.deviceTurned], ['deviceShaken', source_sketch.deviceShaken], ['keyPressed', source_sketch.keyPressed], ['keyReleased', source_sketch.keyReleased], ['keyTyped', source_sketch.keyTyped], ['mouseMoved', source_sketch.mouseMoved], ['mouseDragged', source_sketch.mouseDragged], ['mousePressed', source_sketch.mousePressed], ['mouseReleased', source_sketch.mouseReleased], ['mouseClicked', source_sketch.mouseClicked], ['doubleClicked', source_sketch.doubleClicked], ['mouseWheel', source_sketch.mouseWheel], ['touchStarted', source_sketch.touchStarted], ['touchMoved', source_sketch.touchMoved], ['touchEnded', source_sketch.touchEnded], ['windowResized', source_sketch.windowResized]]);
-start_p5 (source_sketch.setup, source_sketch.draw, event_functions);
+export var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var deviceMoved = null;
+export var deviceTurned = null;
+export var deviceShaken = null;
+export var keyPressed = null;
+export var keyReleased = null;
+export var keyTyped = null;
+export var mouseMoved = null;
+export var mouseDragged = null;
+export var mousePressed = null;
+export var mouseReleased = null;
+export var mouseClicked = null;
+export var doubleClicked = null;
+export var mouseWheel = null;
+export var touchStarted = null;
+export var touchMoved = null;
+export var touchEnded = null;
+export var windowResized = null;
+export var boids = [];
+var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	createCanvas (720, 400);
+	for (var i = 0; i < 40; i++) {
+		boids.append (Boid (random (720), random (400)));
+	}
+};
+var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	background (51);
+	for (var boid of boids) {
+		boid.run (boids);
+	}
+};
+export var Boid =  __class__ ('Boid', [object], {
+	__module__: __name__,
+	get __init__ () {return __get__ (this, function (self, x, y) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+						case 'x': var x = __allkwargs0__ [__attrib0__]; break;
+						case 'y': var y = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		self.acceleration = createVector (0, 0);
+		self.velocity = p5.Vector.random2D ();
+		self.position = createVector (x, y);
+		self.r = 3.0;
+		self.maxspeed = 3;
+		self.maxforce = 0.05;
+	});},
+	get run () {return __get__ (this, function (self, boids) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+						case 'boids': var boids = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		self.flock (boids);
+		self.py_update ();
+		self.borders ();
+		self.render ();
+	});},
+	get applyForce () {return __get__ (this, function (self, force) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+						case 'force': var force = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		self.acceleration.add (force);
+	});},
+	get flock () {return __get__ (this, function (self, boids) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+						case 'boids': var boids = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		var sep = self.separate (boids);
+		var ali = self.align (boids);
+		var coh = self.cohesion (boids);
+		sep.mult (2.5);
+		ali.mult (1.0);
+		coh.mult (1.0);
+		self.applyForce (sep);
+		self.applyForce (ali);
+		self.applyForce (coh);
+	});},
+	get py_update () {return __get__ (this, function (self) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		self.velocity.add (self.acceleration);
+		self.velocity.limit (self.maxspeed);
+		self.position.add (self.velocity);
+		self.acceleration.mult (0);
+	});},
+	get seek () {return __get__ (this, function (self, target) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+						case 'target': var target = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		var desired = p5.Vector.sub (target, self.position);
+		desired.normalize ();
+		desired.mult (self.maxspeed);
+		var steer = p5.Vector.sub (desired, self.velocity);
+		steer.limit (self.maxforce);
+		return steer;
+	});},
+	get render () {return __get__ (this, function (self) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		fill (127, 127);
+		stroke (200);
+		ellipse (self.position.x, self.position.y, 16, 16);
+	});},
+	get borders () {return __get__ (this, function (self) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		if (self.position.x < -(self.r)) {
+			self.position.x = width + self.r;
+		}
+		if (self.position.y < -(self.r)) {
+			self.position.y = height + self.r;
+		}
+		if (self.position.x > width + self.r) {
+			self.position.x = -(self.r);
+		}
+		if (self.position.y > height + self.r) {
+			self.position.y = -(self.r);
+		}
+	});},
+	get separate () {return __get__ (this, function (self, boids) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+						case 'boids': var boids = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		var desiredseparation = 25.0;
+		var steer = createVector (0, 0);
+		var count = 0;
+		for (var i = 0; i < len (boids); i++) {
+			var d = p5.Vector.dist (self.position, boids [i].position);
+			if (d > 0 && d < desiredseparation) {
+				var diff = p5.Vector.sub (self.position, boids [i].position);
+				diff.normalize ();
+				diff.div (d);
+				steer.add (diff);
+				count++;
+			}
+		}
+		if (count > 0) {
+			steer.div (count);
+		}
+		if (steer.mag () > 0) {
+			steer.normalize ();
+			steer.mult (self.maxspeed);
+			steer.sub (self.velocity);
+			steer.limit (self.maxforce);
+		}
+		return steer;
+	});},
+	get align () {return __get__ (this, function (self, boids) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+						case 'boids': var boids = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		var neighbordist = 50;
+		var sum = createVector (0, 0);
+		var count = 0;
+		for (var i = 0; i < len (boids); i++) {
+			var d = p5.Vector.dist (self.position, boids [i].position);
+			if (d > 0 && d < neighbordist) {
+				sum.add (boids [i].velocity);
+				count++;
+			}
+		}
+		if (count > 0) {
+			sum.div (count);
+			sum.normalize ();
+			sum.mult (self.maxspeed);
+			var steer = p5.Vector.sub (sum, self.velocity);
+			steer.limit (self.maxforce);
+			return steer;
+		}
+		else {
+			return createVector (0, 0);
+		}
+	});},
+	get cohesion () {return __get__ (this, function (self, boids) {
+		if (arguments.length) {
+			var __ilastarg0__ = arguments.length - 1;
+			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+				var __allkwargs0__ = arguments [__ilastarg0__--];
+				for (var __attrib0__ in __allkwargs0__) {
+					switch (__attrib0__) {
+						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
+						case 'boids': var boids = __allkwargs0__ [__attrib0__]; break;
+					}
+				}
+			}
+		}
+		else {
+		}
+		var neighbordist = 50;
+		var sum = createVector (0, 0);
+		var count = 0;
+		for (var i = 0; i < len (boids); i++) {
+			var d = p5.Vector.dist (self.position, boids [i].position);
+			if (d > 0 && d < neighbordist) {
+				sum.add (boids [i].position);
+				count++;
+			}
+		}
+		if (count > 0) {
+			sum.div (count);
+			return self.seek (sum);
+		}
+		else {
+			return createVector (0, 0);
+		}
+	});}
+});
+export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized});
+start_p5 (setup, draw, event_functions);
 
 //# sourceMappingURL=target_sketch.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_004/target/target_sketch.project b/docs/examples/transcrypt/sketch_004/target/target_sketch.project
index a1774970..b5ce1549 100644
--- a/docs/examples/transcrypt/sketch_004/target/target_sketch.project
+++ b/docs/examples/transcrypt/sketch_004/target/target_sketch.project
@@ -1 +1 @@
-{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/sketch_004.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/sketch_004.js"}]}
\ No newline at end of file
+{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_004/__target__/python_functions.js"}]}
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_004/target/target_sketch.py b/docs/examples/transcrypt/sketch_004/target/target_sketch.py
index a993286f..aae72bb0 100644
--- a/docs/examples/transcrypt/sketch_004/target/target_sketch.py
+++ b/docs/examples/transcrypt/sketch_004/target/target_sketch.py
@@ -1,24 +1,213 @@
-import sketch_004 as source_sketch
 from pyp5js import *
 
+def setup():
+    pass
+
+def draw():
+    pass
+
+deviceMoved = None
+deviceTurned = None
+deviceShaken = None
+keyPressed = None
+keyReleased = None
+keyTyped = None
+mouseMoved = None
+mouseDragged = None
+mousePressed = None
+mouseReleased = None
+mouseClicked = None
+doubleClicked = None
+mouseWheel = None
+touchStarted = None
+touchMoved = None
+touchEnded = None
+windowResized = None
+
+
+# From Prof. Claudio Esperança examples for BrythonIDE
+# https://github.com/esperanc/brythonide/blob/master/demoSketches/boids.py
+
+boids = [];
+
+def setup() :
+  createCanvas(720, 400);
+
+  # Add an initial set of boids into the system
+  for i in range(40):
+    boids.append (Boid(random(720), random(400)))
+
+def draw() :
+  background(51);
+  # Run all the boids
+  for boid in boids: boid.run(boids)
+
+
+# Boid class
+# Methods for Separation, Cohesion, Alignment added
+class Boid (object):
+
+    def __init__(self, x, y) :
+        self.acceleration = createVector(0, 0);
+        self.velocity = p5.Vector.random2D();
+        self.position = createVector(x, y);
+        self.r = 3.0;
+        self.maxspeed = 3;    # Maximum speed
+        self.maxforce = 0.05; # Maximum steering force
+
+    def run (self, boids):
+        self.flock(boids);
+        self.update();
+        self.borders();
+        self.render();
+
+    # Forces go into acceleration
+    def applyForce (self,force):
+        self.acceleration.add(force);
+
+    # We accumulate a new acceleration each time based on three rules
+    def flock (self, boids) :
+        sep = self.separate(boids); # Separation
+        ali = self.align(boids);    # Alignment
+        coh = self.cohesion(boids); # Cohesion
+        # Arbitrarily weight these forces
+        sep.mult(2.5);
+        ali.mult(1.0);
+        coh.mult(1.0);
+        # Add the force vectors to acceleration
+        self.applyForce(sep);
+        self.applyForce(ali);
+        self.applyForce(coh);
+
+    # Method to update location
+    def update (self) :
+        # Update velocity
+        self.velocity.add(self.acceleration);
+        # Limit speed
+        self.velocity.limit(self.maxspeed);
+        self.position.add(self.velocity);
+        # Reset acceleration to 0 each cycle
+        self.acceleration.mult(0);
+
+    # A method that calculates and applies a steering force towards a target
+    # STEER = DESIRED MINUS VELOCITY
+    def seek (self,target):
+        desired = p5.Vector.sub(target, self.position); # A vector pointing from the location to the target
+        # Normalize desired and scale to maximum speed
+        desired.normalize();
+        desired.mult(self.maxspeed);
+        # Steering = Desired minus Velocity
+        steer = p5.Vector.sub(desired, self.velocity);
+        steer.limit(self.maxforce); # Limit to maximum steering force
+        return steer;
+
+    # Draw boid as a circle
+    def render (self) :
+        fill(127, 127);
+        stroke(200);
+        ellipse(self.position.x, self.position.y, 16, 16);
+
+    # Wraparound
+    def borders (self) :
+        if (self.position.x < -self.r): self.position.x = width + self.r;
+        if (self.position.y < -self.r): self.position.y = height + self.r;
+        if (self.position.x > width + self.r): self.position.x = -self.r;
+        if (self.position.y > height + self.r): self.position.y = -self.r;
+
+
+    # Separation
+    # Method checks for nearby boids and steers away
+    def separate (self, boids) :
+        desiredseparation = 25.0;
+        steer = createVector(0, 0);
+        count = 0;
+        # For every boid in the system, check if it's too close
+        for i in range(len(boids)):
+            d = p5.Vector.dist(self.position, boids[i].position);
+            # If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself)
+            if ((d > 0) and (d < desiredseparation)) :
+              # Calculate vector pointing away from neighbor
+              diff = p5.Vector.sub(self.position, boids[i].position);
+              diff.normalize();
+              diff.div(d); # Weight by distance
+              steer.add(diff);
+              count+=1; # Keep track of how many
+        # Average -- divide by how many
+        if (count > 0) :
+            steer.div(count);
+
+
+        # As long as the vector is greater than 0
+        if (steer.mag() > 0) :
+            # Implement Reynolds: Steering = Desired - Velocity
+            steer.normalize();
+            steer.mult(self.maxspeed);
+            steer.sub(self.velocity);
+            steer.limit(self.maxforce);
+
+        return steer;
+
+
+    # Alignment
+    # For every nearby boid in the system, calculate the average velocity
+    def align (self, boids) :
+      neighbordist = 50;
+      sum = createVector(0, 0);
+      count = 0;
+      for i in range(len(boids)):
+        d = p5.Vector.dist(self.position, boids[i].position);
+        if ((d > 0) and (d < neighbordist)) :
+          sum.add(boids[i].velocity);
+          count+=1;
+
+      if (count > 0) :
+        sum.div(count);
+        sum.normalize();
+        sum.mult(self.maxspeed);
+        steer = p5.Vector.sub(sum, self.velocity);
+        steer.limit(self.maxforce);
+        return steer;
+      else:
+        return createVector(0, 0);
+
+    # Cohesion
+    # For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location
+    def cohesion  (self, boids) :
+      neighbordist = 50;
+      sum = createVector(0, 0); # Start with empty vector to accumulate all locations
+      count = 0;
+      for i in range(len(boids)):
+        d = p5.Vector.dist(self.position, boids[i].position);
+        if ((d > 0) and (d < neighbordist)) :
+          sum.add(boids[i].position); # Add location
+          count+=1;
+
+      if (count > 0) :
+        sum.div(count);
+        return self.seek(sum); # Steer towards the location
+      else:
+        return createVector(0, 0);
+
+
+
 event_functions = {
-    "deviceMoved": source_sketch.deviceMoved,
-    "deviceTurned": source_sketch.deviceTurned,
-    "deviceShaken": source_sketch.deviceShaken,
-    "keyPressed": source_sketch.keyPressed,
-    "keyReleased": source_sketch.keyReleased,
-    "keyTyped": source_sketch.keyTyped,
-    "mouseMoved": source_sketch.mouseMoved,
-    "mouseDragged": source_sketch.mouseDragged,
-    "mousePressed": source_sketch.mousePressed,
-    "mouseReleased": source_sketch.mouseReleased,
-    "mouseClicked": source_sketch.mouseClicked,
-    "doubleClicked": source_sketch.doubleClicked,
-    "mouseWheel": source_sketch.mouseWheel,
-    "touchStarted": source_sketch.touchStarted,
-    "touchMoved": source_sketch.touchMoved,
-    "touchEnded": source_sketch.touchEnded,
-    "windowResized": source_sketch.windowResized,
+    "deviceMoved": deviceMoved,
+    "deviceTurned": deviceTurned,
+    "deviceShaken": deviceShaken,
+    "keyPressed": keyPressed,
+    "keyReleased": keyReleased,
+    "keyTyped": keyTyped,
+    "mouseMoved": mouseMoved,
+    "mouseDragged": mouseDragged,
+    "mousePressed": mousePressed,
+    "mouseReleased": mouseReleased,
+    "mouseClicked": mouseClicked,
+    "doubleClicked": doubleClicked,
+    "mouseWheel": mouseWheel,
+    "touchStarted": touchStarted,
+    "touchMoved": touchMoved,
+    "touchEnded": touchEnded,
+    "windowResized": windowResized,
 }
 
-start_p5(source_sketch.setup, source_sketch.draw, event_functions)
\ No newline at end of file
+start_p5(setup, draw, event_functions)
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_005/index.html b/docs/examples/transcrypt/sketch_005/index.html
index 9efd0fe2..d0a08c00 100644
--- a/docs/examples/transcrypt/sketch_005/index.html
+++ b/docs/examples/transcrypt/sketch_005/index.html
@@ -47,9 +47,6 @@
         
              
-from pyp5js import *
-
-
 def setup():
     createCanvas(600,600)
     noStroke()
diff --git a/docs/examples/transcrypt/sketch_005/sketch_005.py b/docs/examples/transcrypt/sketch_005/sketch_005.py
index 2dfca4be..997fb196 100644
--- a/docs/examples/transcrypt/sketch_005/sketch_005.py
+++ b/docs/examples/transcrypt/sketch_005/sketch_005.py
@@ -1,6 +1,3 @@
-from pyp5js import *
-
-
 def setup():
     createCanvas(600,600)
     noStroke()
diff --git a/docs/examples/transcrypt/sketch_005/target/org.transcrypt.__runtime__.js b/docs/examples/transcrypt/sketch_005/target/org.transcrypt.__runtime__.js
index f9dbe647..f58efad8 100644
--- a/docs/examples/transcrypt/sketch_005/target/org.transcrypt.__runtime__.js
+++ b/docs/examples/transcrypt/sketch_005/target/org.transcrypt.__runtime__.js
@@ -1,10 +1,10 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:35
+// Transcrypt'ed from Python, 2021-10-14 12:26:21
 var __name__ = 'org.transcrypt.__runtime__';
 export var __envir__ = {};
 __envir__.interpreter_name = 'python';
 __envir__.transpiler_name = 'transcrypt';
 __envir__.executor_name = __envir__.transpiler_name;
-__envir__.transpiler_version = '3.7.16';
+__envir__.transpiler_version = '3.9.0';
 
 export function __nest__ (headObject, tailNames, value) {
     var current = headObject;
@@ -38,15 +38,14 @@ export function __init__ (module) {
     }
     return module.__all__;
 };
-export var __proxy__ = false;
-export function __get__ (self, func, quotedFuncName) {
-    if (self) {
-        if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) {
+export function __get__ (aThis, func, quotedFuncName) {
+    if (aThis) {
+        if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) {
             if (quotedFuncName) {
-                Object.defineProperty (self, quotedFuncName, {
+                Object.defineProperty (aThis, quotedFuncName, {
                     value: function () {
                         var args = [] .slice.apply (arguments);
-                        return func.apply (null, [self] .concat (args));
+                        return func.apply (null, [aThis] .concat (args));
                     },
                     writable: true,
                     enumerable: true,
@@ -55,7 +54,7 @@ export function __get__ (self, func, quotedFuncName) {
             }
             return function () {
                 var args = [] .slice.apply (arguments);
-                return func.apply (null, [self] .concat (args));
+                return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args));
             };
         }
         else {
@@ -66,21 +65,21 @@ export function __get__ (self, func, quotedFuncName) {
         return func;
     }
 };
-export function __getcm__ (self, func, quotedFuncName) {
-    if (self.hasOwnProperty ('__class__')) {
+export function __getcm__ (aThis, func, quotedFuncName) {
+    if (aThis.hasOwnProperty ('__class__')) {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self.__class__] .concat (args));
+            return func.apply (null, [aThis.__class__] .concat (args));
         };
     }
     else {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self] .concat (args));
+            return func.apply (null, [aThis] .concat (args));
         };
     }
 };
-export function __getsm__ (self, func, quotedFuncName) {
+export function __getsm__ (aThis, func, quotedFuncName) {
     return func;
 };
 export var py_metatype = {
@@ -95,6 +94,9 @@ export var py_metatype = {
             var base = bases [index];
             for (var attrib in base) {
                 var descrip = Object.getOwnPropertyDescriptor (base, attrib);
+                if (descrip == null) {
+                    continue;
+                }
                 Object.defineProperty (cls, attrib, descrip);
             }
             for (let symbol of Object.getOwnPropertySymbols (base)) {
@@ -125,7 +127,7 @@ export var object = {
     __new__: function (args) {
         var instance = Object.create (this, {__class__: {value: this, enumerable: true}});
         if ('__getattr__' in this || '__setattr__' in this) {
-            instance = new Proxy (instance, {
+            instance.__proxy__ = new Proxy (instance, {
                 get: function (target, name) {
                     let result = target [name];
                     if (result == undefined) {
@@ -145,6 +147,7 @@ export var object = {
                     return true;
                 }
             })
+			instance = instance.__proxy__
         }
         this.__init__.apply (null, [instance] .concat (args));
         return instance;
@@ -1830,10 +1833,13 @@ export var Exception =  __class__ ('Exception', [BaseException], {
 			var args = tuple ();
 		}
 		self.__args__ = args;
-		try {
+		if (kwargs.error != null) {
 			self.stack = kwargs.error.stack;
 		}
-		catch (__except0__) {
+		else if (Error) {
+			self.stack = new Error ().stack;
+		}
+		else {
 			self.stack = 'No stack trace available';
 		}
 	});},
diff --git a/docs/examples/transcrypt/sketch_005/target/org.transcrypt.__runtime__.py b/docs/examples/transcrypt/sketch_005/target/org.transcrypt.__runtime__.py
index 87834491..8b06f7ba 100644
--- a/docs/examples/transcrypt/sketch_005/target/org.transcrypt.__runtime__.py
+++ b/docs/examples/transcrypt/sketch_005/target/org.transcrypt.__runtime__.py
@@ -19,9 +19,11 @@ class Exception (BaseException):
     #__pragma__ ('kwargs')
     def __init__ (self, *args, **kwargs):
         self.__args__ = args
-        try:
+        if kwargs.error != None:
             self.stack = kwargs.error.stack # Integrate with JavaScript Error object
-        except:
+        elif Error:
+            self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one
+        else:
             self.stack = 'No stack trace available'
     #__pragma__ ('nokwargs')
         
diff --git a/docs/examples/transcrypt/sketch_005/target/pyp5js.js b/docs/examples/transcrypt/sketch_005/target/pyp5js.js
index 6d6a26be..6ce11a86 100644
--- a/docs/examples/transcrypt/sketch_005/target/pyp5js.js
+++ b/docs/examples/transcrypt/sketch_005/target/pyp5js.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:35
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:21
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 import {PythonFunctions} from './python_functions.js';
 var __name__ = 'pyp5js';
 export var _P5_INSTANCE = null;
diff --git a/docs/examples/transcrypt/sketch_005/target/python_functions.js b/docs/examples/transcrypt/sketch_005/target/python_functions.js
index 3921fc73..6958e35e 100644
--- a/docs/examples/transcrypt/sketch_005/target/python_functions.js
+++ b/docs/examples/transcrypt/sketch_005/target/python_functions.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:35
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:22
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 var __name__ = 'python_functions';
 export var PythonFunctions =  __class__ ('PythonFunctions', [object], {
 	__module__: __name__,
diff --git a/docs/examples/transcrypt/sketch_005/target/sketch_005.js b/docs/examples/transcrypt/sketch_005/target/sketch_005.js
deleted file mode 100644
index 08a0cb5c..00000000
--- a/docs/examples/transcrypt/sketch_005/target/sketch_005.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:36
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-var __name__ = 'sketch_005';
-export var setup = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	createCanvas (600, 600);
-	noStroke ();
-	rectMode (CENTER);
-};
-export var draw = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	colorMode (HSB, 100);
-	var h = map (mouseY, 0, 600, 0, 100);
-	background (h, 100, 100);
-	fill (100 - h, 100, 100);
-	rect (300, 300, mouseX + 1, mouseX + 1);
-};
-
-//# sourceMappingURL=sketch_005.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_005/target/sketch_005.py b/docs/examples/transcrypt/sketch_005/target/sketch_005.py
deleted file mode 100644
index 2dfca4be..00000000
--- a/docs/examples/transcrypt/sketch_005/target/sketch_005.py
+++ /dev/null
@@ -1,15 +0,0 @@
-from pyp5js import *
-
-
-def setup():
-    createCanvas(600,600)
-    noStroke()
-    rectMode(CENTER)
-
-
-def draw():
-    colorMode(HSB,100)
-    h = map(mouseY,0,600,0,100)
-    background(h,100,100)
-    fill(100-h,100,100)
-    rect(300,300,mouseX+1,mouseX+1)
diff --git a/docs/examples/transcrypt/sketch_005/target/target_sketch.js b/docs/examples/transcrypt/sketch_005/target/target_sketch.js
index 6d17df34..a575c641 100644
--- a/docs/examples/transcrypt/sketch_005/target/target_sketch.js
+++ b/docs/examples/transcrypt/sketch_005/target/target_sketch.js
@@ -1,9 +1,83 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:35
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-import * as source_sketch from './sketch_005.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:21
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
 var __name__ = '__main__';
-export var event_functions = dict ([['deviceMoved', source_sketch.deviceMoved], ['deviceTurned', source_sketch.deviceTurned], ['deviceShaken', source_sketch.deviceShaken], ['keyPressed', source_sketch.keyPressed], ['keyReleased', source_sketch.keyReleased], ['keyTyped', source_sketch.keyTyped], ['mouseMoved', source_sketch.mouseMoved], ['mouseDragged', source_sketch.mouseDragged], ['mousePressed', source_sketch.mousePressed], ['mouseReleased', source_sketch.mouseReleased], ['mouseClicked', source_sketch.mouseClicked], ['doubleClicked', source_sketch.doubleClicked], ['mouseWheel', source_sketch.mouseWheel], ['touchStarted', source_sketch.touchStarted], ['touchMoved', source_sketch.touchMoved], ['touchEnded', source_sketch.touchEnded], ['windowResized', source_sketch.windowResized]]);
-start_p5 (source_sketch.setup, source_sketch.draw, event_functions);
+export var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var deviceMoved = null;
+export var deviceTurned = null;
+export var deviceShaken = null;
+export var keyPressed = null;
+export var keyReleased = null;
+export var keyTyped = null;
+export var mouseMoved = null;
+export var mouseDragged = null;
+export var mousePressed = null;
+export var mouseReleased = null;
+export var mouseClicked = null;
+export var doubleClicked = null;
+export var mouseWheel = null;
+export var touchStarted = null;
+export var touchMoved = null;
+export var touchEnded = null;
+export var windowResized = null;
+var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	createCanvas (600, 600);
+	noStroke ();
+	rectMode (CENTER);
+};
+var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	colorMode (HSB, 100);
+	var h = map (mouseY, 0, 600, 0, 100);
+	background (h, 100, 100);
+	fill (100 - h, 100, 100);
+	rect (300, 300, mouseX + 1, mouseX + 1);
+};
+export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized});
+start_p5 (setup, draw, event_functions);
 
 //# sourceMappingURL=target_sketch.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_005/target/target_sketch.project b/docs/examples/transcrypt/sketch_005/target/target_sketch.project
index c101292d..e0bfda90 100644
--- a/docs/examples/transcrypt/sketch_005/target/target_sketch.project
+++ b/docs/examples/transcrypt/sketch_005/target/target_sketch.project
@@ -1 +1 @@
-{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/sketch_005.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/sketch_005.js"}]}
\ No newline at end of file
+{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_005/__target__/python_functions.js"}]}
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_005/target/target_sketch.py b/docs/examples/transcrypt/sketch_005/target/target_sketch.py
index b0eb7670..c0de17b6 100644
--- a/docs/examples/transcrypt/sketch_005/target/target_sketch.py
+++ b/docs/examples/transcrypt/sketch_005/target/target_sketch.py
@@ -1,24 +1,63 @@
-import sketch_005 as source_sketch
 from pyp5js import *
 
+def setup():
+    pass
+
+def draw():
+    pass
+
+deviceMoved = None
+deviceTurned = None
+deviceShaken = None
+keyPressed = None
+keyReleased = None
+keyTyped = None
+mouseMoved = None
+mouseDragged = None
+mousePressed = None
+mouseReleased = None
+mouseClicked = None
+doubleClicked = None
+mouseWheel = None
+touchStarted = None
+touchMoved = None
+touchEnded = None
+windowResized = None
+
+
+def setup():
+    createCanvas(600,600)
+    noStroke()
+    rectMode(CENTER)
+
+
+def draw():
+    colorMode(HSB,100)
+    h = map(mouseY,0,600,0,100)
+    background(h,100,100)
+    fill(100-h,100,100)
+    rect(300,300,mouseX+1,mouseX+1)
+
+
+
 event_functions = {
-    "deviceMoved": source_sketch.deviceMoved,
-    "deviceTurned": source_sketch.deviceTurned,
-    "deviceShaken": source_sketch.deviceShaken,
-    "keyPressed": source_sketch.keyPressed,
-    "keyReleased": source_sketch.keyReleased,
-    "keyTyped": source_sketch.keyTyped,
-    "mouseMoved": source_sketch.mouseMoved,
-    "mouseDragged": source_sketch.mouseDragged,
-    "mousePressed": source_sketch.mousePressed,
-    "mouseReleased": source_sketch.mouseReleased,
-    "mouseClicked": source_sketch.mouseClicked,
-    "doubleClicked": source_sketch.doubleClicked,
-    "mouseWheel": source_sketch.mouseWheel,
-    "touchStarted": source_sketch.touchStarted,
-    "touchMoved": source_sketch.touchMoved,
-    "touchEnded": source_sketch.touchEnded,
-    "windowResized": source_sketch.windowResized,
+    "deviceMoved": deviceMoved,
+    "deviceTurned": deviceTurned,
+    "deviceShaken": deviceShaken,
+    "keyPressed": keyPressed,
+    "keyReleased": keyReleased,
+    "keyTyped": keyTyped,
+    "mouseMoved": mouseMoved,
+    "mouseDragged": mouseDragged,
+    "mousePressed": mousePressed,
+    "mouseReleased": mouseReleased,
+    "mouseClicked": mouseClicked,
+    "doubleClicked": doubleClicked,
+    "mouseWheel": mouseWheel,
+    "touchStarted": touchStarted,
+    "touchMoved": touchMoved,
+    "touchEnded": touchEnded,
+    "windowResized": windowResized,
 }
 
-start_p5(source_sketch.setup, source_sketch.draw, event_functions)
\ No newline at end of file
+start_p5(setup, draw, event_functions)
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_006/index.html b/docs/examples/transcrypt/sketch_006/index.html
index 4a5b9153..37e62842 100644
--- a/docs/examples/transcrypt/sketch_006/index.html
+++ b/docs/examples/transcrypt/sketch_006/index.html
@@ -47,8 +47,6 @@
         
              
-from pyp5js import *
-
 r = None
 def setup():
     global r
diff --git a/docs/examples/transcrypt/sketch_006/sketch_006.py b/docs/examples/transcrypt/sketch_006/sketch_006.py
index c005162a..ca879b0e 100644
--- a/docs/examples/transcrypt/sketch_006/sketch_006.py
+++ b/docs/examples/transcrypt/sketch_006/sketch_006.py
@@ -1,5 +1,3 @@
-from pyp5js import *
-
 r = None
 def setup():
     global r
diff --git a/docs/examples/transcrypt/sketch_006/target/org.transcrypt.__runtime__.js b/docs/examples/transcrypt/sketch_006/target/org.transcrypt.__runtime__.js
index d9572b6e..533516c6 100644
--- a/docs/examples/transcrypt/sketch_006/target/org.transcrypt.__runtime__.js
+++ b/docs/examples/transcrypt/sketch_006/target/org.transcrypt.__runtime__.js
@@ -1,10 +1,10 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:36
+// Transcrypt'ed from Python, 2021-10-14 12:26:23
 var __name__ = 'org.transcrypt.__runtime__';
 export var __envir__ = {};
 __envir__.interpreter_name = 'python';
 __envir__.transpiler_name = 'transcrypt';
 __envir__.executor_name = __envir__.transpiler_name;
-__envir__.transpiler_version = '3.7.16';
+__envir__.transpiler_version = '3.9.0';
 
 export function __nest__ (headObject, tailNames, value) {
     var current = headObject;
@@ -38,15 +38,14 @@ export function __init__ (module) {
     }
     return module.__all__;
 };
-export var __proxy__ = false;
-export function __get__ (self, func, quotedFuncName) {
-    if (self) {
-        if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) {
+export function __get__ (aThis, func, quotedFuncName) {
+    if (aThis) {
+        if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) {
             if (quotedFuncName) {
-                Object.defineProperty (self, quotedFuncName, {
+                Object.defineProperty (aThis, quotedFuncName, {
                     value: function () {
                         var args = [] .slice.apply (arguments);
-                        return func.apply (null, [self] .concat (args));
+                        return func.apply (null, [aThis] .concat (args));
                     },
                     writable: true,
                     enumerable: true,
@@ -55,7 +54,7 @@ export function __get__ (self, func, quotedFuncName) {
             }
             return function () {
                 var args = [] .slice.apply (arguments);
-                return func.apply (null, [self] .concat (args));
+                return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args));
             };
         }
         else {
@@ -66,21 +65,21 @@ export function __get__ (self, func, quotedFuncName) {
         return func;
     }
 };
-export function __getcm__ (self, func, quotedFuncName) {
-    if (self.hasOwnProperty ('__class__')) {
+export function __getcm__ (aThis, func, quotedFuncName) {
+    if (aThis.hasOwnProperty ('__class__')) {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self.__class__] .concat (args));
+            return func.apply (null, [aThis.__class__] .concat (args));
         };
     }
     else {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self] .concat (args));
+            return func.apply (null, [aThis] .concat (args));
         };
     }
 };
-export function __getsm__ (self, func, quotedFuncName) {
+export function __getsm__ (aThis, func, quotedFuncName) {
     return func;
 };
 export var py_metatype = {
@@ -95,6 +94,9 @@ export var py_metatype = {
             var base = bases [index];
             for (var attrib in base) {
                 var descrip = Object.getOwnPropertyDescriptor (base, attrib);
+                if (descrip == null) {
+                    continue;
+                }
                 Object.defineProperty (cls, attrib, descrip);
             }
             for (let symbol of Object.getOwnPropertySymbols (base)) {
@@ -125,7 +127,7 @@ export var object = {
     __new__: function (args) {
         var instance = Object.create (this, {__class__: {value: this, enumerable: true}});
         if ('__getattr__' in this || '__setattr__' in this) {
-            instance = new Proxy (instance, {
+            instance.__proxy__ = new Proxy (instance, {
                 get: function (target, name) {
                     let result = target [name];
                     if (result == undefined) {
@@ -145,6 +147,7 @@ export var object = {
                     return true;
                 }
             })
+			instance = instance.__proxy__
         }
         this.__init__.apply (null, [instance] .concat (args));
         return instance;
@@ -1830,10 +1833,13 @@ export var Exception =  __class__ ('Exception', [BaseException], {
 			var args = tuple ();
 		}
 		self.__args__ = args;
-		try {
+		if (kwargs.error != null) {
 			self.stack = kwargs.error.stack;
 		}
-		catch (__except0__) {
+		else if (Error) {
+			self.stack = new Error ().stack;
+		}
+		else {
 			self.stack = 'No stack trace available';
 		}
 	});},
diff --git a/docs/examples/transcrypt/sketch_006/target/org.transcrypt.__runtime__.py b/docs/examples/transcrypt/sketch_006/target/org.transcrypt.__runtime__.py
index 87834491..8b06f7ba 100644
--- a/docs/examples/transcrypt/sketch_006/target/org.transcrypt.__runtime__.py
+++ b/docs/examples/transcrypt/sketch_006/target/org.transcrypt.__runtime__.py
@@ -19,9 +19,11 @@ class Exception (BaseException):
     #__pragma__ ('kwargs')
     def __init__ (self, *args, **kwargs):
         self.__args__ = args
-        try:
+        if kwargs.error != None:
             self.stack = kwargs.error.stack # Integrate with JavaScript Error object
-        except:
+        elif Error:
+            self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one
+        else:
             self.stack = 'No stack trace available'
     #__pragma__ ('nokwargs')
         
diff --git a/docs/examples/transcrypt/sketch_006/target/pyp5js.js b/docs/examples/transcrypt/sketch_006/target/pyp5js.js
index c4704f93..400d8b0e 100644
--- a/docs/examples/transcrypt/sketch_006/target/pyp5js.js
+++ b/docs/examples/transcrypt/sketch_006/target/pyp5js.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:36
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:23
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 import {PythonFunctions} from './python_functions.js';
 var __name__ = 'pyp5js';
 export var _P5_INSTANCE = null;
diff --git a/docs/examples/transcrypt/sketch_006/target/python_functions.js b/docs/examples/transcrypt/sketch_006/target/python_functions.js
index ad6e63c9..e0b21e0c 100644
--- a/docs/examples/transcrypt/sketch_006/target/python_functions.js
+++ b/docs/examples/transcrypt/sketch_006/target/python_functions.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:37
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:23
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 var __name__ = 'python_functions';
 export var PythonFunctions =  __class__ ('PythonFunctions', [object], {
 	__module__: __name__,
diff --git a/docs/examples/transcrypt/sketch_006/target/sketch_006.js b/docs/examples/transcrypt/sketch_006/target/sketch_006.js
deleted file mode 100644
index fc0a9904..00000000
--- a/docs/examples/transcrypt/sketch_006/target/sketch_006.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:37
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-var __name__ = 'sketch_006';
-export var r = null;
-export var setup = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	createCanvas (900, 900);
-	r = random (100, 700);
-	noFill ();
-};
-export var draw = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	var __left0__ = tuple ([100, 100]);
-	var x = __left0__ [0];
-	var y = __left0__ [1];
-	rect (x, y, r, r);
-};
-export var keyPressed = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	console.log ('Key pressed event');
-	if (key == 'n') {
-		r = random (100, 700);
-		redraw ();
-	}
-};
-export var mouseDragged = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	r = random (100, 700);
-	redraw ();
-};
-
-//# sourceMappingURL=sketch_006.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_006/target/sketch_006.py b/docs/examples/transcrypt/sketch_006/target/sketch_006.py
deleted file mode 100644
index c005162a..00000000
--- a/docs/examples/transcrypt/sketch_006/target/sketch_006.py
+++ /dev/null
@@ -1,29 +0,0 @@
-from pyp5js import *
-
-r = None
-def setup():
-    global r
-
-    createCanvas(900, 900)
-    r = random(100, 700)
-    noFill()
-
-
-def draw():
-    x, y = 100, 100
-    rect(x, y, r, r)
-
-
-def keyPressed():
-    console.log("Key pressed event")
-
-    if key == "n":
-        global r
-        r = random(100, 700)
-        redraw()
-
-
-def mouseDragged():
-    global r
-    r = random(100, 700)
-    redraw()
diff --git a/docs/examples/transcrypt/sketch_006/target/target_sketch.js b/docs/examples/transcrypt/sketch_006/target/target_sketch.js
index 6338f40d..b5012e2e 100644
--- a/docs/examples/transcrypt/sketch_006/target/target_sketch.js
+++ b/docs/examples/transcrypt/sketch_006/target/target_sketch.js
@@ -1,9 +1,114 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:36
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-import * as source_sketch from './sketch_006.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:23
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
 var __name__ = '__main__';
-export var event_functions = dict ([['deviceMoved', source_sketch.deviceMoved], ['deviceTurned', source_sketch.deviceTurned], ['deviceShaken', source_sketch.deviceShaken], ['keyPressed', source_sketch.keyPressed], ['keyReleased', source_sketch.keyReleased], ['keyTyped', source_sketch.keyTyped], ['mouseMoved', source_sketch.mouseMoved], ['mouseDragged', source_sketch.mouseDragged], ['mousePressed', source_sketch.mousePressed], ['mouseReleased', source_sketch.mouseReleased], ['mouseClicked', source_sketch.mouseClicked], ['doubleClicked', source_sketch.doubleClicked], ['mouseWheel', source_sketch.mouseWheel], ['touchStarted', source_sketch.touchStarted], ['touchMoved', source_sketch.touchMoved], ['touchEnded', source_sketch.touchEnded], ['windowResized', source_sketch.windowResized]]);
-start_p5 (source_sketch.setup, source_sketch.draw, event_functions);
+export var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var deviceMoved = null;
+export var deviceTurned = null;
+export var deviceShaken = null;
+export var keyPressed = null;
+export var keyReleased = null;
+export var keyTyped = null;
+export var mouseMoved = null;
+export var mouseDragged = null;
+export var mousePressed = null;
+export var mouseReleased = null;
+export var mouseClicked = null;
+export var doubleClicked = null;
+export var mouseWheel = null;
+export var touchStarted = null;
+export var touchMoved = null;
+export var touchEnded = null;
+export var windowResized = null;
+export var r = null;
+var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	createCanvas (900, 900);
+	r = random (100, 700);
+	noFill ();
+};
+var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	var __left0__ = tuple ([100, 100]);
+	var x = __left0__ [0];
+	var y = __left0__ [1];
+	rect (x, y, r, r);
+};
+var keyPressed = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	console.log ('Key pressed event');
+	if (key == 'n') {
+		r = random (100, 700);
+		redraw ();
+	}
+};
+var mouseDragged = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	r = random (100, 700);
+	redraw ();
+};
+export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized});
+start_p5 (setup, draw, event_functions);
 
 //# sourceMappingURL=target_sketch.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_006/target/target_sketch.project b/docs/examples/transcrypt/sketch_006/target/target_sketch.project
index 4ac50409..f34743f4 100644
--- a/docs/examples/transcrypt/sketch_006/target/target_sketch.project
+++ b/docs/examples/transcrypt/sketch_006/target/target_sketch.project
@@ -1 +1 @@
-{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/sketch_006.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/sketch_006.js"}]}
\ No newline at end of file
+{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_006/__target__/python_functions.js"}]}
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_006/target/target_sketch.py b/docs/examples/transcrypt/sketch_006/target/target_sketch.py
index b504e993..c8a9948c 100644
--- a/docs/examples/transcrypt/sketch_006/target/target_sketch.py
+++ b/docs/examples/transcrypt/sketch_006/target/target_sketch.py
@@ -1,24 +1,78 @@
-import sketch_006 as source_sketch
 from pyp5js import *
 
+def setup():
+    pass
+
+def draw():
+    pass
+
+deviceMoved = None
+deviceTurned = None
+deviceShaken = None
+keyPressed = None
+keyReleased = None
+keyTyped = None
+mouseMoved = None
+mouseDragged = None
+mousePressed = None
+mouseReleased = None
+mouseClicked = None
+doubleClicked = None
+mouseWheel = None
+touchStarted = None
+touchMoved = None
+touchEnded = None
+windowResized = None
+
+
+r = None
+def setup():
+    global r
+
+    createCanvas(900, 900)
+    r = random(100, 700)
+    noFill()
+
+
+def draw():
+    x, y = 100, 100
+    rect(x, y, r, r)
+
+
+def keyPressed():
+    console.log("Key pressed event")
+
+    if key == "n":
+        global r
+        r = random(100, 700)
+        redraw()
+
+
+def mouseDragged():
+    global r
+    r = random(100, 700)
+    redraw()
+
+
+
 event_functions = {
-    "deviceMoved": source_sketch.deviceMoved,
-    "deviceTurned": source_sketch.deviceTurned,
-    "deviceShaken": source_sketch.deviceShaken,
-    "keyPressed": source_sketch.keyPressed,
-    "keyReleased": source_sketch.keyReleased,
-    "keyTyped": source_sketch.keyTyped,
-    "mouseMoved": source_sketch.mouseMoved,
-    "mouseDragged": source_sketch.mouseDragged,
-    "mousePressed": source_sketch.mousePressed,
-    "mouseReleased": source_sketch.mouseReleased,
-    "mouseClicked": source_sketch.mouseClicked,
-    "doubleClicked": source_sketch.doubleClicked,
-    "mouseWheel": source_sketch.mouseWheel,
-    "touchStarted": source_sketch.touchStarted,
-    "touchMoved": source_sketch.touchMoved,
-    "touchEnded": source_sketch.touchEnded,
-    "windowResized": source_sketch.windowResized,
+    "deviceMoved": deviceMoved,
+    "deviceTurned": deviceTurned,
+    "deviceShaken": deviceShaken,
+    "keyPressed": keyPressed,
+    "keyReleased": keyReleased,
+    "keyTyped": keyTyped,
+    "mouseMoved": mouseMoved,
+    "mouseDragged": mouseDragged,
+    "mousePressed": mousePressed,
+    "mouseReleased": mouseReleased,
+    "mouseClicked": mouseClicked,
+    "doubleClicked": doubleClicked,
+    "mouseWheel": mouseWheel,
+    "touchStarted": touchStarted,
+    "touchMoved": touchMoved,
+    "touchEnded": touchEnded,
+    "windowResized": windowResized,
 }
 
-start_p5(source_sketch.setup, source_sketch.draw, event_functions)
\ No newline at end of file
+start_p5(setup, draw, event_functions)
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_007/index.html b/docs/examples/transcrypt/sketch_007/index.html
index ec8f4a4a..1d85d9bf 100644
--- a/docs/examples/transcrypt/sketch_007/index.html
+++ b/docs/examples/transcrypt/sketch_007/index.html
@@ -47,9 +47,6 @@
         
              
-from pyp5js import *
-
-
 def setup():
     createCanvas(900, 900)
     stroke(27, 27, 27, 10)
diff --git a/docs/examples/transcrypt/sketch_007/sketch_007.py b/docs/examples/transcrypt/sketch_007/sketch_007.py
index 46ddb6f8..113e7a0a 100644
--- a/docs/examples/transcrypt/sketch_007/sketch_007.py
+++ b/docs/examples/transcrypt/sketch_007/sketch_007.py
@@ -1,6 +1,3 @@
-from pyp5js import *
-
-
 def setup():
     createCanvas(900, 900)
     stroke(27, 27, 27, 10)
diff --git a/docs/examples/transcrypt/sketch_007/target/org.transcrypt.__runtime__.js b/docs/examples/transcrypt/sketch_007/target/org.transcrypt.__runtime__.js
index 70161687..059ed3d7 100644
--- a/docs/examples/transcrypt/sketch_007/target/org.transcrypt.__runtime__.js
+++ b/docs/examples/transcrypt/sketch_007/target/org.transcrypt.__runtime__.js
@@ -1,10 +1,10 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:37
+// Transcrypt'ed from Python, 2021-10-14 12:26:24
 var __name__ = 'org.transcrypt.__runtime__';
 export var __envir__ = {};
 __envir__.interpreter_name = 'python';
 __envir__.transpiler_name = 'transcrypt';
 __envir__.executor_name = __envir__.transpiler_name;
-__envir__.transpiler_version = '3.7.16';
+__envir__.transpiler_version = '3.9.0';
 
 export function __nest__ (headObject, tailNames, value) {
     var current = headObject;
@@ -38,15 +38,14 @@ export function __init__ (module) {
     }
     return module.__all__;
 };
-export var __proxy__ = false;
-export function __get__ (self, func, quotedFuncName) {
-    if (self) {
-        if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) {
+export function __get__ (aThis, func, quotedFuncName) {
+    if (aThis) {
+        if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) {
             if (quotedFuncName) {
-                Object.defineProperty (self, quotedFuncName, {
+                Object.defineProperty (aThis, quotedFuncName, {
                     value: function () {
                         var args = [] .slice.apply (arguments);
-                        return func.apply (null, [self] .concat (args));
+                        return func.apply (null, [aThis] .concat (args));
                     },
                     writable: true,
                     enumerable: true,
@@ -55,7 +54,7 @@ export function __get__ (self, func, quotedFuncName) {
             }
             return function () {
                 var args = [] .slice.apply (arguments);
-                return func.apply (null, [self] .concat (args));
+                return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args));
             };
         }
         else {
@@ -66,21 +65,21 @@ export function __get__ (self, func, quotedFuncName) {
         return func;
     }
 };
-export function __getcm__ (self, func, quotedFuncName) {
-    if (self.hasOwnProperty ('__class__')) {
+export function __getcm__ (aThis, func, quotedFuncName) {
+    if (aThis.hasOwnProperty ('__class__')) {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self.__class__] .concat (args));
+            return func.apply (null, [aThis.__class__] .concat (args));
         };
     }
     else {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self] .concat (args));
+            return func.apply (null, [aThis] .concat (args));
         };
     }
 };
-export function __getsm__ (self, func, quotedFuncName) {
+export function __getsm__ (aThis, func, quotedFuncName) {
     return func;
 };
 export var py_metatype = {
@@ -95,6 +94,9 @@ export var py_metatype = {
             var base = bases [index];
             for (var attrib in base) {
                 var descrip = Object.getOwnPropertyDescriptor (base, attrib);
+                if (descrip == null) {
+                    continue;
+                }
                 Object.defineProperty (cls, attrib, descrip);
             }
             for (let symbol of Object.getOwnPropertySymbols (base)) {
@@ -125,7 +127,7 @@ export var object = {
     __new__: function (args) {
         var instance = Object.create (this, {__class__: {value: this, enumerable: true}});
         if ('__getattr__' in this || '__setattr__' in this) {
-            instance = new Proxy (instance, {
+            instance.__proxy__ = new Proxy (instance, {
                 get: function (target, name) {
                     let result = target [name];
                     if (result == undefined) {
@@ -145,6 +147,7 @@ export var object = {
                     return true;
                 }
             })
+			instance = instance.__proxy__
         }
         this.__init__.apply (null, [instance] .concat (args));
         return instance;
@@ -1830,10 +1833,13 @@ export var Exception =  __class__ ('Exception', [BaseException], {
 			var args = tuple ();
 		}
 		self.__args__ = args;
-		try {
+		if (kwargs.error != null) {
 			self.stack = kwargs.error.stack;
 		}
-		catch (__except0__) {
+		else if (Error) {
+			self.stack = new Error ().stack;
+		}
+		else {
 			self.stack = 'No stack trace available';
 		}
 	});},
diff --git a/docs/examples/transcrypt/sketch_007/target/org.transcrypt.__runtime__.py b/docs/examples/transcrypt/sketch_007/target/org.transcrypt.__runtime__.py
index 87834491..8b06f7ba 100644
--- a/docs/examples/transcrypt/sketch_007/target/org.transcrypt.__runtime__.py
+++ b/docs/examples/transcrypt/sketch_007/target/org.transcrypt.__runtime__.py
@@ -19,9 +19,11 @@ class Exception (BaseException):
     #__pragma__ ('kwargs')
     def __init__ (self, *args, **kwargs):
         self.__args__ = args
-        try:
+        if kwargs.error != None:
             self.stack = kwargs.error.stack # Integrate with JavaScript Error object
-        except:
+        elif Error:
+            self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one
+        else:
             self.stack = 'No stack trace available'
     #__pragma__ ('nokwargs')
         
diff --git a/docs/examples/transcrypt/sketch_007/target/pyp5js.js b/docs/examples/transcrypt/sketch_007/target/pyp5js.js
index 5d763a42..bf5c9330 100644
--- a/docs/examples/transcrypt/sketch_007/target/pyp5js.js
+++ b/docs/examples/transcrypt/sketch_007/target/pyp5js.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:37
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:24
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 import {PythonFunctions} from './python_functions.js';
 var __name__ = 'pyp5js';
 export var _P5_INSTANCE = null;
diff --git a/docs/examples/transcrypt/sketch_007/target/python_functions.js b/docs/examples/transcrypt/sketch_007/target/python_functions.js
index 3b4aa04c..68a93f18 100644
--- a/docs/examples/transcrypt/sketch_007/target/python_functions.js
+++ b/docs/examples/transcrypt/sketch_007/target/python_functions.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:38
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:25
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 var __name__ = 'python_functions';
 export var PythonFunctions =  __class__ ('PythonFunctions', [object], {
 	__module__: __name__,
diff --git a/docs/examples/transcrypt/sketch_007/target/sketch_007.js b/docs/examples/transcrypt/sketch_007/target/sketch_007.js
deleted file mode 100644
index fc89ce5d..00000000
--- a/docs/examples/transcrypt/sketch_007/target/sketch_007.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:38
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-var __name__ = 'sketch_007';
-export var setup = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	createCanvas (900, 900);
-	stroke (27, 27, 27, 10);
-	strokeWeight (2);
-};
-export var draw = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	push ();
-	translate (width / 2, height / 2);
-	var v = p5.Vector.random2D ();
-	v.normalize ();
-	v.mult (random (100, 400));
-	line (0, 0, v.x, v.y);
-	py_pop ();
-};
-
-//# sourceMappingURL=sketch_007.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_007/target/sketch_007.py b/docs/examples/transcrypt/sketch_007/target/sketch_007.py
deleted file mode 100644
index 46ddb6f8..00000000
--- a/docs/examples/transcrypt/sketch_007/target/sketch_007.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from pyp5js import *
-
-
-def setup():
-    createCanvas(900, 900)
-    stroke(27, 27, 27, 10)
-    strokeWeight(2)
-
-
-def draw():
-    push()
-
-    translate(width / 2, height / 2)
-    v = p5.Vector.random2D()
-    v.normalize()
-    v.mult(random(100, 400))
-    line(0, 0, v.x, v.y)
-
-    pop()
diff --git a/docs/examples/transcrypt/sketch_007/target/target_sketch.js b/docs/examples/transcrypt/sketch_007/target/target_sketch.js
index 198779ac..680f1843 100644
--- a/docs/examples/transcrypt/sketch_007/target/target_sketch.js
+++ b/docs/examples/transcrypt/sketch_007/target/target_sketch.js
@@ -1,9 +1,85 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:37
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-import * as source_sketch from './sketch_007.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:24
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
 var __name__ = '__main__';
-export var event_functions = dict ([['deviceMoved', source_sketch.deviceMoved], ['deviceTurned', source_sketch.deviceTurned], ['deviceShaken', source_sketch.deviceShaken], ['keyPressed', source_sketch.keyPressed], ['keyReleased', source_sketch.keyReleased], ['keyTyped', source_sketch.keyTyped], ['mouseMoved', source_sketch.mouseMoved], ['mouseDragged', source_sketch.mouseDragged], ['mousePressed', source_sketch.mousePressed], ['mouseReleased', source_sketch.mouseReleased], ['mouseClicked', source_sketch.mouseClicked], ['doubleClicked', source_sketch.doubleClicked], ['mouseWheel', source_sketch.mouseWheel], ['touchStarted', source_sketch.touchStarted], ['touchMoved', source_sketch.touchMoved], ['touchEnded', source_sketch.touchEnded], ['windowResized', source_sketch.windowResized]]);
-start_p5 (source_sketch.setup, source_sketch.draw, event_functions);
+export var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var deviceMoved = null;
+export var deviceTurned = null;
+export var deviceShaken = null;
+export var keyPressed = null;
+export var keyReleased = null;
+export var keyTyped = null;
+export var mouseMoved = null;
+export var mouseDragged = null;
+export var mousePressed = null;
+export var mouseReleased = null;
+export var mouseClicked = null;
+export var doubleClicked = null;
+export var mouseWheel = null;
+export var touchStarted = null;
+export var touchMoved = null;
+export var touchEnded = null;
+export var windowResized = null;
+var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	createCanvas (900, 900);
+	stroke (27, 27, 27, 10);
+	strokeWeight (2);
+};
+var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	push ();
+	translate (width / 2, height / 2);
+	var v = p5.Vector.random2D ();
+	v.normalize ();
+	v.mult (random (100, 400));
+	line (0, 0, v.x, v.y);
+	py_pop ();
+};
+export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized});
+start_p5 (setup, draw, event_functions);
 
 //# sourceMappingURL=target_sketch.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_007/target/target_sketch.project b/docs/examples/transcrypt/sketch_007/target/target_sketch.project
index 6f1f958c..a28408fe 100644
--- a/docs/examples/transcrypt/sketch_007/target/target_sketch.project
+++ b/docs/examples/transcrypt/sketch_007/target/target_sketch.project
@@ -1 +1 @@
-{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/sketch_007.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/sketch_007.js"}]}
\ No newline at end of file
+{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_007/__target__/python_functions.js"}]}
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_007/target/target_sketch.py b/docs/examples/transcrypt/sketch_007/target/target_sketch.py
index b78f41cd..7d1f925f 100644
--- a/docs/examples/transcrypt/sketch_007/target/target_sketch.py
+++ b/docs/examples/transcrypt/sketch_007/target/target_sketch.py
@@ -1,24 +1,67 @@
-import sketch_007 as source_sketch
 from pyp5js import *
 
+def setup():
+    pass
+
+def draw():
+    pass
+
+deviceMoved = None
+deviceTurned = None
+deviceShaken = None
+keyPressed = None
+keyReleased = None
+keyTyped = None
+mouseMoved = None
+mouseDragged = None
+mousePressed = None
+mouseReleased = None
+mouseClicked = None
+doubleClicked = None
+mouseWheel = None
+touchStarted = None
+touchMoved = None
+touchEnded = None
+windowResized = None
+
+
+def setup():
+    createCanvas(900, 900)
+    stroke(27, 27, 27, 10)
+    strokeWeight(2)
+
+
+def draw():
+    push()
+
+    translate(width / 2, height / 2)
+    v = p5.Vector.random2D()
+    v.normalize()
+    v.mult(random(100, 400))
+    line(0, 0, v.x, v.y)
+
+    pop()
+
+
+
 event_functions = {
-    "deviceMoved": source_sketch.deviceMoved,
-    "deviceTurned": source_sketch.deviceTurned,
-    "deviceShaken": source_sketch.deviceShaken,
-    "keyPressed": source_sketch.keyPressed,
-    "keyReleased": source_sketch.keyReleased,
-    "keyTyped": source_sketch.keyTyped,
-    "mouseMoved": source_sketch.mouseMoved,
-    "mouseDragged": source_sketch.mouseDragged,
-    "mousePressed": source_sketch.mousePressed,
-    "mouseReleased": source_sketch.mouseReleased,
-    "mouseClicked": source_sketch.mouseClicked,
-    "doubleClicked": source_sketch.doubleClicked,
-    "mouseWheel": source_sketch.mouseWheel,
-    "touchStarted": source_sketch.touchStarted,
-    "touchMoved": source_sketch.touchMoved,
-    "touchEnded": source_sketch.touchEnded,
-    "windowResized": source_sketch.windowResized,
+    "deviceMoved": deviceMoved,
+    "deviceTurned": deviceTurned,
+    "deviceShaken": deviceShaken,
+    "keyPressed": keyPressed,
+    "keyReleased": keyReleased,
+    "keyTyped": keyTyped,
+    "mouseMoved": mouseMoved,
+    "mouseDragged": mouseDragged,
+    "mousePressed": mousePressed,
+    "mouseReleased": mouseReleased,
+    "mouseClicked": mouseClicked,
+    "doubleClicked": doubleClicked,
+    "mouseWheel": mouseWheel,
+    "touchStarted": touchStarted,
+    "touchMoved": touchMoved,
+    "touchEnded": touchEnded,
+    "windowResized": windowResized,
 }
 
-start_p5(source_sketch.setup, source_sketch.draw, event_functions)
\ No newline at end of file
+start_p5(setup, draw, event_functions)
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_008/index.html b/docs/examples/transcrypt/sketch_008/index.html
index 7283189c..1b27ea0a 100644
--- a/docs/examples/transcrypt/sketch_008/index.html
+++ b/docs/examples/transcrypt/sketch_008/index.html
@@ -47,9 +47,6 @@
         
              
-from pyp5js import *
-
-
 rect_base_size = 30
 positions = []
 rect_size = None
diff --git a/docs/examples/transcrypt/sketch_008/sketch_008.py b/docs/examples/transcrypt/sketch_008/sketch_008.py
index e1a9b205..ee4214e4 100644
--- a/docs/examples/transcrypt/sketch_008/sketch_008.py
+++ b/docs/examples/transcrypt/sketch_008/sketch_008.py
@@ -1,6 +1,3 @@
-from pyp5js import *
-
-
 rect_base_size = 30
 positions = []
 rect_size = None
diff --git a/docs/examples/transcrypt/sketch_008/target/org.transcrypt.__runtime__.js b/docs/examples/transcrypt/sketch_008/target/org.transcrypt.__runtime__.js
index 06fa4155..1b4aaa1a 100644
--- a/docs/examples/transcrypt/sketch_008/target/org.transcrypt.__runtime__.js
+++ b/docs/examples/transcrypt/sketch_008/target/org.transcrypt.__runtime__.js
@@ -1,10 +1,10 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:38
+// Transcrypt'ed from Python, 2021-10-14 12:26:25
 var __name__ = 'org.transcrypt.__runtime__';
 export var __envir__ = {};
 __envir__.interpreter_name = 'python';
 __envir__.transpiler_name = 'transcrypt';
 __envir__.executor_name = __envir__.transpiler_name;
-__envir__.transpiler_version = '3.7.16';
+__envir__.transpiler_version = '3.9.0';
 
 export function __nest__ (headObject, tailNames, value) {
     var current = headObject;
@@ -38,15 +38,14 @@ export function __init__ (module) {
     }
     return module.__all__;
 };
-export var __proxy__ = false;
-export function __get__ (self, func, quotedFuncName) {
-    if (self) {
-        if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) {
+export function __get__ (aThis, func, quotedFuncName) {
+    if (aThis) {
+        if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) {
             if (quotedFuncName) {
-                Object.defineProperty (self, quotedFuncName, {
+                Object.defineProperty (aThis, quotedFuncName, {
                     value: function () {
                         var args = [] .slice.apply (arguments);
-                        return func.apply (null, [self] .concat (args));
+                        return func.apply (null, [aThis] .concat (args));
                     },
                     writable: true,
                     enumerable: true,
@@ -55,7 +54,7 @@ export function __get__ (self, func, quotedFuncName) {
             }
             return function () {
                 var args = [] .slice.apply (arguments);
-                return func.apply (null, [self] .concat (args));
+                return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args));
             };
         }
         else {
@@ -66,21 +65,21 @@ export function __get__ (self, func, quotedFuncName) {
         return func;
     }
 };
-export function __getcm__ (self, func, quotedFuncName) {
-    if (self.hasOwnProperty ('__class__')) {
+export function __getcm__ (aThis, func, quotedFuncName) {
+    if (aThis.hasOwnProperty ('__class__')) {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self.__class__] .concat (args));
+            return func.apply (null, [aThis.__class__] .concat (args));
         };
     }
     else {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self] .concat (args));
+            return func.apply (null, [aThis] .concat (args));
         };
     }
 };
-export function __getsm__ (self, func, quotedFuncName) {
+export function __getsm__ (aThis, func, quotedFuncName) {
     return func;
 };
 export var py_metatype = {
@@ -95,6 +94,9 @@ export var py_metatype = {
             var base = bases [index];
             for (var attrib in base) {
                 var descrip = Object.getOwnPropertyDescriptor (base, attrib);
+                if (descrip == null) {
+                    continue;
+                }
                 Object.defineProperty (cls, attrib, descrip);
             }
             for (let symbol of Object.getOwnPropertySymbols (base)) {
@@ -125,7 +127,7 @@ export var object = {
     __new__: function (args) {
         var instance = Object.create (this, {__class__: {value: this, enumerable: true}});
         if ('__getattr__' in this || '__setattr__' in this) {
-            instance = new Proxy (instance, {
+            instance.__proxy__ = new Proxy (instance, {
                 get: function (target, name) {
                     let result = target [name];
                     if (result == undefined) {
@@ -145,6 +147,7 @@ export var object = {
                     return true;
                 }
             })
+			instance = instance.__proxy__
         }
         this.__init__.apply (null, [instance] .concat (args));
         return instance;
@@ -1830,10 +1833,13 @@ export var Exception =  __class__ ('Exception', [BaseException], {
 			var args = tuple ();
 		}
 		self.__args__ = args;
-		try {
+		if (kwargs.error != null) {
 			self.stack = kwargs.error.stack;
 		}
-		catch (__except0__) {
+		else if (Error) {
+			self.stack = new Error ().stack;
+		}
+		else {
 			self.stack = 'No stack trace available';
 		}
 	});},
diff --git a/docs/examples/transcrypt/sketch_008/target/org.transcrypt.__runtime__.py b/docs/examples/transcrypt/sketch_008/target/org.transcrypt.__runtime__.py
index 87834491..8b06f7ba 100644
--- a/docs/examples/transcrypt/sketch_008/target/org.transcrypt.__runtime__.py
+++ b/docs/examples/transcrypt/sketch_008/target/org.transcrypt.__runtime__.py
@@ -19,9 +19,11 @@ class Exception (BaseException):
     #__pragma__ ('kwargs')
     def __init__ (self, *args, **kwargs):
         self.__args__ = args
-        try:
+        if kwargs.error != None:
             self.stack = kwargs.error.stack # Integrate with JavaScript Error object
-        except:
+        elif Error:
+            self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one
+        else:
             self.stack = 'No stack trace available'
     #__pragma__ ('nokwargs')
         
diff --git a/docs/examples/transcrypt/sketch_008/target/pyp5js.js b/docs/examples/transcrypt/sketch_008/target/pyp5js.js
index 6d7c0a79..b994eda8 100644
--- a/docs/examples/transcrypt/sketch_008/target/pyp5js.js
+++ b/docs/examples/transcrypt/sketch_008/target/pyp5js.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:39
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:26
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 import {PythonFunctions} from './python_functions.js';
 var __name__ = 'pyp5js';
 export var _P5_INSTANCE = null;
diff --git a/docs/examples/transcrypt/sketch_008/target/python_functions.js b/docs/examples/transcrypt/sketch_008/target/python_functions.js
index d94881f7..24133b19 100644
--- a/docs/examples/transcrypt/sketch_008/target/python_functions.js
+++ b/docs/examples/transcrypt/sketch_008/target/python_functions.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:39
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:26
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 var __name__ = 'python_functions';
 export var PythonFunctions =  __class__ ('PythonFunctions', [object], {
 	__module__: __name__,
diff --git a/docs/examples/transcrypt/sketch_008/target/sketch_008.js b/docs/examples/transcrypt/sketch_008/target/sketch_008.js
deleted file mode 100644
index 73fd9c1f..00000000
--- a/docs/examples/transcrypt/sketch_008/target/sketch_008.js
+++ /dev/null
@@ -1,53 +0,0 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:39
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-var __name__ = 'sketch_008';
-export var rect_base_size = 30;
-export var positions = [];
-export var rect_size = null;
-export var setup = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	createP ('Hi! This is an example of how to use p5.dom.js with pyp5js');
-	var slider_div = createDiv ();
-	slider_div.style ('display', 'block');
-	rect_size = createSlider (0, 600, 100);
-	rect_size.style ('width', '50%');
-	slider_div.child (rect_size);
-	createCanvas (600, 600);
-	for (var x of range (-(rect_base_size), width + rect_base_size, rect_base_size)) {
-		for (var y of range (-(rect_base_size), height + rect_base_size, rect_base_size)) {
-			positions.append (tuple ([x, y]));
-		}
-	}
-	noFill ();
-	strokeWeight (2);
-	rectMode (CENTER);
-};
-export var draw = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	background (255);
-	var size = rect_size.value ();
-	for (var [x, y] of positions) {
-		rect (x, y, size, size);
-	}
-};
-
-//# sourceMappingURL=sketch_008.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_008/target/sketch_008.py b/docs/examples/transcrypt/sketch_008/target/sketch_008.py
deleted file mode 100644
index e1a9b205..00000000
--- a/docs/examples/transcrypt/sketch_008/target/sketch_008.py
+++ /dev/null
@@ -1,39 +0,0 @@
-from pyp5js import *
-
-
-rect_base_size = 30
-positions = []
-rect_size = None
-
-def setup():
-    global rect_size
-
-    createP("Hi! This is an example of how to use p5.dom.js with pyp5js")
-
-    # creates a container div
-    slider_div = createDiv()
-    slider_div.style("display", "block")
-
-    # creates the slider
-    rect_size = createSlider(0, 600, 100)
-    rect_size.style('width', '50%')
-
-    # adds the slider to the container div
-    slider_div.child(rect_size)
-
-    createCanvas(600, 600)
-
-    for x in range(-rect_base_size, width + rect_base_size, rect_base_size):
-        for y in range(-rect_base_size, height + rect_base_size, rect_base_size):
-            positions.append((x, y))
-
-    noFill()
-    strokeWeight(2)
-    rectMode(CENTER)
-
-
-def draw():
-    background(255)
-    size = rect_size.value()
-    for x, y in positions:
-        rect(x, y, size, size)
diff --git a/docs/examples/transcrypt/sketch_008/target/target_sketch.js b/docs/examples/transcrypt/sketch_008/target/target_sketch.js
index 791a68b0..6d27bbb9 100644
--- a/docs/examples/transcrypt/sketch_008/target/target_sketch.js
+++ b/docs/examples/transcrypt/sketch_008/target/target_sketch.js
@@ -1,9 +1,98 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:38
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-import * as source_sketch from './sketch_008.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:26
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
 var __name__ = '__main__';
-export var event_functions = dict ([['deviceMoved', source_sketch.deviceMoved], ['deviceTurned', source_sketch.deviceTurned], ['deviceShaken', source_sketch.deviceShaken], ['keyPressed', source_sketch.keyPressed], ['keyReleased', source_sketch.keyReleased], ['keyTyped', source_sketch.keyTyped], ['mouseMoved', source_sketch.mouseMoved], ['mouseDragged', source_sketch.mouseDragged], ['mousePressed', source_sketch.mousePressed], ['mouseReleased', source_sketch.mouseReleased], ['mouseClicked', source_sketch.mouseClicked], ['doubleClicked', source_sketch.doubleClicked], ['mouseWheel', source_sketch.mouseWheel], ['touchStarted', source_sketch.touchStarted], ['touchMoved', source_sketch.touchMoved], ['touchEnded', source_sketch.touchEnded], ['windowResized', source_sketch.windowResized]]);
-start_p5 (source_sketch.setup, source_sketch.draw, event_functions);
+export var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var deviceMoved = null;
+export var deviceTurned = null;
+export var deviceShaken = null;
+export var keyPressed = null;
+export var keyReleased = null;
+export var keyTyped = null;
+export var mouseMoved = null;
+export var mouseDragged = null;
+export var mousePressed = null;
+export var mouseReleased = null;
+export var mouseClicked = null;
+export var doubleClicked = null;
+export var mouseWheel = null;
+export var touchStarted = null;
+export var touchMoved = null;
+export var touchEnded = null;
+export var windowResized = null;
+export var rect_base_size = 30;
+export var positions = [];
+export var rect_size = null;
+var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	createP ('Hi! This is an example of how to use p5.dom.js with pyp5js');
+	var slider_div = createDiv ();
+	slider_div.style ('display', 'block');
+	rect_size = createSlider (0, 600, 100);
+	rect_size.style ('width', '50%');
+	slider_div.child (rect_size);
+	createCanvas (600, 600);
+	for (var x of range (-(rect_base_size), width + rect_base_size, rect_base_size)) {
+		for (var y of range (-(rect_base_size), height + rect_base_size, rect_base_size)) {
+			positions.append (tuple ([x, y]));
+		}
+	}
+	noFill ();
+	strokeWeight (2);
+	rectMode (CENTER);
+};
+var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	background (255);
+	var size = rect_size.value ();
+	for (var [x, y] of positions) {
+		rect (x, y, size, size);
+	}
+};
+export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized});
+start_p5 (setup, draw, event_functions);
 
 //# sourceMappingURL=target_sketch.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_008/target/target_sketch.project b/docs/examples/transcrypt/sketch_008/target/target_sketch.project
index cac3d7ee..2e547690 100644
--- a/docs/examples/transcrypt/sketch_008/target/target_sketch.project
+++ b/docs/examples/transcrypt/sketch_008/target/target_sketch.project
@@ -1 +1 @@
-{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/sketch_008.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/sketch_008.js"}]}
\ No newline at end of file
+{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_008/__target__/python_functions.js"}]}
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_008/target/target_sketch.py b/docs/examples/transcrypt/sketch_008/target/target_sketch.py
index 12da28d0..9ca7cbbb 100644
--- a/docs/examples/transcrypt/sketch_008/target/target_sketch.py
+++ b/docs/examples/transcrypt/sketch_008/target/target_sketch.py
@@ -1,24 +1,87 @@
-import sketch_008 as source_sketch
 from pyp5js import *
 
+def setup():
+    pass
+
+def draw():
+    pass
+
+deviceMoved = None
+deviceTurned = None
+deviceShaken = None
+keyPressed = None
+keyReleased = None
+keyTyped = None
+mouseMoved = None
+mouseDragged = None
+mousePressed = None
+mouseReleased = None
+mouseClicked = None
+doubleClicked = None
+mouseWheel = None
+touchStarted = None
+touchMoved = None
+touchEnded = None
+windowResized = None
+
+
+rect_base_size = 30
+positions = []
+rect_size = None
+
+def setup():
+    global rect_size
+
+    createP("Hi! This is an example of how to use p5.dom.js with pyp5js")
+
+    # creates a container div
+    slider_div = createDiv()
+    slider_div.style("display", "block")
+
+    # creates the slider
+    rect_size = createSlider(0, 600, 100)
+    rect_size.style('width', '50%')
+
+    # adds the slider to the container div
+    slider_div.child(rect_size)
+
+    createCanvas(600, 600)
+
+    for x in range(-rect_base_size, width + rect_base_size, rect_base_size):
+        for y in range(-rect_base_size, height + rect_base_size, rect_base_size):
+            positions.append((x, y))
+
+    noFill()
+    strokeWeight(2)
+    rectMode(CENTER)
+
+
+def draw():
+    background(255)
+    size = rect_size.value()
+    for x, y in positions:
+        rect(x, y, size, size)
+
+
+
 event_functions = {
-    "deviceMoved": source_sketch.deviceMoved,
-    "deviceTurned": source_sketch.deviceTurned,
-    "deviceShaken": source_sketch.deviceShaken,
-    "keyPressed": source_sketch.keyPressed,
-    "keyReleased": source_sketch.keyReleased,
-    "keyTyped": source_sketch.keyTyped,
-    "mouseMoved": source_sketch.mouseMoved,
-    "mouseDragged": source_sketch.mouseDragged,
-    "mousePressed": source_sketch.mousePressed,
-    "mouseReleased": source_sketch.mouseReleased,
-    "mouseClicked": source_sketch.mouseClicked,
-    "doubleClicked": source_sketch.doubleClicked,
-    "mouseWheel": source_sketch.mouseWheel,
-    "touchStarted": source_sketch.touchStarted,
-    "touchMoved": source_sketch.touchMoved,
-    "touchEnded": source_sketch.touchEnded,
-    "windowResized": source_sketch.windowResized,
+    "deviceMoved": deviceMoved,
+    "deviceTurned": deviceTurned,
+    "deviceShaken": deviceShaken,
+    "keyPressed": keyPressed,
+    "keyReleased": keyReleased,
+    "keyTyped": keyTyped,
+    "mouseMoved": mouseMoved,
+    "mouseDragged": mouseDragged,
+    "mousePressed": mousePressed,
+    "mouseReleased": mouseReleased,
+    "mouseClicked": mouseClicked,
+    "doubleClicked": doubleClicked,
+    "mouseWheel": mouseWheel,
+    "touchStarted": touchStarted,
+    "touchMoved": touchMoved,
+    "touchEnded": touchEnded,
+    "windowResized": windowResized,
 }
 
-start_p5(source_sketch.setup, source_sketch.draw, event_functions)
\ No newline at end of file
+start_p5(setup, draw, event_functions)
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_009/index.html b/docs/examples/transcrypt/sketch_009/index.html
index b32970ae..86a9f9d0 100644
--- a/docs/examples/transcrypt/sketch_009/index.html
+++ b/docs/examples/transcrypt/sketch_009/index.html
@@ -47,8 +47,6 @@
         
              
-from pyp5js import *
-
 from random import choice
 
 
diff --git a/docs/examples/transcrypt/sketch_009/sketch_009.py b/docs/examples/transcrypt/sketch_009/sketch_009.py
index c9dd4736..c9388d7c 100644
--- a/docs/examples/transcrypt/sketch_009/sketch_009.py
+++ b/docs/examples/transcrypt/sketch_009/sketch_009.py
@@ -1,5 +1,3 @@
-from pyp5js import *
-
 from random import choice
 
 
diff --git a/docs/examples/transcrypt/sketch_009/target/math.js b/docs/examples/transcrypt/sketch_009/target/math.js
index e1572c2e..0c621bdc 100644
--- a/docs/examples/transcrypt/sketch_009/target/math.js
+++ b/docs/examples/transcrypt/sketch_009/target/math.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:40
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:27
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 var __name__ = 'math';
 export var pi = Math.PI;
 export var e = Math.E;
diff --git a/docs/examples/transcrypt/sketch_009/target/org.transcrypt.__runtime__.js b/docs/examples/transcrypt/sketch_009/target/org.transcrypt.__runtime__.js
index eb712672..87791797 100644
--- a/docs/examples/transcrypt/sketch_009/target/org.transcrypt.__runtime__.js
+++ b/docs/examples/transcrypt/sketch_009/target/org.transcrypt.__runtime__.js
@@ -1,10 +1,10 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:40
+// Transcrypt'ed from Python, 2021-10-14 12:26:27
 var __name__ = 'org.transcrypt.__runtime__';
 export var __envir__ = {};
 __envir__.interpreter_name = 'python';
 __envir__.transpiler_name = 'transcrypt';
 __envir__.executor_name = __envir__.transpiler_name;
-__envir__.transpiler_version = '3.7.16';
+__envir__.transpiler_version = '3.9.0';
 
 export function __nest__ (headObject, tailNames, value) {
     var current = headObject;
@@ -38,15 +38,14 @@ export function __init__ (module) {
     }
     return module.__all__;
 };
-export var __proxy__ = false;
-export function __get__ (self, func, quotedFuncName) {
-    if (self) {
-        if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) {
+export function __get__ (aThis, func, quotedFuncName) {
+    if (aThis) {
+        if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) {
             if (quotedFuncName) {
-                Object.defineProperty (self, quotedFuncName, {
+                Object.defineProperty (aThis, quotedFuncName, {
                     value: function () {
                         var args = [] .slice.apply (arguments);
-                        return func.apply (null, [self] .concat (args));
+                        return func.apply (null, [aThis] .concat (args));
                     },
                     writable: true,
                     enumerable: true,
@@ -55,7 +54,7 @@ export function __get__ (self, func, quotedFuncName) {
             }
             return function () {
                 var args = [] .slice.apply (arguments);
-                return func.apply (null, [self] .concat (args));
+                return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args));
             };
         }
         else {
@@ -66,21 +65,21 @@ export function __get__ (self, func, quotedFuncName) {
         return func;
     }
 };
-export function __getcm__ (self, func, quotedFuncName) {
-    if (self.hasOwnProperty ('__class__')) {
+export function __getcm__ (aThis, func, quotedFuncName) {
+    if (aThis.hasOwnProperty ('__class__')) {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self.__class__] .concat (args));
+            return func.apply (null, [aThis.__class__] .concat (args));
         };
     }
     else {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self] .concat (args));
+            return func.apply (null, [aThis] .concat (args));
         };
     }
 };
-export function __getsm__ (self, func, quotedFuncName) {
+export function __getsm__ (aThis, func, quotedFuncName) {
     return func;
 };
 export var py_metatype = {
@@ -95,6 +94,9 @@ export var py_metatype = {
             var base = bases [index];
             for (var attrib in base) {
                 var descrip = Object.getOwnPropertyDescriptor (base, attrib);
+                if (descrip == null) {
+                    continue;
+                }
                 Object.defineProperty (cls, attrib, descrip);
             }
             for (let symbol of Object.getOwnPropertySymbols (base)) {
@@ -125,7 +127,7 @@ export var object = {
     __new__: function (args) {
         var instance = Object.create (this, {__class__: {value: this, enumerable: true}});
         if ('__getattr__' in this || '__setattr__' in this) {
-            instance = new Proxy (instance, {
+            instance.__proxy__ = new Proxy (instance, {
                 get: function (target, name) {
                     let result = target [name];
                     if (result == undefined) {
@@ -145,6 +147,7 @@ export var object = {
                     return true;
                 }
             })
+			instance = instance.__proxy__
         }
         this.__init__.apply (null, [instance] .concat (args));
         return instance;
@@ -1830,10 +1833,13 @@ export var Exception =  __class__ ('Exception', [BaseException], {
 			var args = tuple ();
 		}
 		self.__args__ = args;
-		try {
+		if (kwargs.error != null) {
 			self.stack = kwargs.error.stack;
 		}
-		catch (__except0__) {
+		else if (Error) {
+			self.stack = new Error ().stack;
+		}
+		else {
 			self.stack = 'No stack trace available';
 		}
 	});},
diff --git a/docs/examples/transcrypt/sketch_009/target/org.transcrypt.__runtime__.py b/docs/examples/transcrypt/sketch_009/target/org.transcrypt.__runtime__.py
index 87834491..8b06f7ba 100644
--- a/docs/examples/transcrypt/sketch_009/target/org.transcrypt.__runtime__.py
+++ b/docs/examples/transcrypt/sketch_009/target/org.transcrypt.__runtime__.py
@@ -19,9 +19,11 @@ class Exception (BaseException):
     #__pragma__ ('kwargs')
     def __init__ (self, *args, **kwargs):
         self.__args__ = args
-        try:
+        if kwargs.error != None:
             self.stack = kwargs.error.stack # Integrate with JavaScript Error object
-        except:
+        elif Error:
+            self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one
+        else:
             self.stack = 'No stack trace available'
     #__pragma__ ('nokwargs')
         
diff --git a/docs/examples/transcrypt/sketch_009/target/pyp5js.js b/docs/examples/transcrypt/sketch_009/target/pyp5js.js
index f3e74eaa..258c3377 100644
--- a/docs/examples/transcrypt/sketch_009/target/pyp5js.js
+++ b/docs/examples/transcrypt/sketch_009/target/pyp5js.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:40
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:27
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 import {PythonFunctions} from './python_functions.js';
 var __name__ = 'pyp5js';
 export var _P5_INSTANCE = null;
diff --git a/docs/examples/transcrypt/sketch_009/target/python_functions.js b/docs/examples/transcrypt/sketch_009/target/python_functions.js
index be0ab1c4..ac0c8407 100644
--- a/docs/examples/transcrypt/sketch_009/target/python_functions.js
+++ b/docs/examples/transcrypt/sketch_009/target/python_functions.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:40
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:28
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 var __name__ = 'python_functions';
 export var PythonFunctions =  __class__ ('PythonFunctions', [object], {
 	__module__: __name__,
diff --git a/docs/examples/transcrypt/sketch_009/target/random.js b/docs/examples/transcrypt/sketch_009/target/random.js
index d24ee9e8..debb6584 100644
--- a/docs/examples/transcrypt/sketch_009/target/random.js
+++ b/docs/examples/transcrypt/sketch_009/target/random.js
@@ -1,6 +1,6 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:40
+// Transcrypt'ed from Python, 2021-10-14 12:26:27
 var math = {};
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 import * as __module_math__ from './math.js';
 __nest__ (math, '', __module_math__);
 var __name__ = 'random';
@@ -138,7 +138,7 @@ export var shuffle = function (x) {
 	}
 	else {
 	}
-	for (var i of range (len (x) - 1, 0, -(1))) {
+	for (var i = len (x) - 1; i > 0; i--) {
 		var j = math.floor (random () * (i + 1));
 		var temp = x [i];
 		x [i] = x [j];
diff --git a/docs/examples/transcrypt/sketch_009/target/sketch_009.js b/docs/examples/transcrypt/sketch_009/target/sketch_009.js
deleted file mode 100644
index c6e22fdc..00000000
--- a/docs/examples/transcrypt/sketch_009/target/sketch_009.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:40
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {choice} from './random.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-var __name__ = 'sketch_009';
-export var images = [];
-export var setup = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	createP ('Click to add a new image');
-	createCanvas (600, 600);
-	background (200);
-	images = [loadImage ('smile.png'), loadImage ('alien.png'), loadImage ('rainbow.png')];
-};
-export var mousePressed = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	var __left0__ = tuple ([mouseX, mouseY]);
-	var x = __left0__ [0];
-	var y = __left0__ [1];
-	var img = choice (images);
-	image (img, x, y);
-};
-export var draw = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	// pass;
-};
-
-//# sourceMappingURL=sketch_009.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_009/target/sketch_009.py b/docs/examples/transcrypt/sketch_009/target/sketch_009.py
deleted file mode 100644
index c9dd4736..00000000
--- a/docs/examples/transcrypt/sketch_009/target/sketch_009.py
+++ /dev/null
@@ -1,28 +0,0 @@
-from pyp5js import *
-
-from random import choice
-
-
-images = []
-
-def setup():
-    global images
-
-    createP("Click to add a new image")
-    createCanvas(600, 600)
-    background(200)
-    images = [
-        loadImage('smile.png'),
-        loadImage('alien.png'),
-        loadImage('rainbow.png'),
-    ]
-
-
-def mousePressed():
-    x, y = mouseX, mouseY
-    img = choice(images)
-    image(img, x, y)
-
-
-def draw():
-    pass
diff --git a/docs/examples/transcrypt/sketch_009/target/target_sketch.js b/docs/examples/transcrypt/sketch_009/target/target_sketch.js
index b07e9439..c13f2253 100644
--- a/docs/examples/transcrypt/sketch_009/target/target_sketch.js
+++ b/docs/examples/transcrypt/sketch_009/target/target_sketch.js
@@ -1,9 +1,99 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:40
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-import * as source_sketch from './sketch_009.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:27
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+import {choice} from './random.js';
+import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
 var __name__ = '__main__';
-export var event_functions = dict ([['deviceMoved', source_sketch.deviceMoved], ['deviceTurned', source_sketch.deviceTurned], ['deviceShaken', source_sketch.deviceShaken], ['keyPressed', source_sketch.keyPressed], ['keyReleased', source_sketch.keyReleased], ['keyTyped', source_sketch.keyTyped], ['mouseMoved', source_sketch.mouseMoved], ['mouseDragged', source_sketch.mouseDragged], ['mousePressed', source_sketch.mousePressed], ['mouseReleased', source_sketch.mouseReleased], ['mouseClicked', source_sketch.mouseClicked], ['doubleClicked', source_sketch.doubleClicked], ['mouseWheel', source_sketch.mouseWheel], ['touchStarted', source_sketch.touchStarted], ['touchMoved', source_sketch.touchMoved], ['touchEnded', source_sketch.touchEnded], ['windowResized', source_sketch.windowResized]]);
-start_p5 (source_sketch.setup, source_sketch.draw, event_functions);
+export var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var deviceMoved = null;
+export var deviceTurned = null;
+export var deviceShaken = null;
+export var keyPressed = null;
+export var keyReleased = null;
+export var keyTyped = null;
+export var mouseMoved = null;
+export var mouseDragged = null;
+export var mousePressed = null;
+export var mouseReleased = null;
+export var mouseClicked = null;
+export var doubleClicked = null;
+export var mouseWheel = null;
+export var touchStarted = null;
+export var touchMoved = null;
+export var touchEnded = null;
+export var windowResized = null;
+export var images = [];
+var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	createP ('Click to add a new image');
+	createCanvas (600, 600);
+	background (200);
+	images = [loadImage ('smile.png'), loadImage ('alien.png'), loadImage ('rainbow.png')];
+};
+var mousePressed = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	var __left0__ = tuple ([mouseX, mouseY]);
+	var x = __left0__ [0];
+	var y = __left0__ [1];
+	var img = choice (images);
+	image (img, x, y);
+};
+var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized});
+start_p5 (setup, draw, event_functions);
 
 //# sourceMappingURL=target_sketch.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_009/target/target_sketch.project b/docs/examples/transcrypt/sketch_009/target/target_sketch.project
index 6a89df12..e858342a 100644
--- a/docs/examples/transcrypt/sketch_009/target/target_sketch.project
+++ b/docs/examples/transcrypt/sketch_009/target/target_sketch.project
@@ -1 +1 @@
-{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/sketch_009.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/sketch_009.js"}, {"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/random/__init__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/random.js"}, {"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/math/__init__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/math.js"}]}
\ No newline at end of file
+{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/target_sketch.js"}, {"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/random/__init__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/random.js"}, {"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/math/__init__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/math.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_009/__target__/python_functions.js"}]}
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_009/target/target_sketch.py b/docs/examples/transcrypt/sketch_009/target/target_sketch.py
index e7a6e442..5236322f 100644
--- a/docs/examples/transcrypt/sketch_009/target/target_sketch.py
+++ b/docs/examples/transcrypt/sketch_009/target/target_sketch.py
@@ -1,24 +1,77 @@
-import sketch_009 as source_sketch
 from pyp5js import *
 
+def setup():
+    pass
+
+def draw():
+    pass
+
+deviceMoved = None
+deviceTurned = None
+deviceShaken = None
+keyPressed = None
+keyReleased = None
+keyTyped = None
+mouseMoved = None
+mouseDragged = None
+mousePressed = None
+mouseReleased = None
+mouseClicked = None
+doubleClicked = None
+mouseWheel = None
+touchStarted = None
+touchMoved = None
+touchEnded = None
+windowResized = None
+
+
+from random import choice
+
+
+images = []
+
+def setup():
+    global images
+
+    createP("Click to add a new image")
+    createCanvas(600, 600)
+    background(200)
+    images = [
+        loadImage('smile.png'),
+        loadImage('alien.png'),
+        loadImage('rainbow.png'),
+    ]
+
+
+def mousePressed():
+    x, y = mouseX, mouseY
+    img = choice(images)
+    image(img, x, y)
+
+
+def draw():
+    pass
+
+
+
 event_functions = {
-    "deviceMoved": source_sketch.deviceMoved,
-    "deviceTurned": source_sketch.deviceTurned,
-    "deviceShaken": source_sketch.deviceShaken,
-    "keyPressed": source_sketch.keyPressed,
-    "keyReleased": source_sketch.keyReleased,
-    "keyTyped": source_sketch.keyTyped,
-    "mouseMoved": source_sketch.mouseMoved,
-    "mouseDragged": source_sketch.mouseDragged,
-    "mousePressed": source_sketch.mousePressed,
-    "mouseReleased": source_sketch.mouseReleased,
-    "mouseClicked": source_sketch.mouseClicked,
-    "doubleClicked": source_sketch.doubleClicked,
-    "mouseWheel": source_sketch.mouseWheel,
-    "touchStarted": source_sketch.touchStarted,
-    "touchMoved": source_sketch.touchMoved,
-    "touchEnded": source_sketch.touchEnded,
-    "windowResized": source_sketch.windowResized,
+    "deviceMoved": deviceMoved,
+    "deviceTurned": deviceTurned,
+    "deviceShaken": deviceShaken,
+    "keyPressed": keyPressed,
+    "keyReleased": keyReleased,
+    "keyTyped": keyTyped,
+    "mouseMoved": mouseMoved,
+    "mouseDragged": mouseDragged,
+    "mousePressed": mousePressed,
+    "mouseReleased": mouseReleased,
+    "mouseClicked": mouseClicked,
+    "doubleClicked": doubleClicked,
+    "mouseWheel": mouseWheel,
+    "touchStarted": touchStarted,
+    "touchMoved": touchMoved,
+    "touchEnded": touchEnded,
+    "windowResized": windowResized,
 }
 
-start_p5(source_sketch.setup, source_sketch.draw, event_functions)
\ No newline at end of file
+start_p5(setup, draw, event_functions)
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_010/index.html b/docs/examples/transcrypt/sketch_010/index.html
index 3f533b90..4064f358 100644
--- a/docs/examples/transcrypt/sketch_010/index.html
+++ b/docs/examples/transcrypt/sketch_010/index.html
@@ -47,9 +47,6 @@
         
              
-from pyp5js import *
-
-
 MY_POINTS = [
     (100, 50),
     (300, 100),
diff --git a/docs/examples/transcrypt/sketch_010/sketch_010.py b/docs/examples/transcrypt/sketch_010/sketch_010.py
index a55147fe..c7053f2b 100644
--- a/docs/examples/transcrypt/sketch_010/sketch_010.py
+++ b/docs/examples/transcrypt/sketch_010/sketch_010.py
@@ -1,6 +1,3 @@
-from pyp5js import *
-
-
 MY_POINTS = [
     (100, 50),
     (300, 100),
diff --git a/docs/examples/transcrypt/sketch_010/target/org.transcrypt.__runtime__.js b/docs/examples/transcrypt/sketch_010/target/org.transcrypt.__runtime__.js
index 842ed33c..d7f8923c 100644
--- a/docs/examples/transcrypt/sketch_010/target/org.transcrypt.__runtime__.js
+++ b/docs/examples/transcrypt/sketch_010/target/org.transcrypt.__runtime__.js
@@ -1,10 +1,10 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:41
+// Transcrypt'ed from Python, 2021-10-14 12:26:28
 var __name__ = 'org.transcrypt.__runtime__';
 export var __envir__ = {};
 __envir__.interpreter_name = 'python';
 __envir__.transpiler_name = 'transcrypt';
 __envir__.executor_name = __envir__.transpiler_name;
-__envir__.transpiler_version = '3.7.16';
+__envir__.transpiler_version = '3.9.0';
 
 export function __nest__ (headObject, tailNames, value) {
     var current = headObject;
@@ -38,15 +38,14 @@ export function __init__ (module) {
     }
     return module.__all__;
 };
-export var __proxy__ = false;
-export function __get__ (self, func, quotedFuncName) {
-    if (self) {
-        if (self.hasOwnProperty ('__class__') || typeof self == 'string' || self instanceof String) {
+export function __get__ (aThis, func, quotedFuncName) {
+    if (aThis) {
+        if (aThis.hasOwnProperty ('__class__') || typeof aThis == 'string' || aThis instanceof String) {
             if (quotedFuncName) {
-                Object.defineProperty (self, quotedFuncName, {
+                Object.defineProperty (aThis, quotedFuncName, {
                     value: function () {
                         var args = [] .slice.apply (arguments);
-                        return func.apply (null, [self] .concat (args));
+                        return func.apply (null, [aThis] .concat (args));
                     },
                     writable: true,
                     enumerable: true,
@@ -55,7 +54,7 @@ export function __get__ (self, func, quotedFuncName) {
             }
             return function () {
                 var args = [] .slice.apply (arguments);
-                return func.apply (null, [self] .concat (args));
+                return func.apply (null, [aThis.__proxy__ ? aThis.__proxy__ : aThis] .concat (args));
             };
         }
         else {
@@ -66,21 +65,21 @@ export function __get__ (self, func, quotedFuncName) {
         return func;
     }
 };
-export function __getcm__ (self, func, quotedFuncName) {
-    if (self.hasOwnProperty ('__class__')) {
+export function __getcm__ (aThis, func, quotedFuncName) {
+    if (aThis.hasOwnProperty ('__class__')) {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self.__class__] .concat (args));
+            return func.apply (null, [aThis.__class__] .concat (args));
         };
     }
     else {
         return function () {
             var args = [] .slice.apply (arguments);
-            return func.apply (null, [self] .concat (args));
+            return func.apply (null, [aThis] .concat (args));
         };
     }
 };
-export function __getsm__ (self, func, quotedFuncName) {
+export function __getsm__ (aThis, func, quotedFuncName) {
     return func;
 };
 export var py_metatype = {
@@ -95,6 +94,9 @@ export var py_metatype = {
             var base = bases [index];
             for (var attrib in base) {
                 var descrip = Object.getOwnPropertyDescriptor (base, attrib);
+                if (descrip == null) {
+                    continue;
+                }
                 Object.defineProperty (cls, attrib, descrip);
             }
             for (let symbol of Object.getOwnPropertySymbols (base)) {
@@ -125,7 +127,7 @@ export var object = {
     __new__: function (args) {
         var instance = Object.create (this, {__class__: {value: this, enumerable: true}});
         if ('__getattr__' in this || '__setattr__' in this) {
-            instance = new Proxy (instance, {
+            instance.__proxy__ = new Proxy (instance, {
                 get: function (target, name) {
                     let result = target [name];
                     if (result == undefined) {
@@ -145,6 +147,7 @@ export var object = {
                     return true;
                 }
             })
+			instance = instance.__proxy__
         }
         this.__init__.apply (null, [instance] .concat (args));
         return instance;
@@ -1830,10 +1833,13 @@ export var Exception =  __class__ ('Exception', [BaseException], {
 			var args = tuple ();
 		}
 		self.__args__ = args;
-		try {
+		if (kwargs.error != null) {
 			self.stack = kwargs.error.stack;
 		}
-		catch (__except0__) {
+		else if (Error) {
+			self.stack = new Error ().stack;
+		}
+		else {
 			self.stack = 'No stack trace available';
 		}
 	});},
diff --git a/docs/examples/transcrypt/sketch_010/target/org.transcrypt.__runtime__.py b/docs/examples/transcrypt/sketch_010/target/org.transcrypt.__runtime__.py
index 87834491..8b06f7ba 100644
--- a/docs/examples/transcrypt/sketch_010/target/org.transcrypt.__runtime__.py
+++ b/docs/examples/transcrypt/sketch_010/target/org.transcrypt.__runtime__.py
@@ -19,9 +19,11 @@ class Exception (BaseException):
     #__pragma__ ('kwargs')
     def __init__ (self, *args, **kwargs):
         self.__args__ = args
-        try:
+        if kwargs.error != None:
             self.stack = kwargs.error.stack # Integrate with JavaScript Error object
-        except:
+        elif Error:
+            self.stack = (__new__(Error())).stack # Create our own stack if we aren't given one
+        else:
             self.stack = 'No stack trace available'
     #__pragma__ ('nokwargs')
         
diff --git a/docs/examples/transcrypt/sketch_010/target/pyp5js.js b/docs/examples/transcrypt/sketch_010/target/pyp5js.js
index c0920fec..4b8cadc1 100644
--- a/docs/examples/transcrypt/sketch_010/target/pyp5js.js
+++ b/docs/examples/transcrypt/sketch_010/target/pyp5js.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:41
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:28
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 import {PythonFunctions} from './python_functions.js';
 var __name__ = 'pyp5js';
 export var _P5_INSTANCE = null;
diff --git a/docs/examples/transcrypt/sketch_010/target/python_functions.js b/docs/examples/transcrypt/sketch_010/target/python_functions.js
index 61d9a110..96e8f286 100644
--- a/docs/examples/transcrypt/sketch_010/target/python_functions.js
+++ b/docs/examples/transcrypt/sketch_010/target/python_functions.js
@@ -1,5 +1,5 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:41
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:29
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
 var __name__ = 'python_functions';
 export var PythonFunctions =  __class__ ('PythonFunctions', [object], {
 	__module__: __name__,
diff --git a/docs/examples/transcrypt/sketch_010/target/sketch_010.js b/docs/examples/transcrypt/sketch_010/target/sketch_010.js
deleted file mode 100644
index 2a5591f0..00000000
--- a/docs/examples/transcrypt/sketch_010/target/sketch_010.js
+++ /dev/null
@@ -1,242 +0,0 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:41
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-var __name__ = 'sketch_010';
-export var MY_POINTS = [tuple ([100, 50]), tuple ([300, 100]), tuple ([200, 300]), tuple ([100, 300])];
-export var FRAME_IDX = 0;
-export var POINT_SIZE = 10;
-export var CNV = null;
-export var setup = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	CNV = createCanvas (400, 400);
-	var BUTTON_PREV = createButton ('Previous frame');
-	BUTTON_PREV.position (CNV.position ().x, CNV.height + CNV.position ().y);
-	BUTTON_PREV.mousePressed (prev_frame);
-	var BUTTON_NEXT = createButton ('Next frame');
-	BUTTON_NEXT.position (CNV.position ().x + BUTTON_PREV.size ().width, BUTTON_PREV.position ().y);
-	BUTTON_NEXT.mousePressed (next_frame);
-	background (190);
-	draw_labels (MY_POINTS);
-};
-export var draw = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	background (190);
-	draw_closed_curve_vertex (MY_POINTS, FRAME_IDX);
-	draw_labels (MY_POINTS);
-};
-export var mouseClicked = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	if (is_point_in_canvas (mouseX, mouseY)) {
-		var i = get_point_index (mouseX, mouseY);
-		if (i != null) {
-			MY_POINTS.py_pop (i);
-			if (FRAME_IDX >= len (MY_POINTS)) {
-				FRAME_IDX = len (MY_POINTS) - 1;
-			}
-		}
-		else {
-			MY_POINTS.append (tuple ([mouseX, mouseY]));
-		}
-	}
-};
-export var get_point_index = function (x, y) {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-				switch (__attrib0__) {
-					case 'x': var x = __allkwargs0__ [__attrib0__]; break;
-					case 'y': var y = __allkwargs0__ [__attrib0__]; break;
-				}
-			}
-		}
-	}
-	else {
-	}
-	for (var [idx, [p_x, p_y]] of enumerate (MY_POINTS)) {
-		if ((p_x - POINT_SIZE < x && x < p_x + POINT_SIZE) && (p_y - POINT_SIZE < y && y < p_y + POINT_SIZE)) {
-			return idx;
-		}
-	}
-};
-export var is_point_in_canvas = function (x, y) {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-				switch (__attrib0__) {
-					case 'x': var x = __allkwargs0__ [__attrib0__]; break;
-					case 'y': var y = __allkwargs0__ [__attrib0__]; break;
-				}
-			}
-		}
-	}
-	else {
-	}
-	if ((x < 0 || x > CNV.width) || (y < 0 || y > CNV.height)) {
-		return false;
-	}
-	return true;
-};
-export var next_frame = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	if (FRAME_IDX < len (MY_POINTS) - 1) {
-		FRAME_IDX += 1;
-	}
-};
-export var prev_frame = function () {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-			}
-		}
-	}
-	else {
-	}
-	if (FRAME_IDX > 0) {
-		FRAME_IDX -= 1;
-	}
-};
-export var draw_closed_curve_vertex = function (points, max_idx) {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-				switch (__attrib0__) {
-					case 'points': var points = __allkwargs0__ [__attrib0__]; break;
-					case 'max_idx': var max_idx = __allkwargs0__ [__attrib0__]; break;
-				}
-			}
-		}
-	}
-	else {
-	}
-	if (len (points) < 2) {
-		return ;
-	}
-	var used_points = [];
-	beginShape ();
-	var idx = len (points) - 1;
-	curveVertex (...points [idx]);
-	used_points.append (idx);
-	for (var [idx, p] of enumerate (points)) {
-		if (idx > max_idx) {
-			break;
-		}
-		curveVertex (...p);
-		used_points.append (idx);
-	}
-	var idx = 0;
-	curveVertex (...points [idx]);
-	used_points.append (idx);
-	var idx = 1;
-	curveVertex (...points [idx]);
-	used_points.append (idx);
-	endShape ();
-	textSize (10);
-	noStroke ();
-	text ('Points used to draw this curve (first and last are control points only)', 5, CNV.height - 30);
-	textSize (20);
-	text (', '.join (used_points), 10, CNV.height - 10);
-	stroke (0);
-	for (var i = 0; i < len (used_points) - 1; i++) {
-		draw_dotted_line (points [used_points [i]], points [used_points [i + 1]]);
-	}
-};
-export var draw_labels = function (points) {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-				switch (__attrib0__) {
-					case 'points': var points = __allkwargs0__ [__attrib0__]; break;
-				}
-			}
-		}
-	}
-	else {
-	}
-	strokeWeight (POINT_SIZE);
-	for (var [idx, p] of enumerate (points)) {
-		var ts = 32;
-		textSize (ts);
-		var textY = p [1] - ts / 2;
-		if (p [1] > CNV.height / 2) {
-			var textY = p [1] + ts;
-		}
-		noStroke ();
-		text (idx, p [0], textY);
-		stroke (0);
-		point (...p);
-	}
-	strokeWeight (1);
-};
-export var draw_dotted_line = function (p1, p2) {
-	if (arguments.length) {
-		var __ilastarg0__ = arguments.length - 1;
-		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
-			var __allkwargs0__ = arguments [__ilastarg0__--];
-			for (var __attrib0__ in __allkwargs0__) {
-				switch (__attrib0__) {
-					case 'p1': var p1 = __allkwargs0__ [__attrib0__]; break;
-					case 'p2': var p2 = __allkwargs0__ [__attrib0__]; break;
-				}
-			}
-		}
-	}
-	else {
-	}
-	stroke (100);
-	strokeWeight (3);
-	for (var i = 0; i < 11; i++) {
-		var x = lerp (p1 [0], p2 [0], i / 10);
-		var y = lerp (p1 [1], p2 [1], i / 10);
-		point (x, y);
-	}
-	stroke (0);
-	strokeWeight (1);
-};
-
-//# sourceMappingURL=sketch_010.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_010/target/sketch_010.py b/docs/examples/transcrypt/sketch_010/target/sketch_010.py
deleted file mode 100644
index a55147fe..00000000
--- a/docs/examples/transcrypt/sketch_010/target/sketch_010.py
+++ /dev/null
@@ -1,139 +0,0 @@
-from pyp5js import *
-
-
-MY_POINTS = [
-    (100, 50),
-    (300, 100),
-    (200, 300),
-    (100, 300),
-]
-FRAME_IDX = 0
-POINT_SIZE = 10
-CNV = None
-
-def setup():
-    global CNV
-    CNV = createCanvas(400, 400)
-
-    BUTTON_PREV = createButton('Previous frame')
-    BUTTON_PREV.position(CNV.position().x,
-                         CNV.height + CNV.position().y)
-    BUTTON_PREV.mousePressed(prev_frame)
-
-    BUTTON_NEXT = createButton('Next frame')
-    BUTTON_NEXT.position(CNV.position().x + BUTTON_PREV.size().width,
-                         BUTTON_PREV.position().y)
-    BUTTON_NEXT.mousePressed(next_frame)
-
-    background(190)
-    draw_labels(MY_POINTS)
-
-def draw():
-    background(190)
-    draw_closed_curve_vertex(MY_POINTS, FRAME_IDX)
-    draw_labels(MY_POINTS)
-
-def mouseClicked():
-    global FRAME_IDX
-    global MY_POINTS
-    if is_point_in_canvas(mouseX, mouseY):
-        i = get_point_index(mouseX, mouseY)
-        if i != None:
-            MY_POINTS.pop(i)
-            if FRAME_IDX >= len(MY_POINTS):
-                # cap i if it exceeds maximum length now.
-                FRAME_IDX = len(MY_POINTS) - 1
-        else:
-            MY_POINTS.append((mouseX, mouseY))
-
-def get_point_index(x, y):
-    for idx, (p_x,p_y) in enumerate(MY_POINTS):
-        if (p_x - POINT_SIZE < x and x < p_x + POINT_SIZE) and \
-           (p_y - POINT_SIZE < y and y < p_y + POINT_SIZE):
-            return idx
-
-def is_point_in_canvas(x, y):
-    if (x < 0 or x > CNV.width) or \
-       (y < 0 or y > CNV.height):
-        return False
-    return True
-
-def next_frame():
-    global FRAME_IDX
-    if FRAME_IDX < len(MY_POINTS) - 1:
-        FRAME_IDX += 1
-
-def prev_frame():
-    global FRAME_IDX
-    if FRAME_IDX > 0:
-        FRAME_IDX -= 1
-
-def draw_closed_curve_vertex(points, max_idx):
-    if len(points) < 2:
-        return
-    used_points = []
-    beginShape()
-
-    # start by using the last point as the initial control point
-    idx = len(points) - 1
-    curveVertex(*points[idx])
-    used_points.append(idx)
-
-    # add each point to the curve
-    for idx,p in enumerate(points):
-        if idx > max_idx:
-            break
-        curveVertex(*p)
-        used_points.append(idx)
-
-    # to close the curve, we need to create the last curve.
-    # for that, we must go to the first point
-    idx = 0
-    curveVertex(*points[idx])
-    used_points.append(idx)
-
-    # and use the next point as a control point.
-    idx = 1
-    curveVertex(*points[idx])
-    used_points.append(idx)
-    endShape()
-
-    textSize(10)
-    noStroke()
-    text('Points used to draw this curve (first and last are control points only)', 5, CNV.height - 30)
-
-    textSize(20)
-    text(', '.join(used_points), 10, CNV.height - 10)
-    stroke(0)
-
-    for i in range(len(used_points) - 1):
-        draw_dotted_line(points[used_points[i]],
-                         points[used_points[i + 1]])
-
-def draw_labels(points):
-    strokeWeight(POINT_SIZE)
-    for idx, p in enumerate(points):
-        ts = 32
-        textSize(ts)
-        textY = p[1] - ts / 2
-
-        if p[1] > CNV.height / 2:
-            textY = p[1] + ts
-
-        noStroke()
-        text(idx, p[0], textY)
-        stroke(0)
-        point(*p)
-
-    strokeWeight(1)
-
-def draw_dotted_line(p1, p2):
-    stroke(100)
-    strokeWeight(3)
-    for i in range(11):
-        x = lerp(p1[0], p2[0], i/10)
-        y = lerp(p1[1], p2[1], i/10)
-        point(x, y)
-
-    stroke(0)
-    strokeWeight(1)
diff --git a/docs/examples/transcrypt/sketch_010/target/target_sketch.js b/docs/examples/transcrypt/sketch_010/target/target_sketch.js
index 5408f504..e5397c09 100644
--- a/docs/examples/transcrypt/sketch_010/target/target_sketch.js
+++ b/docs/examples/transcrypt/sketch_010/target/target_sketch.js
@@ -1,9 +1,287 @@
-// Transcrypt'ed from Python, 2021-09-20 17:40:41
-import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
-import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, draw, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, setup, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
-import * as source_sketch from './sketch_010.js';
+// Transcrypt'ed from Python, 2021-10-14 12:26:28
+import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, all, any, assert, bool, bytearray, bytes, callable, chr, deepcopy, delattr, dict, dir, divmod, enumerate, getattr, hasattr, isinstance, issubclass, len, list, object, ord, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, set, setattr, sorted, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
+import {ADD, ALT, ARROW, AUDIO, AUTO, AXES, BACKSPACE, BASELINE, BEVEL, BEZIER, BLEND, BLUR, BOLD, BOLDITALIC, BOTTOM, BURN, CENTER, CHORD, CLAMP, CLOSE, CONTROL, CORNER, CORNERS, CROSS, CURVE, DARKEST, DEGREES, DEG_TO_RAD, DELETE, DIFFERENCE, DILATE, DODGE, DOWN_ARROW, ENTER, ERODE, ESCAPE, EXCLUSION, FILL, GRAY, GRID, HALF_PI, HAND, HARD_LIGHT, HSB, HSL, IMAGE, IMMEDIATE, INVERT, ITALIC, LANDSCAPE, LEFT, LEFT_ARROW, LIGHTEST, LINEAR, LINES, LINE_LOOP, LINE_STRIP, MIRROR, MITER, MOVE, MULTIPLY, NEAREST, NORMAL, OPAQUE, OPEN, OPTION, OVERLAY, P2D, PI, PIE, POINTS, PORTRAIT, POSTERIZE, PROJECT, PVector, QUADRATIC, QUADS, QUAD_STRIP, QUARTER_PI, RADIANS, RADIUS, RAD_TO_DEG, REPEAT, REPLACE, RETURN, RGB, RIGHT, RIGHT_ARROW, ROUND, SCREEN, SHIFT, SOFT_LIGHT, SQUARE, STROKE, SUBTRACT, TAB, TAU, TEXT, TEXTURE, THRESHOLD, TOP, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, TWO_PI, UP_ARROW, VIDEO, WAIT, WEBGL, _CTX_MIDDLE, _DEFAULT_FILL, _DEFAULT_LEADMULT, _DEFAULT_STROKE, _DEFAULT_TEXT_FILL, _P5_INSTANCE, abs, accelerationX, accelerationY, accelerationZ, acos, add_library, alpha, ambientLight, ambientMaterial, angleMode, append, applyMatrix, arc, arrayCopy, asin, atan, atan2, background, beginContour, beginShape, bezier, bezierDetail, bezierPoint, bezierTangent, bezierVertex, blend, blendMode, blue, boolean, box, brightness, byte, camera, ceil, changed, char, circle, color, colorMode, concat, cone, constrain, copy, cos, createA, createAudio, createButton, createCamera, createCanvas, createCapture, createCheckbox, createColorPicker, createDiv, createElement, createFileInput, createGraphics, createImage, createImg, createInput, createNumberDict, createP, createRadio, createSelect, createShader, createSlider, createSpan, createStringDict, createVector, createVideo, createWriter, cursor, curve, curveDetail, curvePoint, curveTangent, curveTightness, curveVertex, cylinder, day, debugMode, degrees, deviceOrientation, directionalLight, disableFriendlyErrors, displayDensity, displayHeight, displayWidth, dist, ellipse, ellipseMode, ellipsoid, endContour, endShape, erase, exp, fill, filter, float, floor, focused, frameCount, frameRate, fullscreen, getURL, getURLParams, getURLPath, global_p5_injection, green, height, hex, hour, httpDo, httpGet, httpPost, hue, image, imageMode, image_proxy, input, int, join, key, keyCode, keyIsDown, keyIsPressed, lerp, lerpColor, lightness, lights, line, loadBytes, loadFont, loadImage, loadJSON, loadModel, loadPixels, loadShader, loadStrings, loadTable, loadXML, log, logOnloaded, loop, mag, map, match, matchAll, max, millis, min, minute, model, month, mouseButton, mouseIsPressed, mouseX, mouseY, nf, nfc, nfp, nfs, noCanvas, noCursor, noDebugMode, noErase, noFill, noLoop, noSmooth, noStroke, noTint, noise, noiseDetail, noiseSeed, norm, normalMaterial, orbitControl, ortho, pAccelerationX, pAccelerationY, pAccelerationZ, pRotationX, pRotationY, pRotationZ, perspective, pixelDensity, pixels, plane, pmouseX, pmouseY, point, pointLight, popMatrix, popStyle, pow, pre_draw, preload, push, pushMatrix, pushStyle, pwinMouseX, pwinMouseY, py_clear, py_get, py_pop, py_set, py_sort, py_split, quad, quadraticVertex, radians, random, randomGaussian, randomSeed, rect, rectMode, red, redraw, remove, removeElements, resetMatrix, resetShader, resizeCanvas, reverse, rotate, rotateX, rotateY, rotateZ, rotationX, rotationY, rotationZ, round, saturation, save, saveCanvas, saveFrames, saveJSON, saveStrings, saveTable, scale, second, select, selectAll, setAttributes, setCamera, setMoveThreshold, setShakeThreshold, shader, shearX, shearY, shininess, shorten, shuffle, sin, size, smooth, specularMaterial, sphere, splice, splitTokens, sq, sqrt, square, start_p5, str, stroke, strokeCap, strokeJoin, strokeWeight, subset, tan, text, textAlign, textAscent, textDescent, textFont, textLeading, textSize, textStyle, textWidth, texture, textureMode, textureWrap, tint, torus, touches, translate, triangle, trim, turnAxis, unchar, unhex, updatePixels, vertex, width, winMouseX, winMouseY, windowHeight, windowWidth, year} from './pyp5js.js';
 var __name__ = '__main__';
-export var event_functions = dict ([['deviceMoved', source_sketch.deviceMoved], ['deviceTurned', source_sketch.deviceTurned], ['deviceShaken', source_sketch.deviceShaken], ['keyPressed', source_sketch.keyPressed], ['keyReleased', source_sketch.keyReleased], ['keyTyped', source_sketch.keyTyped], ['mouseMoved', source_sketch.mouseMoved], ['mouseDragged', source_sketch.mouseDragged], ['mousePressed', source_sketch.mousePressed], ['mouseReleased', source_sketch.mouseReleased], ['mouseClicked', source_sketch.mouseClicked], ['doubleClicked', source_sketch.doubleClicked], ['mouseWheel', source_sketch.mouseWheel], ['touchStarted', source_sketch.touchStarted], ['touchMoved', source_sketch.touchMoved], ['touchEnded', source_sketch.touchEnded], ['windowResized', source_sketch.windowResized]]);
-start_p5 (source_sketch.setup, source_sketch.draw, event_functions);
+export var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	// pass;
+};
+export var deviceMoved = null;
+export var deviceTurned = null;
+export var deviceShaken = null;
+export var keyPressed = null;
+export var keyReleased = null;
+export var keyTyped = null;
+export var mouseMoved = null;
+export var mouseDragged = null;
+export var mousePressed = null;
+export var mouseReleased = null;
+export var mouseClicked = null;
+export var doubleClicked = null;
+export var mouseWheel = null;
+export var touchStarted = null;
+export var touchMoved = null;
+export var touchEnded = null;
+export var windowResized = null;
+export var MY_POINTS = [tuple ([100, 50]), tuple ([300, 100]), tuple ([200, 300]), tuple ([100, 300])];
+export var FRAME_IDX = 0;
+export var POINT_SIZE = 10;
+export var CNV = null;
+var setup = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	CNV = createCanvas (400, 400);
+	var BUTTON_PREV = createButton ('Previous frame');
+	BUTTON_PREV.position (CNV.position ().x, CNV.height + CNV.position ().y);
+	BUTTON_PREV.mousePressed (prev_frame);
+	var BUTTON_NEXT = createButton ('Next frame');
+	BUTTON_NEXT.position (CNV.position ().x + BUTTON_PREV.size ().width, BUTTON_PREV.position ().y);
+	BUTTON_NEXT.mousePressed (next_frame);
+	background (190);
+	draw_labels (MY_POINTS);
+};
+var draw = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	background (190);
+	draw_closed_curve_vertex (MY_POINTS, FRAME_IDX);
+	draw_labels (MY_POINTS);
+};
+var mouseClicked = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	if (is_point_in_canvas (mouseX, mouseY)) {
+		var i = get_point_index (mouseX, mouseY);
+		if (i != null) {
+			MY_POINTS.py_pop (i);
+			if (FRAME_IDX >= len (MY_POINTS)) {
+				FRAME_IDX = len (MY_POINTS) - 1;
+			}
+		}
+		else {
+			MY_POINTS.append (tuple ([mouseX, mouseY]));
+		}
+	}
+};
+export var get_point_index = function (x, y) {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+				switch (__attrib0__) {
+					case 'x': var x = __allkwargs0__ [__attrib0__]; break;
+					case 'y': var y = __allkwargs0__ [__attrib0__]; break;
+				}
+			}
+		}
+	}
+	else {
+	}
+	for (var [idx, [p_x, p_y]] of enumerate (MY_POINTS)) {
+		if ((p_x - POINT_SIZE < x && x < p_x + POINT_SIZE) && (p_y - POINT_SIZE < y && y < p_y + POINT_SIZE)) {
+			return idx;
+		}
+	}
+};
+export var is_point_in_canvas = function (x, y) {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+				switch (__attrib0__) {
+					case 'x': var x = __allkwargs0__ [__attrib0__]; break;
+					case 'y': var y = __allkwargs0__ [__attrib0__]; break;
+				}
+			}
+		}
+	}
+	else {
+	}
+	if ((x < 0 || x > CNV.width) || (y < 0 || y > CNV.height)) {
+		return false;
+	}
+	return true;
+};
+export var next_frame = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	if (FRAME_IDX < len (MY_POINTS) - 1) {
+		FRAME_IDX++;
+	}
+};
+export var prev_frame = function () {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+			}
+		}
+	}
+	else {
+	}
+	if (FRAME_IDX > 0) {
+		FRAME_IDX--;
+	}
+};
+export var draw_closed_curve_vertex = function (points, max_idx) {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+				switch (__attrib0__) {
+					case 'points': var points = __allkwargs0__ [__attrib0__]; break;
+					case 'max_idx': var max_idx = __allkwargs0__ [__attrib0__]; break;
+				}
+			}
+		}
+	}
+	else {
+	}
+	if (len (points) < 2) {
+		return ;
+	}
+	var used_points = [];
+	beginShape ();
+	var idx = len (points) - 1;
+	curveVertex (...points [idx]);
+	used_points.append (idx);
+	for (var [idx, p] of enumerate (points)) {
+		if (idx > max_idx) {
+			break;
+		}
+		curveVertex (...p);
+		used_points.append (idx);
+	}
+	var idx = 0;
+	curveVertex (...points [idx]);
+	used_points.append (idx);
+	var idx = 1;
+	curveVertex (...points [idx]);
+	used_points.append (idx);
+	endShape ();
+	textSize (10);
+	noStroke ();
+	text ('Points used to draw this curve (first and last are control points only)', 5, CNV.height - 30);
+	textSize (20);
+	text (', '.join (used_points), 10, CNV.height - 10);
+	stroke (0);
+	for (var i = 0; i < len (used_points) - 1; i++) {
+		draw_dotted_line (points [used_points [i]], points [used_points [i + 1]]);
+	}
+};
+export var draw_labels = function (points) {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+				switch (__attrib0__) {
+					case 'points': var points = __allkwargs0__ [__attrib0__]; break;
+				}
+			}
+		}
+	}
+	else {
+	}
+	strokeWeight (POINT_SIZE);
+	for (var [idx, p] of enumerate (points)) {
+		var ts = 32;
+		textSize (ts);
+		var textY = p [1] - ts / 2;
+		if (p [1] > CNV.height / 2) {
+			var textY = p [1] + ts;
+		}
+		noStroke ();
+		text (idx, p [0], textY);
+		stroke (0);
+		point (...p);
+	}
+	strokeWeight (1);
+};
+export var draw_dotted_line = function (p1, p2) {
+	if (arguments.length) {
+		var __ilastarg0__ = arguments.length - 1;
+		if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
+			var __allkwargs0__ = arguments [__ilastarg0__--];
+			for (var __attrib0__ in __allkwargs0__) {
+				switch (__attrib0__) {
+					case 'p1': var p1 = __allkwargs0__ [__attrib0__]; break;
+					case 'p2': var p2 = __allkwargs0__ [__attrib0__]; break;
+				}
+			}
+		}
+	}
+	else {
+	}
+	stroke (100);
+	strokeWeight (3);
+	for (var i = 0; i < 11; i++) {
+		var x = lerp (p1 [0], p2 [0], i / 10);
+		var y = lerp (p1 [1], p2 [1], i / 10);
+		point (x, y);
+	}
+	stroke (0);
+	strokeWeight (1);
+};
+export var event_functions = dict ({'deviceMoved': deviceMoved, 'deviceTurned': deviceTurned, 'deviceShaken': deviceShaken, 'keyPressed': keyPressed, 'keyReleased': keyReleased, 'keyTyped': keyTyped, 'mouseMoved': mouseMoved, 'mouseDragged': mouseDragged, 'mousePressed': mousePressed, 'mouseReleased': mouseReleased, 'mouseClicked': mouseClicked, 'doubleClicked': doubleClicked, 'mouseWheel': mouseWheel, 'touchStarted': touchStarted, 'touchMoved': touchMoved, 'touchEnded': touchEnded, 'windowResized': windowResized});
+start_p5 (setup, draw, event_functions);
 
 //# sourceMappingURL=target_sketch.map
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_010/target/target_sketch.project b/docs/examples/transcrypt/sketch_010/target/target_sketch.project
index b6452495..510bb36c 100644
--- a/docs/examples/transcrypt/sketch_010/target/target_sketch.project
+++ b/docs/examples/transcrypt/sketch_010/target/target_sketch.project
@@ -1 +1 @@
-{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.8/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/python_functions.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/sketch_010.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/sketch_010.js"}]}
\ No newline at end of file
+{"options": {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/target_sketch.py", "anno": false, "alimod": false, "build": true, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": true, "keycheck": false, "license": false, "map": true, "nomin": true, "opov": false, "outdir": null, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt", "xtiny": false, "star": false}, "modules": [{"source": "/home/bernardo/.pyenv/versions/pyp5js/lib/python3.9/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/org.transcrypt.__runtime__.js"}, {"source": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/target_sketch.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/target_sketch.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/pyp5js.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/pyp5js.js"}, {"source": "/home/bernardo/envs/pyp5js/pyp5js/templates/transcrypt/python_functions.py", "target": "/home/bernardo/envs/pyp5js/docs/examples/transcrypt/sketch_010/__target__/python_functions.js"}]}
\ No newline at end of file
diff --git a/docs/examples/transcrypt/sketch_010/target/target_sketch.py b/docs/examples/transcrypt/sketch_010/target/target_sketch.py
index a0ab3ac4..1dd65bc3 100644
--- a/docs/examples/transcrypt/sketch_010/target/target_sketch.py
+++ b/docs/examples/transcrypt/sketch_010/target/target_sketch.py
@@ -1,24 +1,187 @@
-import sketch_010 as source_sketch
 from pyp5js import *
 
+def setup():
+    pass
+
+def draw():
+    pass
+
+deviceMoved = None
+deviceTurned = None
+deviceShaken = None
+keyPressed = None
+keyReleased = None
+keyTyped = None
+mouseMoved = None
+mouseDragged = None
+mousePressed = None
+mouseReleased = None
+mouseClicked = None
+doubleClicked = None
+mouseWheel = None
+touchStarted = None
+touchMoved = None
+touchEnded = None
+windowResized = None
+
+
+MY_POINTS = [
+    (100, 50),
+    (300, 100),
+    (200, 300),
+    (100, 300),
+]
+FRAME_IDX = 0
+POINT_SIZE = 10
+CNV = None
+
+def setup():
+    global CNV
+    CNV = createCanvas(400, 400)
+
+    BUTTON_PREV = createButton('Previous frame')
+    BUTTON_PREV.position(CNV.position().x,
+                         CNV.height + CNV.position().y)
+    BUTTON_PREV.mousePressed(prev_frame)
+
+    BUTTON_NEXT = createButton('Next frame')
+    BUTTON_NEXT.position(CNV.position().x + BUTTON_PREV.size().width,
+                         BUTTON_PREV.position().y)
+    BUTTON_NEXT.mousePressed(next_frame)
+
+    background(190)
+    draw_labels(MY_POINTS)
+
+def draw():
+    background(190)
+    draw_closed_curve_vertex(MY_POINTS, FRAME_IDX)
+    draw_labels(MY_POINTS)
+
+def mouseClicked():
+    global FRAME_IDX
+    global MY_POINTS
+    if is_point_in_canvas(mouseX, mouseY):
+        i = get_point_index(mouseX, mouseY)
+        if i != None:
+            MY_POINTS.pop(i)
+            if FRAME_IDX >= len(MY_POINTS):
+                # cap i if it exceeds maximum length now.
+                FRAME_IDX = len(MY_POINTS) - 1
+        else:
+            MY_POINTS.append((mouseX, mouseY))
+
+def get_point_index(x, y):
+    for idx, (p_x,p_y) in enumerate(MY_POINTS):
+        if (p_x - POINT_SIZE < x and x < p_x + POINT_SIZE) and \
+           (p_y - POINT_SIZE < y and y < p_y + POINT_SIZE):
+            return idx
+
+def is_point_in_canvas(x, y):
+    if (x < 0 or x > CNV.width) or \
+       (y < 0 or y > CNV.height):
+        return False
+    return True
+
+def next_frame():
+    global FRAME_IDX
+    if FRAME_IDX < len(MY_POINTS) - 1:
+        FRAME_IDX += 1
+
+def prev_frame():
+    global FRAME_IDX
+    if FRAME_IDX > 0:
+        FRAME_IDX -= 1
+
+def draw_closed_curve_vertex(points, max_idx):
+    if len(points) < 2:
+        return
+    used_points = []
+    beginShape()
+
+    # start by using the last point as the initial control point
+    idx = len(points) - 1
+    curveVertex(*points[idx])
+    used_points.append(idx)
+
+    # add each point to the curve
+    for idx,p in enumerate(points):
+        if idx > max_idx:
+            break
+        curveVertex(*p)
+        used_points.append(idx)
+
+    # to close the curve, we need to create the last curve.
+    # for that, we must go to the first point
+    idx = 0
+    curveVertex(*points[idx])
+    used_points.append(idx)
+
+    # and use the next point as a control point.
+    idx = 1
+    curveVertex(*points[idx])
+    used_points.append(idx)
+    endShape()
+
+    textSize(10)
+    noStroke()
+    text('Points used to draw this curve (first and last are control points only)', 5, CNV.height - 30)
+
+    textSize(20)
+    text(', '.join(used_points), 10, CNV.height - 10)
+    stroke(0)
+
+    for i in range(len(used_points) - 1):
+        draw_dotted_line(points[used_points[i]],
+                         points[used_points[i + 1]])
+
+def draw_labels(points):
+    strokeWeight(POINT_SIZE)
+    for idx, p in enumerate(points):
+        ts = 32
+        textSize(ts)
+        textY = p[1] - ts / 2
+
+        if p[1] > CNV.height / 2:
+            textY = p[1] + ts
+
+        noStroke()
+        text(idx, p[0], textY)
+        stroke(0)
+        point(*p)
+
+    strokeWeight(1)
+
+def draw_dotted_line(p1, p2):
+    stroke(100)
+    strokeWeight(3)
+    for i in range(11):
+        x = lerp(p1[0], p2[0], i/10)
+        y = lerp(p1[1], p2[1], i/10)
+        point(x, y)
+
+    stroke(0)
+    strokeWeight(1)
+
+
+
 event_functions = {
-    "deviceMoved": source_sketch.deviceMoved,
-    "deviceTurned": source_sketch.deviceTurned,
-    "deviceShaken": source_sketch.deviceShaken,
-    "keyPressed": source_sketch.keyPressed,
-    "keyReleased": source_sketch.keyReleased,
-    "keyTyped": source_sketch.keyTyped,
-    "mouseMoved": source_sketch.mouseMoved,
-    "mouseDragged": source_sketch.mouseDragged,
-    "mousePressed": source_sketch.mousePressed,
-    "mouseReleased": source_sketch.mouseReleased,
-    "mouseClicked": source_sketch.mouseClicked,
-    "doubleClicked": source_sketch.doubleClicked,
-    "mouseWheel": source_sketch.mouseWheel,
-    "touchStarted": source_sketch.touchStarted,
-    "touchMoved": source_sketch.touchMoved,
-    "touchEnded": source_sketch.touchEnded,
-    "windowResized": source_sketch.windowResized,
+    "deviceMoved": deviceMoved,
+    "deviceTurned": deviceTurned,
+    "deviceShaken": deviceShaken,
+    "keyPressed": keyPressed,
+    "keyReleased": keyReleased,
+    "keyTyped": keyTyped,
+    "mouseMoved": mouseMoved,
+    "mouseDragged": mouseDragged,
+    "mousePressed": mousePressed,
+    "mouseReleased": mouseReleased,
+    "mouseClicked": mouseClicked,
+    "doubleClicked": doubleClicked,
+    "mouseWheel": mouseWheel,
+    "touchStarted": touchStarted,
+    "touchMoved": touchMoved,
+    "touchEnded": touchEnded,
+    "windowResized": windowResized,
 }
 
-start_p5(source_sketch.setup, source_sketch.draw, event_functions)
\ No newline at end of file
+start_p5(setup, draw, event_functions)
\ No newline at end of file
diff --git a/pyp5js/cli.py b/pyp5js/cli.py
index c832b328..fc89898a 100755
--- a/pyp5js/cli.py
+++ b/pyp5js/cli.py
@@ -60,13 +60,14 @@ def transcrypt_sketch(sketch_name):
 @command_line_entrypoint.command("compile")
 @click.argument("sketch_name")
 @click.option('--refresh', is_flag=True, help="Update the skech index.html before it ends.")
-def compile_sketch(sketch_name, refresh):
+@click.option('--template', '-t', type=click.Path(exists=True), help='Specify a custom index.html template to use. Must be used with --refresh in order to work.')
+def compile_sketch(sketch_name, refresh, template):
     """
     Command to update your sketch files (index, js codes etc)
     \nExample:
     $ pyp5js compile my_sketch
     """
-    files = commands.compile_sketch(sketch_name.replace("/", ""), refresh)
+    files = commands.compile_sketch(sketch_name.replace("/", ""), refresh, template)
     cprint.ok(f"Your sketch is ready and available at file://{files.index_html.absolute()}")
 
 
diff --git a/pyp5js/commands.py b/pyp5js/commands.py
index c6d04e84..b7a5c0f2 100644
--- a/pyp5js/commands.py
+++ b/pyp5js/commands.py
@@ -42,7 +42,7 @@ def new_sketch(sketch_name, interpreter=PYODIDE_INTERPRETER, template_file=""):
     return sketch
 
 
-def compile_sketch(sketch_name, generate_index=False):
+def compile_sketch(sketch_name, generate_index=False, index_template=None):
     """
     Transcrypt the sketch python code to javascript.
 
@@ -61,6 +61,9 @@ def compile_sketch(sketch_name, generate_index=False):
 
     compile_sketch_js(sketch)
     if generate_index:
+        # to be able to overwrite default index template file
+        # useful for generating the docs or debugging
+        sketch.config.index_template = index_template
         index_contet = get_sketch_index_content(sketch)
         with open(sketch.index_html, "w") as fd:
             fd.write(index_contet)
diff --git a/pyp5js/templates/transcrypt/target_sketch.py.template b/pyp5js/templates/transcrypt/target_sketch.py.template
index 26e8a252..9a538c0a 100644
--- a/pyp5js/templates/transcrypt/target_sketch.py.template
+++ b/pyp5js/templates/transcrypt/target_sketch.py.template
@@ -1,24 +1,51 @@
-import {{ sketch_name }} as source_sketch
 from pyp5js import *
 
+def setup():
+    pass
+
+def draw():
+    pass
+
+deviceMoved = None
+deviceTurned = None
+deviceShaken = None
+keyPressed = None
+keyReleased = None
+keyTyped = None
+mouseMoved = None
+mouseDragged = None
+mousePressed = None
+mouseReleased = None
+mouseClicked = None
+doubleClicked = None
+mouseWheel = None
+touchStarted = None
+touchMoved = None
+touchEnded = None
+windowResized = None
+
+
+{{ sketch_content }}
+
+
 event_functions = {
-    "deviceMoved": source_sketch.deviceMoved,
-    "deviceTurned": source_sketch.deviceTurned,
-    "deviceShaken": source_sketch.deviceShaken,
-    "keyPressed": source_sketch.keyPressed,
-    "keyReleased": source_sketch.keyReleased,
-    "keyTyped": source_sketch.keyTyped,
-    "mouseMoved": source_sketch.mouseMoved,
-    "mouseDragged": source_sketch.mouseDragged,
-    "mousePressed": source_sketch.mousePressed,
-    "mouseReleased": source_sketch.mouseReleased,
-    "mouseClicked": source_sketch.mouseClicked,
-    "doubleClicked": source_sketch.doubleClicked,
-    "mouseWheel": source_sketch.mouseWheel,
-    "touchStarted": source_sketch.touchStarted,
-    "touchMoved": source_sketch.touchMoved,
-    "touchEnded": source_sketch.touchEnded,
-    "windowResized": source_sketch.windowResized,
+    "deviceMoved": deviceMoved,
+    "deviceTurned": deviceTurned,
+    "deviceShaken": deviceShaken,
+    "keyPressed": keyPressed,
+    "keyReleased": keyReleased,
+    "keyTyped": keyTyped,
+    "mouseMoved": mouseMoved,
+    "mouseDragged": mouseDragged,
+    "mousePressed": mousePressed,
+    "mouseReleased": mouseReleased,
+    "mouseClicked": mouseClicked,
+    "doubleClicked": doubleClicked,
+    "mouseWheel": mouseWheel,
+    "touchStarted": touchStarted,
+    "touchMoved": touchMoved,
+    "touchEnded": touchEnded,
+    "windowResized": windowResized,
 }
 
-start_p5(source_sketch.setup, source_sketch.draw, event_functions)
+start_p5(setup, draw, event_functions)
diff --git a/pyp5js/tests/test_templates_renderers.py b/pyp5js/tests/test_templates_renderers.py
index e992c0a3..24e2489a 100644
--- a/pyp5js/tests/test_templates_renderers.py
+++ b/pyp5js/tests/test_templates_renderers.py
@@ -30,4 +30,3 @@ def test_get_target_sketch_content(sketch):
     content = renderers.get_target_sketch_content(sketch)
 
     assert expected_content == content
-    assert "import foo as source_sketch" in content