<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=None, pointcut=None, ctx=None, depth=1, public=False, ):
 """Unweave advices on target with input pointcut. :param callable target: target from where checking pointcut and weaving advices. :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 ctx: target ctx (class or instance). :param int depth: class weaving depthing. :param bool public: (default True) weave only on public members :return: the intercepted functions created from input target. """


    # ensure advices is a list if not None
    if advices is not None:

        if isroutine(advices):
            advices = [advices]

    # initialize pointcut

    # do nothing if pointcut is None or is callable
    if pointcut is None or callable(pointcut):
        pass

    # in case of str, use a name matcher
    elif isinstance(pointcut, string_types):
        pointcut = _namematcher(pointcut)

    else:
        error_msg = "Wrong pointcut to check weaving on {0}.".format(target)
        advice_msg = "Must be None, or be a str or a function/method."
        right_msg = "Not {0}".format(type(pointcut))

        raise AdviceError(
            "{0} {1} {2}".format(error_msg, advice_msg, right_msg)
        )

    # get the right ctx
    if ctx is None:
        ctx = find_ctx(target)

    _unweave(
        target=target, advices=advices, pointcut=pointcut,
        ctx=ctx,
        depth=depth, depth_predicate=_publiccallable if public else callable
    )