Add unicode category to set

        Unicode categories are strings like 'Ll', 'Lu', 'Nd', etc.
        See `unicodedata.category()`
346358
def add_category(self, category):
        '''
        
        '''
        if category == sre.CATEGORY_DIGIT:
            self._categories |= UNICODE_DIGIT_CATEGORIES
        elif category == sre.CATEGORY_NOT_DIGIT:
            self._categories |= UNICODE_CATEGORIES - UNICODE_DIGIT_CATEGORIES
        elif category == sre.CATEGORY_SPACE:
            self._categories |= UNICODE_SPACE_CATEGORIES
            for c in (UNICODE_SPACE_CHARS if self._unicode else SPACE_CHARS):
                self._whitelist_chars.add(c)
        elif category == sre.CATEGORY_NOT_SPACE:
            self._categories |= UNICODE_CATEGORIES - UNICODE_SPACE_CATEGORIES
            for c in (UNICODE_SPACE_CHARS if self._unicode else SPACE_CHARS):
                self._blacklist_chars.add(c)
        elif category == sre.CATEGORY_WORD:
            self._categories |= UNICODE_WORD_CATEGORIES
            self._whitelist_chars.add(u'_')
            if HAS_WEIRD_WORD_CHARS and self._unicode:
                for c in UNICODE_WEIRD_NONWORD_CHARS:
                    self._blacklist_chars.add(c)
        elif category == sre.CATEGORY_NOT_WORD:
            self._categories |= UNICODE_CATEGORIES - UNICODE_WORD_CATEGORIES
            self._blacklist_chars.add(u'_')
            if HAS_WEIRD_WORD_CHARS and self._unicode:
                for c in UNICODE_WEIRD_NONWORD_CHARS:
                    self._whitelist_chars.add(c)
453086
def _category(self):
        

        if self.fname.split('_')[0] == 'WAC':
            self.grid = 'WAC'
            self.img = os.path.join(self.wacpath, self.fname + '.IMG')
            self.lbl = ''
        elif self.fname.split('_')[0] == 'LDEM':
            self.grid = 'LOLA'
            self.img = os.path.join(self.lolapath, self.fname + '.IMG')
            self.lbl = os.path.join(self.lolapath, self.fname + '.LBL')
        else:
            raise ValueError("%s : This type of image is not recognized. Possible\
                             images are from %s only" % (self.fname, ', '.join(('WAC', 'LOLA'))))
717733
def add_category(self, category):
        
        self._categories = self._ensure_append(category, self._categories)
195811
def strip_accents(text):
    

    normalized_str = unicodedata.normalize('NFD', text)

    return ''.join([
        c for c in normalized_str if unicodedata.category(c) != 'Mn'])
1257791
def adds(self, string):
        
        if isinstance(string, unicode):
            string = string.encode("utf-8")

        self.children.append((STRING, str(string)))
825022
def group_plugins_into_categories(plugins):
    
    if not plugins:
        return {}
    plugins = sorted(plugins, key=lambda p: p.verbose_name)
    categories = {}

    for plugin in plugins:
        title = str(plugin.category or u"")  # enforce resolving ugettext_lazy proxies.
        if title not in categories:
            categories[title] = []
        categories[title].append(plugin)

    return categories
338009
public boolean supportsCategory(String category) {
		if (category == null) {
			return false;
		}

		List<String> categories = this.getCategories();
		for (String cat : categories) {
			if (cat.compareToIgnoreCase(category) == 0) {
				return true;
			}
		}

		return false;
	}
894202
def set_category(self, category: str = None) -> 'PygalleBaseClass':
        
        return self.set_internal(PygalleBaseClass.__KEYS.CATEGORY, category)
532572
function() {
      var categoriesDict = {};
      this.device.addCategoriesToDict(categoriesDict);
      this.kernel.addCategoriesToDict(categoriesDict);
      for (var pid in this.processes)
        this.processes[pid].addCategoriesToDict(categoriesDict);

      this.categories = [];
      for (var category in categoriesDict)
        if (category != '')
          this.categories.push(category);
    }
589390
def strings_to_categoricals(adata):
    
    from pandas.api.types import is_string_dtype
    from pandas import Categorical
    for df in [adata.obs, adata.var]:
        string_cols = [key for key in df.columns if is_string_dtype(df[key])]
        for key in string_cols:
            c = df[key]
            c = Categorical(c)
            if len(c.categories) < len(c): df[key] = c
724760
public function addCategories($categories)
    {
        $this->setProperty(
            'categories',
            'CATEGORIES' . $this->getCharsetString(),
            trim(implode(',', $categories))
        );

        return $this;
    }
89386
def apply_train(self, df:DataFrame):
        ""
        self.categories = {}
        for n in self.cat_names:
            df.loc[:,n] = df.loc[:,n].astype('category').cat.as_ordered()
            self.categories[n] = df[n].cat.categories
58437
def _repr_categories(self):
        
        max_categories = (10 if get_option("display.max_categories") == 0 else
                          get_option("display.max_categories"))
        from pandas.io.formats import format as fmt
        if len(self.categories) > max_categories:
            num = max_categories // 2
            head = fmt.format_array(self.categories[:num], None)
            tail = fmt.format_array(self.categories[-num:], None)
            category_strs = head + ["..."] + tail
        else:
            category_strs = fmt.format_array(self.categories, None)

        # Strip all leading spaces, which format_array adds for columns...
        category_strs = [x.strip() for x in category_strs]
        return category_strs
563004
public UnifiedPushConfig setCategories(String... categories) {
        validateCategories(categories);        
        this.categories = Arrays.asList(categories);
        return this;
    }
231877
def get_categories(self, languages=None):
        
        query_parameters = {}
        if languages is not None:
            query_parameters['languages'] = self._serialize.query('languages', languages, 'str')
        response = self._send(http_method='GET',
                              location_id='e0a5a71e-3ac3-43a0-ae7d-0bb5c3046a2a',
                              version='5.1-preview.1',
                              query_parameters=query_parameters)
        return self._deserialize('[str]', self._unwrap_collection(response))
227557
def category(self, category):
        
        self.url.category = category
        self.url.set_page(1)
        return self
1152124
def set_category(self, category):
        
        pcategory = self.find("general/category")
        pcategory.clear()
        name = ElementTree.SubElement(pcategory, "name")
        if isinstance(category, Category):
            id_ = ElementTree.SubElement(pcategory, "id")
            id_.text = category.id
            name.text = category.name
        elif isinstance(category, basestring):
            name.text = category