<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _unweave(target, advices, pointcut, ctx, depth, depth_predicate):
 """Unweave deeply advices in target."""


    # if weaving has to be done
    if pointcut is None or pointcut(target):
        # do something only if target is intercepted
        if is_intercepted(target):
            _remove_advices(target=target, advices=advices, ctx=ctx)

    # search inside the target
    if depth > 0:  # for an object or a class, weave on methods
        # get base ctx
        _base_ctx = None
        if ctx is not None:
            _base_ctx = base_ctx(ctx)
        for _, member in getmembers(target, depth_predicate):
            _unweave(
                target=member, advices=advices, pointcut=pointcut,
                depth=depth - 1, depth_predicate=depth_predicate, ctx=_base_ctx
            )