<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def static_cdn_tag(path, cdn, cdn_only=False):
 """ Return the URL of a static file, with handling of offline mode. Usage: ``{% %}`` """

    clean_path = path.lstrip("/")
    if getattr(settings, "OFFLINE", False):
        return static_url(join("vendor", clean_path))
    elif cdn_only:
        return cdn
    return urljoin(cdn, clean_path)