docs: def download_datapackage(self, dataset_key, dest_dir):
          """Download and unzip a dataset's datapackage
  
          :param dataset_key: Dataset identifier, in the form of owner/id
          :type dataset_key: str
          :param dest_dir: Directory under which datapackage should be saved
          :type dest_dir: str or path
          :returns: Location of the datapackage descriptor (datapackage.json) in
              the local filesystem
          :rtype: path
          :raises RestApiException: If a server error occurs
  
          Examples
          --------
          >>> import datadotworld as dw
          >>> api_client = dw.api_client()
          >>> datapackage_descriptor = api_client.download_datapackage(
          ...     'jonloyens/an-intro-to-dataworld-dataset',
          ...     '/tmp/test')  # doctest: +SKIP
          >>> datapackage_descriptor  # doctest: +SKIP
          '/tmp/test/datapackage.json'
          """
          if path.isdir(dest_dir):
              raise ValueError('dest_dir must be a new directory, '
                               'but {} already exists'.format(dest_dir))
  
          owner_id, dataset_id = parse_dataset_key(dataset_key)
          url = "{0}://{1}/datapackage/{2}/{3}".format(
              self._protocol, self._download_host, owner_id, dataset_id)
          headers = {
              'User-Agent': _user_agent(),
              'Authorization': 'Bearer {0}'.format(self._config.auth_token)
          }
  
          try:
              response = requests.get(url, headers=headers, stream=True)
              response.raise_for_status()
          except requests.RequestException as e:
              raise RestApiError(cause=e)
  
          unzip_dir = path.join(self._config.tmp_dir, str(uuid.uuid4()))
          os.makedirs(unzip_dir)
  
          zip_file = path.join(unzip_dir, 'dataset.zip')
  
          with open(zip_file, 'wb') as f:
              for data in response.iter_content(chunk_size=4096):
                  f.write(data)
  
          zip_obj = zipfile.ZipFile(zip_file)
          zip_obj.extractall(path=unzip_dir)
  
          # Find where datapackage.json is within expanded files
          unzipped_descriptor = glob.glob(
              '{}/**/datapackage.json'.format(unzip_dir))
          if not unzipped_descriptor:
              raise RuntimeError(
                  'Zip file did not contain a datapackage manifest.')
  
          unzipped_dir = path.dirname(unzipped_descriptor[0])
  
          shutil.move(unzipped_dir, dest_dir)
          shutil.rmtree(unzip_dir, ignore_errors=True)
  
          return path.join(dest_dir, 'datapackage.json')