def METHOD_NAME(port: Port, length: float, layer: Layer | None = None) -> Component:
    """Returns a straight extension component out of a port.
    Args:
        port: port to extend.
        length: extension length in um.
        layer: for the straight section.
    """
    c = Component()
    layer = layer or port.layer
    # Generate a port extension
    p_start = port.center
    angle = port.orientation
    p_end = move_polar_rad_copy(p_start, angle * DEG2RAD, length)
    w = port.width
    _line = line(p_start, p_end, w)
    c.add_polygon(_line, layer=layer)
    c.add_port(name="original", port=port)
    port_settings = port.to_dict()
    port_settings.update(center=p_end)
    c.add_port(**port_settings)
    return c