code: def draw_pegasus_yield(G, **kwargs):
      
      try:
          assert(G.graph["family"] == "pegasus")
          m = G.graph['columns']
          offset_lists = (G.graph['vertical_offsets'], G.graph['horizontal_offsets'])
          coordinates = G.graph["labels"] == "coordinate"
          # Can't interpret fabric_only from graph attributes
      except:
          raise ValueError("Target pegasus graph needs to have columns, rows, \
          tile, and label attributes to be able to identify faulty qubits.")
  
  
      perfect_graph = pegasus_graph(m, offset_lists=offset_lists, coordinates=coordinates)
  
      draw_yield(G, pegasus_layout(perfect_graph), perfect_graph, **kwargs)
docs: Draws the given graph G with highlighted faults, according to layout.
  
      Parameters
      ----------
      G : NetworkX graph
          The graph to be parsed for faults
  
      unused_color : tuple or color string (optional, default (0.9,0.9,0.9,1.0))
          The color to use for nodes and edges of G which are not faults.
          If unused_color is None, these nodes and edges will not be shown at all.
  
      fault_color : tuple or color string (optional, default (1.0,0.0,0.0,1.0))
          A color to represent nodes absent from the graph G. Colors should be
          length-4 tuples of floats between 0 and 1 inclusive.
  
      fault_shape : string, optional (default='x')
          The shape of the fault nodes. Specification is as matplotlib.scatter
          marker, one of 'so^>v<dph8'.
  
      fault_style : string, optional (default='dashed')
          Edge fault line style (solid|dashed|dotted,dashdot)
  
      kwargs : optional keywords
         See networkx.draw_networkx() for a description of optional keywords,
         with the exception of the `pos` parameter which is not used by this
         function. If `linear_biases` or `quadratic_biases` are provided,
         any provided `node_color` or `edge_color` arguments are ignored.