<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pull_buildpack(url):
 """ Update a buildpack in its shared location, then make a copy into the current directory, using an md5 of the url. """

    defrag = _defrag(urllib.parse.urldefrag(url))
    with lock_or_wait(defrag.url):
        bp = update_buildpack(url)
        dest = bp.basename + '-' + hash_text(defrag.url)
        shutil.copytree(bp.folder, dest)
    # Make the buildpack dir writable, per
    # https://bitbucket.org/yougov/velociraptor/issues/178
    path.Path(dest).chmod('a+wx')
    return dest