code: def connect(node_id, other_node_id):
      
      exp = experiment(session)
  
      # get the parameters
      direction = request_parameter(parameter="direction", default="to")
      if type(direction == Response):
          return direction
  
      # check the nodes exist
      node = models.Node.query.get(node_id)
      if node is None:
          return error_response(error_type="/node/connect, node does not exist")
  
      other_node = models.Node.query.get(other_node_id)
      if other_node is None:
          return error_response(
              error_type="/node/connect, other node does not exist",
              participant=node.participant)
  
      # execute the request
      try:
          vectors = node.connect(whom=other_node, direction=direction)
          for v in vectors:
              assign_properties(v)
  
          # ping the experiment
          exp.vector_post_request(
              node=node,
              vectors=vectors)
  
          session.commit()
      except:
          return error_response(error_type="/vector POST server error",
                                status=403,
                                participant=node.participant)
  
      return success_response(field="vectors",
                              data=[v.__json__() for v in vectors],
                              request_type="vector post")
docs: Connect to another node.
  
      The ids of both nodes must be speficied in the url.
      You can also pass direction (to/from/both) as an argument.