<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
Step1:  YAML component connections
We can define the netlist connections of a component by a netlist in YAML format
Note that you define the connections as instance_source.port -&gt;
instance_destination.port so the order is important and therefore you can only
change the position of the instance_destination
For example, this coupler has the center coupling region at (100, 0)
Step5:  While this one has the sbend_left_coupler sl centered at (100, 0)
Step7:  You can rotate and instance specifying the angle in degrees
Step9:  You can also define ports for the component
Step11:  Routes problem
As we saw in routing_bundles notebooks, for routing bundles of ports we need to use a bundle router
Step13:  Routes Solution
You can define several bundle_routes routed with a bundle router
<ASSISTANT_TASK:>
Python Code:
import pp
gap = 0.2
wg_width = 0.5
length = 10
yaml = f
instances:
    sl:
      component: coupler_symmetric
      settings:
        gap: {gap}
        wg_width: {wg_width}
    sr:
      component: coupler_symmetric
      settings:
        gap: {gap}
        wg_width: {wg_width}
    cs:
      component: coupler_straight
      settings:
        gap: {gap}
        width: {wg_width}
        length: {length}
placements:
    cs:
        x: 100
        y: 0
connections:
    sl,W0: cs,W0
    sr,W0: cs,E0
ports:
    w0: sl,E0
    w1: sl,E1
    e0: sr,E0
    e1: sr,E1
c = pp.component_from_yaml(yaml)
pp.show(c)
pp.plotgds(c)
Explanation: YAML component connections
We can define the netlist connections of a component by a netlist in YAML format
Note that you define the connections as instance_source.port -&gt;
instance_destination.port so the order is important and therefore you can only
change the position of the instance_destination
For example, this coupler has the center coupling region at (100, 0)
End of explanation
gap = 0.2
wg_width = 0.5
length = 10
yaml = f
instances:
    sl:
      component: coupler_symmetric
      settings:
        gap: {gap}
        wg_width: {wg_width}
    sr:
      component: coupler_symmetric
      settings:
        gap: {gap}
        wg_width: {wg_width}
    cs:
      component: coupler_straight
      settings:
        gap: {gap}
        width: {wg_width}
        length: {length}
placements:
    sl:
        x: 100
        y: 0
        rotation: 180
connections:
    cs,W0: sl,W0
    sr,W0: cs,E0
ports:
    w0: sl,E0
    w1: sl,E1
    e0: sr,E0
    e1: sr,E1
c = pp.component_from_yaml(yaml)
pp.show(c)
pp.plotgds(c)
import pp
yaml = 
instances:
    mmi_long:
      component: mmi1x2
      settings:
        width_mmi: 4.5
        length_mmi: 10
    mmi_short:
      component: mmi1x2
      settings:
        width_mmi: 4.5
        length_mmi: 5
placements:        
    mmi_long:
        x: 100
        y: 100
c = pp.component_from_yaml(yaml)
pp.show(c)
pp.plotgds(c)
import pp
yaml = 
instances:
    mmi_long:
      component: mmi1x2
      settings:
        width_mmi: 4.5
        length_mmi: 10
    mmi_short:
      component: mmi1x2
      settings:
        width_mmi: 4.5
        length_mmi: 5
placements:
    mmi_long:
        x: 100
        y: 100
routes:
    mmi_short,E1: mmi_long,W0
c = pp.component_from_yaml(yaml)
pp.show(c)
pp.plotgds(c)
Explanation: While this one has the sbend_left_coupler sl centered at (100, 0)
End of explanation
import pp
yaml = 
instances:
    mmi_long:
      component: mmi1x2
      settings:
        width_mmi: 4.5
        length_mmi: 10
    mmi_short:
      component: mmi1x2
      settings:
        width_mmi: 4.5
        length_mmi: 5
        
placements:
    mmi_long:
        rotation: 180
        x: 100
        y: 100
routes:
    mmi_short,E1: mmi_long,E0
c = pp.component_from_yaml(yaml)
pp.show(c)
pp.plotgds(c)
Explanation: You can rotate and instance specifying the angle in degrees
End of explanation
import pp
yaml = 
instances:
    mmi_long:
      component: mmi1x2
      settings:
        width_mmi: 4.5
        length_mmi: 10
    mmi_short:
      component: mmi1x2
      settings:
        width_mmi: 4.5
        length_mmi: 5
        
placements:
    mmi_long:
        rotation: 180
        x: 100
        y: 100
        
routes:
    mmi_short,E1: mmi_long,E0
    
ports:
    E0: mmi_short,W0
    W0: mmi_long,W0
c = pp.component_from_yaml(yaml)
pp.show(c)
pp.plotgds(c)
r = c.routes['mmi_short,E1:mmi_long,E0']
r
r.parent.length
c.instances
c.routes
Explanation: You can also define ports for the component
End of explanation
sample_2x2_connections_problem = 
name:
    connections_2x2_problem
instances:
    mmi_bottom:
      component: mmi2x2
    mmi_top:
      component: mmi2x2
placements:
    mmi_top:
        x: 100
        y: 100
routes:
    mmi_bottom,E0: mmi_top,W0
    mmi_bottom,E1: mmi_top,W1
def test_connections_2x2_problem():
    c = pp.component_from_yaml(sample_2x2_connections_problem)
    return c
c = test_connections_2x2_problem()
pp.qp(c)
pp.show(c)
Explanation: Routes problem
As we saw in routing_bundles notebooks, for routing bundles of ports we need to use a bundle router
End of explanation
import pp
sample_2x2_connections_solution = 
name:
    connections_2x2_problem
instances:
    mmi_bottom:
      component: mmi2x2
    mmi_top:
      component: mmi2x2
placements:
    mmi_top:
        x: 100
        y: 100
bundle_routes:
    mmis:
        mmi_bottom,E0: mmi_top,W0
        mmi_bottom,E1: mmi_top,W1
def test_connections_2x2_solution():
    c = pp.component_from_yaml(sample_2x2_connections_solution)
    return c
c = test_connections_2x2_solution()
pp.qp(c)
pp.show(c)
Explanation: Routes Solution
You can define several bundle_routes routed with a bundle router
End of explanation
<END_TASK>