# Generated by Haxe 3.4.5
# coding: utf-8

import math as python_lib_Math
import math as Math
from os import path as python_lib_os_Path
import inspect as python_lib_Inspect
import builtins as python_lib_Builtins
import functools as python_lib_Functools
import random as python_lib_Random
import re as python_lib_Re
from io import StringIO as python_lib_io_StringIO


class _hx_AnonObject:
    def __init__(self, fields):
        self.__dict__ = fields


_hx_classes = {}


class Enum:
    _hx_class_name = "Enum"
    __slots__ = ("tag", "index", "params")
    _hx_fields = ["tag", "index", "params"]
    _hx_methods = ["__str__"]

    def __init__(self,tag,index,params):
        # /usr/local/lib/haxe/std/python/internal/EnumImpl.hx:38
        self.tag = tag
        # /usr/local/lib/haxe/std/python/internal/EnumImpl.hx:39
        self.index = index
        # /usr/local/lib/haxe/std/python/internal/EnumImpl.hx:40
        self.params = params

    def __str__(self):
        # /usr/local/lib/haxe/std/python/internal/EnumImpl.hx:45
        if (self.params is None):
            return self.tag
        else:
            # /usr/local/lib/haxe/std/python/internal/EnumImpl.hx:48
            _this = self.params
            return (((HxOverrides.stringOrNull(self.tag) + "(") + HxOverrides.stringOrNull(",".join([python_Boot.toString1(x1,'') for x1 in _this]))) + ")")

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.tag = None
        _hx_o.index = None
        _hx_o.params = None
Enum._hx_class = Enum
_hx_classes["Enum"] = Enum


class Class:
    _hx_class_name = "Class"
Class._hx_class = Class
_hx_classes["Class"] = Class


class EReg:
    _hx_class_name = "EReg"
    __slots__ = ("pattern", "matchObj", "_hx_global")
    _hx_fields = ["pattern", "matchObj", "global"]

    def __init__(self,r,opt):
        # /usr/local/lib/haxe/std/python/_std/EReg.hx:30
        self.matchObj = None
        # /usr/local/lib/haxe/std/python/_std/EReg.hx:34
        self._hx_global = False
        # /usr/local/lib/haxe/std/python/_std/EReg.hx:35
        options = 0
        # /usr/local/lib/haxe/std/python/_std/EReg.hx:36
        # /usr/local/lib/haxe/std/python/_std/EReg.hx:36
        _g1 = 0
        _g = len(opt)
        while (_g1 < _g):
            i = _g1
            _g1 = (_g1 + 1)
            # /usr/local/lib/haxe/std/python/_std/EReg.hx:37
            c = (-1 if ((i >= len(opt))) else ord(opt[i]))
            # /usr/local/lib/haxe/std/python/_std/EReg.hx:38
            if (c == 109):
                options = (options | python_lib_Re.M)
            # /usr/local/lib/haxe/std/python/_std/EReg.hx:39
            if (c == 105):
                options = (options | python_lib_Re.I)
            # /usr/local/lib/haxe/std/python/_std/EReg.hx:40
            if (c == 115):
                options = (options | python_lib_Re.S)
            # /usr/local/lib/haxe/std/python/_std/EReg.hx:41
            if (c == 117):
                options = (options | python_lib_Re.U)
            # /usr/local/lib/haxe/std/python/_std/EReg.hx:42
            if (c == 103):
                self._hx_global = True
        # /usr/local/lib/haxe/std/python/_std/EReg.hx:44
        self.pattern = python_lib_Re.compile(r,options)

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.pattern = None
        _hx_o.matchObj = None
        _hx_o._hx_global = None
EReg._hx_class = EReg
_hx_classes["EReg"] = EReg


class EnumValue:
    _hx_class_name = "EnumValue"
EnumValue._hx_class = EnumValue
_hx_classes["EnumValue"] = EnumValue


class HaxeLowDisk:
    _hx_class_name = "HaxeLowDisk"
    __slots__ = ()
    _hx_methods = ["readFileSync", "writeFile"]
HaxeLowDisk._hx_class = HaxeLowDisk
_hx_classes["HaxeLowDisk"] = HaxeLowDisk


class SysDisk:
    _hx_class_name = "SysDisk"
    __slots__ = ()
    _hx_methods = ["readFileSync", "writeFile"]
    _hx_interfaces = [HaxeLowDisk]

    def __init__(self):
        pass

    def readFileSync(self,file):
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:71
        if sys_FileSystem.exists(file):
            return sys_io_File.getContent(file)
        else:
            return None

    def writeFile(self,file,data):
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:75
        sys_io_File.saveContent(file,data)

    @staticmethod
    def _hx_empty_init(_hx_o):        pass
SysDisk._hx_class = SysDisk
_hx_classes["SysDisk"] = SysDisk


class HaxeLow:
    _hx_class_name = "HaxeLow"
    __slots__ = ("file", "db", "checksum", "disk")
    _hx_fields = ["file", "db", "checksum", "disk"]
    _hx_methods = ["backup", "restore", "save", "col"]

    def __init__(self,file = None,disk = None):
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:101
        self.checksum = None
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:105
        self.file = file
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:106
        self.disk = disk
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:107
        self.db = _hx_AnonObject({})
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:109
        if ((disk is None) and ((file is not None))):
            self.disk = SysDisk()
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:120
        if (self.file is not None):
            # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:121
            if (self.disk is None):
                raise _HxException("HaxeLow: no disk storage set.")
            # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:123
            self.checksum = self.disk.readFileSync(self.file)
            # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:124
            if (self.checksum is not None):
                self.restore(self.checksum)

    def backup(self,file = None):
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:129
        backup = tjson_TJSON.encode(self.db,"fancy")
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:130
        if (file is not None):
            self.disk.writeFile(file,backup)
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:131
        return backup

    def restore(self,s):
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:135
        try:
            # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:136
            self.db = tjson_TJSON.parse(s)
            # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:139
            self.checksum = None
        except Exception as _hx_e:
            _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
            e = _hx_e1
            raise _HxException(((("HaxeLow: JSON parsing failed: file \"" + HxOverrides.stringOrNull(self.file)) + "\" is corrupt. ") + Std.string(e)))
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:144
        return self

    def save(self):
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:148
        if (self.file is None):
            return self
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:150
        data = self.backup()
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:151
        if (data == self.checksum):
            return self
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:153
        self.checksum = data
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:154
        self.disk.writeFile(self.file,data)
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:156
        return self

    def col(self,cls):
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:160
        name = Type.getClassName(cls)
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:161
        if (not hasattr(self.db,(("_hx_" + name) if ((name in python_Boot.keywords)) else (("_hx_" + name) if (((((len(name) > 2) and ((ord(name[0]) == 95))) and ((ord(name[1]) == 95))) and ((ord(name[(len(name) - 1)]) != 95)))) else name)))):
            # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:162
            # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:162
            o = self.db
            value = list()
            setattr(o,(("_hx_" + name) if ((name in python_Boot.keywords)) else (("_hx_" + name) if (((((len(name) > 2) and ((ord(name[0]) == 95))) and ((ord(name[1]) == 95))) and ((ord(name[(len(name) - 1)]) != 95)))) else name)),value)
            # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:163
            self.save()
        # /usr/local/lib/haxe/lib/haxelow/0,7,1/HaxeLow.hx:166
        return Reflect.field(self.db,name)

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.file = None
        _hx_o.db = None
        _hx_o.checksum = None
        _hx_o.disk = None
HaxeLow._hx_class = HaxeLow
_hx_classes["HaxeLow"] = HaxeLow


class List:
    _hx_class_name = "List"
    __slots__ = ("h", "length")
    _hx_fields = ["h", "length"]
    _hx_methods = ["iterator"]

    def __init__(self):
        # /usr/local/lib/haxe/std/List.hx:32
        self.h = None
        # /usr/local/lib/haxe/std/List.hx:44
        self.length = 0

    def iterator(self):
        # /usr/local/lib/haxe/std/List.hx:161
        return _List_ListIterator(self.h)

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.h = None
        _hx_o.length = None
List._hx_class = List
_hx_classes["List"] = List


class _List_ListNode:
    _hx_class_name = "_List.ListNode"
    __slots__ = ("item", "next")
    _hx_fields = ["item", "next"]

    def __init__(self,item,next):
        # /usr/local/lib/haxe/std/List.hx:256
        self.item = item
        # /usr/local/lib/haxe/std/List.hx:257
        self.next = next

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.item = None
        _hx_o.next = None
_List_ListNode._hx_class = _List_ListNode
_hx_classes["_List.ListNode"] = _List_ListNode


class _List_ListIterator:
    _hx_class_name = "_List.ListIterator"
    __slots__ = ("head",)
    _hx_fields = ["head"]
    _hx_methods = ["hasNext", "next"]

    def __init__(self,head):
        # /usr/local/lib/haxe/std/List.hx:269
        self.head = head

    def hasNext(self):
        # /usr/local/lib/haxe/std/List.hx:273
        return (self.head is not None)

    def next(self):
        # /usr/local/lib/haxe/std/List.hx:277
        val = self.head.item
        # /usr/local/lib/haxe/std/List.hx:278
        self.head = self.head.next
        # /usr/local/lib/haxe/std/List.hx:279
        return val

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.head = None
_List_ListIterator._hx_class = _List_ListIterator
_hx_classes["_List.ListIterator"] = _List_ListIterator


class Main:
    _hx_class_name = "Main"
    __slots__ = ()
    _hx_statics = ["main"]

    def __init__(self):
        # src/Main.hx:10
        print("Python Haxelow Example")
        # src/Main.hx:13
        db = HaxeLow("db.json")
        # src/Main.hx:16
        persons = db.col(Person)
        # src/Main.hx:20
        # src/Main.hx:20
        x = Person("Test",50)
        persons.append(x)
        # src/Main.hx:25
        db.save()

    @staticmethod
    def main():
        # src/Main.hx:31
        main = Main()
Main._hx_class = Main
_hx_classes["Main"] = Main


class Person:
    _hx_class_name = "Person"
    __slots__ = ("name", "age")
    _hx_fields = ["name", "age"]

    def __init__(self,name,age):
        # src/Main.hx:37
        self.name = name
        # src/Main.hx:38
        self.age = age

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.name = None
        _hx_o.age = None
Person._hx_class = Person
_hx_classes["Person"] = Person


class Reflect:
    _hx_class_name = "Reflect"
    __slots__ = ()
    _hx_statics = ["field", "isObject"]

    @staticmethod
    def field(o,field):
        # /usr/local/lib/haxe/std/python/_std/Reflect.hx:44
        return python_Boot.field(o,field)

    @staticmethod
    def isObject(v):
        # /usr/local/lib/haxe/std/python/_std/Reflect.hx:106
        _g = Type.typeof(v)
        _g1 = _g.index
        # /usr/local/lib/haxe/std/python/_std/Reflect.hx:107
        if ((_g1 == 6) or ((_g1 == 4))):
            return True
        else:
            return False
Reflect._hx_class = Reflect
_hx_classes["Reflect"] = Reflect


class Std:
    _hx_class_name = "Std"
    __slots__ = ()
    _hx_statics = ["is", "string", "parseInt", "shortenPossibleNumber", "parseFloat"]

    @staticmethod
    def _hx_is(v,t):
        # /usr/local/lib/haxe/std/python/_std/Std.hx:51
        if ((v is None) and ((t is None))):
            return False
        # /usr/local/lib/haxe/std/python/_std/Std.hx:54
        if (t is None):
            return False
        # /usr/local/lib/haxe/std/python/_std/Std.hx:58
        if (t == Dynamic):
            return True
        # /usr/local/lib/haxe/std/python/_std/Std.hx:61
        isBool = isinstance(v,bool)
        # /usr/local/lib/haxe/std/python/_std/Std.hx:63
        if ((t == Bool) and isBool):
            return True
        # /usr/local/lib/haxe/std/python/_std/Std.hx:66
        if ((((not isBool) and (not (t == Bool))) and (t == Int)) and isinstance(v,int)):
            return True
        # /usr/local/lib/haxe/std/python/_std/Std.hx:69
        vIsFloat = isinstance(v,float)
        # /usr/local/lib/haxe/std/python/_std/Std.hx:71
        tmp = None
        tmp1 = None
        tmp2 = None
        tmp3 = None
        if (((not isBool) and vIsFloat) and (t == Int)):
            f = v
            if ((f != Math.POSITIVE_INFINITY) and ((f != Math.NEGATIVE_INFINITY))):
                tmp3 = (not python_lib_Math.isnan(f))
            else:
                tmp3 = False
        else:
            tmp3 = False
        if tmp3:
            tmp4 = None
            try:
                tmp4 = int(v)
            except Exception as _hx_e:
                _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
                e = _hx_e1
                tmp4 = None
            tmp2 = (v == tmp4)
        else:
            tmp2 = False
        if tmp2:
            tmp1 = (v <= 2147483647)
        else:
            tmp1 = False
        if tmp1:
            tmp = (v >= -2147483648)
        else:
            tmp = False
        if tmp:
            return True
        # /usr/local/lib/haxe/std/python/_std/Std.hx:76
        if (((not isBool) and (t == Float)) and isinstance(v,(float, int))):
            return True
        # /usr/local/lib/haxe/std/python/_std/Std.hx:80
        if (t == str):
            return isinstance(v,str)
        # /usr/local/lib/haxe/std/python/_std/Std.hx:83
        isEnumType = (t == Enum)
        # /usr/local/lib/haxe/std/python/_std/Std.hx:84
        if ((isEnumType and python_lib_Inspect.isclass(v)) and hasattr(v,"_hx_constructs")):
            return True
        # /usr/local/lib/haxe/std/python/_std/Std.hx:86
        if isEnumType:
            return False
        # /usr/local/lib/haxe/std/python/_std/Std.hx:88
        isClassType = (t == Class)
        # /usr/local/lib/haxe/std/python/_std/Std.hx:89
        if ((((isClassType and (not isinstance(v,Enum))) and python_lib_Inspect.isclass(v)) and hasattr(v,"_hx_class_name")) and (not hasattr(v,"_hx_constructs"))):
            return True
        # /usr/local/lib/haxe/std/python/_std/Std.hx:91
        if isClassType:
            return False
        # /usr/local/lib/haxe/std/python/_std/Std.hx:93
        tmp5 = None
        try:
            tmp5 = isinstance(v,t)
        except Exception as _hx_e:
            _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
            e1 = _hx_e1
            tmp5 = False
        if tmp5:
            return True
        # /usr/local/lib/haxe/std/python/_std/Std.hx:97
        if python_lib_Inspect.isclass(t):
            # /usr/local/lib/haxe/std/python/_std/Std.hx:99
            loop = None
            # /usr/local/lib/haxe/std/python/_std/Std.hx:100
            def _hx_local_1(intf):
                # /usr/local/lib/haxe/std/python/_std/Std.hx:101
                f1 = (intf._hx_interfaces if (hasattr(intf,"_hx_interfaces")) else [])
                # /usr/local/lib/haxe/std/python/_std/Std.hx:102
                if (f1 is not None):
                    # /usr/local/lib/haxe/std/python/_std/Std.hx:103
                    # /usr/local/lib/haxe/std/python/_std/Std.hx:103
                    _g = 0
                    while (_g < len(f1)):
                        i = (f1[_g] if _g >= 0 and _g < len(f1) else None)
                        _g = (_g + 1)
                        # /usr/local/lib/haxe/std/python/_std/Std.hx:104
                        if HxOverrides.eq(i,t):
                            return True
                        else:
                            # /usr/local/lib/haxe/std/python/_std/Std.hx:107
                            l = loop(i)
                            # /usr/local/lib/haxe/std/python/_std/Std.hx:108
                            if l:
                                return True
                    # /usr/local/lib/haxe/std/python/_std/Std.hx:113
                    return False
                else:
                    return False
            # /usr/local/lib/haxe/std/python/_std/Std.hx:99
            loop = _hx_local_1
            loop1 = loop
            # /usr/local/lib/haxe/std/python/_std/Std.hx:118
            currentClass = v.__class__
            # /usr/local/lib/haxe/std/python/_std/Std.hx:119
            while (currentClass is not None):
                # /usr/local/lib/haxe/std/python/_std/Std.hx:120
                if loop1(currentClass):
                    return True
                # /usr/local/lib/haxe/std/python/_std/Std.hx:123
                currentClass = python_Boot.getSuperClass(currentClass)
            # /usr/local/lib/haxe/std/python/_std/Std.hx:125
            return False
        else:
            return False

    @staticmethod
    def string(s):
        # /usr/local/lib/haxe/std/python/_std/Std.hx:134
        return python_Boot.toString1(s,"")

    @staticmethod
    def parseInt(x):
        # /usr/local/lib/haxe/std/python/_std/Std.hx:147
        if (x is None):
            return None
        # /usr/local/lib/haxe/std/python/_std/Std.hx:148
        try:
            return int(x)
        except Exception as _hx_e:
            _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
            e = _hx_e1
            try:
                # /usr/local/lib/haxe/std/python/_std/Std.hx:152
                prefix = HxString.substr(x,0,2).lower()
                # /usr/local/lib/haxe/std/python/_std/Std.hx:154
                if (prefix == "0x"):
                    return int(x,16)
                # /usr/local/lib/haxe/std/python/_std/Std.hx:157
                raise _HxException("fail")
            except Exception as _hx_e:
                _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
                e1 = _hx_e1
                # /usr/local/lib/haxe/std/python/_std/Std.hx:160
                x1 = Std.parseFloat(x)
                r = None
                try:
                    r = int(x1)
                except Exception as _hx_e:
                    _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
                    e2 = _hx_e1
                    r = None
                # /usr/local/lib/haxe/std/python/_std/Std.hx:162
                if (r is None):
                    # /usr/local/lib/haxe/std/python/_std/Std.hx:163
                    r1 = Std.shortenPossibleNumber(x)
                    # /usr/local/lib/haxe/std/python/_std/Std.hx:164
                    if (r1 != x):
                        return Std.parseInt(r1)
                    else:
                        return None
                # /usr/local/lib/haxe/std/python/_std/Std.hx:170
                return r

    @staticmethod
    def shortenPossibleNumber(x):
        # /usr/local/lib/haxe/std/python/_std/Std.hx:177
        r = ""
        # /usr/local/lib/haxe/std/python/_std/Std.hx:178
        # /usr/local/lib/haxe/std/python/_std/Std.hx:178
        _g1 = 0
        _g = len(x)
        while (_g1 < _g):
            i = _g1
            _g1 = (_g1 + 1)
            # /usr/local/lib/haxe/std/python/_std/Std.hx:179
            c = ("" if (((i < 0) or ((i >= len(x))))) else x[i])
            # /usr/local/lib/haxe/std/python/_std/Std.hx:180
            # /usr/local/lib/haxe/std/python/_std/Std.hx:180
            _g2 = HxString.charCodeAt(c,0)
            if (_g2 is None):
                break
            else:
                _g21 = _g2
                # /usr/local/lib/haxe/std/python/_std/Std.hx:191
                if (((((((((((_g21 == 57) or ((_g21 == 56))) or ((_g21 == 55))) or ((_g21 == 54))) or ((_g21 == 53))) or ((_g21 == 52))) or ((_g21 == 51))) or ((_g21 == 50))) or ((_g21 == 49))) or ((_g21 == 48))) or ((_g21 == 46))):
                    r = (("null" if r is None else r) + ("null" if c is None else c))
                else:
                    break
        # /usr/local/lib/haxe/std/python/_std/Std.hx:195
        return r

    @staticmethod
    def parseFloat(x):
        # /usr/local/lib/haxe/std/python/_std/Std.hx:200
        try:
            return float(x)
        except Exception as _hx_e:
            _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
            e = _hx_e1
            # /usr/local/lib/haxe/std/python/_std/Std.hx:204
            if (x is not None):
                # /usr/local/lib/haxe/std/python/_std/Std.hx:205
                r1 = Std.shortenPossibleNumber(x)
                # /usr/local/lib/haxe/std/python/_std/Std.hx:206
                if (r1 != x):
                    return Std.parseFloat(r1)
            # /usr/local/lib/haxe/std/python/_std/Std.hx:210
            return Math.NaN
Std._hx_class = Std
_hx_classes["Std"] = Std


class Float:
    _hx_class_name = "Float"
Float._hx_class = Float
_hx_classes["Float"] = Float


class Int:
    _hx_class_name = "Int"
Int._hx_class = Int
_hx_classes["Int"] = Int


class Bool:
    _hx_class_name = "Bool"
Bool._hx_class = Bool
_hx_classes["Bool"] = Bool


class Dynamic:
    _hx_class_name = "Dynamic"
Dynamic._hx_class = Dynamic
_hx_classes["Dynamic"] = Dynamic


class StringTools:
    _hx_class_name = "StringTools"
    __slots__ = ()
    _hx_statics = ["startsWith", "replace"]

    @staticmethod
    def startsWith(s,start):
        # /usr/local/lib/haxe/std/StringTools.hx:200
        if (len(s) >= len(start)):
            return (HxString.substr(s,0,len(start)) == start)
        else:
            return False

    @staticmethod
    def replace(s,sub,by):
        # /usr/local/lib/haxe/std/StringTools.hx:386
        _this = (list(s) if ((sub == "")) else s.split(sub))
        return by.join([python_Boot.toString1(x1,'') for x1 in _this])
StringTools._hx_class = StringTools
_hx_classes["StringTools"] = StringTools


class sys_FileSystem:
    _hx_class_name = "sys.FileSystem"
    __slots__ = ()
    _hx_statics = ["exists"]

    @staticmethod
    def exists(path):
        # /usr/local/lib/haxe/std/python/_std/sys/FileSystem.hx:31
        return python_lib_os_Path.exists(path)
sys_FileSystem._hx_class = sys_FileSystem
_hx_classes["sys.FileSystem"] = sys_FileSystem


class haxe_IMap:
    _hx_class_name = "haxe.IMap"
    __slots__ = ()
    _hx_methods = ["get", "keys"]
haxe_IMap._hx_class = haxe_IMap
_hx_classes["haxe.IMap"] = haxe_IMap


class haxe_ds_StringMap:
    _hx_class_name = "haxe.ds.StringMap"
    __slots__ = ("h",)
    _hx_fields = ["h"]
    _hx_methods = ["get", "keys"]
    _hx_interfaces = [haxe_IMap]

    def __init__(self):
        # /usr/local/lib/haxe/std/python/_std/haxe/ds/StringMap.hx:32
        self.h = dict()

    def get(self,key):
        # /usr/local/lib/haxe/std/python/_std/haxe/ds/StringMap.hx:40
        return self.h.get(key,None)

    def keys(self):
        # /usr/local/lib/haxe/std/python/_std/haxe/ds/StringMap.hx:54
        return python_HaxeIterator(iter(self.h.keys()))

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.h = None
haxe_ds_StringMap._hx_class = haxe_ds_StringMap
_hx_classes["haxe.ds.StringMap"] = haxe_ds_StringMap


class python_HaxeIterator:
    _hx_class_name = "python.HaxeIterator"
    __slots__ = ("it", "x", "has", "checked")
    _hx_fields = ["it", "x", "has", "checked"]
    _hx_methods = ["next", "hasNext"]

    def __init__(self,it):
        # /usr/local/lib/haxe/std/python/HaxeIterator.hx:31
        self.checked = False
        # /usr/local/lib/haxe/std/python/HaxeIterator.hx:30
        self.has = False
        # /usr/local/lib/haxe/std/python/HaxeIterator.hx:29
        self.x = None
        # /usr/local/lib/haxe/std/python/HaxeIterator.hx:34
        self.it = it

    def next(self):
        # /usr/local/lib/haxe/std/python/HaxeIterator.hx:38
        if (not self.checked):
            self.hasNext()
        # /usr/local/lib/haxe/std/python/HaxeIterator.hx:39
        self.checked = False
        # /usr/local/lib/haxe/std/python/HaxeIterator.hx:40
        return self.x

    def hasNext(self):
        # /usr/local/lib/haxe/std/python/HaxeIterator.hx:44
        if (not self.checked):
            # /usr/local/lib/haxe/std/python/HaxeIterator.hx:45
            try:
                # /usr/local/lib/haxe/std/python/HaxeIterator.hx:46
                self.x = self.it.__next__()
                # /usr/local/lib/haxe/std/python/HaxeIterator.hx:47
                self.has = True
            except Exception as _hx_e:
                _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
                if isinstance(_hx_e1, StopIteration):
                    s = _hx_e1
                    # /usr/local/lib/haxe/std/python/HaxeIterator.hx:49
                    self.has = False
                    # /usr/local/lib/haxe/std/python/HaxeIterator.hx:50
                    self.x = None
                else:
                    raise _hx_e
            # /usr/local/lib/haxe/std/python/HaxeIterator.hx:52
            self.checked = True
        # /usr/local/lib/haxe/std/python/HaxeIterator.hx:54
        return self.has

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.it = None
        _hx_o.x = None
        _hx_o.has = None
        _hx_o.checked = None
python_HaxeIterator._hx_class = python_HaxeIterator
_hx_classes["python.HaxeIterator"] = python_HaxeIterator

class ValueType(Enum):
    __slots__ = ()
    _hx_class_name = "ValueType"
    _hx_constructs = ["TNull", "TInt", "TFloat", "TBool", "TObject", "TFunction", "TClass", "TEnum", "TUnknown"]

    @staticmethod
    def TClass(c):
        return ValueType("TClass", 6, [c])

    @staticmethod
    def TEnum(e):
        return ValueType("TEnum", 7, [e])
ValueType.TNull = ValueType("TNull", 0, list())
ValueType.TInt = ValueType("TInt", 1, list())
ValueType.TFloat = ValueType("TFloat", 2, list())
ValueType.TBool = ValueType("TBool", 3, list())
ValueType.TObject = ValueType("TObject", 4, list())
ValueType.TFunction = ValueType("TFunction", 5, list())
ValueType.TUnknown = ValueType("TUnknown", 8, list())
ValueType._hx_class = ValueType
_hx_classes["ValueType"] = ValueType


class Type:
    _hx_class_name = "Type"
    __slots__ = ()
    _hx_statics = ["getClass", "getSuperClass", "getClassName", "resolveClass", "createEmptyInstance", "typeof"]

    @staticmethod
    def getClass(o):
        # /usr/local/lib/haxe/std/python/_std/Type.hx:46
        if (o is None):
            return None
        # /usr/local/lib/haxe/std/python/_std/Type.hx:49
        if ((o is not None) and (((o == str) or python_lib_Inspect.isclass(o)))):
            return None
        # /usr/local/lib/haxe/std/python/_std/Type.hx:51
        if isinstance(o,_hx_AnonObject):
            return None
        # /usr/local/lib/haxe/std/python/_std/Type.hx:53
        if hasattr(o,"_hx_class"):
            return o._hx_class
        # /usr/local/lib/haxe/std/python/_std/Type.hx:56
        if hasattr(o,"__class__"):
            return o.__class__
        else:
            return None

    @staticmethod
    def getSuperClass(c):
        # /usr/local/lib/haxe/std/python/_std/Type.hx:70
        return python_Boot.getSuperClass(c)

    @staticmethod
    def getClassName(c):
        # /usr/local/lib/haxe/std/python/_std/Type.hx:75
        if hasattr(c,"_hx_class_name"):
            return c._hx_class_name
        else:
            # /usr/local/lib/haxe/std/python/_std/Type.hx:79
            if (c == list):
                return "Array"
            # /usr/local/lib/haxe/std/python/_std/Type.hx:80
            if (c == Math):
                return "Math"
            # /usr/local/lib/haxe/std/python/_std/Type.hx:81
            if (c == str):
                return "String"
            # /usr/local/lib/haxe/std/python/_std/Type.hx:83
            try:
                return c.__name__
            except Exception as _hx_e:
                _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
                e = _hx_e1
                return None

    @staticmethod
    def resolveClass(name):
        # /usr/local/lib/haxe/std/python/_std/Type.hx:97
        if (name == "Array"):
            return list
        # /usr/local/lib/haxe/std/python/_std/Type.hx:98
        if (name == "Math"):
            return Math
        # /usr/local/lib/haxe/std/python/_std/Type.hx:99
        if (name == "String"):
            return str
        # /usr/local/lib/haxe/std/python/_std/Type.hx:101
        cl = _hx_classes.get(name,None)
        # /usr/local/lib/haxe/std/python/_std/Type.hx:103
        if ((cl is None) or (not (((cl is not None) and (((cl == str) or python_lib_Inspect.isclass(cl))))))):
            return None
        # /usr/local/lib/haxe/std/python/_std/Type.hx:105
        return cl

    @staticmethod
    def createEmptyInstance(cl):
        # /usr/local/lib/haxe/std/python/_std/Type.hx:121
        i = cl.__new__(cl)
        # /usr/local/lib/haxe/std/python/_std/Type.hx:123
        callInit = None
        def _hx_local_0(cl1):
            # /usr/local/lib/haxe/std/python/_std/Type.hx:124
            sc = Type.getSuperClass(cl1)
            # /usr/local/lib/haxe/std/python/_std/Type.hx:125
            if (sc is not None):
                callInit(sc)
            # /usr/local/lib/haxe/std/python/_std/Type.hx:128
            if hasattr(cl1,"_hx_empty_init"):
                cl1._hx_empty_init(i)
        callInit = _hx_local_0
        callInit1 = callInit
        # /usr/local/lib/haxe/std/python/_std/Type.hx:132
        callInit1(cl)
        # /usr/local/lib/haxe/std/python/_std/Type.hx:134
        return i

    @staticmethod
    def typeof(v):
        # /usr/local/lib/haxe/std/python/_std/Type.hx:178
        if (v is None):
            return ValueType.TNull
        elif isinstance(v,bool):
            return ValueType.TBool
        elif isinstance(v,int):
            return ValueType.TInt
        elif isinstance(v,float):
            return ValueType.TFloat
        elif isinstance(v,str):
            return ValueType.TClass(str)
        elif isinstance(v,list):
            return ValueType.TClass(list)
        elif (isinstance(v,_hx_AnonObject) or python_lib_Inspect.isclass(v)):
            return ValueType.TObject
        elif isinstance(v,Enum):
            return ValueType.TEnum(v.__class__)
        elif (isinstance(v,type) or hasattr(v,"_hx_class")):
            return ValueType.TClass(v.__class__)
        elif callable(v):
            return ValueType.TFunction
        else:
            return ValueType.TUnknown
Type._hx_class = Type
_hx_classes["Type"] = Type


class haxe_Utf8:
    _hx_class_name = "haxe.Utf8"
    __slots__ = ("_hx___b",)
    _hx_fields = ["__b"]

    def __init__(self,size = None):
        # /usr/local/lib/haxe/std/haxe/Utf8.hx:36
        self._hx___b = ""

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o._hx___b = None
haxe_Utf8._hx_class = haxe_Utf8
_hx_classes["haxe.Utf8"] = haxe_Utf8


class haxe_io_Eof:
    _hx_class_name = "haxe.io.Eof"
    __slots__ = ()
    _hx_methods = ["toString"]

    def __init__(self):
        pass

    def toString(self):
        # /usr/local/lib/haxe/std/haxe/io/Eof.hx:31
        return "Eof"

    @staticmethod
    def _hx_empty_init(_hx_o):        pass
haxe_io_Eof._hx_class = haxe_io_Eof
_hx_classes["haxe.io.Eof"] = haxe_io_Eof


class python_Boot:
    _hx_class_name = "python.Boot"
    __slots__ = ()
    _hx_statics = ["keywords", "toString1", "fields", "simpleField", "field", "getInstanceFields", "getSuperClass", "getClassFields", "prefixLength", "unhandleKeywords"]

    @staticmethod
    def toString1(o,s):
        # /usr/local/lib/haxe/std/python/Boot.hx:94
        if (o is None):
            return "null"
        # /usr/local/lib/haxe/std/python/Boot.hx:96
        if isinstance(o,str):
            return o
        # /usr/local/lib/haxe/std/python/Boot.hx:98
        if (s is None):
            s = ""
        # /usr/local/lib/haxe/std/python/Boot.hx:99
        if (len(s) >= 5):
            return "<...>"
        # /usr/local/lib/haxe/std/python/Boot.hx:101
        if isinstance(o,bool):
            if o:
                return "true"
            else:
                return "false"
        # /usr/local/lib/haxe/std/python/Boot.hx:104
        if isinstance(o,int):
            return str(o)
        # /usr/local/lib/haxe/std/python/Boot.hx:108
        if isinstance(o,float):
            try:
                if (o == int(o)):
                    return str(Math.floor((o + 0.5)))
                else:
                    return str(o)
            except Exception as _hx_e:
                _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
                e = _hx_e1
                return str(o)
        # /usr/local/lib/haxe/std/python/Boot.hx:120
        if isinstance(o,list):
            # /usr/local/lib/haxe/std/python/Boot.hx:122
            o1 = o
            # /usr/local/lib/haxe/std/python/Boot.hx:124
            l = len(o1)
            # /usr/local/lib/haxe/std/python/Boot.hx:126
            st = "["
            # /usr/local/lib/haxe/std/python/Boot.hx:127
            s = (("null" if s is None else s) + "\t")
            # /usr/local/lib/haxe/std/python/Boot.hx:128
            # /usr/local/lib/haxe/std/python/Boot.hx:128
            _g1 = 0
            _g = l
            while (_g1 < _g):
                i = _g1
                _g1 = (_g1 + 1)
                # /usr/local/lib/haxe/std/python/Boot.hx:129
                prefix = ""
                # /usr/local/lib/haxe/std/python/Boot.hx:130
                if (i > 0):
                    prefix = ","
                # /usr/local/lib/haxe/std/python/Boot.hx:133
                st = (("null" if st is None else st) + HxOverrides.stringOrNull(((("null" if prefix is None else prefix) + HxOverrides.stringOrNull(python_Boot.toString1((o1[i] if i >= 0 and i < len(o1) else None),s))))))
            # /usr/local/lib/haxe/std/python/Boot.hx:135
            st = (("null" if st is None else st) + "]")
            # /usr/local/lib/haxe/std/python/Boot.hx:136
            return st
        # /usr/local/lib/haxe/std/python/Boot.hx:139
        try:
            if hasattr(o,"toString"):
                return o.toString()
        except Exception as _hx_e:
            _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
            pass
        # /usr/local/lib/haxe/std/python/Boot.hx:145
        if (python_lib_Inspect.isfunction(o) or python_lib_Inspect.ismethod(o)):
            return "<function>"
        # /usr/local/lib/haxe/std/python/Boot.hx:147
        if hasattr(o,"__class__"):
            # /usr/local/lib/haxe/std/python/Boot.hx:150
            if isinstance(o,_hx_AnonObject):
                # /usr/local/lib/haxe/std/python/Boot.hx:152
                toStr = None
                # /usr/local/lib/haxe/std/python/Boot.hx:153
                try:
                    # /usr/local/lib/haxe/std/python/Boot.hx:155
                    fields = python_Boot.fields(o)
                    # /usr/local/lib/haxe/std/python/Boot.hx:156
                    _g2 = []
                    _g11 = 0
                    while (_g11 < len(fields)):
                        f = (fields[_g11] if _g11 >= 0 and _g11 < len(fields) else None)
                        _g11 = (_g11 + 1)
                        x = ((("" + ("null" if f is None else f)) + " : ") + HxOverrides.stringOrNull(python_Boot.toString1(python_Boot.simpleField(o,f),(("null" if s is None else s) + "\t"))))
                        _g2.append(x)
                    fieldsStr = _g2
                    # /usr/local/lib/haxe/std/python/Boot.hx:157
                    toStr = (("{ " + HxOverrides.stringOrNull(", ".join([x1 for x1 in fieldsStr]))) + " }")
                except Exception as _hx_e:
                    _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
                    e2 = _hx_e1
                    return "{ ... }"
                # /usr/local/lib/haxe/std/python/Boot.hx:163
                if (toStr is None):
                    return "{ ... }"
                else:
                    return toStr
            # /usr/local/lib/haxe/std/python/Boot.hx:173
            if isinstance(o,Enum):
                # /usr/local/lib/haxe/std/python/Boot.hx:175
                o2 = o
                # /usr/local/lib/haxe/std/python/Boot.hx:177
                l1 = len(o2.params)
                # /usr/local/lib/haxe/std/python/Boot.hx:178
                hasParams = (l1 > 0)
                # /usr/local/lib/haxe/std/python/Boot.hx:179
                if hasParams:
                    # /usr/local/lib/haxe/std/python/Boot.hx:180
                    paramsStr = ""
                    # /usr/local/lib/haxe/std/python/Boot.hx:181
                    # /usr/local/lib/haxe/std/python/Boot.hx:181
                    _g12 = 0
                    _g3 = l1
                    while (_g12 < _g3):
                        i1 = _g12
                        _g12 = (_g12 + 1)
                        # /usr/local/lib/haxe/std/python/Boot.hx:182
                        prefix1 = ""
                        # /usr/local/lib/haxe/std/python/Boot.hx:183
                        if (i1 > 0):
                            prefix1 = ","
                        # /usr/local/lib/haxe/std/python/Boot.hx:186
                        paramsStr = (("null" if paramsStr is None else paramsStr) + HxOverrides.stringOrNull(((("null" if prefix1 is None else prefix1) + HxOverrides.stringOrNull(python_Boot.toString1((o2.params[i1] if i1 >= 0 and i1 < len(o2.params) else None),s))))))
                    # /usr/local/lib/haxe/std/python/Boot.hx:188
                    return (((HxOverrides.stringOrNull(o2.tag) + "(") + ("null" if paramsStr is None else paramsStr)) + ")")
                else:
                    return o2.tag
            # /usr/local/lib/haxe/std/python/Boot.hx:194
            if hasattr(o,"_hx_class_name"):
                if (o.__class__.__name__ != "type"):
                    # /usr/local/lib/haxe/std/python/Boot.hx:196
                    fields1 = python_Boot.getInstanceFields(o)
                    # /usr/local/lib/haxe/std/python/Boot.hx:197
                    _g4 = []
                    _g13 = 0
                    while (_g13 < len(fields1)):
                        f1 = (fields1[_g13] if _g13 >= 0 and _g13 < len(fields1) else None)
                        _g13 = (_g13 + 1)
                        x1 = ((("" + ("null" if f1 is None else f1)) + " : ") + HxOverrides.stringOrNull(python_Boot.toString1(python_Boot.simpleField(o,f1),(("null" if s is None else s) + "\t"))))
                        _g4.append(x1)
                    fieldsStr1 = _g4
                    # /usr/local/lib/haxe/std/python/Boot.hx:199
                    toStr1 = (((HxOverrides.stringOrNull(o._hx_class_name) + "( ") + HxOverrides.stringOrNull(", ".join([x1 for x1 in fieldsStr1]))) + " )")
                    # /usr/local/lib/haxe/std/python/Boot.hx:200
                    return toStr1
                else:
                    # /usr/local/lib/haxe/std/python/Boot.hx:202
                    fields2 = python_Boot.getClassFields(o)
                    # /usr/local/lib/haxe/std/python/Boot.hx:203
                    _g5 = []
                    _g14 = 0
                    while (_g14 < len(fields2)):
                        f2 = (fields2[_g14] if _g14 >= 0 and _g14 < len(fields2) else None)
                        _g14 = (_g14 + 1)
                        x2 = ((("" + ("null" if f2 is None else f2)) + " : ") + HxOverrides.stringOrNull(python_Boot.toString1(python_Boot.simpleField(o,f2),(("null" if s is None else s) + "\t"))))
                        _g5.append(x2)
                    fieldsStr2 = _g5
                    # /usr/local/lib/haxe/std/python/Boot.hx:204
                    toStr2 = (((("#" + HxOverrides.stringOrNull(o._hx_class_name)) + "( ") + HxOverrides.stringOrNull(", ".join([x1 for x1 in fieldsStr2]))) + " )")
                    # /usr/local/lib/haxe/std/python/Boot.hx:205
                    return toStr2
            # /usr/local/lib/haxe/std/python/Boot.hx:209
            if (o == str):
                return "#String"
            # /usr/local/lib/haxe/std/python/Boot.hx:213
            if (o == list):
                return "#Array"
            # /usr/local/lib/haxe/std/python/Boot.hx:217
            if callable(o):
                return "function"
            # /usr/local/lib/haxe/std/python/Boot.hx:220
            try:
                if hasattr(o,"__repr__"):
                    return o.__repr__()
            except Exception as _hx_e:
                _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
                pass
            # /usr/local/lib/haxe/std/python/Boot.hx:226
            if hasattr(o,"__str__"):
                return o.__str__([])
            # /usr/local/lib/haxe/std/python/Boot.hx:230
            if hasattr(o,"__name__"):
                return o.__name__
            # /usr/local/lib/haxe/std/python/Boot.hx:233
            return "???"
        else:
            return str(o)

    @staticmethod
    def fields(o):
        # /usr/local/lib/haxe/std/python/Boot.hx:245
        a = []
        # /usr/local/lib/haxe/std/python/Boot.hx:246
        if (o is not None):
            # /usr/local/lib/haxe/std/python/Boot.hx:247
            if hasattr(o,"_hx_fields"):
                # /usr/local/lib/haxe/std/python/Boot.hx:248
                fields = o._hx_fields
                # /usr/local/lib/haxe/std/python/Boot.hx:249
                return list(fields)
            # /usr/local/lib/haxe/std/python/Boot.hx:251
            if isinstance(o,_hx_AnonObject):
                # /usr/local/lib/haxe/std/python/Boot.hx:253
                d = o.__dict__
                # /usr/local/lib/haxe/std/python/Boot.hx:254
                keys = d.keys()
                # /usr/local/lib/haxe/std/python/Boot.hx:255
                handler = python_Boot.unhandleKeywords
                # /usr/local/lib/haxe/std/python/Boot.hx:257
                for k in keys:
                # /usr/local/lib/haxe/std/python/Boot.hx:258
                    a.append(handler(k))
            elif hasattr(o,"__dict__"):
                # /usr/local/lib/haxe/std/python/Boot.hx:262
                d1 = o.__dict__
                # /usr/local/lib/haxe/std/python/Boot.hx:263
                keys1 = d1.keys()
                # /usr/local/lib/haxe/std/python/Boot.hx:264
                for k in keys1:
                # /usr/local/lib/haxe/std/python/Boot.hx:265
                    a.append(k)
        # /usr/local/lib/haxe/std/python/Boot.hx:269
        return a

    @staticmethod
    def simpleField(o,field):
        # /usr/local/lib/haxe/std/python/Boot.hx:281
        if (field is None):
            return None
        # /usr/local/lib/haxe/std/python/Boot.hx:283
        field1 = (("_hx_" + field) if ((field in python_Boot.keywords)) else (("_hx_" + field) if (((((len(field) > 2) and ((ord(field[0]) == 95))) and ((ord(field[1]) == 95))) and ((ord(field[(len(field) - 1)]) != 95)))) else field))
        # /usr/local/lib/haxe/std/python/Boot.hx:284
        if hasattr(o,field1):
            return getattr(o,field1)
        else:
            return None

    @staticmethod
    def field(o,field):
        # /usr/local/lib/haxe/std/python/Boot.hx:288
        if (field is None):
            return None
        # /usr/local/lib/haxe/std/python/Boot.hx:290
        field1 = field
        _hx_local_0 = len(field1)
        # /usr/local/lib/haxe/std/python/Boot.hx:295
        if (_hx_local_0 == 10):
            if (field1 == "charCodeAt"):
                if isinstance(o,str):
                    # /usr/local/lib/haxe/std/python/Boot.hx:295
                    s1 = o
                    def _hx_local_1(a11):
                        return HxString.charCodeAt(s1,a11)
                    return _hx_local_1
        elif (_hx_local_0 == 11):
            if (field1 == "lastIndexOf"):
                if isinstance(o,str):
                    # /usr/local/lib/haxe/std/python/Boot.hx:297
                    s3 = o
                    def _hx_local_2(a15):
                        return HxString.lastIndexOf(s3,a15)
                    return _hx_local_2
                elif isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:315
                    a4 = o
                    def _hx_local_3(x4):
                        return python_internal_ArrayImpl.lastIndexOf(a4,x4)
                    return _hx_local_3
            elif (field1 == "toLowerCase"):
                if isinstance(o,str):
                    # /usr/local/lib/haxe/std/python/Boot.hx:292
                    s7 = o
                    def _hx_local_4():
                        return HxString.toLowerCase(s7)
                    return _hx_local_4
            elif (field1 == "toUpperCase"):
                if isinstance(o,str):
                    # /usr/local/lib/haxe/std/python/Boot.hx:293
                    s9 = o
                    def _hx_local_5():
                        return HxString.toUpperCase(s9)
                    return _hx_local_5
        elif (_hx_local_0 == 9):
            if (field1 == "substring"):
                if isinstance(o,str):
                    # /usr/local/lib/haxe/std/python/Boot.hx:300
                    s6 = o
                    def _hx_local_6(a19):
                        return HxString.substring(s6,a19)
                    return _hx_local_6
        elif (_hx_local_0 == 4):
            if (field1 == "copy"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:306
                    def _hx_local_7():
                        # /usr/local/lib/haxe/std/python/Boot.hx:306
                        return list(o)
                    return _hx_local_7
            elif (field1 == "join"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:309
                    def _hx_local_8(sep):
                        # /usr/local/lib/haxe/std/python/Boot.hx:309
                        return sep.join([python_Boot.toString1(x1,'') for x1 in o])
                    return _hx_local_8
            elif (field1 == "push"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:312
                    x7 = o
                    def _hx_local_9(e):
                        return python_internal_ArrayImpl.push(x7,e)
                    return _hx_local_9
            elif (field1 == "sort"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:320
                    x11 = o
                    def _hx_local_10(f2):
                        python_internal_ArrayImpl.sort(x11,f2)
                    return _hx_local_10
        elif (_hx_local_0 == 5):
            if (field1 == "shift"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:318
                    x9 = o
                    def _hx_local_11():
                        return python_internal_ArrayImpl.shift(x9)
                    return _hx_local_11
            elif (field1 == "slice"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:319
                    x10 = o
                    def _hx_local_12(a16):
                        return python_internal_ArrayImpl.slice(x10,a16)
                    return _hx_local_12
            elif (field1 == "split"):
                if isinstance(o,str):
                    # /usr/local/lib/haxe/std/python/Boot.hx:298
                    s4 = o
                    def _hx_local_13(d):
                        return HxString.split(s4,d)
                    return _hx_local_13
        elif (_hx_local_0 == 7):
            if (field1 == "indexOf"):
                if isinstance(o,str):
                    # /usr/local/lib/haxe/std/python/Boot.hx:296
                    s2 = o
                    def _hx_local_14(a13):
                        return HxString.indexOf(s2,a13)
                    return _hx_local_14
                elif isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:314
                    a = o
                    def _hx_local_15(x1):
                        return python_internal_ArrayImpl.indexOf(a,x1)
                    return _hx_local_15
            elif (field1 == "reverse"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:317
                    a5 = o
                    def _hx_local_16():
                        python_internal_ArrayImpl.reverse(a5)
                    return _hx_local_16
            elif (field1 == "unshift"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:313
                    x14 = o
                    def _hx_local_17(e2):
                        python_internal_ArrayImpl.unshift(x14,e2)
                    return _hx_local_17
        elif (_hx_local_0 == 3):
            if (field1 == "map"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:303
                    x5 = o
                    def _hx_local_18(f1):
                        return python_internal_ArrayImpl.map(x5,f1)
                    return _hx_local_18
            elif (field1 == "pop"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:311
                    x6 = o
                    def _hx_local_19():
                        return python_internal_ArrayImpl.pop(x6)
                    return _hx_local_19
        elif (_hx_local_0 == 8):
            if (field1 == "iterator"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:307
                    x3 = o
                    def _hx_local_20():
                        return python_internal_ArrayImpl.iterator(x3)
                    return _hx_local_20
            elif (field1 == "toString"):
                if isinstance(o,str):
                    # /usr/local/lib/haxe/std/python/Boot.hx:301
                    s8 = o
                    def _hx_local_21():
                        return HxString.toString(s8)
                    return _hx_local_21
                elif isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:310
                    x13 = o
                    def _hx_local_22():
                        return python_internal_ArrayImpl.toString(x13)
                    return _hx_local_22
        elif (_hx_local_0 == 6):
            if (field1 == "charAt"):
                if isinstance(o,str):
                    # /usr/local/lib/haxe/std/python/Boot.hx:294
                    s = o
                    def _hx_local_23(a1):
                        return HxString.charAt(s,a1)
                    return _hx_local_23
            elif (field1 == "concat"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:305
                    a12 = o
                    def _hx_local_24(a2):
                        return python_internal_ArrayImpl.concat(a12,a2)
                    return _hx_local_24
            elif (field1 == "filter"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:304
                    x = o
                    def _hx_local_25(f):
                        return python_internal_ArrayImpl.filter(x,f)
                    return _hx_local_25
            elif (field1 == "insert"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:308
                    a3 = o
                    def _hx_local_26(a14,x2):
                        python_internal_ArrayImpl.insert(a3,a14,x2)
                    return _hx_local_26
            elif (field1 == "length"):
                if isinstance(o,str):
                    return len(o)
                elif isinstance(o,list):
                    return len(o)
            elif (field1 == "remove"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:316
                    x8 = o
                    def _hx_local_27(e1):
                        return python_internal_ArrayImpl.remove(x8,e1)
                    return _hx_local_27
            elif (field1 == "splice"):
                if isinstance(o,list):
                    # /usr/local/lib/haxe/std/python/Boot.hx:321
                    x12 = o
                    def _hx_local_28(a17,a21):
                        return python_internal_ArrayImpl.splice(x12,a17,a21)
                    return _hx_local_28
            elif (field1 == "substr"):
                if isinstance(o,str):
                    # /usr/local/lib/haxe/std/python/Boot.hx:299
                    s5 = o
                    def _hx_local_29(a18):
                        return HxString.substr(s5,a18)
                    return _hx_local_29
        else:
            pass
        # /usr/local/lib/haxe/std/python/Boot.hx:325
        field2 = (("_hx_" + field) if ((field in python_Boot.keywords)) else (("_hx_" + field) if (((((len(field) > 2) and ((ord(field[0]) == 95))) and ((ord(field[1]) == 95))) and ((ord(field[(len(field) - 1)]) != 95)))) else field))
        # /usr/local/lib/haxe/std/python/Boot.hx:326
        if hasattr(o,field2):
            return getattr(o,field2)
        else:
            return None

    @staticmethod
    def getInstanceFields(c):
        # /usr/local/lib/haxe/std/python/Boot.hx:331
        f = (c._hx_fields if (hasattr(c,"_hx_fields")) else [])
        # /usr/local/lib/haxe/std/python/Boot.hx:332
        if hasattr(c,"_hx_methods"):
            f = (f + c._hx_methods)
        # /usr/local/lib/haxe/std/python/Boot.hx:335
        sc = python_Boot.getSuperClass(c)
        # /usr/local/lib/haxe/std/python/Boot.hx:337
        if (sc is None):
            return f
        else:
            # /usr/local/lib/haxe/std/python/Boot.hx:341
            scArr = python_Boot.getInstanceFields(sc)
            # /usr/local/lib/haxe/std/python/Boot.hx:342
            scMap = set(scArr)
            # /usr/local/lib/haxe/std/python/Boot.hx:345
            # /usr/local/lib/haxe/std/python/Boot.hx:345
            _g = 0
            while (_g < len(f)):
                f1 = (f[_g] if _g >= 0 and _g < len(f) else None)
                _g = (_g + 1)
                # /usr/local/lib/haxe/std/python/Boot.hx:346
                if (not (f1 in scMap)):
                    scArr.append(f1)
            # /usr/local/lib/haxe/std/python/Boot.hx:351
            return scArr

    @staticmethod
    def getSuperClass(c):
        # /usr/local/lib/haxe/std/python/Boot.hx:356
        if (c is None):
            return None
        # /usr/local/lib/haxe/std/python/Boot.hx:359
        try:
            # /usr/local/lib/haxe/std/python/Boot.hx:360
            if hasattr(c,"_hx_super"):
                return c._hx_super
            # /usr/local/lib/haxe/std/python/Boot.hx:363
            return None
        except Exception as _hx_e:
            _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
            pass
        # /usr/local/lib/haxe/std/python/Boot.hx:367
        return None

    @staticmethod
    def getClassFields(c):
        # /usr/local/lib/haxe/std/python/Boot.hx:372
        if hasattr(c,"_hx_statics"):
            # /usr/local/lib/haxe/std/python/Boot.hx:373
            x = c._hx_statics
            # /usr/local/lib/haxe/std/python/Boot.hx:374
            return list(x)
        else:
            return []

    @staticmethod
    def unhandleKeywords(name):
        # /usr/local/lib/haxe/std/python/Boot.hx:398
        if (HxString.substr(name,0,python_Boot.prefixLength) == "_hx_"):
            # /usr/local/lib/haxe/std/python/Boot.hx:399
            real = HxString.substr(name,python_Boot.prefixLength,None)
            # /usr/local/lib/haxe/std/python/Boot.hx:400
            if (real in python_Boot.keywords):
                return real
        # /usr/local/lib/haxe/std/python/Boot.hx:402
        return name
python_Boot._hx_class = python_Boot
_hx_classes["python.Boot"] = python_Boot


class python_internal_ArrayImpl:
    _hx_class_name = "python.internal.ArrayImpl"
    __slots__ = ()
    _hx_statics = ["concat", "iterator", "indexOf", "lastIndexOf", "toString", "pop", "push", "unshift", "remove", "shift", "slice", "sort", "splice", "map", "filter", "insert", "reverse", "_get", "_set"]

    @staticmethod
    def concat(a1,a2):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:35
        return (a1 + a2)

    @staticmethod
    def iterator(x):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:45
        return python_HaxeIterator(x.__iter__())

    @staticmethod
    def indexOf(a,x,fromIndex = None):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:50
        _hx_len = len(a)
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:51
        l = (0 if ((fromIndex is None)) else ((_hx_len + fromIndex) if ((fromIndex < 0)) else fromIndex))
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:55
        if (l < 0):
            l = 0
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:56
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:56
        _g1 = l
        _g = _hx_len
        while (_g1 < _g):
            i = _g1
            _g1 = (_g1 + 1)
            # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:57
            if (a[i] == x):
                return i
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:59
        return -1

    @staticmethod
    def lastIndexOf(a,x,fromIndex = None):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:64
        _hx_len = len(a)
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:65
        l = (_hx_len if ((fromIndex is None)) else (((_hx_len + fromIndex) + 1) if ((fromIndex < 0)) else (fromIndex + 1)))
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:69
        if (l > _hx_len):
            l = _hx_len
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:70
        while True:
            # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:70
            l = (l - 1)
            tmp = l
            if (not ((tmp > -1))):
                break
            # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:71
            if (a[l] == x):
                return l
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:73
        return -1

    @staticmethod
    def toString(x):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:84
        return (("[" + HxOverrides.stringOrNull(",".join([python_Boot.toString1(x1,'') for x1 in x]))) + "]")

    @staticmethod
    def pop(x):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:89
        if (len(x) == 0):
            return None
        else:
            return x.pop()

    @staticmethod
    def push(x,e):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:94
        x.append(e)
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:95
        return len(x)

    @staticmethod
    def unshift(x,e):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:100
        x.insert(0, e)

    @staticmethod
    def remove(x,e):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:105
        try:
            # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:106
            x.remove(e)
            # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:107
            return True
        except Exception as _hx_e:
            _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
            e1 = _hx_e1
            return False

    @staticmethod
    def shift(x):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:115
        if (len(x) == 0):
            return None
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:116
        return x.pop(0)

    @staticmethod
    def slice(x,pos,end = None):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:121
        return x[pos:end]

    @staticmethod
    def sort(x,f):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:125
        x.sort(key= python_lib_Functools.cmp_to_key(f))

    @staticmethod
    def splice(x,pos,_hx_len):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:130
        if (pos < 0):
            pos = (len(x) + pos)
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:131
        if (pos < 0):
            pos = 0
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:132
        res = x[pos:(pos + _hx_len)]
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:133
        del x[pos:(pos + _hx_len)]
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:134
        return res

    @staticmethod
    def map(x,f):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:139
        return list(map(f,x))

    @staticmethod
    def filter(x,f):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:144
        return list(filter(f,x))

    @staticmethod
    def insert(a,pos,x):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:149
        a.insert(pos, x)

    @staticmethod
    def reverse(a):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:153
        a.reverse()

    @staticmethod
    def _get(x,idx):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:158
        if ((idx > -1) and ((idx < len(x)))):
            return x[idx]
        else:
            return None

    @staticmethod
    def _set(x,idx,v):
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:163
        l = len(x)
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:164
        while (l < idx):
            # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:165
            x.append(None)
            # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:166
            l = (l + 1)
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:168
        if (l == idx):
            x.append(v)
        else:
            x[idx] = v
        # /usr/local/lib/haxe/std/python/internal/ArrayImpl.hx:173
        return v
python_internal_ArrayImpl._hx_class = python_internal_ArrayImpl
_hx_classes["python.internal.ArrayImpl"] = python_internal_ArrayImpl


class _HxException(Exception):
    _hx_class_name = "_HxException"
    __slots__ = ("val",)
    _hx_fields = ["val"]
    _hx_methods = []
    _hx_statics = []
    _hx_interfaces = []
    _hx_super = Exception


    def __init__(self,val):
        # /usr/local/lib/haxe/std/python/internal/HxException.hx:28
        self.val = None
        # /usr/local/lib/haxe/std/python/internal/HxException.hx:31
        message = str(val)
        # /usr/local/lib/haxe/std/python/internal/HxException.hx:32
        super().__init__(message)
        # /usr/local/lib/haxe/std/python/internal/HxException.hx:33
        self.val = val

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.val = None
_HxException._hx_class = _HxException
_hx_classes["_HxException"] = _HxException


class HxOverrides:
    _hx_class_name = "HxOverrides"
    __slots__ = ()
    _hx_statics = ["iterator", "eq", "stringOrNull"]

    @staticmethod
    def iterator(x):
        # /usr/local/lib/haxe/std/python/internal/HxOverrides.hx:39
        if isinstance(x,list):
            return python_HaxeIterator(x.__iter__())
        # /usr/local/lib/haxe/std/python/internal/HxOverrides.hx:42
        return x.iterator()

    @staticmethod
    def eq(a,b):
        # /usr/local/lib/haxe/std/python/internal/HxOverrides.hx:46
        if (isinstance(a,list) or isinstance(b,list)):
            return a is b
        # /usr/local/lib/haxe/std/python/internal/HxOverrides.hx:49
        return (a == b)

    @staticmethod
    def stringOrNull(s):
        # /usr/local/lib/haxe/std/python/internal/HxOverrides.hx:53
        if (s is None):
            return "null"
        else:
            return s
HxOverrides._hx_class = HxOverrides
_hx_classes["HxOverrides"] = HxOverrides


class HxString:
    _hx_class_name = "HxString"
    __slots__ = ()
    _hx_statics = ["split", "charCodeAt", "charAt", "lastIndexOf", "toUpperCase", "toLowerCase", "indexOf", "toString", "substring", "substr"]

    @staticmethod
    def split(s,d):
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:31
        if (d == ""):
            return list(s)
        else:
            return s.split(d)

    @staticmethod
    def charCodeAt(s,index):
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:37
        if ((((s is None) or ((len(s) == 0))) or ((index < 0))) or ((index >= len(s)))):
            return None
        else:
            return ord(s[index])

    @staticmethod
    def charAt(s,index):
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:43
        if ((index < 0) or ((index >= len(s)))):
            return ""
        else:
            return s[index]

    @staticmethod
    def lastIndexOf(s,_hx_str,startIndex = None):
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:48
        if (startIndex is None):
            return s.rfind(_hx_str, 0, len(s))
        else:
            # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:52
            i = s.rfind(_hx_str, 0, (startIndex + 1))
            # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:53
            startLeft = (max(0,((startIndex + 1) - len(_hx_str))) if ((i == -1)) else (i + 1))
            # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:54
            check = s.find(_hx_str, startLeft, len(s))
            # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:55
            if ((check > i) and ((check <= startIndex))):
                return check
            else:
                return i

    @staticmethod
    def toUpperCase(s):
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:66
        return s.upper()

    @staticmethod
    def toLowerCase(s):
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:70
        return s.lower()

    @staticmethod
    def indexOf(s,_hx_str,startIndex = None):
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:74
        if (startIndex is None):
            return s.find(_hx_str)
        else:
            return s.find(_hx_str, startIndex)

    @staticmethod
    def toString(s):
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:81
        return s

    @staticmethod
    def substring(s,startIndex,endIndex = None):
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:97
        if (startIndex < 0):
            startIndex = 0
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:98
        if (endIndex is None):
            return s[startIndex:]
        else:
            # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:101
            if (endIndex < 0):
                endIndex = 0
            # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:102
            if (endIndex < startIndex):
                return s[endIndex:startIndex]
            else:
                return s[startIndex:endIndex]

    @staticmethod
    def substr(s,startIndex,_hx_len = None):
        # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:113
        if (_hx_len is None):
            return s[startIndex:]
        else:
            # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:116
            if (_hx_len == 0):
                return ""
            # /usr/local/lib/haxe/std/python/internal/StringImpl.hx:117
            return s[startIndex:(startIndex + _hx_len)]
HxString._hx_class = HxString
_hx_classes["HxString"] = HxString


class sys_io_File:
    _hx_class_name = "sys.io.File"
    __slots__ = ()
    _hx_statics = ["getContent", "saveContent"]

    @staticmethod
    def getContent(path):
        # /usr/local/lib/haxe/std/python/_std/sys/io/File.hx:32
        f = python_lib_Builtins.open(path,"r",-1,"utf-8",None,"")
        # /usr/local/lib/haxe/std/python/_std/sys/io/File.hx:33
        content = f.read(-1)
        # /usr/local/lib/haxe/std/python/_std/sys/io/File.hx:34
        f.close()
        # /usr/local/lib/haxe/std/python/_std/sys/io/File.hx:35
        return content

    @staticmethod
    def saveContent(path,content):
        # /usr/local/lib/haxe/std/python/_std/sys/io/File.hx:39
        f = python_lib_Builtins.open(path,"w",-1,"utf-8",None,"")
        # /usr/local/lib/haxe/std/python/_std/sys/io/File.hx:40
        f.write(content)
        # /usr/local/lib/haxe/std/python/_std/sys/io/File.hx:41
        f.close()
sys_io_File._hx_class = sys_io_File
_hx_classes["sys.io.File"] = sys_io_File


class tjson_TJSON:
    _hx_class_name = "tjson.TJSON"
    __slots__ = ()
    _hx_statics = ["OBJECT_REFERENCE_PREFIX", "parse", "encode"]

    @staticmethod
    def parse(json,fileName = "JSON Data",stringProcessor = None):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:12
        if (fileName is None):
            fileName = "JSON Data"
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:13
        t = tjson_TJSONParser(json,fileName,stringProcessor)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:14
        return t.doParse()

    @staticmethod
    def encode(obj,style = None,useCache = True):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:22
        if (useCache is None):
            useCache = True
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:23
        t = tjson_TJSONEncoder(useCache)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:24
        return t.doEncode(obj,style)
tjson_TJSON._hx_class = tjson_TJSON
_hx_classes["tjson.TJSON"] = tjson_TJSON


class tjson_TJSONParser:
    _hx_class_name = "tjson.TJSONParser"
    __slots__ = ("pos", "json", "lastSymbolQuoted", "fileName", "currentLine", "cache", "floatRegex", "intRegex", "strProcessor")
    _hx_fields = ["pos", "json", "lastSymbolQuoted", "fileName", "currentLine", "cache", "floatRegex", "intRegex", "strProcessor"]
    _hx_methods = ["doParse", "doObject", "doArray", "convertSymbolToProperType", "looksLikeFloat", "looksLikeInt", "getNextSymbol", "defaultStringProcessor"]

    def __init__(self,vjson,vfileName = "JSON Data",stringProcessor = None):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:42
        if (vfileName is None):
            vfileName = "JSON Data"
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:44
        self.json = vjson
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:45
        self.fileName = vfileName
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:46
        self.currentLine = 1
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:47
        self.lastSymbolQuoted = False
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:48
        self.pos = 0
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:49
        self.floatRegex = EReg("^-?[0-9]*\\.[0-9]+$","")
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:50
        self.intRegex = EReg("^-?[0-9]+$","")
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:51
        self.strProcessor = (self.defaultStringProcessor if ((stringProcessor is None)) else stringProcessor)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:52
        self.cache = list()

    def doParse(self):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:56
        try:
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:58
            _g = self.getNextSymbol()
            _g1 = _g
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:60
            if (_g1 == "["):
                return self.doArray()
            elif (_g1 == "{"):
                return self.doObject()
            else:
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:61
                s = _g
                return self.convertSymbolToProperType(s)
        except Exception as _hx_e:
            _hx_e1 = _hx_e.val if isinstance(_hx_e, _HxException) else _hx_e
            if isinstance(_hx_e1, str):
                e = _hx_e1
                raise _HxException(((((HxOverrides.stringOrNull(self.fileName) + " on line ") + Std.string(self.currentLine)) + ": ") + ("null" if e is None else e)))
            else:
                raise _hx_e

    def doObject(self):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:69
        o = _hx_AnonObject({})
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:70
        val = ""
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:71
        key = None
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:72
        isClassOb = False
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:73
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:73
        _this = self.cache
        _this.append(o)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:74
        while (self.pos < len(self.json)):
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:75
            key = self.getNextSymbol()
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:76
            if ((key == ",") and (not self.lastSymbolQuoted)):
                continue
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:77
            if ((key == "}") and (not self.lastSymbolQuoted)):
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:79
                if (isClassOb and ((Reflect.field(o,"TJ_unserialize") is not None))):
                    Reflect.field(o,"TJ_unserialize")()
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:82
                return o
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:85
            seperator = self.getNextSymbol()
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:86
            if (seperator != ":"):
                raise _HxException((("Expected ':' but got '" + ("null" if seperator is None else seperator)) + "' instead."))
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:90
            v = self.getNextSymbol()
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:92
            if (key == "_hxcls"):
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:93
                cls = Type.resolveClass(v)
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:94
                if (cls is None):
                    raise _HxException(("Invalid class name - " + ("null" if v is None else v)))
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:95
                o = Type.createEmptyInstance(cls)
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:96
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:96
                _this1 = self.cache
                if (len(_this1) != 0):
                    _this1.pop()
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:97
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:97
                _this2 = self.cache
                _this2.append(o)
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:98
                isClassOb = True
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:99
                continue
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:103
            if ((v == "{") and (not self.lastSymbolQuoted)):
                val = self.doObject()
            elif ((v == "[") and (not self.lastSymbolQuoted)):
                val = self.doArray()
            else:
                val = self.convertSymbolToProperType(v)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:110
            setattr(o,(("_hx_" + key) if ((key in python_Boot.keywords)) else (("_hx_" + key) if (((((len(key) > 2) and ((ord(key[0]) == 95))) and ((ord(key[1]) == 95))) and ((ord(key[(len(key) - 1)]) != 95)))) else key)),val)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:112
        raise _HxException("Unexpected end of file. Expected '}'")

    def doArray(self):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:117
        a = list()
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:118
        val = None
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:119
        while (self.pos < len(self.json)):
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:120
            val = self.getNextSymbol()
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:121
            if ((val == ",") and (not self.lastSymbolQuoted)):
                continue
            elif ((val == "]") and (not self.lastSymbolQuoted)):
                return a
            elif ((val == "{") and (not self.lastSymbolQuoted)):
                val = self.doObject()
            elif ((val == "[") and (not self.lastSymbolQuoted)):
                val = self.doArray()
            else:
                val = self.convertSymbolToProperType(val)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:134
            a.append(val)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:136
        raise _HxException("Unexpected end of file. Expected ']'")

    def convertSymbolToProperType(self,symbol):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:140
        if self.lastSymbolQuoted:
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:143
            if StringTools.startsWith(symbol,tjson_TJSON.OBJECT_REFERENCE_PREFIX):
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:144
                idx = Std.parseInt(HxString.substr(symbol,len(tjson_TJSON.OBJECT_REFERENCE_PREFIX),None))
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:145
                return (self.cache[idx] if idx >= 0 and idx < len(self.cache) else None)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:147
            return symbol
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:149
        if self.looksLikeFloat(symbol):
            return Std.parseFloat(symbol)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:152
        if self.looksLikeInt(symbol):
            return Std.parseInt(symbol)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:155
        if (symbol.lower() == "true"):
            return True
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:158
        if (symbol.lower() == "false"):
            return False
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:161
        if (symbol.lower() == "null"):
            return None
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:165
        return symbol

    def looksLikeFloat(self,s):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:170
        _this = self.floatRegex
        _this.matchObj = python_lib_Re.search(_this.pattern,s)
        if (_this.matchObj is None):
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:171
            _this1 = self.intRegex
            _this1.matchObj = python_lib_Re.search(_this1.pattern,s)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:170
            if (_this1.matchObj is not None):
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:172
                intStr = self.intRegex.matchObj.group(0)
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:173
                if (HxString.charCodeAt(intStr,0) == 45):
                    return (intStr > "-2147483648")
                else:
                    return (intStr > "2147483647")
            else:
                return False
        else:
            return True

    def looksLikeInt(self,s):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:182
        _this = self.intRegex
        _this.matchObj = python_lib_Re.search(_this.pattern,s)
        return (_this.matchObj is not None)

    def getNextSymbol(self):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:186
        self.lastSymbolQuoted = False
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:187
        c = ""
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:188
        inQuote = False
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:189
        quoteType = ""
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:190
        symbol = ""
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:191
        inEscape = False
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:192
        inSymbol = False
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:193
        inLineComment = False
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:194
        inBlockComment = False
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:196
        while (self.pos < len(self.json)):
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:197
            _this = self.json
            index = self.pos
            self.pos = (self.pos + 1)
            if ((index < 0) or ((index >= len(_this)))):
                c = ""
            else:
                c = _this[index]
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:198
            if ((c == "\n") and (not inSymbol)):
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:199
                _hx_local_0 = self
                _hx_local_1 = _hx_local_0.currentLine
                _hx_local_0.currentLine = (_hx_local_1 + 1)
                _hx_local_1
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:200
            if inLineComment:
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:201
                if ((c == "\n") or ((c == "\r"))):
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:202
                    inLineComment = False
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:203
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:203
                    _hx_local_2 = self
                    _hx_local_3 = _hx_local_2.pos
                    _hx_local_2.pos = (_hx_local_3 + 1)
                    _hx_local_3
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:205
                continue
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:208
            if inBlockComment:
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:209
                tmp = None
                if (c == "*"):
                    _this1 = self.json
                    index1 = self.pos
                    tmp = ((("" if (((index1 < 0) or ((index1 >= len(_this1))))) else _this1[index1])) == "/")
                else:
                    tmp = False
                if tmp:
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:210
                    inBlockComment = False
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:211
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:211
                    _hx_local_4 = self
                    _hx_local_5 = _hx_local_4.pos
                    _hx_local_4.pos = (_hx_local_5 + 1)
                    _hx_local_5
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:213
                continue
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:216
            if inQuote:
                if inEscape:
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:218
                    inEscape = False
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:219
                    if ((c == "'") or ((c == "\""))):
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:220
                        symbol = (("null" if symbol is None else symbol) + ("null" if c is None else c))
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:221
                        continue
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:223
                    if (c == "t"):
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:224
                        symbol = (("null" if symbol is None else symbol) + "\t")
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:225
                        continue
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:227
                    if (c == "n"):
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:228
                        symbol = (("null" if symbol is None else symbol) + "\n")
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:229
                        continue
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:231
                    if (c == "\\"):
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:232
                        symbol = (("null" if symbol is None else symbol) + "\\")
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:233
                        continue
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:235
                    if (c == "r"):
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:236
                        symbol = (("null" if symbol is None else symbol) + "\r")
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:237
                        continue
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:239
                    if (c == "/"):
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:240
                        symbol = (("null" if symbol is None else symbol) + "/")
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:241
                        continue
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:244
                    if (c == "u"):
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:245
                        hexValue = 0
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:247
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:247
                        _g = 0
                        while (_g < 4):
                            i = _g
                            _g = (_g + 1)
                            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:248
                            if (self.pos >= len(self.json)):
                                raise _HxException("Unfinished UTF8 character")
                            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:250
                            index2 = self.pos
                            self.pos = (self.pos + 1)
                            nc = HxString.charCodeAt(self.json,index2)
                            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:251
                            hexValue = (hexValue << 4)
                            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:252
                            if ((nc >= 48) and ((nc <= 57))):
                                hexValue = (hexValue + ((nc - 48)))
                            elif ((nc >= 65) and ((nc <= 70))):
                                hexValue = (hexValue + (((10 + nc) - 65)))
                            elif ((nc >= 97) and ((nc <= 102))):
                                hexValue = (hexValue + (((10 + nc) - 95)))
                            else:
                                raise _HxException("Not a hex digit")
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:261
                        utf = haxe_Utf8()
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:262
                        utf._hx___b = (HxOverrides.stringOrNull(utf._hx___b) + HxOverrides.stringOrNull("".join(map(chr,[hexValue]))))
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:263
                        symbol = (("null" if symbol is None else symbol) + HxOverrides.stringOrNull(utf._hx___b))
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:265
                        continue
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:269
                    raise _HxException((("Invalid escape sequence '\\" + ("null" if c is None else c)) + "'"))
                else:
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:271
                    if (c == "\\"):
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:272
                        inEscape = True
                        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:273
                        continue
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:275
                    if (c == quoteType):
                        return symbol
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:278
                    symbol = (("null" if symbol is None else symbol) + ("null" if c is None else c))
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:279
                    continue
            elif (c == "/"):
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:286
                _this2 = self.json
                index3 = self.pos
                c2 = ("" if (((index3 < 0) or ((index3 >= len(_this2))))) else _this2[index3])
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:289
                if (c2 == "/"):
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:290
                    inLineComment = True
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:291
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:291
                    _hx_local_19 = self
                    _hx_local_20 = _hx_local_19.pos
                    _hx_local_19.pos = (_hx_local_20 + 1)
                    _hx_local_20
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:292
                    continue
                elif (c2 == "*"):
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:297
                    inBlockComment = True
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:298
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:298
                    _hx_local_21 = self
                    _hx_local_22 = _hx_local_21.pos
                    _hx_local_21.pos = (_hx_local_22 + 1)
                    _hx_local_22
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:299
                    continue
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:305
            if inSymbol:
                if ((((((((c == " ") or ((c == "\n"))) or ((c == "\r"))) or ((c == "\t"))) or ((c == ","))) or ((c == ":"))) or ((c == "}"))) or ((c == "]"))):
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:307
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:307
                    _hx_local_23 = self
                    _hx_local_24 = _hx_local_23.pos
                    _hx_local_23.pos = (_hx_local_24 - 1)
                    _hx_local_24
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:308
                    return symbol
                else:
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:310
                    symbol = (("null" if symbol is None else symbol) + ("null" if c is None else c))
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:311
                    continue
            else:
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:316
                if ((((c == " ") or ((c == "\t"))) or ((c == "\n"))) or ((c == "\r"))):
                    continue
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:320
                if ((((((c == "{") or ((c == "}"))) or ((c == "["))) or ((c == "]"))) or ((c == ","))) or ((c == ":"))):
                    return c
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:326
                if ((c == "'") or ((c == "\""))):
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:327
                    inQuote = True
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:328
                    quoteType = c
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:329
                    self.lastSymbolQuoted = True
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:330
                    continue
                else:
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:332
                    inSymbol = True
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:333
                    symbol = c
                    # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:334
                    continue
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:340
        if inQuote:
            raise _HxException((("Unexpected end of data. Expected ( " + ("null" if quoteType is None else quoteType)) + " )"))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:343
        return symbol

    def defaultStringProcessor(self,_hx_str):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:348
        return _hx_str

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.pos = None
        _hx_o.json = None
        _hx_o.lastSymbolQuoted = None
        _hx_o.fileName = None
        _hx_o.currentLine = None
        _hx_o.cache = None
        _hx_o.floatRegex = None
        _hx_o.intRegex = None
        _hx_o.strProcessor = None
tjson_TJSONParser._hx_class = tjson_TJSONParser
_hx_classes["tjson.TJSONParser"] = tjson_TJSONParser


class tjson_TJSONEncoder:
    _hx_class_name = "tjson.TJSONEncoder"
    __slots__ = ("cache", "uCache")
    _hx_fields = ["cache", "uCache"]
    _hx_methods = ["doEncode", "encodeObject", "encodeMap", "encodeIterable", "cacheEncode", "encodeValue"]

    def __init__(self,useCache = True):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:358
        if (useCache is None):
            useCache = True
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:355
        self.cache = None
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:359
        self.uCache = useCache
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:360
        if self.uCache:
            self.cache = list()

    def doEncode(self,obj,style = None):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:364
        if (not Reflect.isObject(obj)):
            raise _HxException("Provided object is not an object.")
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:367
        st = None
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:368
        if Std._hx_is(style,tjson_EncodeStyle):
            st = style
        elif (style == "fancy"):
            st = tjson_FancyStyle()
        else:
            st = tjson_SimpleStyle()
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:375
        buffer_b = python_lib_io_StringIO()
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:376
        if (Std._hx_is(obj,list) or Std._hx_is(obj,List)):
            buffer_b.write(Std.string(self.encodeIterable(obj,st,0)))
        elif Std._hx_is(obj,haxe_ds_StringMap):
            buffer_b.write(Std.string(self.encodeMap(obj,st,0)))
        else:
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:382
            self.cacheEncode(obj)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:383
            buffer_b.write(Std.string(self.encodeObject(obj,st,0)))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:385
        return buffer_b.getvalue()

    def encodeObject(self,obj,style,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:389
        buffer_b = python_lib_io_StringIO()
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:390
        buffer_b.write(Std.string(style.beginObject(depth)))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:391
        fieldCount = 0
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:392
        fields = None
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:393
        dontEncodeFields = None
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:394
        cls = Type.getClass(obj)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:395
        if (cls is not None):
            fields = python_Boot.getInstanceFields(cls)
        else:
            fields = python_Boot.fields(obj)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:402
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:402
        _g = Type.typeof(obj)
        if (_g.index == 6):
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:403
            c = _g.params[0]
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:404
            tmp = fieldCount
            fieldCount = (fieldCount + 1)
            if (tmp > 0):
                buffer_b.write(Std.string(style.entrySeperator(depth)))
            else:
                buffer_b.write(Std.string(style.firstEntry(depth)))
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:406
            buffer_b.write(Std.string(("\"_hxcls\"" + HxOverrides.stringOrNull(style.keyValueSeperator(depth)))))
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:407
            buffer_b.write(Std.string(self.encodeValue(Type.getClassName(c),style,depth)))
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:409
            if (Reflect.field(obj,"TJ_noEncode") is not None):
                dontEncodeFields = Reflect.field(obj,"TJ_noEncode")()
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:415
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:415
        _g1 = 0
        while (_g1 < len(fields)):
            field = (fields[_g1] if _g1 >= 0 and _g1 < len(fields) else None)
            _g1 = (_g1 + 1)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:416
            if ((dontEncodeFields is not None) and ((python_internal_ArrayImpl.indexOf(dontEncodeFields,field,None) >= 0))):
                continue
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:417
            value = Reflect.field(obj,field)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:418
            vStr = self.encodeValue(value,style,depth)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:419
            if (vStr is not None):
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:420
                tmp1 = fieldCount
                fieldCount = (fieldCount + 1)
                if (tmp1 > 0):
                    buffer_b.write(Std.string(style.entrySeperator(depth)))
                else:
                    buffer_b.write(Std.string(style.firstEntry(depth)))
                # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:422
                buffer_b.write(Std.string((((("\"" + ("null" if field is None else field)) + "\"") + HxOverrides.stringOrNull(style.keyValueSeperator(depth))) + Std.string(vStr))))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:429
        buffer_b.write(Std.string(style.endObject(depth)))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:430
        return buffer_b.getvalue()

    def encodeMap(self,obj,style,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:435
        buffer_b = python_lib_io_StringIO()
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:436
        buffer_b.write(Std.string(style.beginObject(depth)))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:437
        fieldCount = 0
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:438
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:438
        field = obj.keys()
        while field.hasNext():
            field1 = field.next()
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:439
            tmp = fieldCount
            fieldCount = (fieldCount + 1)
            if (tmp > 0):
                buffer_b.write(Std.string(style.entrySeperator(depth)))
            else:
                buffer_b.write(Std.string(style.firstEntry(depth)))
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:441
            value = obj.get(field1)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:442
            buffer_b.write(Std.string(((("\"" + ("null" if field1 is None else field1)) + "\"") + HxOverrides.stringOrNull(style.keyValueSeperator(depth)))))
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:443
            buffer_b.write(Std.string(self.encodeValue(value,style,depth)))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:445
        buffer_b.write(Std.string(style.endObject(depth)))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:446
        return buffer_b.getvalue()

    def encodeIterable(self,obj,style,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:451
        buffer_b = python_lib_io_StringIO()
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:452
        buffer_b.write(Std.string(style.beginArray(depth)))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:453
        fieldCount = 0
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:454
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:454
        value = HxOverrides.iterator(obj)
        while value.hasNext():
            value1 = value.next()
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:455
            tmp = fieldCount
            fieldCount = (fieldCount + 1)
            if (tmp > 0):
                buffer_b.write(Std.string(style.entrySeperator(depth)))
            else:
                buffer_b.write(Std.string(style.firstEntry(depth)))
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:457
            buffer_b.write(Std.string(self.encodeValue(value1,style,depth)))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:460
        buffer_b.write(Std.string(style.endArray(depth)))
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:461
        return buffer_b.getvalue()

    def cacheEncode(self,value):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:465
        if (not self.uCache):
            return None
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:467
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:467
        _g1 = 0
        _g = len(self.cache)
        while (_g1 < _g):
            c = _g1
            _g1 = (_g1 + 1)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:468
            if HxOverrides.eq((self.cache[c] if c >= 0 and c < len(self.cache) else None),value):
                return ((("\"" + HxOverrides.stringOrNull(tjson_TJSON.OBJECT_REFERENCE_PREFIX)) + Std.string(c)) + "\"")
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:472
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:472
        _this = self.cache
        _this.append(value)
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:473
        return None

    def encodeValue(self,value,style,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:477
        if (Std._hx_is(value,Int) or Std._hx_is(value,Float)):
            return value
        elif (Std._hx_is(value,list) or Std._hx_is(value,List)):
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:481
            v = value
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:482
            return self.encodeIterable(v,style,(depth + 1))
        elif Std._hx_is(value,List):
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:485
            v1 = value
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:486
            return self.encodeIterable(v1,style,(depth + 1))
        elif Std._hx_is(value,haxe_ds_StringMap):
            return self.encodeMap(value,style,(depth + 1))
        elif Std._hx_is(value,str):
            return (("\"" + HxOverrides.stringOrNull(StringTools.replace(StringTools.replace(StringTools.replace(StringTools.replace(Std.string(value),"\\","\\\\"),"\n","\\n"),"\r","\\r"),"\"","\\\""))) + "\"")
        elif Std._hx_is(value,Bool):
            return value
        elif Reflect.isObject(value):
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:500
            ret = self.cacheEncode(value)
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:501
            if (ret is not None):
                return ret
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:502
            return self.encodeObject(value,style,(depth + 1))
        elif (value is None):
            return "null"
        else:
            return None

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.cache = None
        _hx_o.uCache = None
tjson_TJSONEncoder._hx_class = tjson_TJSONEncoder
_hx_classes["tjson.TJSONEncoder"] = tjson_TJSONEncoder


class tjson_EncodeStyle:
    _hx_class_name = "tjson.EncodeStyle"
    __slots__ = ()
    _hx_methods = ["beginObject", "endObject", "beginArray", "endArray", "firstEntry", "entrySeperator", "keyValueSeperator"]
tjson_EncodeStyle._hx_class = tjson_EncodeStyle
_hx_classes["tjson.EncodeStyle"] = tjson_EncodeStyle


class tjson_SimpleStyle:
    _hx_class_name = "tjson.SimpleStyle"
    __slots__ = ()
    _hx_methods = ["beginObject", "endObject", "beginArray", "endArray", "firstEntry", "entrySeperator", "keyValueSeperator"]
    _hx_interfaces = [tjson_EncodeStyle]

    def __init__(self):
        pass

    def beginObject(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:532
        return "{"

    def endObject(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:535
        return "}"

    def beginArray(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:538
        return "["

    def endArray(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:541
        return "]"

    def firstEntry(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:544
        return ""

    def entrySeperator(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:547
        return ","

    def keyValueSeperator(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:550
        return ":"

    @staticmethod
    def _hx_empty_init(_hx_o):        pass
tjson_SimpleStyle._hx_class = tjson_SimpleStyle
_hx_classes["tjson.SimpleStyle"] = tjson_SimpleStyle


class tjson_FancyStyle:
    _hx_class_name = "tjson.FancyStyle"
    __slots__ = ("tab", "charTimesNCache")
    _hx_fields = ["tab", "charTimesNCache"]
    _hx_methods = ["beginObject", "endObject", "beginArray", "endArray", "firstEntry", "entrySeperator", "keyValueSeperator", "charTimesN"]
    _hx_interfaces = [tjson_EncodeStyle]

    def __init__(self,tab = "    "):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:558
        if (tab is None):
            tab = "    "
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:559
        self.tab = tab
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:560
        self.charTimesNCache = [""]

    def beginObject(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:563
        return "{\n"

    def endObject(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:566
        return (("\n" + HxOverrides.stringOrNull(self.charTimesN(depth))) + "}")

    def beginArray(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:569
        return "[\n"

    def endArray(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:572
        return (("\n" + HxOverrides.stringOrNull(self.charTimesN(depth))) + "]")

    def firstEntry(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:575
        return (HxOverrides.stringOrNull(self.charTimesN((depth + 1))) + " ")

    def entrySeperator(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:578
        return (("\n" + HxOverrides.stringOrNull(self.charTimesN((depth + 1)))) + ",")

    def keyValueSeperator(self,depth):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:581
        return " : "

    def charTimesN(self,n):
        # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:585
        if (n < len(self.charTimesNCache)):
            return (self.charTimesNCache[n] if n >= 0 and n < len(self.charTimesNCache) else None)
        else:
            # /usr/local/lib/haxe/lib/tjson/1,4,0/tjson/TJSON.hx:588
            tmp = self.charTimesN((n - 1))
            def _hx_local_1():
                def _hx_local_0():
                    python_internal_ArrayImpl._set(self.charTimesNCache, n, (("null" if tmp is None else tmp) + HxOverrides.stringOrNull(self.tab)))
                    return (self.charTimesNCache[n] if n >= 0 and n < len(self.charTimesNCache) else None)
                return _hx_local_0()
            return _hx_local_1()

    @staticmethod
    def _hx_empty_init(_hx_o):
        _hx_o.tab = None
        _hx_o.charTimesNCache = None
tjson_FancyStyle._hx_class = tjson_FancyStyle
_hx_classes["tjson.FancyStyle"] = tjson_FancyStyle

# /usr/local/lib/haxe/std/python/_std/Math.hx:135
Math.NEGATIVE_INFINITY = float("-inf")
# /usr/local/lib/haxe/std/python/_std/Math.hx:136
Math.POSITIVE_INFINITY = float("inf")
# /usr/local/lib/haxe/std/python/_std/Math.hx:137
Math.NaN = float("nan")
# /usr/local/lib/haxe/std/python/_std/Math.hx:138
Math.PI = python_lib_Math.pi

python_Boot.keywords = set(["and", "del", "from", "not", "with", "as", "elif", "global", "or", "yield", "assert", "else", "if", "pass", "None", "break", "except", "import", "raise", "True", "class", "exec", "in", "return", "False", "continue", "finally", "is", "try", "def", "for", "lambda", "while"])
python_Boot.prefixLength = len("_hx_")
tjson_TJSON.OBJECT_REFERENCE_PREFIX = "@~obRef#"

Main.main()