<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_advices(target, ctx=None, local=False):
 """Get element advices. :param target: target from where get advices. :param ctx: ctx from where get target. :param bool local: If ctx is not None or target is a method, if True (False by default) get only target advices without resolving super target advices in a super ctx. :return: list of advices. :rtype: list """


    result = []
    if is_intercepted(target):
        # find ctx if not given
        if ctx is None:
            ctx = find_ctx(target)
        # find advices among super ctx if same intercepted/interception
        if ctx is not None:
            # get target name
            target_name = target.__name__
            # resolve target and _target_ctx
            _target_ctx = ctx
            _target = getattr(_target_ctx, target_name, None)
            # check if _target is intercepted
            if is_intercepted(_target):
                # get intercepted_target in order to compare with super targets
                intercepted_target, intercepted_ctx = get_intercepted(_target)
                # if ctx is not a class
                if not isclass(_target_ctx):
                    if intercepted_ctx is _target_ctx:
                        interception_fn = _get_function(_target)
                        advices = getattr(interception_fn, _ADVICES, [])
                        result += advices
                        _target_ctx = _target_ctx.__class__
                        _target = getattr(_target_ctx, target_name, None)
                # climb back class hierarchy tree through all super targets
                while _target is not None and _target_ctx is not None:
                    # check if _target is intercepted
                    if is_intercepted(_target):
                        # get intercepted ctx
                        intercepted_fn, intercepted_ctx = get_intercepted(
                            _target
                        )
                        # if intercepted ctx is ctx
                        if intercepted_ctx is _target_ctx:
                            # get advices from _target interception
                            interception_fn = _get_function(_target)
                            advices = getattr(interception_fn, _ADVICES, [])
                            result += advices
                            # update _target
                            _target, _target_ctx = super_method(
                                name=target_name, ctx=_target_ctx
                            )
                        else:  # else _target_ctx is intercepted_ctx
                            _target_ctx = intercepted_ctx
                            # and update _target
                            _target = getattr(_target_ctx, target_name, None)
                    else:  # else, intercepted_fn is _target function
                        intercepted_fn = _get_function(_target)
                        _target, _target_ctx = super_method(
                            name=target_name, ctx=_target_ctx
                        )
                    # if intercepted are different, stop iteration
                    if intercepted_target is not intercepted_fn:
                        break

                    if local:  # break if local has been requested
                        break

        else:
            # get advices from interception function
            interception_function = _get_function(target)
            result = getattr(interception_function, _ADVICES, [])

    return result