def remove_decorator(srccode: str, decorator: str) -> str:
    """remove decorator from return value of `inspect.getsource`.
    :param srccode: return value of `inspect.getsource`
    :param decorator: remove target ex: '@snippet'
    :return srccode_without_decorator: srccode removed decorator
    """
    # no decorator remained
    if srccode.find(decorator) != 0:
        return srccode.strip()

    len_deco = len(decorator)
    # no option
    if srccode[len_deco] != '(':
        return srccode[len_deco:].strip()

    stack = []
    stack.append('(')
    i = len_deco + 1
    while stack:
        top = stack[-1]
        nchr = srccode[i]
        if top == '(':
            if nchr == ')':
                stack.pop()
            elif nchr == "'" or nchr == '"':
                stack.append(nchr)
        elif top == "'":
            if nchr == "'":
                stack.pop()
        elif top == '"':
            if nchr == '"':
                stack.pop()
        i += 1

    return srccode[i:].strip()