code: def node_neighbors(node_id):
      
      exp = Experiment(session)
  
      # get the parameters
      node_type = request_parameter(
          parameter="node_type", parameter_type="known_class", default=models.Node
      )
      connection = request_parameter(parameter="connection", default="to")
      failed = request_parameter(parameter="failed", parameter_type="bool", optional=True)
      for x in [node_type, connection]:
          if type(x) == Response:
              return x
  
      # make sure the node exists
      node = models.Node.query.get(node_id)
      if node is None:
          return error_response(
              error_type="/node/neighbors, node does not exist",
              error_text="/node/{0}/neighbors, node {0} does not exist".format(node_id),
          )
  
      # get its neighbors
      if failed is not None:
          # This will always raise because "failed" is not a supported parameter.
          # We just want to pass the exception message back in the response:
          try:
              node.neighbors(type=node_type, direction=connection, failed=failed)
          except Exception as e:
              return error_response(error_type="node.neighbors", error_text=str(e))
  
      else:
          nodes = node.neighbors(type=node_type, direction=connection)
          try:
              # ping the experiment
              exp.node_get_request(node=node, nodes=nodes)
              session.commit()
          except Exception:
              return error_response(error_type="exp.node_get_request")
  
      return success_response(nodes=[n.__json__() for n in nodes])
docs: 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()