Display the topology
320241
def show_graph(cn_topo, showintfs=False, showaddrs=False):
    '''
     
    '''
    __do_draw(cn_topo, showintfs=showintfs, showaddrs=showaddrs)
    pyp.show()
1241177
function DisplayObject()
{
    EventEmitter.call(this);

    /**
     * The coordinate of the object relative to the local coordinates of the parent.
     *
     * @member {Point}
     */
    this.position = new math.Point();

    /**
     * The scale factor of the object.
     *
     * @member {Point}
     */
    this.scale = new math.Point(1, 1);

    /**
     * The pivot point of the displayObject that it rotates around
     *
     * @member {Point}
     */
    this.pivot = new math.Point(0, 0);

    /**
     * The rotation of the object in radians.
     *
     * @member {number}
     */
    this.rotation = 0;

    /**
     * The opacity of the object.
     *
     * @member {number}
     */
    this.alpha = 1;

    /**
     * The visibility of the object. If false the object will not be drawn, and
     * the updateTransform function will not be called.
     *
     * @member {boolean}
     */
    this.visible = true;

    /**
     * Can this object be rendered, if false the object will not be drawn but the updateTransform
     * methods will still be called.
     *
     * @member {boolean}
     */
    this.renderable = true;

    /**
     * The display object container that contains this display object.
     *
     * @member {Container}
     * @readOnly
     */
    this.parent = null;

    /**
     * The multiplied alpha of the displayObject
     *
     * @member {number}
     * @readOnly
     */
    this.worldAlpha = 1;

    /**
     * Current transform of the object based on world (parent) factors
     *
     * @member {Matrix}
     * @readOnly
     */
    this.worldTransform = new math.Matrix();

    /**
     * The area the filter is applied to. This is used as more of an optimisation
     * rather than figuring out the dimensions of the displayObject each frame you can set this rectangle
     *
     * @member {Rectangle}
     */
    this.filterArea = null;

    /**
     * cached sin rotation
     *
     * @member {number}
     * @private
     */
    this._sr = 0;

    /**
     * cached cos rotation
     *
     * @member {number}
     * @private
     */
    this._cr = 1;

    /**
     * The original, cached bounds of the object
     *
     * @member {Rectangle}
     * @private
     */
    this._bounds = new math.Rectangle(0, 0, 1, 1);

    /**
     * The most up-to-date bounds of the object
     *
     * @member {Rectangle}
     * @private
     */
    this._currentBounds = null;

    /**
     * The original, cached mask of the object
     *
     * @member {Rectangle}
     * @private
     */
    this._mask = null;

    //TODO rename to _isMask
   // this.isMask = false;

    /**
     * Cached internal flag.
     *
     * @member {boolean}
     * @private
     */
    this._cacheAsBitmap = false;
    this._cachedObject = null;
}
1315543
def display(self):
        """"""
        country = self.country if self.state else self.country_full
        state = self.state if self.city else self.state_full
        vals = (self.street, self.city, state, country)
        disp = u', '.join(filter(None, vals))
        if self.street and (self.house or self.apartment):
            prefix = u'-'.join([val for val in (self.house, self.apartment) 
                                if val])
            disp = prefix + u' ' + (disp or u'')
        if self.po_box and not self.street:
            disp = u' '.join([u'P.O. Box', self.po_box, (disp or u'')])
        return disp
1061085
def line_ribbon(self):
        '''

        '''
        # Control points are the CA (C alphas)
        backbone = np.array(self.topology['atom_names']) == 'CA'
        smoothline = self.add_representation('smoothline', {'coordinates': self.coordinates[backbone],
                                                            'color': 0xffffff})

        def update(self=self, smoothline=smoothline):
            self.update_representation(smoothline, {'coordinates': self.coordinates[backbone]})
        self.update_callbacks.append(update)

        self.autozoom(self.coordinates)
807775
def display_weyl(decomps):
    """"""
    tx, ty, tz = list(zip(*decomps))

    rcParams['axes.labelsize'] = 24
    rcParams['font.family'] = 'serif'
    rcParams['font.serif'] = ['Computer Modern Roman']
    rcParams['text.usetex'] = True
    fig = pyplot.figure()
    ax = Axes3D(fig)
    ax.scatter(tx, ty, tz)
    ax.plot((1,), (1,), (1,))
    ax.plot((0, 1, 1/2, 0, 1/2, 1, 1/2, 1/2),
            (0, 0, 1/2, 0, 1/2, 0, 1/2, 1/2),
            (0, 0, 0, 0, 1/2, 0, 0, 1/2))
    ax.plot((0, 1/2, 1, 1/2, 1/2),
            (0, 1/4, 0, 1/4, 1/2),
            (0, 1/4, 0, 1/4, 0))

    points = [(0, 0, 0), (1/4, 0, 0), (1/2, 0, 0), (3/4, 0, 0), (1, 0, 0),
              (1/4, 1/4, 0), (1/2, 1/4, 0), (3/4, 1/4, 0), (1/2, 1/2, 0),
              (1/4, 1/4, 1/4), (1/2, 1/4, 1/4), (3/4, 1/4, 1/4),
              (1/2, 1/2, 1/4), (1/2, 1/2, 1/2)]

    ax.scatter(*zip(*points))
    eps = 0.04
    ax.text(0, 0, 0-2*eps, 'I', ha='center')
    ax.text(1, 0, 0-2*eps, 'I', ha='center')
    ax.text(1/2, 1/2, 0-2*eps, 'iSWAP', ha='center')
    ax.text(1/2, 1/2, 1/2+eps, 'SWAP', ha='center')
    ax.text(1/2, 0, 0-2*eps, 'CNOT', ha='center')

    # More coordinate labels
    # ax.text(1/4-eps, 1/4, 1/4, '$\sqrt{SWAP}$', ha='right')
    # ax.text(3/4+eps, 1/4, 1/4, '$\sqrt{SWAP}^\dagger$', ha='left')
    # ax.text(1/4, 0, 0-2*eps, '$\sqrt{{CNOT}}$', ha='center')
    # ax.text(3/4, 0, 0-2*eps, '$\sqrt{{CNOT}}$', ha='center')
    # ax.text(1/2, 1/4, 0-2*eps, 'B', ha='center')
    # ax.text(1/2, 1/4, 1/4+eps, 'ECP', ha='center')
    # ax.text(1/4, 1/4, 0-2*eps, '$\sqrt{iSWAP}$', ha='center')
    # ax.text(3/4, 1/4, 0-2*eps, '$\sqrt{iSWAP}$', ha='center')
    # ax.text(1/2, 1/2+eps, 1/4, 'PSWAP(1/2)', ha='left')

    ax.set_xlim(0, 1)
    ax.set_ylim(-1/4, 3/4)
    ax.set_zlim(-1/4, 3/4)

    # Get rid of the panes
    ax.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
    ax.w_yaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))
    ax.w_zaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))

    # Get rid of the spines
    ax.w_xaxis.line.set_color((1.0, 1.0, 1.0, 0.0))
    ax.w_yaxis.line.set_color((1.0, 1.0, 1.0, 0.0))
    ax.w_zaxis.line.set_color((1.0, 1.0, 1.0, 0.0))

    # Get rid of the ticks
    ax.set_xticks([])
    ax.set_yticks([])
    ax.set_zticks([])

    pyplot.show()
840342
def output_component(graph, edge_stack, u, v):
    """"""
    edge_list = []
    while len(edge_stack) > 0:
        edge_id = edge_stack.popleft()
        edge_list.append(edge_id)

        edge = graph.get_edge(edge_id)
        tpl_a = (u, v)
        tpl_b = (v, u)
        if tpl_a == edge['vertices'] or tpl_b == edge['vertices']:
            break

    return edge_list
61774
def _draw(self):
        """"""
        self._compute()
        self._compute_x_labels()
        self._compute_x_labels_major()
        self._compute_y_labels()
        self._compute_y_labels_major()
        self._compute_secondary()
        self._post_compute()
        self._compute_margin()
        self._decorate()
        if self.series and self._has_data() and self._values:
            self._plot()
        else:
            self.svg.draw_no_data()
411972
def show_graphs(self):
        """"""
        elements = itertools.chain.from_iterable(
            ([graph]
             for graph in self.visible_graphs.values()))
        self.graph_place_holder.original_widget = urwid.Pile(elements)
374928
public static int nvgraphSetGraphStructure(
        nvgraphHandle handle, 
        nvgraphGraphDescr descrG, 
        Object topologyData, 
        int TType)
    {
        return checkResult(nvgraphSetGraphStructureNative(handle, descrG, topologyData, TType));
    }
146891
def show(self):
        
        self.data()
        print("")
        self.msg.template(78)
        print("| {0}{1}{2}".format("Dependencies", " " * 20, "Packages"))
        self.msg.template(78)
        for key, value in self.dmap.iteritems():
            print("  {0}{1}{2}{3}{4}".format(
                self.green, key, self.endc, " " * (32-len(key)),
                ", ".join(value)))
        self.summary()
        if self.image:
            Graph(self.image).dependencies(self.dmap)
860856
def _display(node, indent, expandattrs, expandvals, output):
    """"""
    attrs = _displayattrs(node.attrib, expandattrs)
    if node.text is None or not expandvals:
        val = ''
    elif isinstance(node.text, str):
        val = ' %s' % repr(node.text.strip())
    else:
        val = ' %s' % repr(node.text)  # node.text can be a tuple
    output.write(encode(indent + striptag(node.tag) + attrs + val + '\n'))
    for sub_node in node:
        _display(sub_node, indent + '  ', expandattrs, expandvals, output)
569327
def show(self):
        
        import matplotlib.pyplot as plt
        nx.draw(self.transforms, with_labels=True)
        plt.show()
1262814
def generate_nodes(self, topology):
        
        nodes = []

        devices = topology['devices']
        hypervisors = topology['conf']

        for device in sorted(devices):
            hv_id = devices[device]['hv_id']
            try:
                tmp_node = Node(hypervisors[hv_id], self.port_id)
            except IndexError:
                tmp_node = Node({}, self.port_id)
            # Start building the structure
            tmp_node.node['properties']['name'] = device
            tmp_node.node['id'] = devices[device]['node_id']
            tmp_node.node['x'] = devices[device]['x']
            tmp_node.node['y'] = devices[device]['y']
            tmp_node.device_info['from'] = devices[device]['from']
            tmp_node.device_info['type'] = devices[device]['type']
            tmp_node.device_info['desc'] = devices[device]['desc']

            if 'ext_conf' in devices[device]:
                tmp_node.device_info['ext_conf'] = devices[device]['ext_conf']

            # Node Label
            tmp_node.node['label']['text'] = device
            if 'hx' in devices[device] and 'hy' in devices[device]:
                tmp_node.node['label']['x'] = devices[device]['hx']
                tmp_node.node['label']['y'] = devices[device]['hy']

            if 'model' in devices[device]:
                tmp_node.device_info['model'] = devices[device]['model']
            else:
                tmp_node.device_info['model'] = ''

            tmp_node.set_description()
            tmp_node.set_type()

            # Now lets process the rest
            for item in sorted(devices[device]):
                tmp_node.add_device_items(item, devices[device])

            if tmp_node.device_info['type'] == 'Router':
                tmp_node.add_info_from_hv()
                tmp_node.node['router_id'] = devices[device]['node_id']
                tmp_node.calc_mb_ports()

                for item in sorted(tmp_node.node['properties']):
                    if item.startswith('slot'):
                        tmp_node.add_slot_ports(item)
                    elif item.startswith('wic'):
                        tmp_node.add_wic_ports(item)

                # Add default ports to 7200 and 3660
                if tmp_node.device_info['model'] == 'c7200':
                    # tmp_node.add_slot_ports('slot0')
                    # C7200 doesnt have any ports by default
                    pass
                elif tmp_node.device_info['model'] == 'c3600' \
                        and tmp_node.device_info['chassis'] == '3660':
                    tmp_node.node['properties']['slot0'] = 'Leopard-2FE'

                # Calculate the router links
                tmp_node.calc_device_links()

            elif tmp_node.device_info['type'] == 'Cloud':
                try:
                    tmp_node.calc_cloud_connection()
                except RuntimeError as err:
                    print(err)

            elif tmp_node.device_info['type'] == 'FrameRelaySwitch':
                tmp_node.process_mappings()

            elif tmp_node.device_info['type'] == 'VirtualBoxVM':
                tmp_node.add_to_virtualbox()
                tmp_node.add_vm_ethernet_ports()
                tmp_node.calc_device_links()

            elif tmp_node.device_info['type'] == 'QemuVM':
                tmp_node.add_to_qemu()
                tmp_node.set_qemu_symbol()
                tmp_node.add_vm_ethernet_ports()
                tmp_node.calc_device_links()

            # Get the data we need back from the node instance
            self.links.extend(tmp_node.links)
            self.configs.extend(tmp_node.config)
            self.port_id += tmp_node.get_nb_added_ports(self.port_id)

            nodes.append(tmp_node.node)

        return nodes
802388
def show(self, resolve_mac=True, print_result=True):
        """"""
        res = []
        for iface_name in sorted(self.data):
            dev = self.data[iface_name]
            mac = dev.mac
            if resolve_mac and conf.manufdb:
                mac = conf.manufdb._resolve_MAC(mac)
            validity_color = lambda x: conf.color_theme.red if x else \
                conf.color_theme.green
            description = validity_color(dev.is_invalid())(
                str(dev.description)
            )
            index = str(dev.win_index)
            res.append((index, description, str(dev.ip), mac))

        res = pretty_list(res, [("INDEX", "IFACE", "IP", "MAC")], sortBy=2)
        if print_result:
            print(res)
        else:
            return res
601479
def display_upstream_structure(structure_dict):
    
    graph = _create_graph(structure_dict)
    plt = Image(graph.create_png())
    display(plt)
1080204
def display_map(fname):
    
    print("viewing ", fname)
    
    app = view_tk(None)
    app.show_grid_from_file(fname)
    app.title('Map View')
    #app.after(2000,vais_main_loop(app))
    
        # bind mouse and keyboard for interactivity
  #  frame = Frame(app, width=100, height=100)
   # frame.bind("<Button-1>", callback)
    app.canvas.bind("<Button-1>", callback)
    app.bind("<Key>", key)

    
    app.mainloop()
988861
def show(self):
        """"""

        if len(self.text) > self.textwidth:
            label = self.text[0:self.textwidth]
        else:
            label = self.text.rjust(self.textwidth)

        terminalSize = getTerminalSize()
        if terminalSize is None:
            terminalSize = 80
        else:
            terminalSize = terminalSize[1]

        barWidth = terminalSize - self.textwidth - 10

        if self.value is None or self.value < 0:
            pattern = self.twiddle_sequence[
                self.twiddle % len(self.twiddle_sequence)]
            self.twiddle += 1
            barSymbols = (pattern * int(math.ceil(barWidth/3.0)))[0:barWidth]
            progressFractionText = '   . %'
        else:
            progressFraction = float(self.value) / self.max

            nBlocksFrac, nBlocksInt = math.modf(
                max(0.0, min(1.0, progressFraction)) * barWidth)
            nBlocksInt = int(nBlocksInt)

            partialBlock = self.sequence[
                int(math.floor(nBlocksFrac * len(self.sequence)))]

            nBlanks = barWidth - nBlocksInt - 1
            barSymbols = (self.sequence[-1] * nBlocksInt) + partialBlock + \
                (self.sequence[0] * nBlanks)
            barSymbols = barSymbols[:barWidth]
            progressFractionText = ('%.1f%%' % (100*progressFraction)).rjust(6)

        print >>self.fid, '\r\x1B[1m' + label + '\x1B[0m [' + barSymbols + \
            ']' + progressFractionText,
        self.fid.flush()
        self.linefed = False