def _get_project_id(self, name):
    """Fetch the id of a project.

    :param name: Project name.

    """
    self._logger.debug('Retrieving id for project %s.', name)
    try:
      res = _extract_json(self._request(
        method='GET',
        endpoint='manager',
        params={
          # there is no endpoint to get the project id, getPermissions is
          # the least expensive endpoint whose response contains the id
          'ajax': 'getPermissions',
          'project': name,
        },
      ))
    except __HOLE__:
      # Azkaban server sends a 200 empty response if the project doesn't exist
      raise AzkabanError(
        'Failed to get project id. Check that the project exists.'
      )
    else:
      project_id = res['projectId']
    self._logger.info('Retrieved id for project %s: %s.', name, project_id)
    return project_id
dataset/ETHPy150Open mtth/azkaban/azkaban/remote.py/Session._get_project_id