Get list of one Categories object containing categories allowed by collection.

@param inline True if Categories object should contain collection of in-line Categories
objects or false if it should set the Href for out-of-line categories.
518477
public List<Categories> getCategories(final boolean inline) {
        final Categories cats = new Categories();
        cats.setFixed(true);
        cats.setScheme(contextURI + "/" + handle + "/" + singular);
        if (inline) {
            for (final String catName : catNames) {
                final Category cat = new Category();
                cat.setTerm(catName);
                cats.addCategory(cat);
            }
        } else {
            cats.setHref(getCategoriesURI());
        }
        return Collections.singletonList(cats);
    }
786767
public void setCategories(int i, String v) { 
    if (GOMention_Type.featOkTst && ((GOMention_Type)jcasType).casFeat_categories == null)
      jcasType.jcas.throwFeatMissing("categories", "de.julielab.jules.types.GOMention");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((GOMention_Type)jcasType).casFeatCode_categories), i);
    jcasType.ll_cas.ll_setStringArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((GOMention_Type)jcasType).casFeatCode_categories), i, v);}
939274
def is_link_inline(cls, tag, attribute):
        ''''''
        if tag in cls.TAG_ATTRIBUTES \
           and attribute in cls.TAG_ATTRIBUTES[tag]:
            attr_flags = cls.TAG_ATTRIBUTES[tag][attribute]
            return attr_flags & cls.ATTR_INLINE

        return attribute != 'href'
1106292
private function checkAlwaysFalseCategories()
    {
        $filtered = [];
        foreach ($this->categories as $category) {
            if ($category->formula === false) {
                if (null !== $category->examples) {
                    throw new \RuntimeException("The category '{$category->id}' should never occur, but it has examples (so for CLDR it may occur!)");
                }
            } else {
                $filtered[] = $category;
            }
        }
        $this->categories = $filtered;
    }
255239
def inline_list(id)
      chapter, id = extract_chapter_id(id)
      if get_chap(chapter).nil?
        macro('reviewlistref', I18n.t('format_number_without_chapter', [chapter.list(id).number]))
      else
        macro('reviewlistref', I18n.t('format_number', [get_chap(chapter), chapter.list(id).number]))
      end
    rescue KeyError
      error "unknown list: #{id}"
    end
526462
def get_category_lists(self, init_kwargs=None, additional_parents_aliases=None):
        

        if self._category_editor is not None:  # Return editor lists instead of plain lists if it's enabled.
            return self._category_editor.get_lists()

        from .toolbox import get_category_lists
        init_kwargs = init_kwargs or {}

        catlist_kwargs = {}
        if self._category_lists_init_kwargs is not None:
            catlist_kwargs.update(self._category_lists_init_kwargs)
        catlist_kwargs.update(init_kwargs)

        lists = get_category_lists(catlist_kwargs, additional_parents_aliases, obj=self)

        return lists
1062849
@SuppressWarnings("unchecked")
    @Collection
    public List<ExcelModuleDemoToDoItem> getToDoItems() {
        return container.allMatches(ExcelModuleDemoToDoItem.class,
                Predicates.and(
                    ExcelModuleDemoToDoItem.Predicates.thoseOwnedBy(currentUserName()),
                    ExcelModuleDemoToDoItem.Predicates.thoseCompleted(isComplete()),
                    ExcelModuleDemoToDoItem.Predicates.thoseCategorised(getCategory(), getSubcategory())));
    }
649187
function(category, filter) {
            var r = [];
            for (var i in this.registered_node_types) {
                var type = this.registered_node_types[i];
                if (filter && type.filter && type.filter != filter) {
                    continue;
                }

                if (category == "") {
                    if (type.category == null) {
                        r.push(type);
                    }
                } else if (type.category == category) {
                    r.push(type);
                }
            }

            return r;
        }
533749
public Map<Integer, String> getLines(int categoryNumber)
    {
        if (lines == null)
        {
            lines = new TreeMap<>();
        }

        Map<String, Object> responseMap = super.getAttributes();
        for (Entry<String, Object> response : responseMap.entrySet())
        {
            String key = response.getKey();
            if (key.toLowerCase(Locale.US).contains("line"))
            {
                String[] keyParts = key.split("-");

                // if it doesn't have at least line-XXXXXX-XXXXXX, skip
                if (keyParts.length < 3)
                {
                    continue;
                }

                // try to get the number of this category, skip if we mess up
                Integer potentialCategoryNumber;
                try
                {
                    potentialCategoryNumber = Integer.parseInt(keyParts[1]);
                }
                catch (Exception exception)
                {
                    continue;
                }

                // try to get the number of this line, skip if we mess up
                Integer potentialLineNumber;
                try
                {
                    potentialLineNumber = Integer.parseInt(keyParts[2]);
                }
                catch (Exception exception)
                {
                    continue;
                }

                // get the List out for placing stuff in
                Map<Integer, String> linesForCategory = lines.get(potentialCategoryNumber);
                if (linesForCategory == null)
                {
                    linesForCategory = new TreeMap<>();
                }

                // put the line we just parsed into the line map for this category
                linesForCategory.put(potentialLineNumber, (String) response.getValue());
                if (!lines.containsKey(potentialCategoryNumber))
                {
                    lines.put(potentialCategoryNumber, linesForCategory);
                }
            }
        }

        return lines.get(categoryNumber);
    }
1008700
def nodeListGetString(self, list, inLine):
        
        if list is None: list__o = None
        else: list__o = list._o
        ret = libxml2mod.xmlNodeListGetString(self._o, list__o, inLine)
        return ret
42063
def get_inlines(self, obj):
        
        plugin = obj.get_plugin_class()
        inlines = getattr(plugin, 'inlines', [])
        data = {}
        for inline in inlines:
            for related_object in obj._meta.related_objects:
                if getattr(related_object, 'related_model', None) == inline.model:
                    name = related_object.name
                    serializer = get_serializer(
                        getattr(obj, name).all(), model=inline.model, many=True, context=self.context)
                    data[name] = serializer.data
                    break
        return data
335830
function isCategoriesForUniversalLinks(categories) {
  // there can be only 2 categories
  if (categories == null || categories.length != 2) {
    return false;
  }

  var isBrowsable = false;
  var isDefault = false;

  // check intent categories
  categories.forEach(function(category) {
    var categoryName = category['$']['android:name'];
    if (!isBrowsable) {
      isBrowsable = 'android.intent.category.BROWSABLE' === categoryName;
    }

    if (!isDefault) {
      isDefault = 'android.intent.category.DEFAULT' === categoryName;
    }
  });

  return isDefault && isBrowsable;
}
825289
@Override
	public LinkRelation getCollectionResourceRelFor(Class<?> type) {
		return LinkRelation.of(StringUtils.uncapitalize(type.getSimpleName()) + "List");
	}
455661
public GetListOfCategoriesRequest.Builder getListOfCategories() {
    return new GetListOfCategoriesRequest.Builder(accessToken)
            .setDefaults(httpManager, scheme, host, port);
  }
521316
public static final TypeCategory getTypeCategory(Type type) {
        if (type instanceof GenericObjectType) {
            return ((GenericObjectType) type).getTypeCategory();
        }

        if (type instanceof ObjectType || type instanceof NullType) {
            return TypeCategory.PLAIN_OBJECT_TYPE;
        }

        if (type instanceof ArrayType) {
            return TypeCategory.ARRAY_TYPE;
        }

        throw new IllegalArgumentException("Not a reference type: " + type);
    }
980616
function hasMetaDocsCategory(metaPropertyNode) {
    const metaDocs = getPropertyFromObject("docs", metaPropertyNode.value);

    return metaDocs && getPropertyFromObject("category", metaDocs.value);
}
305954
@Override
    public Categories getCategories(final AtomRequest areq) throws AtomException {
        LOG.debug("getCollection");
        final String[] pathInfo = StringUtils.split(areq.getPathInfo(), "/");
        final String handle = pathInfo[0];
        final String collection = pathInfo[1];
        final FileBasedCollection col = service.findCollectionByHandle(handle, collection);
        return col.getCategories(true).get(0);
    }