<jupyter_start><jupyter_text>Decorator with Arguments<jupyter_code>def math_op(math_func):
    def do_op(x):
        func = math_func(x)
        print("Your number {} is {}".format(func[0],func[1]))
    return do_op
@math_op
def square(x):
    return ('squared', x ** 2)
square(10)
def math_op(math_func):
    def do_op(*args, **kwargs):
        func = math_func(*args, **kwargs)
        print("Your number {} is {}".format(func[0],func[1]))
    return do_op
@math_op
def square(x):
    return ('squared', x ** 2)
square(10)
@math_op
def cube():
    return('cubed', 10 **3)
cube()<jupyter_output>Your number cubed is 1000
{'fraction_non_alphanumeric': 0.16908212560386474, 'fraction_numerical': 0.027375201288244767, 'mean_word_length': 4.056910569105691, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '71409', 'license': 'MIT', 'n_tokens_mistral': 251, 'n_tokens_neox': 235, 'n_words': 55, 'path': 'Section 5/5.2-decorator_with_arg.ipynb', 'repo_name': 'PacktPublishing/The-Modern-Python-Challenge-v-', 'size': '621'}