@app.route("<STR_LIT>", methods=["<STR_LIT:GET>"])<EOL>def node_neighbors(node_id):
exp = Experiment(session)<EOL>node_type = request_parameter(<EOL>parameter="<STR_LIT>", parameter_type="<STR_LIT>", default=models.Node<EOL>)<EOL>connection = request_parameter(parameter="<STR_LIT>", default="<STR_LIT:to>")<EOL>failed = request_parameter(parameter="<STR_LIT>", parameter_type="<STR_LIT:bool>", optional=True)<EOL>for x in [node_type, connection]:<EOL><INDENT>if type(x) == Response:<EOL><INDENT>return x<EOL><DEDENT><DEDENT>node = models.Node.query.get(node_id)<EOL>if node is None:<EOL><INDENT>return error_response(<EOL>error_type="<STR_LIT>",<EOL>error_text="<STR_LIT>".format(node_id),<EOL>)<EOL><DEDENT>if failed is not None:<EOL><INDENT>try:<EOL><INDENT>node.neighbors(type=node_type, direction=connection, failed=failed)<EOL><DEDENT>except Exception as e:<EOL><INDENT>return error_response(error_type="<STR_LIT>", error_text=str(e))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>nodes = node.neighbors(type=node_type, direction=connection)<EOL>try:<EOL><INDENT>exp.node_get_request(node=node, nodes=nodes)<EOL>session.commit()<EOL><DEDENT>except Exception:<EOL><INDENT>return error_response(error_type="<STR_LIT>")<EOL><DEDENT><DEDENT>return success_response(nodes=[n.__json__() for n in nodes])<EOL>
Send a GET request to the node table.

    This calls the neighbours method of the node
    making the request and returns a list of descriptions of
    the nodes (even if there is only one).
    Required arguments: participant_id, node_id
    Optional arguments: type, connection

    After getting the neighbours it also calls
    exp.node_get_request()