### `_parseVertex()` Parse one line of text from a Tinkerpop graphson stream, yielding one vertex.
162826
function _parseVertex(line) {
        var vertex = JSON.parse(line);
        assert.ok(_smellsLikeAnElement(vertex));
        // A vertex is an object, i.e. a key,value map.
        // We don't sort the keys of the object, leaving that to jsonStableStringify below.
        // But a vertex values contain `property containers`, each of which may contain embedded arrays of elements.
        return _.mapValues(vertex, _sortPropertyContainers);
    }
960276
function parse(node) {
  var link = {}
  var url = node.url || node.href || ''
  var start
  var end
  var page

  if (
    url.slice(0, GH_URL_PREFIX_LENGTH) !== GH_URL_PREFIX ||
    node.children.length !== 1 ||
    node.children[0].type !== 'text' ||
    toString(node).slice(0, GH_URL_PREFIX_LENGTH) !== GH_URL_PREFIX
  ) {
    return
  }

  start = GH_URL_PREFIX_LENGTH
  end = usernameEnd(url, GH_URL_PREFIX_LENGTH)

  if (end === -1 || url.charCodeAt(end) !== CC_SLASH) {
    return
  }

  link.user = url.slice(start, end)

  start = end + 1
  end = projectEnd(url, start)

  if (end === -1 || url.charCodeAt(end) !== CC_SLASH) {
    return
  }

  link.project = url.slice(start, end)

  start = end + 1
  end = url.indexOf('/', start)

  if (end === -1) {
    return
  }

  page = url.slice(start, end)

  if (page !== parse.COMMIT && page !== parse.ISSUE && page !== parse.PULL) {
    return
  }

  link.page = page
  start = end + 1

  if (page === parse.COMMIT) {
    end = shaEnd(url, start, true)
  } else {
    end = issueEnd(url, start)
  }

  if (end === -1) {
    return
  }

  link.reference = url.slice(start, end)
  link.comment = url.charCodeAt(end) === CC_HASH && url.length > end + 1

  return link
}
1313671
def Take(input_vertex: vertex_constructor_param_types, index: Collection[int], label: Optional[str]=None) -> Vertex:
    
    return Double(context.jvm_view().TakeVertex, label, cast_to_double_vertex(input_vertex), cast_to_long_array(index))
907749
function parseOrigLink (node, nodeType, feedType) {
  var origLink;

  if (origLink = utils.getFirstFoundPropValue(node, ['feedburner:origlink', 'pheedo:origlink'])) {
    return origLink;
  } else {
    utils.parse(node.link, function (linkEl) {
      var linkAttr = linkEl['@'];

      if (linkAttr.href && linkAttr.rel === 'canonical') {
        origLink = linkAttr.href;
        return true;
      }
    }, this, true);
  }

  return origLink;
}
650837
@Override
  public void enterVertex(GDLParser.VertexContext vertexContext) {
    String variable = getVariable(vertexContext.header());
    Vertex v;
    if (variable != null && userVertexCache.containsKey(variable)) {
      v = userVertexCache.get(variable);
    } else {
      v = initNewVertex(vertexContext);

      if (variable != null) {
        userVertexCache.put(variable, v);
      } else {
        variable = String.format(ANONYMOUS_VERTEX_VARIABLE, v.getId());
        autoVertexCache.put(variable, v);
      }
      v.setVariable(variable);
      vertices.add(v);
    }
    updateGraphElement(v);
    setLastSeenVertex(v);
    updateLastSeenEdge(v);
  }
251804
function buildEdgeVertex(index, x, y, tileBody, isGhost) {
	let vertex = {
		x: x,
		y: y,
		index: index,
		body: tileBody,
		isInternal: false,
		isGhost: isGhost,
		contact: null
	};
	
	vertex.contact = {
		vertex: vertex,
		normalImpulse: 0,
		tangentImpulse: 0
	};
	
	return vertex;
}
129736
public static Parse parseParse(final String parse, final GapLabeler gl) {
    final StringBuilder text = new StringBuilder();
    int offset = 0;
    final Stack<Constituent> stack = new Stack<Constituent>();
    final List<Constituent> cons = new LinkedList<Constituent>();
    for (int ci = 0, cl = parse.length(); ci < cl; ci++) {
      final char c = parse.charAt(ci);
      if (c == '(') {
        final String rest = parse.substring(ci + 1);
        final String type = getType(rest);
        if (type == null) {
          System.err.println("null type for: " + rest);
        }
        final String token = getToken(rest);
        stack.push(new Constituent(type, new Span(offset, offset)));
        if (token != null) {
          if (type.equals("-NONE-") && gl != null) {
            // System.err.println("stack.size="+stack.size());
            gl.labelGaps(stack);
          } else {
            cons.add(new Constituent(ShiftReduceParser.TOK_NODE,
                new Span(offset, offset + token.length())));
            text.append(token).append(" ");
            offset += token.length() + 1;
          }
        }
      } else if (c == ')') {
        final Constituent con = stack.pop();
        final int start = con.getSpan().getStart();
        if (start < offset) {
          cons.add(
              new Constituent(con.getLabel(), new Span(start, offset - 1)));
        }
      }
    }
    final String txt = text.toString();
    int tokenIndex = -1;
    final Parse p = new Parse(txt, new Span(0, txt.length()),
        ShiftReduceParser.TOP_NODE, 1, 0);
    for (int ci = 0; ci < cons.size(); ci++) {
      final Constituent con = cons.get(ci);
      final String type = con.getLabel();
      if (!type.equals(ShiftReduceParser.TOP_NODE)) {
        if (type == ShiftReduceParser.TOK_NODE) {
          tokenIndex++;
        }
        final Parse c = new Parse(txt, con.getSpan(), type, 1, tokenIndex);
        // System.err.println("insert["+ci+"] "+type+" "+c.toString()+"
        // "+c.hashCode());
        p.insert(c);
        // codeTree(p);
      }
    }
    return p;
  }
769475
def _parse_node(node,
                parent_matrix,
                material_map,
                meshes,
                graph,
                resolver=None):
    

    # Parse mesh node
    if isinstance(node, collada.scene.GeometryNode):
        geometry = node.geometry

        # Create local material map from material symbol to actual material
        local_material_map = {}
        for mn in node.materials:
            symbol = mn.symbol
            m = mn.target
            if m.id in material_map:
                local_material_map[symbol] = material_map[m.id]
            else:
                local_material_map[symbol] = _parse_material(m, resolver)

        # Iterate over primitives of geometry
        for i, primitive in enumerate(geometry.primitives):
            if isinstance(primitive, collada.polylist.Polylist):
                primitive = primitive.triangleset()
            if isinstance(primitive, collada.triangleset.TriangleSet):
                vertex = primitive.vertex
                vertex_index = primitive.vertex_index
                vertices = vertex[vertex_index].reshape(
                    len(vertex_index) * 3, 3)

                # Get normals if present
                normals = None
                if primitive.normal is not None:
                    normal = primitive.normal
                    normal_index = primitive.normal_index
                    normals = normal[normal_index].reshape(
                        len(normal_index) * 3, 3)

                # Get colors if present
                colors = None
                s = primitive.sources
                if ('COLOR' in s and len(s['COLOR'])
                        > 0 and len(primitive.index) > 0):
                    color = s['COLOR'][0][4].data
                    color_index = primitive.index[:, :, s['COLOR'][0][0]]
                    colors = color[color_index].reshape(
                        len(color_index) * 3, 3)

                faces = np.arange(
                    vertices.shape[0]).reshape(
                    vertices.shape[0] // 3, 3)

                # Get UV coordinates if possible
                vis = None
                if primitive.material in local_material_map:
                    material = copy.copy(
                        local_material_map[primitive.material])
                    uv = None
                    if len(primitive.texcoordset) > 0:
                        texcoord = primitive.texcoordset[0]
                        texcoord_index = primitive.texcoord_indexset[0]
                        uv = texcoord[texcoord_index].reshape(
                            (len(texcoord_index) * 3, 2))
                    vis = visual.texture.TextureVisuals(
                        uv=uv, material=material)

                primid = '{}.{}'.format(geometry.id, i)
                meshes[primid] = {
                    'vertices': vertices,
                    'faces': faces,
                    'vertex_normals': normals,
                    'vertex_colors': colors,
                    'visual': vis}

                graph.append({'frame_to': primid,
                              'matrix': parent_matrix,
                              'geometry': primid})

    # recurse down tree for nodes with children
    elif isinstance(node, collada.scene.Node):
        if node.children is not None:
            for child in node.children:
                # create the new matrix
                matrix = np.dot(parent_matrix, node.matrix)
                # parse the child node
                _parse_node(
                    node=child,
                    parent_matrix=matrix,
                    material_map=material_map,
                    meshes=meshes,
                    graph=graph,
                    resolver=resolver)

    elif isinstance(node, collada.scene.CameraNode):
        # TODO: convert collada cameras to trimesh cameras
        pass
    elif isinstance(node, collada.scene.LightNode):
        # TODO: convert collada lights to trimesh lights
        pass
829169
def getVertex(self, _id):
        """"""
        try:
            node = self.neograph.nodes.get(_id)
        except client.NotFoundError:
            return None
        return Vertex(node)
908676
def _parse_loops_from_graph(self, graph):
        
        outtop = []
        outall = []
        for subg in networkx.strongly_connected_component_subgraphs(graph):
            if len(subg.nodes()) == 1:
                if len(list(subg.successors(list(subg.nodes())[0]))) == 0:
                    continue
            thisloop, allloops = self._parse_loop_graph(subg, graph)
            if thisloop is not None:
                outall += allloops
                outtop.append(thisloop)
        return outtop, outall
83893
def parse(self, text):
        
        gen = self.lexer.lex(text)
        next_val_fn = partial(next, *(gen,))

        commands = []
        token = next_val_fn()
        while token[0] is not EOF:
            command, token = self.rule_svg_transform(next_val_fn, token)
            commands.append(command)
        return commands
1205516
def _parse_line(line=''):
    '''
    
    '''
    parts = line.split()
    key = parts.pop(0)
    value = ' '.join(parts)
    return key, value
401372
function parseDiagram(diagramXML) {
  return new Promise((resolve, reject) => {
    moddle.fromXML(diagramXML, (error, moddleElement, context) => {

      if (error) {
        return resolve({
          error
        });
      }

      const warnings = context.warnings || [];

      return resolve({
        moddleElement,
        warnings
      });
    });
  });
}
545661
def from_lines(lines: Iterable[str], **kwargs) -> BELGraph:
    
    graph = BELGraph()
    parse_lines(graph=graph, lines=lines, **kwargs)
    return graph
1349036
function parse(text) {
    const textLineByLine = text.split(LINEBREAKE_MARK);
    // it should be alternately Str and Break
    let startIndex = 0;
    const lastLineIndex = textLineByLine.length - 1;
    const isLasEmptytLine = (line, index) => {
        return index === lastLineIndex && line === "";
    };
    const isEmptyLine = (line, index) => {
        return index !== lastLineIndex && line === "";
    };
    const children = textLineByLine.reduce(function(result, currentLine, index) {
        const lineNumber = index + 1;
        if (isLasEmptytLine(currentLine, index)) {
            return result;
        }
        // \n
        if (isEmptyLine(currentLine, index)) {
            const emptyBreakNode = createBRNode(lineNumber, startIndex);
            startIndex += emptyBreakNode.raw.length;
            result.push(emptyBreakNode);
            return result;
        }

        // (Paragraph > Str) -> Br?
        const strNode = parseLine(currentLine, lineNumber, startIndex);
        const paragraph = createParagraph([strNode]);
        startIndex += paragraph.raw.length;
        result.push(paragraph);
        if (index !== lastLineIndex) {
            const breakNode = createEndedBRNode(paragraph);
            startIndex += breakNode.raw.length;
            result.push(breakNode);
        }
        return result;
    }, []);
    return {
        type: Syntax.Document,
        raw: text,
        range: [0, text.length],
        loc: {
            start: {
                line: 1,
                column: 0
            },
            end: {
                line: textLineByLine.length,
                column: textLineByLine[textLineByLine.length - 1].length
            }
        },
        children
    };
}
174163
def parse(self, data):
        
        # initialize graph and list of aggregated nodes
        graph = self._init_graph()
        server = self._server_common_name
        # add server (central node) to graph
        graph.add_node(server)
        # data may be empty
        if data is None:
            clients = []
            links = []
        else:
            clients = data.client_list.values()
            links = data.routing_table.values()
        # add clients in graph as nodes
        for client in clients:
            if client.common_name == 'UNDEF':
                continue
            client_properties = {
                'label': client.common_name,
                'real_address': str(client.real_address.host),
                'port': int(client.real_address.port),
                'connected_since': client.connected_since.strftime('%Y-%m-%dT%H:%M:%SZ'),
                'bytes_received': int(client.bytes_received),
                'bytes_sent': int(client.bytes_sent)
            }
            local_addresses = [
                str(route.virtual_address)
                for route in data.routing_table.values()
                if route.real_address == client.real_address
            ]
            if local_addresses:
                client_properties['local_addresses'] = local_addresses
            graph.add_node(str(client.real_address.host), **client_properties)
        # add links in routing table to graph
        for link in links:
            if link.common_name == 'UNDEF':
                continue
            graph.add_edge(server, str(link.real_address.host), weight=1)
        return graph
467467
def parseNode(self):
		
		n = SGFParser.parseNode(self)			# process one Node as usual
		self.index = self.datalen				# set end of data
		return n