<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def directed_account(transition, direction, mechanisms=False, purviews=False, allow_neg=False):
 """Return the set of all |CausalLinks| of the specified direction."""

    if mechanisms is False:
        mechanisms = utils.powerset(transition.mechanism_indices(direction),
                                    nonempty=True)
    links = [
        transition.find_causal_link(direction, mechanism, purviews=purviews,
                                    allow_neg=allow_neg)
        for mechanism in mechanisms]

    # Filter out causal links with zero alpha
    return DirectedAccount(filter(None, links))