If emit is true then the edge id also needs to be printed.
This is required when there are multiple edges to the same vertex.
Only by having access to the edge id can on tell if the vertex needs to be emitted.
495320
private static void constructEmitFromClause(LinkedList<SchemaTableTree> distinctQueryStack, ColumnList cols) {
        int count = 1;
        for (SchemaTableTree schemaTableTree : distinctQueryStack) {
            if (count > 1) {
                if (!schemaTableTree.getSchemaTable().isEdgeTable() && schemaTableTree.isEmit()) {
                    //if the VertexStep is for an edge table there is no need to print edge ids as its already printed.
                    printEdgeId(schemaTableTree.parent, cols);
                }
            }
            count++;
        }
    }
1161682
private boolean isExceptionEdge(Edge edge) {
        boolean isExceptionEdge = edge.isExceptionEdge();
        if (isExceptionEdge) {
            if (DEBUG) {
                System.out.println("NOT Ignoring " + edge);
            }
            return true; // false
        }
        if (edge.getType() != EdgeTypes.FALL_THROUGH_EDGE) {
            return false;
        }
        InstructionHandle h = edge.getSource().getLastInstruction();
        return h != null
            && h.getInstruction() instanceof IFNONNULL
            && isNullCheck(h, methodGen.getConstantPool());
    }
73132
public boolean isSafe(Node node, Edge edge)
	{
		initMaps();

		setColor(node, BLACK);
		setLabel(node, 0);
		setLabel(edge, 0);

		labelEquivRecursive(node, UPWARD, 0, false, false);
		labelEquivRecursive(node, DOWNWARD, 0, false, false);

		// Initialize dist and color of source set

		Node neigh = edge.getTargetNode();

		if (getColor(neigh) != WHITE) return false;

		setColor(neigh, GRAY);
		setLabel(neigh, 0);

		queue.add(neigh);

		labelEquivRecursive(neigh, UPWARD, 0, true, false);
		labelEquivRecursive(neigh, DOWNWARD, 0, true, false);

		// Process the queue

		while (!queue.isEmpty())
		{
			Node current = queue.remove(0);

			if (ST.contains(current)) return true;
			
			boolean safe = processNode2(current);

			if (safe) return true;

			// Current node is processed
			setColor(current, BLACK);
		}

		return false;
	}
800521
function isInbound(network, id) {
  for( var i = 0; i < network.edge.in.length; i++ ) {
    if(id === network.edge.out[i].properties.hobbes.id) {
      return true;
    }
  }

  return false;
}
1130374
public function isValid()
    {
        $vertices = $this->getGraph()->getVertices()->getMap();
        // check source graph contains all vertices
        foreach ($this->getVertices()->getMap() as $vid => $vertex) {
            // make sure vertex ID exists and has not been replaced
            if (!isset($vertices[$vid]) || $vertices[$vid] !== $vertex) {
                return false;
            }
        }
        $edges = $this->getGraph()->getEdges()->getVector();
        // check source graph contains all edges
        foreach ($this->edges as $edge) {
            if (!in_array($edge, $edges, true)) {
                return false;
            }
        }

        return true;
    }
1090478
def _getMultigraphID(self, graph_name, subgraph_name=None):
        
        if self.isMultiInstance and self._instanceName is not None:
            if subgraph_name is None:
                return "%s_%s" % (graph_name, self._instanceName)
            else:
                return "%s_%s.%s_%s" % (graph_name, self._instanceName, 
                                        subgraph_name, self._instanceName)
        else:
            if subgraph_name is None:
                return graph_name
            else:
                return "%s.%s" % (graph_name, subgraph_name)
1149824
private static boolean mayHaveResourceEdge(TransactionOLTP graknGraph, ConceptId conceptId1, ConceptId conceptId2) {
        Concept concept1 = graknGraph.getConcept(conceptId1);
        Concept concept2 = graknGraph.getConcept(conceptId2);
        return concept1 != null && concept2 != null && (concept1.isAttribute() || concept2.isAttribute());
    }
172400
static boolean getConsistent(DirectedGraph g) {
        Object[] vertexOrdering = new Object[g.size()];
        int voa = 0;
        for (Iterator<?> itr = g.iterator(); itr.hasNext(); voa++) {
            vertexOrdering[voa] = itr.next();
        }
        int vol = vertexOrdering.length;
        Weight[][] updatedEdges = new Weight[vol][vol];
        for (int k = vol - 1; k > 1; k--) {
            Object vk = vertexOrdering[k];
            for (int i = 0; i < k; i++) {
                Object vi = vertexOrdering[i];
                Weight wik = getWeight(i, k, vi, vk, g, updatedEdges);
                if (wik != null) {
                    /*
                     * wki may be different from wik, so we can't just get the
                     * inverse of wik.
                     */
                    Weight wki = getWeight(k, i, vk, vi, g, updatedEdges);
                    // i > j because we evaluate the vertices in order.
                    for (int j = i + 1; j < k; j++) {
                        Object vj = vertexOrdering[j];
                        Weight wjk = getWeight(j, k, vj, vk, g, updatedEdges);
                        if (wjk != null) {
                            Weight wkj = getWeight(k, j, vk, vj, g,
                                    updatedEdges);
                            Weight wikj = wik.add(wkj);
                            Weight wjki = wjk.add(wki);
                            Weight wij = getWeight(i, j, vi, vj, g,
                                    updatedEdges);
                            Weight wji = getWeight(j, i, vj, vi, g,
                                    updatedEdges);
                            Weight iwjki = wjki.invertSign();
                            Weight iwji = null;
                            if (wji != null) {
                                iwji = wji.invertSign();
                            }
                            if (wij != null) {
                                Weight intersectionMin = Weight.max(iwji, iwjki);
                                Weight intersectionMax = Weight.min(wij, wikj);
                                if (intersectionMin.compareTo(intersectionMax) > 0) {
                                    return false;
                                }
                                updatedEdges[i][j] = intersectionMax;
                                updatedEdges[j][i] = intersectionMin.invertSign();
                            } else {
                                updatedEdges[i][j] = wikj;
                                updatedEdges[j][i] = wjki;
                            }
                        }
                    }
                }
            }
        }

        return true;
    }
252925
@Override
    public void onNewItem(int id, Barcode item) {
        mGraphic.setId(id);
        if (mListener != null) mListener.onNewBarcodeDetected(id, item);
    }
639649
function(graph)
	{
		var wnd = window.open();
		var bounds = graph.getGraphBounds();
		mxUtils.show(graph, wnd.document);
		
		var print = function()
		{
			wnd.focus();
			wnd.print();
			wnd.close();
		};
		
		// Workaround for Google Chrome which needs a bit of a
		// delay in order to render the SVG contents
		if (mxClient.IS_GC)
		{
			wnd.setTimeout(print, 500);
		}
		else
		{
			print();
		}
	}
317492
def emit(
        self, tup, tup_id=None, stream=None, direct_task=None, need_task_ids=False
    ):
        
        if tup_id is None:
            raise ValueError(
                "You must provide a tuple ID when emitting with a "
                "ReliableSpout in order for the tuple to be "
                "tracked."
            )
        args = (tup, stream, direct_task, need_task_ids)
        self.unacked_tuples[tup_id] = args
        return super(ReliableSpout, self).emit(
            tup,
            tup_id=tup_id,
            stream=stream,
            direct_task=direct_task,
            need_task_ids=need_task_ids,
        )
1349929
private void emit() throws TTIOException {
        // Emit pending end elements.
        if (mCloseElements) {
            if (!mStack.empty() && mStack.peek() != ((ITreeStructData)mRtx.getNode()).getLeftSiblingKey()) {
                mRtx.moveTo(mStack.pop());
                emitEndTag();
                mRtx.moveTo(mKey);
            } else if (!mStack.empty()) {
                mRtx.moveTo(mStack.pop());
                emitEndTag();
                mRtx.moveTo(mKey);
                mCloseElements = false;
                mCloseElementsEmitted = true;
            }
        } else {
            mCloseElementsEmitted = false;

            // Emit node.
            emitNode();

            final long nodeKey = mRtx.getNode().getDataKey();
            mLastKey = nodeKey;

            // Push end element to stack if we are a start element.
            if (mRtx.getNode().getKind() == ELEMENT) {
                mStack.push(nodeKey);
            }

            // Remember to emit all pending end elements from stack if
            // required.
            if (!((ITreeStructData)mRtx.getNode()).hasFirstChild()
                && !((ITreeStructData)mRtx.getNode()).hasRightSibling()) {
                mGoUp = true;
                moveToNextNode();
            } else if (mRtx.getNode().getKind() == ELEMENT && !((ElementNode)mRtx.getNode()).hasFirstChild()) {
                // Case: Empty elements with right siblings.
                mGoBack = true;
                moveToNextNode();
            }
        }
    }
1355679
def add_edge (u, v)
      add_vertex(u)                         # ensure key
      add_vertex(v)                         # ensure key
      basic_add_edge(u, v)
    end
594859
final long internalEdgeDisconnect(int edgeToRemove, long edgeToUpdatePointer, int baseNode) {
        long edgeToRemovePointer = toPointer(edgeToRemove);
        // an edge is shared across the two nodes even if the edge is not in both directions
        // so we need to know two edge-pointers pointing to the edge before edgeToRemovePointer
        int nextEdgeId = getNodeA(edgeToRemovePointer) == baseNode ? getLinkA(edgeToRemovePointer) : getLinkB(edgeToRemovePointer);
        if (edgeToUpdatePointer < 0) {
            setEdgeRef(baseNode, nextEdgeId);
        } else {
            // adjNode is different for the edge we want to update with the new link
            long link = getNodeA(edgeToUpdatePointer) == baseNode ? edgeToUpdatePointer + E_LINKA : edgeToUpdatePointer + E_LINKB;
            edges.setInt(link, nextEdgeId);
        }
        return edgeToRemovePointer;
    }
1018108
def has_vertex_color(self):
        """"""
        for v in (self._vertex_colors, self._vertex_colors_indexed_by_faces,
                  self._vertex_colors_indexed_by_edges):
            if v is not None:
                return True
        return False
135876
def delete_edge_by_id(self, edge_id):
        """"""
        edge = self.get_edge(edge_id)

        # Remove the edge from the "from node"
        # --Determine the from node
        from_node_id = edge['vertices'][0]
        from_node = self.get_node(from_node_id)

        # --Remove the edge from it
        from_node['edges'].remove(edge_id)

        # Remove the edge from the "to node"
        to_node_id = edge['vertices'][1]
        to_node = self.get_node(to_node_id)

        # --Remove the edge from it
        to_node['edges'].remove(edge_id)

        # Remove the edge from the edge list
        del self.edges[edge_id]

        self._num_edges -= 1
362804
function(id, socket) {
  EventEmitter.call(this);
  this.id = id;
  this.socket = socket;

  if(!socket._socket) {
    this.remoteAddress = {
      ip: socket.address().address,
      port: socket.address().port
    };
  } else {
    this.remoteAddress = {
      ip: socket._socket.remoteAddress,
      port: socket._socket.remotePort
    };
  }

  var self = this;

  socket.once('close', this.emit.bind(this, 'disconnect'));
  socket.on('error', this.emit.bind(this, 'error'));

  socket.on('message', function(msg) {
    if(msg) {
      msg = Package.decode(msg);
      handler(self, msg);
    }
  });

  this.state = ST_INITED;

  // TODO: any other events?
}