the result of the below code gives graph properly with the requirement of my objective. but id does not included the lable which i described in the code into the resultant graph over my edges. please update the code with the labled edges without modify the complete structure and procedures imlemented in the below code.

Code:
# Define edge colors based on terminal types
edge_colors = {'D': 'blue', 'G': 'red', 'S': 'green', 'B': 'grey'}

def add_vertex_components_features(G, components):
    for component_type, component_list in components.items():
        for component in component_list:
            name = component['device_name']
            nets = component['nets']
                # Add edges between transistor nodes and net nodes
                for i, terminal in enumerate(['D', 'G', 'S', 'B']):
                    G.add_edge(name, nets[i], label='{' + terminal + '}', color=edge_colors[terminal])
                
            elif component_type == 'resistors':
                # Add edges between device nodes and net nodes
                for net in nets:
                    G.add_edge(name, net, label='{P_R}', color='yellow')                    

            elif component_type == 'inductors':
                # Add edges between device nodes and net nodes
                for net in nets:
                    G.add_edge(name, net, label='{P_L}', color='yellow') 

            elif component_type == 'capacitors':
                # Add edges between device nodes and net nodes
                for net in nets:
                    G.add_edge(name, net, label='{P_C}', color='yellow')
                
            elif component_type in ['current_sources', 'voltage_sources']:           
                # Add edges between device nodes and net nodes
                for net in nets:
                    G.add_edge(name, net, label='{' + source + '}', color='black')
                    
# Adjusted the draw_parallel_edges function to include edge labels
def draw_parallel_edges(G, pos, unique_edges):
    def parallel_edges(G, pos, u, v, key, rad=0.1):
        # Simplified curve with a single offset point
        offset = rad * (key - G.number_of_edges(u, v) / 2.0)
        middle = [(pos[u][0] + pos[v][0]) / 2, (pos[u][1] + pos[v][1]) / 2 + offset]
        return [(pos[u], middle), (middle, pos[v])]

    for u, v, data in unique_edges:
        keys = G[u][v].keys() # get all keys for edges between u and v
        for key in keys:
            edge_color = G[u][v][key]['color']
            edge_label = G[u][v][key]['label']
            # Draw each edge with parallel offset
            for start, end in parallel_edges(G, pos, u, v, key):
                plt.plot([start[0], end[0]], [start[1], end[1]], color=edge_color, lw=2)

# Create an empty graph
G = nx.MultiGraph()

# Parse the netlist
components = Phrase_Netlist_withincode.parse_netlist(netlist_content)

# Call the function to add vertex features
add_vertex_components_features(G, components)
add_vertex_nets_features(G, components)

# Draw the multigraph with Ve(Components) on the below and Vn(nets) on the top
device_nodes = [node for node, data in G.nodes(data=True) if 'device_type' in data and data['device_type'] in ['transistor', 'passive', 'current_source', 'voltage_source']]
net_nodes = [node for node, data in G.nodes(data=True) if 'device_type' in data and data['device_type'] == 'net']

# Get the positions for the bipartite layout
if device_nodes and net_nodes:
    pos = nx.bipartite_layout(G, device_nodes, align='vertical')
else:
    pos = nx.spring_layout(G)  # Fallback layout if no device or net nodes found

# Draw nodes with labels
nx.draw_networkx_nodes(G, pos, nodelist=device_nodes, node_size=1000, node_color='lightgrey')
nx.draw_networkx_nodes(G, pos, nodelist=net_nodes, node_shape='s', node_size=1000, node_color='lightgrey')

# Draw edges with labels
unique_edges = set(G.edges(keys=True))  # Use a set to obtain unique edges (ignoring keys)
draw_parallel_edges(G, pos, unique_edges)

# Draw labels
nx.draw_networkx_labels(G, pos)

# Show the plot
plt.axis('off')
plt.show()