def node_class_factory(ast, parent):
    ast = deepcopy(ast)
    if ((not isinstance(ast, dict)) or ('nodeType' not in ast)):
        return ast
    if ('body' in ast):
        ast['nodes'] = ast.pop('body')
    base_class = (IterableNodeBase if ('nodes' in ast) else NodeBase)
    base_type = next((k for (k, v) in BASE_NODE_TYPES.items() if (ast['nodeType'] in v)), None)
    if base_type:
        ast['baseNodeType'] = base_type
    return type(ast['nodeType'], (base_class,), {})(ast, parent)
def node_class_factory(ast, parent):
    ast = deepcopy(ast)
    if ((not isinstance(ast, dict)) or ('nodeType' not in ast)):
        return ast
    if ('body' in ast):
        ast['nodes'] = ast.pop('body')
    base_class = (IterableNodeBase if ('nodes' in ast) else NodeBase)
    base_type = next((k for (k, v) in BASE_NODE_TYPES.items() if (ast['nodeType'] in v)), None)
    if base_type:
        ast['baseNodeType'] = base_type
    return type(ast['nodeType'], (base_class,), {})(ast, parent)