def convert(value, _type):
    return {
            'BOOL'  : lambda x: x == '1' or x.lower() == 'true',
            'INT'   : lambda x: int(x),
            'FLOAT' : lambda x: float(x),
            'STRING': lambda x: x[1:-1].replace(r'\"', r'"').replace(r"\'", "'"),
            }.get(_type, lambda x: x)(value)
Convert instances of textx types to python types.
dataset/ETHPy150Open igordejanovic/textX/textx/model.py/convert