# ┌──────────────────────────────────────────────────────────────────────────┐
# │ Name: ns-scripts -> cleaning decorators                                  │
# │ Author: sh-navid                                                         │
# │ CLEAN SCRIPT                                                             │
# ├──────────────────────────────────────────────────────────────────────────┤
# │ Description:                                                             │
# │ ...                                                                      │
# ├──────────────────────────────────────────────────────────────────────────┤
# │ Tips:                                                                    │
# │ ...                                                                      │
# └──────────────────────────────────────────────────────────────────────────┘


def decorated(func):
    def wrapper(*args, **kwargs):
        print("Called:", args, kwargs)
        print("Returned: ", func(*args, **kwargs))
        # return this to process in function
        return func(*args, **kwargs)

    return wrapper


def dirty(func):
    def wrapper(*args, **kwargs):
        print("CLEAN ME PLEASE: Dirty Function: ", func.__name__)
        # return this to process in function
        return func(*args, **kwargs)

    return wrapper

def tightlycoupled(func):
    def wrapper(*args, **kwargs):
        print("TIGHTLY COUPLED: make it loosely coupled", func.__name__)
        # return this to process in function
        return func(*args, **kwargs)

    return wrapper


if __name__ == "__main__":
    @dirty
    def hello(a: int, b: int) -> int:
        print("Hello", a, b)
        return 1
    hello(1, 2)

# ┌──────────────────────────────────────────────────────────────────────────┐
# │ Name: ns-scripts -> cleaning decorators                                  │
# │ Author: sh-navid                                                         │
# │ CLEAN SCRIPT                                                             │
# ├──────────────────────────────────────────────────────────────────────────┤
# │ Description:                                                             │
# │ ...                                                                      │
# ├──────────────────────────────────────────────────────────────────────────┤
# │ Tips:                                                                    │
# │ ...                                                                      │
# └──────────────────────────────────────────────────────────────────────────┘


def decorated(func):
    def wrapper(*args, **kwargs):
        print("Called:", args, kwargs)
        print("Returned: ", func(*args, **kwargs))
        # return this to process in function
        return func(*args, **kwargs)

    return wrapper


def dirty(func):
    def wrapper(*args, **kwargs):
        print("CLEAN ME PLEASE: Dirty Function: ", func.__name__)
        # return this to process in function
        return func(*args, **kwargs)

    return wrapper

def tightlycoupled(func):
    def wrapper(*args, **kwargs):
        print("TIGHTLY COUPLED: make it loosely coupled", func.__name__)
        # return this to process in function
        return func(*args, **kwargs)

    return wrapper


if __name__ == "__main__":
    @dirty
    def hello(a: int, b: int) -> int:
        print("Hello", a, b)
        return 1
    hello(1, 2)

# ┌──────────────────────────────────────────────────────────────────────────┐ # │ Name: ns-scripts -> cleaning decorators                                  │ # │ Author: sh-navid                                                         │ # │ CLEAN SCRIPT                                                             │ # ├──────────────────────────────────────────────────────────────────────────┤ # │ Description:                                                             │ # │ ...                                                                      │ # ├──────────────────────────────────────────────────────────────────────────┤ # │ Tips:                                                                    │ # │ ...                                                                      │ # └──────────────────────────────────────────────────────────────────────────┘ # return this to process in function # return this to process in function # return this to process in function