def METHOD_NAME(
    self,
    project: str,
    widget: str,
    color: str,
    extension: str,
    lang: str | None = None,
    component: str | None = None,
):
    path = [project]
    if component:
        path.append(component)
    if lang:
        if not component:
            path.append("-")
        path.append(lang)
    # Redirect no longer supported badge styles to svg
    if widget in ("status", "shields"):
        widget = "svg"
    return reverse(
        "widget-image",
        kwargs={
            "color": color,
            "extension": extension,
            "widget": widget,
            "path": path,
        },
    )