<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _weave( target, advices, pointcut, ctx, depth, depth_predicate, intercepted, pointcut_application ):
 """Weave deeply advices in target. :param callable target: target from where checking pointcut and weaving advices. :param advices: advices to weave on target. :param ctx: target ctx (class or instance). :param pointcut: condition for weaving advices on joinpointe. The condition depends on its type. :type pointcut: - NoneType: advices are weaved on target. - str: target name is compared to pointcut regex. - function: called with target in parameter, if True, advices will be weaved on target. :param int depth: class weaving depthing. :param list intercepted: list of intercepted targets. :param routine pointcut_application: routine which applies a pointcut when required. _Joinpoint().apply_pointcut by default. Such routine has to take in parameters a routine called target and its related function called function. Its result is the interception function. """


    # if weaving has to be done
    if pointcut is None or pointcut(target):
        # get target interception function
        interception_fn = _get_function(target)
        # does not handle not python functions
        if interception_fn is not None:
            # flag which specifies if poincut has to by applied
            # True if target is not intercepted
            apply_poincut = not is_intercepted(target)
            # apply poincut if not intercepted
            if (not apply_poincut) and ctx is not None:
                # apply poincut if ctx is not intercepted_ctx
                intercepted_fn, intercepted_ctx = get_intercepted(target)
                # if previous weave was done directly on the function
                if intercepted_ctx is None:
                    # update intercepted_ctx on target
                    intercepted_ctx = interception_fn._intercepted_ctx = ctx
                # if old ctx and the new one are same
                if ctx is not intercepted_ctx:
                    # apply pointcut
                    apply_poincut = True
                    # and update interception_fn
                    interception_fn = intercepted_fn
            # if weave has to be done
            if apply_poincut:
                # instantiate a new joinpoint if pointcut_application is None
                if pointcut_application is None:
                    pointcut_application = _Joinpoint().apply_pointcut
                interception_fn = pointcut_application(
                    target=target, function=interception_fn, ctx=ctx
                )
            # add advices to the interception function
            _add_advices(
                target=interception_fn, advices=advices
            )
            # append interception function to the intercepted ones
            intercepted.append(interception_fn)

    # search inside the target
    elif depth > 0:  # for an object or a class, weave on methods
        # get the right ctx
        if ctx is None:
            ctx = target
        for _, member in getmembers(ctx, depth_predicate):
            _weave(
                target=member, advices=advices, pointcut=pointcut,
                depth_predicate=depth_predicate, intercepted=intercepted,
                pointcut_application=pointcut_application, depth=depth - 1,
                ctx=ctx
            )