<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_cuts(transition, direction):
 """A list of possible cuts to a transition."""

    n = transition.network.size

    if direction is Direction.BIDIRECTIONAL:
        yielded = set()
        for cut in chain(_get_cuts(transition, Direction.CAUSE),
                         _get_cuts(transition, Direction.EFFECT)):
            cm = utils.np_hashable(cut.cut_matrix(n))
            if cm not in yielded:
                yielded.add(cm)
                yield cut

    else:
        mechanism = transition.mechanism_indices(direction)
        purview = transition.purview_indices(direction)
        for partition in mip_partitions(mechanism, purview,
                                        transition.node_labels):
            yield ActualCut(direction, partition, transition.node_labels)