"""
    Python decorator example
"""


def my_decorator(msg='Default Welcome Message'):
    def decorated(fnc):
        def wrapper(*args, **kwargs):
            print('The message is: ' + msg)
            print('Before calling the function')
            fnc(*args, **kwargs)
            print('After calling the function')

        return wrapper

    return decorated


@my_decorator('Hi!')
def print_name(name):
    return print(name)


print_name('Ertugrul')

f604c0f5c3a5fca7530f0dccab4b3a8ba8847309
<mask token>

<mask token>


def my_decorator(msg='Default Welcome Message'):

    def decorated(fnc):

        def wrapper(*args, **kwargs):
            print('The message is: ' + msg)
            print('Before calling the function')
            fnc(*args, **kwargs)
            print('After calling the function')
        return wrapper
    return decorated


<mask token>

<mask token>


def my_decorator(msg='Default Welcome Message'):

    def decorated(fnc):

        def wrapper(*args, **kwargs):
            print('The message is: ' + msg)
            print('Before calling the function')
            fnc(*args, **kwargs)
            print('After calling the function')
        return wrapper
    return decorated


@my_decorator('Hi!')
def print_name(name):
    return print(name)


<mask token>

<mask token>


def my_decorator(msg='Default Welcome Message'):

    def decorated(fnc):

        def wrapper(*args, **kwargs):
            print('The message is: ' + msg)
            print('Before calling the function')
            fnc(*args, **kwargs)
            print('After calling the function')
        return wrapper
    return decorated


@my_decorator('Hi!')
def print_name(name):
    return print(name)


print_name('Ertugrul')

"""
    Python decorator example
"""


def my_decorator(msg='Default Welcome Message'):
    def decorated(fnc):
        def wrapper(*args, **kwargs):
            print('The message is: ' + msg)
            print('Before calling the function')
            fnc(*args, **kwargs)
            print('After calling the function')

        return wrapper

    return decorated


@my_decorator('Hi!')
def print_name(name):
    return print(name)


print_name('Ertugrul')
