'Delete project from Jira.
:param str pid:     JIRA projectID or Project or slug
:returns bool:      True if project was deleted
:raises JIRAError:  If project not found or not enough permissions
:raises ValueError: If pid parameter is not Project, slug or ProjectID'

def delete_project(self, pid):

    if hasattr(pid, u'id'):
        pid = pid.id
    try:
        (str(int(pid)) == pid)
    except Exception as e:
        r_json = self._get_json(u'project')
        for e in r_json:
            if ((e[u'key'] == pid) or (e[u'name'] == pid)):
                pid = e[u'id']
                break
        else:
            raise ValueError((u'Parameter    pid="%s"    is    not    a    Project,    projectID    or    slug' % pid))
    uri = (u'/rest/api/2/project/%s' % pid)
    url = (self._options[u'server'] + uri)
    try:
        r = self._session.delete(url, headers={u'Content-Type': u'application/json'})
    except JIRAError as je:
        if (u'403' in str(je)):
            raise JIRAError(u'Not    enough    permissions    to    delete    project')
        if (u'404' in str(je)):
            raise JIRAError(u'Project    not    found    in    Jira')
        raise je
    if (r.status_code == 204):
        return True
