<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def destroy(self, url, recursive=False):
 """Destroy a bucket, directory, or file. Specifying recursive=True recursively deletes all subdirectories and files."""

        bucket, obj_key = _parse_url(url)

        if not bucket:
            raise InvalidURL(url,
                             "You must specify a bucket and (optional) path")

        if obj_key:
            target = "/".join((bucket, obj_key))
        else:
            target = bucket

        if recursive:
            for obj in self.get(url, delimiter=''):
                self.destroy(obj['url'])

        return self.call("DeleteBucket", bucket=target)