I need to modify the edge features completely in the following code based on the below given requirements,
# 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']
            print("name", name)            
            num_component = int(name[1:])  # Extract component number from name
            nets = component['nets']
            print("nets", nets)
            if component_type.startswith(('NMOS', 'PMOS')):
                # Designate all transistors under a general ‘transistor’ type but with specific attributes
                device_type = 'transistor'  # All transistors are considered as 'transistor'
                num_terminals = 4  # Number of terminals for transistors
                G.add_node(name, type=component_type, vertex_type=component_type[:4], device_type=device_type, nets=nets)
                # Add features based on transistor type (NMOS or PMOS)
                G.nodes[name]['D_terminal'] = nets[0]
                G.nodes[name]['G_terminal'] = nets[1]
                G.nodes[name]['S_terminal'] = nets[2]
                G.nodes[name]['B_terminal'] = nets[3]
                G.nodes[name]['w_value'] = component['width']
                G.nodes[name]['l_value'] = component['length']
                G.nodes[name]['size'] = 'high' if component['width'] / component['length'] > 380e-9 else \
                    'medium' if 380e-9 >= component['width'] / component['length'] > 35e-9 else 'low'

                # Add edges between transistor nodes and net nodes                
                for i, terminal in enumerate(['D', 'G', 'S', 'B']):
                    edge_type = f'{terminal}'
                    edge_features = {
                        'device_type': device_type,
                        'terminal_number': f'{terminal}{num_component}',
                        'edge_label': f'{terminal}{num_component}',
                        'connection_detail': f'{name} -> {nets[i]}',
                        'has_parallel_edges': False  # Initially set to False
                    }
                    G.add_edge(name, nets[i], edge_type=' + terminal + ', label='{' + terminal + '}', color=edge_colors[terminal], edge_features=edge_features)
                    
                    # Update the edge feature for existing parallel edges
                    if G.has_edge(name, nets[i]):
                        G.edges[name, nets[i], 0]['has_parallel_edges'] = True  # Set to True for multi-edge

I am having bipartite_layout multigraph, where one side of the nodes are the 'device components' (M0, M1, M2, M3, M4, M5, M6, M7, C0, C1, R0, L0, I0, V0, V1) present in the netlist and another side of the nodes are 'nets' (Vbias, VOUT, net1, net2, net3, IN1, IN2, vdd!, 0) present in the circuit netlist. I need to make edge features in the graph data. I need the edge features based on my below requirements.

Edge Features:
For vertex_type (NMOS, PMOS, R, L, C, I, V), i require the edge features as follows
If the vertex_type is NMOS/PMOS: it has 8 component (transistors) M0, M1, M2, M3, M4, M5, M6, M7. Each component has four terminals ['D', 'G', 'S', 'B'] respectively. Each terminals connected to respective 'nets' at the another side of the nodes. 
sample for name M0:  it connect to the nets ['net3', 'IN1', 'net1', '0'] respectively. we need to understand here that the four terminal of the transistor ['D', 'G', 'S', 'B'] are connecting with the corresponding nets respectively, the terminal 'D0' connected with nets 'net3', the terminal 'G0' connected with nets 'IN1', the terminal 'S0' connected with nets 'net1', and the terminal 'B0' connected with nets '0'.
in some cases i had the parallel edges connected between the same terminal and same nets,
sample for name M7: it connect to the nets ['Vbias', 'Vbias', '0', '0'] respectively, here the terminals ['D7', 'G7', 'S7', 'B7'] were connect with corresponding nets like, the terminal 'D7' connected with nets 'Vbias', the terminal 'G7' connected with nets 'Vbias', the terminal 'S7' connected with nets '0', and the terminal 'B7' connected with nets '0'. In this case we have parallel edges, we need to find which of the edges are having parallel edges (true/false) if the parallel edges are present then 'T' true, else 'F' false. and each edges are in respective colors, edge_colors = {'D': 'blue', 'G': 'red', 'S': 'green', 'B': 'grey'}

I need my edge features in the following format with attributes name [device type, device, number of terminals, terminal ('D', 'G', 'S', 'B')]
device type: vertex_type (NMOS, PMOS, R, L, C, I, V)
device: component 'name' (M0, M1, M2, M3, M4, M5, M6, M7, C0, C1, R0, L0, I0, V0, V1)
number of terminals: based on the number of nets "nets = component['nets']"
terminal ('D', 'G', 'S', 'B'): (edges pair, edge_colors, T/F)

sample terminal for device M0 connected with nets ['net3', 'IN1', 'net1', '0'] then, D0: (M0, net3, blue, F), G0: (M0, IN1, red, F), S0: (M0, net1, green, F), B0: (M0, 0, grey, F),

sample terminal for device M7 connected with nets ['Vbias', 'Vbias', '0', '0'] then, D7: (M7, Vbias, blue, T), G7: (M7, Vbias, red, T), S7: (M7, 0, green, T), B7: (M7, 0, grey, T); here for terminal D7 we have edge pair 'M7, Vbias', and for terminal G7 we have edge pair 'M7, Vbias' so the parallel edge were 'T' for both terminals similarly for the terminals S7 and B7 has parallel terminals so it has 'T'.

For all the nets (Vbias, VOUT, net1, net2, net3, IN1, IN2, vdd!, 0), the edge features is,
nets: device type: nets, Device: Nill, Number of terminals: Nill, terminal: Nill.