Return the count of references in this part's XML to the relationship
        identified by *rId*.
179218
def _rel_ref_count(self, rId):
        
        rIds = self._element.xpath('//@r:id')
        return len([_rId for _rId in rIds if _rId == rId])
52348
private int calculateForeignKeyColumnCount(PersistentEntity refDomainClass, String[] propertyNames) {
        int expectedForeignKeyColumnLength = 0;
        for (String propertyName : propertyNames) {
            PersistentProperty referencedProperty = refDomainClass.getPropertyByName(propertyName);
            if(referencedProperty instanceof ToOne) {
                ToOne toOne = (ToOne) referencedProperty;
                PersistentProperty[] compositeIdentity = toOne.getAssociatedEntity().getCompositeIdentity();
                if(compositeIdentity != null) {
                    expectedForeignKeyColumnLength += compositeIdentity.length;
                }
                else {
                    expectedForeignKeyColumnLength++;
                }
            }
            else {
                expectedForeignKeyColumnLength++;
            }
        }
        return expectedForeignKeyColumnLength;
    }
395305
def _parse_references(xml):
    """"""
    references = []
    ref_finder = HTMLReferenceFinder(xml)
    for elm, uri_attr in ref_finder:
        type_ = _discover_uri_type(elm.get(uri_attr))
        references.append(Reference(elm, type_, uri_attr))
    return references
608079
def rowCount(self, parent):
        """"""
        if not parent.isValid():
            v = self._conf
        else:
            v = self.get_value(parent)
        if isinstance(v, Section):
            return len(v.keys())
        else:
            return 0
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()
14225
public Relation getRelation_ref() {
    if (RelationMention_Type.featOkTst && ((RelationMention_Type)jcasType).casFeat_relation_ref == null)
      jcasType.jcas.throwFeatMissing("relation_ref", "de.julielab.jules.types.ace.RelationMention");
    return (Relation)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((RelationMention_Type)jcasType).casFeatCode_relation_ref)));}
1147411
def rowCount(self, parent=QModelIndex()):
        

        if not parent.isValid():
            parent_node = self.__root_node
        else:
            parent_node = parent.internalPointer()
        return parent_node.children_count()
522535
protected function objectCount()
    {
        $topNodeArray = eZPersistentObject::fetchObjectList(
            eZContentObjectTreeNode::definition(),
            null,
            array( 'parent_node_id' => 1, 'depth' => 1 )
        );
        $subTreeCount = 0;
        foreach ( array_keys ( $topNodeArray ) as $key  )
        {
            $subTreeCount += $topNodeArray[$key]->subTreeCount( array( 'Limitation' => array(), 'MainNodeOnly' => true ) );
        }

        return $subTreeCount;
    }
738552
def size(self):
        ''''''
        cur = self._conn.cursor()
        querystr = "SELECT COUNT(*) FROM relationship;"
        cur.execute(querystr)
        result = cur.fetchone()
        return result[0]
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)
419464
private int countInstances(HeaderElement root) {
        int count = 0;
        HeaderElement elem = root;
        while (null != elem) {
            if (!elem.wasRemoved()) {
                count++;
            }
            elem = elem.nextInstance;
        }
        return count;
    }
454809
function getAllReferences() {
  return _.reduce(
    this.getInheritanceChain(),
    (acc, cls) => _.reduce(cls.references, (acc2, v, k) => {acc2[k] = v; return acc2}, acc),
    {})
}
1224045
def _utilized(n, node, other_attrs, unsuppressedPrefixes):
    ''''''
    if n.startswith('xmlns:'):
        n = n[6:]
    elif n.startswith('xmlns'):
        n = n[5:]
    if (n=="" and node.prefix in ["#default", None]) or \
        n == node.prefix or n in unsuppressedPrefixes: 
            return 1
    for attr in other_attrs:
        if n == attr.prefix: return 1
    # For exclusive need to look at attributes
    if unsuppressedPrefixes is not None:
        for attr in _attrs(node):
            if n == attr.prefix: return 1
            
    return 0
430947
protected function getRelationReferenceCount($fkey, $max = null)
    {
        $count = 0;
        $tablename = $fkey->getReferencedTable()->getRawTableName();
        foreach ($this->getTableM2MRelations() as $relation) {
            // $relation key => reference (ForeignKey), refTable (Table)
            if ($this->checkReferenceTableName($relation['refTable'], $tablename)) {
                $count++;
            }
            if ($max && $count == $max) {
                break;
            }
        }

        return $count;
    }
1143481
def count(self, elem):
        
        return self._left_list.count(elem) + self._right_list.count(elem)
164372
public function getAppointmentsCountAttribute()
    {
        // If relation is not loaded already, let's do it first
        if (!array_key_exists('appointmentsCount', $this->relations)) {
            $this->load('appointmentsCount');
        }

        $related = $this->getRelation('appointmentsCount');

        // Return the count directly
        return ($related->count() > 0) ? (int) $related->first()->aggregate : 0;
    }
955854
def _get_relationship_data(self):
        """"""
        relationship_field = request.path.split('/')[-1].replace('-', '_')

        if relationship_field not in get_relationships(self.schema):
            raise RelationNotFound("{} has no attribute {}".format(self.schema.__name__, relationship_field))

        related_type_ = self.schema._declared_fields[relationship_field].type_
        related_id_field = self.schema._declared_fields[relationship_field].id_field
        model_relationship_field = get_model_field(self.schema, relationship_field)

        return relationship_field, model_relationship_field, related_type_, related_id_field