src/pybel/struct/filters/edge_predicates.py
def edge_predicate(func: DictEdgePredicate) -> EdgePredicate:  # noqa: D202
    """Decorate an edge predicate function that only takes a dictionary as its singular argument.

    Apply this as a decorator to a function that takes a single argument, a PyBEL node data dictionary, to make
    sure that it can also accept a pair of arguments, a BELGraph and a PyBEL node tuple as well.
    """

    @wraps(func)
    def _wrapped(*args):
        x = args[0]

        if isinstance(x, BELGraph):
            u, v, k = args[1:4]
            return func(x[u][v][k])

        return func(*args)

    return _wrapped
Decorate an edge predicate function that only takes a dictionary as its singular argument.

    Apply this as a decorator to a function that takes a single argument, a PyBEL node data dictionary, to make
    sure that it can also accept a pair of arguments, a BELGraph and a PyBEL node tuple as well.
    
Decorate an edge predicate function that only takes a dictionary as its singular argument.
Apply this as a decorator to a function that takes a single argument, a PyBEL node data dictionary, to make
sure that it can also accept a pair of arguments, a BELGraph and a PyBEL node tuple as well.
Decorate an edge predicate function that only takes a dictionary as its singular argument . Apply this as a decorator to a function that takes a single argument a PyBEL node data dictionary to make sure that it can also accept a pair of arguments a BELGraph and a PyBEL node tuple as well .
def edge_predicate(func: DictEdgePredicate) -> EdgePredicate:  
    @wraps(func)
    def _wrapped(*args):
        x = args[0]
        if isinstance(x, BELGraph):
            u, v, k = args[1:4]
            return func(x[u][v][k])
        return func(*args)
    return _wrapped
def edge_predicate ( func : DictEdgePredicate ) -> EdgePredicate : @ wraps ( func ) def _wrapped ( * args ) : x = args [ 0 ] if isinstance ( x , BELGraph ) : u , v , k = args [ 1 : 4 ] return func ( x [ u ] [ v ] [ k ] ) return func ( * args ) return _wrapped
Decorate an edge predicate function that only takes a dictionary as its singular argument.
Decorate an edge predicate function that only takes a dictionary as its singular argument .
# noqa: D202 """Decorate an edge predicate function that only takes a dictionary as its singular argument.

    Apply this as a decorator to a function that takes a single argument, a PyBEL node data dictionary, to make
    sure that it can also accept a pair of arguments, a BELGraph and a PyBEL node tuple as well.
    """
func
DictEdgePredicate