cypy/graph/store.py
def relationships(self, r_type=None, n_ids=()):
        """ Match relationships filtered by type and endpoint.

        :param r_type:
        :param n_ids:
        :return:
        """
        if r_type is None:
            r_sets = []
        else:
            r_sets = [self._relationships_by_type.get(r_type, frozenset())]
        if not n_ids or (hasattr(n_ids, "__iter__") and all(n_id is None for n_id in n_ids)):
            pass
        elif isinstance(n_ids, Sequence):
            for n_index, n_id in enumerate_nodes(n_ids):
                if n_id is not None:
                    r_sets.append({r_id for r_id, i in self._relationships_by_node.get(n_id, ())
                                   if i == n_index})
        elif isinstance(n_ids, Set):
            for n_id in n_ids:
                if n_id is not None:
                    r_sets.append({r_id for r_id, i in self._relationships_by_node.get(n_id, ())})
        else:
            raise TypeError("Nodes must be supplied as a Sequence or a Set")
        if r_sets:
            return iter(reduce(and_operator, r_sets))
        else:
            return iter(self._relationships)
 Match relationships filtered by type and endpoint.

        :param r_type:
        :param n_ids:
        :return:
        
Match relationships filtered by type and endpoint.
Match relationships filtered by type and endpoint .
def relationships(self, r_type=None, n_ids=()):
        if r_type is None:
            r_sets = []
        else:
            r_sets = [self._relationships_by_type.get(r_type, frozenset())]
        if not n_ids or (hasattr(n_ids, "__iter__") and all(n_id is None for n_id in n_ids)):
            pass
        elif isinstance(n_ids, Sequence):
            for n_index, n_id in enumerate_nodes(n_ids):
                if n_id is not None:
                    r_sets.append({r_id for r_id, i in self._relationships_by_node.get(n_id, ())
                                   if i == n_index})
        elif isinstance(n_ids, Set):
            for n_id in n_ids:
                if n_id is not None:
                    r_sets.append({r_id for r_id, i in self._relationships_by_node.get(n_id, ())})
        else:
            raise TypeError("Nodes must be supplied as a Sequence or a Set")
        if r_sets:
            return iter(reduce(and_operator, r_sets))
        else:
            return iter(self._relationships)
def relationships ( self , r_type = None , n_ids = ( ) ) : if r_type is None : r_sets = [ ] else : r_sets = [ self . _relationships_by_type . get ( r_type , frozenset ( ) ) ] if not n_ids or ( hasattr ( n_ids , "__iter__" ) and all ( n_id is None for n_id in n_ids ) ) : pass elif isinstance ( n_ids , Sequence ) : for n_index , n_id in enumerate_nodes ( n_ids ) : if n_id is not None : r_sets . append ( { r_id for r_id , i in self . _relationships_by_node . get ( n_id , ( ) ) if i == n_index } ) elif isinstance ( n_ids , Set ) : for n_id in n_ids : if n_id is not None : r_sets . append ( { r_id for r_id , i in self . _relationships_by_node . get ( n_id , ( ) ) } ) else : raise TypeError ( "Nodes must be supplied as a Sequence or a Set" ) if r_sets : return iter ( reduce ( and_operator , r_sets ) ) else : return iter ( self . _relationships )
Match relationships filtered by type and endpoint.
Match relationships filtered by type and endpoint .
""" Match relationships filtered by type and endpoint.

        :param r_type:
        :param n_ids:
        :return:
        """
None
self
r_type
None
n_ids
None