def _check(func):
            """Check func for decorator."""
            closures = func.__closure__
            # if it doesn't have any closures, it's not decorated at all
            if closures is None:
                return False

            for closure in closures:
                # if the cell content is the searched decorator, we're done
                if closure.cell_contents is decorator:
                    return True

                # if the cell content is other function, need to go deeper
                if isinstance(closure.cell_contents, types.FunctionType):
                    if _check(closure.cell_contents):
                        # found the searched decorator in a deeper layer!
                        return True
            else:
                return False