Returns a QuerySet of objects of this type associated with the given category.

        :param Category category:
        :rtype: list
        :return:
507593
def get_from_category_qs(cls, category):
        
        ids = cls.get_ties_for_categories_qs(category).values_list('object_id').distinct()
        filter_kwargs = {'id__in': [i[0] for i in ids]}
        return cls.objects.filter(**filter_kwargs)
49204
def _category_slugs(self, category):
        """"""
        key = self._category_key(category)
        slugs = self.r.smembers(key)
        return slugs
702030
def get_category_for_slug(slug, language_code=None):
    
    Category = get_category_model()
    if issubclass(Category, TranslatableModel):
        return Category.objects.active_translations(language_code, slug=slug).get()
    else:
        return Category.objects.get(slug=slug)
1044117
def category(self, category=None):
        
        if category is None:
            return int(self.url.category)
        self.url.category = str(category)
319169
def for_category(self, category, live_only=False):
        
        filters = {'tag': category.tag}

        if live_only:
            filters.update({'entry__live': True})

        return self.filter(**filters)
940714
def actions_for_category(category):
    
    actions = set()
    for action, action_category in _action_categories.items():
        if action_category == category:
           actions.add(action)
    return actions
491052
def categorize(func: Union[Callable, Iterable], category: str) -> None:
    
    if isinstance(func, Iterable):
        for item in func:
            setattr(item, HELP_CATEGORY, category)
    else:
        setattr(func, HELP_CATEGORY, category)
810405
def _set_categories(self):
        
        for column, _ in self._categories.items():
            if column in self.columns:
                self[column] = self[column].astype('category')
1371898
public List<String> listTypes(final DataTypes.TypeCategory category) throws AtlasServiceException {
        JSONObject response = callAPIWithRetries(API.LIST_TYPES, null, new ResourceCreator() {
            @Override
            public WebResource createResource() {
                WebResource resource = getResource(API.LIST_TYPES.getPath());
                resource = resource.queryParam(TYPE, category.name());
                return resource;
            }
        });
        return extractResults(response, AtlasClient.RESULTS, new ExtractOperation<String, String>());
    }
1262165
def browse_stations_categories(self):
		

		response = self._call(
			mc_calls.BrowseStationCategories
		)
		station_categories = response.body.get('root', {}).get('subcategories', [])

		return station_categories
1346873
def _categorize(self, slug, category):
        
        key = self._category_key(category)
        self.r.sadd(key, slug)

        # Store all category names in a Redis set, for easy retrieval
        self.r.sadd(self._categories_key, category)
359481
def title(self, category):
        
        return sum(
            [self.getWidth(category, x) for x in self.fields])
545461
def category_names(self):
        '''
        
        '''
        if hasattr(self, '_category_names'):
            return self._category_names
        with open(os.path.join(os.path.dirname(__file__), 'category_names.txt'), 'r') as fd:
            self._category_names = fd.read().splitlines()
        return self._category_names
370101
def get_category_or_404(path):
    
    path_bits = [p for p in path.split('/') if p]
    return get_object_or_404(Category, slug=path_bits[-1])
1091447
def get_categories(self, app_name):
        
        cat_nums = self.apps.get(app_name, {}).get("cats", [])
        cat_names = [self.categories.get("%s" % cat_num, "")
                     for cat_num in cat_nums]

        return cat_names
143710
def show_category(self):
        
        url = 'https://openapi.youku.com/v2/schemas/show/category.json'
        r = requests.get(url)
        check_error(r)
        return r.json()
454779
def get_netid_categories(netid, category_codes):
    
    url = _netid_category_url(netid, category_codes)
    response = get_resource(url)
    return _json_to_categories(response)