'Get child nodes of a node
@param node_id: the node ID
@param category: return only children of this category
@param classify: return each node as tuple (id, category) instead
of just ids
@return: the child nodes as Python set'

def children(self, node_id, category=DEFAULT, classify=False):

    nodes = self.nodes
    default = set()
    node = nodes.get(node_id)
    if (not node):
        return default
    child_ids = node['s']
    if (not child_ids):
        return default
    children = set()
    for child_id in child_ids:
        child_node = nodes.get(child_id)
        if (not child_node):
            continue
        child_category = child_node['c']
        child = ((child_id, child_category) if classify else child_id)
        if ((category is DEFAULT) or (category == child_category)):
            children.add(child)
    return children
