Returns a string representation of the edge in dot language.
770865
def to_string(self):
        

        src = self.parse_node_ref( self.get_source() )
        dst = self.parse_node_ref( self.get_destination() )
        
        if isinstance(src, frozendict):
            edge = [ Subgraph(obj_dict=src).to_string() ]
        elif isinstance(src, (int, long)):
            edge = [ str(src) ]
        else:
            edge = [ src ]
        
        if	(self.get_parent_graph() and
            self.get_parent_graph().get_top_graph_type() and
            self.get_parent_graph().get_top_graph_type() == 'digraph' ):

            edge.append( '->' )
            
        else:
            edge.append( '--' )
            
        if isinstance(dst, frozendict):
            edge.append( Subgraph(obj_dict=dst).to_string() )
        elif isinstance(dst, (int, long)):
            edge.append( str(dst) )
        else:
            edge.append( dst )


        edge_attr = list()
        
        for attr, value in self.obj_dict['attributes'].iteritems():
        
            if value is not None:
                edge_attr.append( '%s=%s' % (attr, quote_if_necessary(value) ) )
            else:
                edge_attr.append( attr )

        edge_attr = ', '.join(edge_attr)
        
        if edge_attr:
            edge.append( ' [' + edge_attr + ']' )

        return ' '.join(edge) + ';'
1244722
def get_edge(self, edge_id):
        """"""
        try:
            edge_object = self.edges[edge_id]
        except KeyError:
            raise NonexistentEdgeError(edge_id)
        return edge_object
1096210
def geom(self):
        """"""
        adj_nodes = self._grid._graph.nodes_from_line(self)

        return LineString([adj_nodes[0].geom, adj_nodes[1].geom])
463838
def _get_edge_sign(im, edge):
    """"""
    edge_data = im[edge[0]][edge[1]]
    # Handle possible multiple edges between nodes
    signs = list(set([v['sign'] for v in edge_data.values()
                                  if v.get('sign')]))
    if len(signs) > 1:
        logger.warning("Edge %s has conflicting polarities; choosing "
                       "positive polarity by default" % str(edge))
        sign = 1
    else:
        sign = signs[0]
    if sign is None:
        raise Exception('No sign attribute for edge.')
    elif abs(sign) == 1:
        return sign
    else:
        raise Exception('Unexpected edge sign: %s' % edge.attr['sign'])
795821
public String getHighwayAsString(EdgeIteratorState edge) {
        int val = getHighway(edge);
        for (Entry<String, Integer> e : highwayMap.entrySet()) {
            if (e.getValue() == val)
                return e.getKey();
        }
        return null;
    }
981347
def get_edge_annotations(self, u, v, key: str) -> Optional[AnnotationsDict]:
        """"""
        return self._get_edge_attr(u, v, key, ANNOTATIONS)
1233316
def get_edge_mark(ttree):
    
    
    ## tree style
    if ttree._kwargs["tree_style"] in ["c", "cladogram"]:
        a=ttree.edges
        vcoordinates=ttree.verts
    else:
        a=ttree._lines               
        vcoordinates=ttree._coords    
   
    ## fixed args
    along='x'
    vmarker='o'
    vcolor=None
    vlshow=False            
    vsize=0.         
    estyle=ttree._kwargs["edge_style"]

    ## get axes
    layout = toyplot.layout.graph(a, vcoordinates=vcoordinates)
    along = toyplot.require.value_in(along, ["x", "y"])
    if along == "x":
        coordinate_axes = ["x", "y"]
    elif along == "y":
        coordinate_axes = ["y", "x"]
        
    ## broadcast args along axes
    vlabel = layout.vids
    vmarker = toyplot.broadcast.pyobject(vmarker, layout.vcount)
    vsize = toyplot.broadcast.scalar(vsize, layout.vcount)
    estyle = toyplot.style.require(estyle, allowed=toyplot.style.allowed.line)

    ## fixed args
    vcolor = toyplot.color.broadcast(colors=None, shape=layout.vcount, default=toyplot.color.black)
    vopacity = toyplot.broadcast.scalar(1.0, layout.vcount)
    vtitle = toyplot.broadcast.pyobject(None, layout.vcount)
    vstyle = None
    vlstyle = None
    
    ## this could be modified in the future to allow diff color edges
    ecolor = toyplot.color.broadcast(colors=None, shape=layout.ecount, default=toyplot.color.black)
    ewidth = toyplot.broadcast.scalar(1.0, layout.ecount)
    eopacity = toyplot.broadcast.scalar(1.0, layout.ecount)
    hmarker = toyplot.broadcast.pyobject(None, layout.ecount)
    mmarker = toyplot.broadcast.pyobject(None, layout.ecount)
    mposition = toyplot.broadcast.scalar(0.5, layout.ecount)
    tmarker = toyplot.broadcast.pyobject(None, layout.ecount)
    
    ## tables are required if I don't want to edit the class
    vtable = toyplot.data.Table()
    vtable["id"] = layout.vids
    for axis, coordinates in zip(coordinate_axes, layout.vcoordinates.T):
        vtable[axis] = coordinates
        #_mark_exportable(vtable, axis)
    vtable["label"] = vlabel
    vtable["marker"] = vmarker
    vtable["size"] = vsize
    vtable["color"] = vcolor
    vtable["opacity"] = vopacity
    vtable["title"] = vtitle

    etable = toyplot.data.Table()
    etable["source"] = layout.edges.T[0]
    #_mark_exportable(etable, "source")
    etable["target"] = layout.edges.T[1]
    #_mark_exportable(etable, "target")
    etable["shape"] = layout.eshapes
    etable["color"] = ecolor
    etable["width"] = ewidth
    etable["opacity"] = eopacity
    etable["hmarker"] = hmarker
    etable["mmarker"] = mmarker
    etable["mposition"] = mposition
    etable["tmarker"] = tmarker
    
    edge_mark = toyplot.mark.Graph(
        coordinate_axes=['x', 'y'],
        ecolor=["color"],
        ecoordinates=layout.ecoordinates,
        efilename=None,
        eopacity=["opacity"],
        eshape=["shape"],
        esource=["source"],
        estyle=estyle,
        etable=etable,
        etarget=["target"],
        ewidth=["width"],
        hmarker=["hmarker"],
        mmarker=["mmarker"],
        mposition=["mposition"],
        tmarker=["tmarker"],
        vcolor=["color"],
        vcoordinates=['x', 'y'],
        vfilename=None,
        vid=["id"],
        vlabel=["label"],
        vlshow=False,
        vlstyle=None,
        vmarker=["marker"],
        vopacity=["opacity"],
        vsize=["size"],
        vstyle=None,
        vtable=vtable,
        vtitle=["title"],
        )
    return edge_mark
219218
def dot2svg(dot):
    # type: (str) -> str
    
    svg = graphviz.Source(dot).pipe(format='svg').decode('utf8')  # type: str
    # strip doctype and xml declaration
    svg = svg[svg.index('<svg'):]
    return svg
728628
private String toStringIterative() {
		final String PADDING = "                                 ";
		final StringBuilder sb = new StringBuilder();
		int elements_debug_local_recounter = 0;
		Node<K, V> node = null;
		int nodeid = rootIdx;
		int depth = 0;
		stackSlots.clear();
		stackSlots.push(rootIdx); // init seed, root node
		boolean lastIsInternal = !Node.isLeaf(rootIdx);
		while (!stackSlots.isEmpty()) {
			nodeid = stackSlots.pop();
			node = getNode(nodeid);
			if (!node.isLeaf()) {
				for (int i = node.allocated; i >= 0; i--) {
					stackSlots.push(((InternalNode<K, V>) node).childs[i]);
				}
			} else {
				elements_debug_local_recounter += node.allocated;
			}
			// For Indentation
			if (lastIsInternal || !node.isLeaf()) { // Last or Curret are Internal
				depth += (lastIsInternal ? +1 : -1);
			}
			lastIsInternal = !node.isLeaf();
			sb.append(PADDING.substring(0, Math.min(PADDING.length(), Math.max(depth - 1, 0))));
			//
			sb.append(node.toString()).append("\n");
		}

		// Count elements
		sb.append("height=").append(getHeight()).append(" root=").append(rootIdx).append(" low=")
				.append(lowIdx).append(" high=").append(highIdx).append(" elements=").append(elements)
				.append(" recounter=").append(elements_debug_local_recounter);

		return sb.toString();
	}
1330777
function getBottomEdge(index, row) {
        return {
          index: index,
          y: editor.dom.getPos(row).y + row.offsetHeight
        };
      }
370499
function edgeStringify(edge) {
        var stream = new Tinkerpop.ByteArrayOutputStream();
        var builder = Tinkerpop.GraphSONWriter.build();
        var writer = builder.create();
        writer.writeEdge(stream, edge);
        return stream.toString(Tinkerpop.UTF8);
    }
865586
def get_dot(stop=True):
    
    defaults = []
    nodes    = []
    edges    = []


    # define default attributes
    for comp, comp_attr in graph_attributes.items():
        attr = ', '.join( '%s = "%s"' % (attr, val)
                         for attr, val in comp_attr.items() )
        defaults.append( '\t%(comp)s [ %(attr)s ];\n' % locals() )

    # define nodes
    for func, hits in func_count.items():
        calls_frac, total_time_frac, total_time = _frac_calculation(func, hits)
        col = settings['node_colour'](calls_frac, total_time_frac)
        attribs = ['%s="%s"' % a for a in settings['node_attributes'].items()]
        node_str = '"%s" [%s];' % (func, ', '.join(attribs))
        nodes.append( node_str % locals() )

    # define edges
    for fr_key, fr_val in call_dict.items():
        if not fr_key: continue
        for to_key, to_val in fr_val.items():
            calls_frac, total_time_frac, totla_time = \
                _frac_calculation(to_key, to_val)
            col = settings['edge_colour'](calls_frac, total_time_frac)
            edge = '[ color = "%s", label="%s" ]' % (col, to_val)
            edges.append('"%s"->"%s" %s;' % (fr_key, to_key, edge))

    defaults = '\n\t'.join( defaults )
    nodes    = '\n\t'.join( nodes )
    edges    = '\n\t'.join( edges )

    dot_fmt = ("digraph G {\n"
               "	%(defaults)s\n\n"
               "	%(nodes)s\n\n"
               "	%(edges)s\n}\n"
              )
    return dot_fmt % locals()
787529
def get_dotstr(self):
        """"""
        dotobj = self.gosubdagplot.get_pydot_graph() # pydot.Dot
        dotstr = dotobj.create_dot()
        return dotstr
996454
def _str_dash(self, depth, no_repeat, obj):
        """"""
        if self.indent:
            # '-' is default character indicating hierarchy level
            # '=' is used to indicate a hierarchical path printed in detail previously.
            single_or_double = not no_repeat or not obj.children
            letter = '-' if single_or_double else '='
            return ''.join([letter]*depth)
        return ""
1150334
public static @Type
    int stringToEdgeType(String s) {
        s = s.toUpperCase(Locale.ENGLISH);

        if ("FALL_THROUGH".equals(s)) {
            return FALL_THROUGH_EDGE;
        } else if ("IFCMP".equals(s)) {
            return IFCMP_EDGE;
        } else if ("SWITCH".equals(s)) {
            return SWITCH_EDGE;
        } else if ("SWITCH_DEFAULT".equals(s)) {
            return SWITCH_DEFAULT_EDGE;
        } else if ("JSR".equals(s)) {
            return JSR_EDGE;
        } else if ("RET".equals(s)) {
            return RET_EDGE;
        } else if ("GOTO".equals(s)) {
            return GOTO_EDGE;
        } else if ("RETURN".equals(s)) {
            return RETURN_EDGE;
        } else if ("UNHANDLED_EXCEPTION".equals(s)) {
            return UNHANDLED_EXCEPTION_EDGE;
        } else if ("HANDLED_EXCEPTION".equals(s)) {
            return HANDLED_EXCEPTION_EDGE;
        } else if ("START".equals(s)) {
            return START_EDGE;
        } else if ("BACKEDGE_TARGET_EDGE".equals(s)) {
            return BACKEDGE_TARGET_EDGE;
        } else if ("BACKEDGE_SOURCE_EDGE".equals(s)) {
            return BACKEDGE_SOURCE_EDGE;
        } else if ("EXIT_EDGE".equals(s)) {
            return EXIT_EDGE;
        } else {
            throw new IllegalArgumentException("Unknown edge type: " + s);
        }
    }
608350
public static String stringFor(int n)
    {
        switch (n)
        {
            case NVGRAPH_STATUS_SUCCESS: return "NVGRAPH_STATUS_SUCCESS";
            case NVGRAPH_STATUS_NOT_INITIALIZED: return "NVGRAPH_STATUS_NOT_INITIALIZED";
            case NVGRAPH_STATUS_ALLOC_FAILED: return "NVGRAPH_STATUS_ALLOC_FAILED";
            case NVGRAPH_STATUS_INVALID_VALUE: return "NVGRAPH_STATUS_INVALID_VALUE";
            case NVGRAPH_STATUS_ARCH_MISMATCH: return "NVGRAPH_STATUS_ARCH_MISMATCH";
            case NVGRAPH_STATUS_MAPPING_ERROR: return "NVGRAPH_STATUS_MAPPING_ERROR";
            case NVGRAPH_STATUS_EXECUTION_FAILED: return "NVGRAPH_STATUS_EXECUTION_FAILED";
            case NVGRAPH_STATUS_INTERNAL_ERROR: return "NVGRAPH_STATUS_INTERNAL_ERROR";
            case NVGRAPH_STATUS_TYPE_NOT_SUPPORTED: return "NVGRAPH_STATUS_TYPE_NOT_SUPPORTED";
            case NVGRAPH_STATUS_NOT_CONVERGED: return "NVGRAPH_STATUS_NOT_CONVERGED";
            case NVGRAPH_STATUS_GRAPH_TYPE_NOT_SUPPORTED: return "NVGRAPH_STATUS_GRAPH_TYPE_NOT_SUPPORTED";
            case JNVGRAPH_STATUS_INTERNAL_ERROR: return "JNVGRAPH_STATUS_INTERNAL_ERROR";
        }
        return "INVALID nvgraphStatus: "+n;
    }
375891
def find_substring_edge(self, substring, suffix_tree_id):
        
        suffix_tree = self.suffix_tree_repo[suffix_tree_id]
        started = datetime.datetime.now()
        edge, ln = find_substring_edge(substring=substring, suffix_tree=suffix_tree, edge_repo=self.edge_repo)
        # if edge is not None:
        #     print("Got edge for substring '{}': {}".format(substring, edge))
        # else:
        #     print("No edge for substring '{}'".format(substring))
        print(" - searched for edge in {} for substring: '{}'".format(datetime.datetime.now() - started, substring))
        return edge, ln