def METHOD_NAME(expr: Expression,
                       real_part: Optional[Expression],
                       imag_part: Optional[Expression]):
    if imag_part is None:
        # A weird code path to hit.
        matrix = real_part
    else:
        matrix = expand_complex(real_part, imag_part)
    return expr.copy([matrix])