<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def url_dirname(url):
 """ Return the folder containing the '.json' file """

    p = six.moves.urllib.parse.urlparse(url)
    for e in [private.FILE_EXT_JSON, private.FILE_EXT_YAML]:
        if p.path.endswith(e):
            return six.moves.urllib.parse.urlunparse(
                p[:2]+
                (os.path.dirname(p.path),)+
                p[3:]
            )
    return url