Get the vectors of a node.

    You must specify the node id in the url.
    You can pass direction (incoming/outgoing/all) and failed
    (True/False/all).
541091
def node_vectors(node_id):
    
    exp = Experiment(session)
    # get the parameters
    direction = request_parameter(parameter="direction", default="all")
    failed = request_parameter(parameter="failed", parameter_type="bool", default=False)
    for x in [direction, failed]:
        if type(x) == Response:
            return x

    # execute the request
    node = models.Node.query.get(node_id)
    if node is None:
        return error_response(error_type="/node/vectors, node does not exist")

    try:
        vectors = node.vectors(direction=direction, failed=failed)
        exp.vector_get_request(node=node, vectors=vectors)
        session.commit()
    except Exception:
        return error_response(
            error_type="/node/vectors GET server error",
            status=403,
            participant=node.participant,
        )

    # return the data
    return success_response(vectors=[v.__json__() for v in vectors])
73397
function _getLinks(nodes) {
  var links = [],
      nodeHash;

  nodeHash = nodes.reduce(function (obj, node) {
    obj[node.id] = node;
    return obj;
  }, {});

  _data.links.forEach(function (link) {
    var source = nodeHash[link.sourceId],
        target = nodeHash[link.targetId];
    if(source && target) {
      link.setProperties({
        source: source,
        target: target,
        isBackwardLink: source.isSelfOrAncestor(target)
      });
      links.push(link);
    }
  });

  return links;
}
1239597
def get_node_by_id(self, node_id):
        
        tmp_nodes = self.diagram_graph.nodes(data=True)
        for node in tmp_nodes:
            if node[0] == node_id:
                return node
256115
def get_nodes(self, node_id=None, **kwargs):
        
        return self.get_elements(Node, elem_id=node_id, **kwargs)
724785
private DatanodeID[] getDatanodes(HttpServletRequest request)
  throws IOException {
    final String datanodes = request.getParameter("candidates");
    if (datanodes == null) {
      return null;
    }
    final String[] datanodeStrs = datanodes.split(" ");
    if (datanodeStrs.length == 0) {
      return null;
    }
    final DatanodeID[] dnIDs = new DatanodeID[datanodeStrs.length];
    for (int i=0; i<dnIDs.length; i++) {
      String hostName = datanodeStrs[i];
      int colon = datanodeStrs[i].indexOf(":");
      if (colon < 0) {
        throw new IOException("Invalid datanode name " + 
            datanodeStrs[i] + ", expecting name:port pair");
      } 
      hostName = datanodeStrs[i].substring(0, colon);
      int infoPort;
      try {
        infoPort = Integer.parseInt(datanodeStrs[i].substring(colon+1));
      } catch (NumberFormatException ne) {
        throw new IOException("Invalid datanode name " + 
            datanodeStrs[i] + ", expecting name:port pair", ne);
      }
      dnIDs[i] = new DatanodeID(hostName, null, infoPort, -1);
    }
    return dnIDs;
  }
746762
def getnodes(self, name):
        "'"
        for node in self.nodes:
            if striptag(node.tag) == name:
                yield node
137041
def parse_osm_nodes_paths(osm_data):
    

    nodes = {}
    paths = {}
    for element in osm_data['elements']:
        if element['type'] == 'node':
            key = element['id']
            nodes[key] = get_node(element)
        elif element['type'] == 'way': #osm calls network paths 'ways'
            key = element['id']
            paths[key] = get_path(element)

    return nodes, paths
486596
def get_nodes(api_url=None, verify=False, cert=list()):
    
    return utils._make_api_request(api_url, '/nodes', verify, cert)
1215920
def nodes(self):
        
        if self._nodes is None:
            self._nodes = layout_nodes(self, only_nodes=True)
        return self._nodes
97538
function (node) {
                    var data = {},
                        names = self.getPointerNames(node),
                        i;
                    for (i = 0; i < names.length; i++) {
                        data[names[i]] = self.getPointerPath(node, names[i]);
                    }
                    return data;
                }
1047411
def get_node(request):
    """"""
    api_major_int = 2 if d1_gmn.app.views.util.is_v2_api(request) else 1
    node_pretty_xml = d1_gmn.app.node.get_pretty_xml(api_major_int)
    return django.http.HttpResponse(node_pretty_xml, d1_common.const.CONTENT_TYPE_XML)
1288460
def get_degrees(self):
        '''
        
        '''
        degree = {}
        if self.attr['type'] is not DIRECTED_GRAPH:
            for n in self.get_node_list():
                degree[n] = len(self.get_neighbors(n))
            return degree
        else:
            for n in self.get_node_list():
                degree[n] = (len(self.get_in_neighbors(n)) +
                             len(self.get_out_neighbors(n)))
1068898
def _get_remote_node_url(self, remote_node):
        
        logging.getLogger("requests").setLevel(logging.WARNING)
        gridextras_port = 3000
        return 'http://{}:{}'.format(remote_node, gridextras_port)
1061671
def getRequiredNodes(self):
        
        return {nodeShape:len(self.nodeReservations[nodeShape]) for nodeShape in self.nodeShapes}
1358837
def get_nodes(self, request):
        
        nodes = []
        nodes.append(NavigationNode(_('Tags'), reverse('zinnia:tag_list'),
                                    'tags'))
        for tag in tags_published():
            nodes.append(NavigationNode(tag.name,
                                        reverse('zinnia:tag_detail',
                                                args=[tag.name]),
                                        tag.pk, 'tags'))
        return nodes
761419
def get_node(self, node_id):
        
        try:
            return self._nodes[node_id]
        except KeyError:
            raise aiohttp.web.HTTPNotFound(text="Node ID {} doesn't exist".format(node_id))
406213
def get_nodes(self, request):
        
        nodes = []
        archives = []
        attributes = {'hidden': HIDE_ENTRY_MENU}
        for entry in Entry.published.all():
            year = entry.creation_date.strftime('%Y')
            month = entry.creation_date.strftime('%m')
            month_text = format(entry.creation_date, 'b').capitalize()
            day = entry.creation_date.strftime('%d')

            key_archive_year = 'year-%s' % year
            key_archive_month = 'month-%s-%s' % (year, month)
            key_archive_day = 'day-%s-%s-%s' % (year, month, day)

            if key_archive_year not in archives:
                nodes.append(NavigationNode(
                    year, reverse('zinnia:entry_archive_year', args=[year]),
                    key_archive_year, attr=attributes))
                archives.append(key_archive_year)

            if key_archive_month not in archives:
                nodes.append(NavigationNode(
                    month_text,
                    reverse('zinnia:entry_archive_month', args=[year, month]),
                    key_archive_month, key_archive_year,
                    attr=attributes))
                archives.append(key_archive_month)

            if key_archive_day not in archives:
                nodes.append(NavigationNode(
                    day, reverse('zinnia:entry_archive_day',
                                 args=[year, month, day]),
                    key_archive_day, key_archive_month,
                    attr=attributes))
                archives.append(key_archive_day)

            nodes.append(NavigationNode(entry.title, entry.get_absolute_url(),
                                        entry.pk, key_archive_day))
        return nodes