<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def run_code(node: Code, parent_node: Node = None, node_globals: InheritedDict = None, **args): #pylint: disable=unused-argument
    '''Executes node content as python module and adds its definitions to globals'''
    if not node.xml_node.text:
        return
    code = node.xml_node.text
    try:
        globs = node_globals.to_dictionary()
        exec(dedent(code), globs) #pylint: disable=exec-used
        definitions = [(key, value) for key, value in globs.items() \
                       if key != '__builtins__' and not node_globals.has_key(key)]
        for key, value in definitions:
            parent_node.node_globals[key] = value
    except SyntaxError as err:
        error = _get_compilation_error(code, 'Invalid syntax', err, err.lineno)
        raise error from err
    except:
        info = exc_info()
        cause = info[1]
        line_number = extract_tb(info[2])[-1][1]
        error = _get_compilation_error(code, 'Code execution is failed', cause, line_number)
        raise error from cause