def METHOD_NAME(
    component: ComponentSpec = mmi2x2,
    cols: int = 4,
    rows: int = 5,
    port1: str = "o1",
    port2: str = "o2",
    port3: str = "o3",
    port4: str = "o4",
    bend180: ComponentSpec = bend_circular180,
    mirror: bool = False,
    straight_length: float | None = None,
    cross_section: CrossSectionSpec = "strip",
    **kwargs,
) -> Component:
    """Returns a daisy chain of splitters for measuring their loss.
    Args:
        component: for cutback.
        cols: number of columns.
        rows: number of rows.
        port1: name of first optical port.
        port2: name of second optical port.
        bend180: ubend.
        straight: waveguide spec to connect both sides.
        mirror: Flips component. Useful when 'o2' is the port that you want to route to.
        straight_length: length of the straight section between cutbacks.
        cross_section: specification (CrossSection, string or dict).
        kwargs: cross_section settings.
    """
    component = gf.get_component(component)
    bendu = bendu_double(
        component=component,
        cross_section=cross_section,
        bend180=bend180,
        port1=port1,
        port2=port2,
        **kwargs,
    )
    straight = straight_double(
        component=component,
        cross_section=cross_section,
        straight_length=straight_length,
        port1=port1,
        port2=port2,
        **kwargs,
    )
    # Define a map between symbols and (component, input port, output port)
    symbol_to_component = {
        "A": (component, port1, port3),
        "B": (component, port4, port2),
        "D": (bendu, "o2", "o3"),
        "C": (bendu, "o4", "o1"),
        "-": (straight, "o1", "o3"),
        "_": (straight, "o2", "o4"),
    }
    # Generate the sequence of staircases
    s = ""
    for i in range(rows):
        s += "AB" * cols
        if mirror:
            s += "C" if i % 2 == 0 else "D"
        else:
            s += "D" if i % 2 == 0 else "C"
    s = s[:-1]
    s += "-_"
    for i in range(rows):
        s += "AB" * cols
        s += "D" if (i + rows) % 2 == 0 else "C"
    s = s[:-1]
    n = cols * rows * 2
    seq = component_sequence(sequence=s, symbol_to_component=symbol_to_component)
    c = gf.Component()
    _ = c << seq
    c.add_port("o1", port=seq.named_references["A1"]["o1"])
    c.add_port("o2", port=seq.named_references["A1"]["o2"])
    c.add_port("o3", port=seq.named_references[f"B{n}"]["o2"])
    c.add_port("o4", port=seq.named_references[f"B{n}"]["o1"])
    c.copy_child_info(component)
    c.info["components"] = 2 * n
    return c