def degree(self, subgraph):
        """ Return the total number of relationships attached to all nodes in
        a subgraph.

        :param subgraph: a :class:`.Node`, :class:`.Relationship` or other
                       :class:`.Subgraph`
        :returns: the total number of distinct relationships
        """
        try:
            return subgraph.__db_degree__(self)
        except __HOLE__:
            raise TypeError("No method defined to determine the degree of object %r" % subgraph)
dataset/ETHPy150Open nigelsmall/py2neo/py2neo/database/__init__.py/Transaction.degree