Gives the total number of elements connected to this parent.

 This count includes all the elements contained in any possible child elements.

 @return [Integer] The total number of child elements connected to this parent
972376
def count_all
      # Iterate over all elements, and repeat recursively for all elements which themselves contain children.
      total_count = count
      @tags.each_value do |value|
        total_count += value.count_all if value.children?
      end
      return total_count
    end
91635
public function countChildren()
    {
        if ($this->hasChildrenRelation()) {
            $result = $this->getRelation($this->getChildrenRelationIndex())->count();
        } else {
            $result = $this->queryByParentId()->count();
        }

        return $result;
    }
208252
protected int getChildCount(){
		int num=0;
		LazyNode token=child;
		while(token!=null){
			num++;
			token=token.next;
		}
		return num;
	}
1272997
def child_count(self, path):
        
        stat = self.stat(path)
        if not stat:
            return 0

        count = stat.numChildren
        for _, _, stat in self.tree(path, 0, include_stat=True):
            if stat:
                count += stat.numChildren
        return count
1082333
def rowCount(self, parent):
        

        if parent.column() > 0:
            return 0

        if not parent.isValid():
            parentItem = self.root
        else:
            parentItem = parent.internalPointer()

        return parentItem.childCount()
558224
public int getLength()
  {

    // It is assumed that the getChildNodes call synchronized
    // the children. Therefore, we can access the first child
    // reference directly.
    int count = 0;

    for (ElemTemplateElement node = m_firstChild; node != null;
            node = node.m_nextSibling)
    {
      count++;
    }

    return count;
  }
1173854
public function nodeCount(): int
    {
        $c = 1;
        foreach ($this->_children as $child) {
            $c += $child->nodeCount();
        }
        return $c;
    }
940346
def child_count(self, only_direct=True):
        
        if not only_direct:
            count = 0
            for _node in self.dfs_iter():
                count += 1
            return count
        return len(self._children)
801386
def pbt_top_parent
      record = self
      return nil unless record.pbt_parent
      no_repeat = PolyBelongsTo::SingletonSet.new
      while !no_repeat.include?(record.pbt_parent) && !record.pbt_parent.nil?
        no_repeat.add?(record)
        record = record.pbt_parent
      end
      record
    end
1126159
def process
      current_node = @instance.current_node
      return unless current_node
      @instance.process_with_node current_node do
        matching_nodes = []
        matching_nodes << current_node if current_node.match? @rules
        current_node.recursive_children do |child_node|
          matching_nodes << child_node if child_node.match? @rules
        end
        matching_nodes.each do |matching_node|
          @instance.process_with_node matching_node do
            @instance.instance_eval &@block
          end
        end
      end
    end
454334
def _get_all_children(self,):
        
        res = ''
        if self.child_nodes:
            for c in self.child_nodes:
                res += ' child = ' + str(c) + '\n'
                if c.child_nodes:
                    for grandchild in c.child_nodes:
                        res += '   child = ' + str(grandchild) + '\n'
        else:
            res += ' child = None\n'
        return res
852305
def available_elements_within_current_scope(parent)
      @_available_elements = if parent
        parents_unique_nested_elements = parent.nested_elements.where(unique: true).pluck(:name)
        available_element_definitions(parent.name).reject do |e|
          parents_unique_nested_elements.include? e['name']
        end
      else
        available_element_definitions
      end
    end
68431
def has_children?(check = nil)
      post = obtain_record(check)
      post.blank? ? false : post.has_children?
    end
13373
def recursive_children
      self.children.each do |child|
        if Parser::AST::Node === child
          yield child
          child.recursive_children { |c| yield c }
        end
      end
    end
476144
def state(self):
        
        state = self._resource.get('state', self.default_state)
        if state not in State:
            state = getattr(State, state)

        if not self.parent:
            raise Exception('Unable to check the parent state')

        parent_state = self.parent.state

        return max([state, parent_state], key=attrgetter('value'))
1027472
def getCounts
      result = {}
      @classes.each do |c|
        count = 0
        ObjectSpace.each_object(c){ count += 1 }
        result[c] = count
      end
      result
    end
1107937
def node(o)
      @nodes.fetch(o.object_id) do
        new_node = @g.add_nodes new_node_name, node_options(o)
        @nodes[o.object_id] = new_node
        each_child_node_of(o) {|_| new_node << node(_) }
        new_node
      end
    end