def METHOD_NAME(request, path: str, widget: str, color: str, extension: str):
    # We intentionally skip ACL here to allow widget sharing
    obj = parse_path(
        request, path, (Component, ProjectLanguage, Project, Translation), skip_acl=True
    )
    lang = None
    if hasattr(obj, "language"):
        lang = obj.language
    if isinstance(obj, Translation):
        obj = obj.component
    if isinstance(obj, ProjectLanguage):
        obj = obj.project
    if lang:
        if "native" not in request.GET:
            try_set_language(lang.code)
    else:
        try_set_language("en")
    # Get widget class
    try:
        widget_class = WIDGETS[widget]
    except KeyError:
        raise Http404
    # Construct object
    widget_obj = widget_class(obj, color, lang)
    # Invalid extension
    if extension != widget_obj.extension or color != widget_obj.color:
        kwargs = {
            "path": path,
            "widget": widget,
            "color": widget_obj.color,
            "extension": widget_obj.extension,
        }
        return redirect("widget-image", permanent=True, **kwargs)
    # Render widget
    response = HttpResponse(content_type=widget_obj.content_type)
    widget_obj.render(response)
    return response