'Get badips.com categories.
Returns
set
Set of categories.
Raises
HTTPError
Any issues with badips.com request.
ValueError
If badips.com response didn\'t contain necessary information'

def getCategories(self, incParents=False):

    try:
        response = urlopen(self._Request('/'.join([self._badips, 'get', 'categories'])), timeout=self.timeout)
    except HTTPError as response:
        messages = json.loads(response.read().decode('utf-8'))
        self._logSys.error("Failed    to    fetch    categories.    badips.com    response:    '%s'", messages['err'])
        raise
    else:
        response_json = json.loads(response.read().decode('utf-8'))
        if (not ('categories' in response_json)):
            err = ('badips.com    response    lacked    categories    specification.    Response    was:    %s' % (response_json,))
            self._logSys.error(err)
            raise ValueError(err)
        categories = response_json['categories']
        categories_names = set((value['Name'] for value in categories))
        if incParents:
            categories_names.update(set((value['Parent'] for value in categories if ('Parent' in value))))
        return categories_names
