import time debug = True def timeit(func): def wrapper(*args, **kwargs): start = time.perf_counter() result = func(*args, **kwargs) end = time.perf_counter() if debug: print(f"{func.__name__} time cost: {end - start:.2f} seconds") return result return wrapper @timeit def my_function(x, y): # Do some time-consuming operations time.sleep(2) return x + y # Call the decorated my_function with arguments result = my_function(3, 4) # Output: # my_function time cost: 2.00 seconds print(result) # Output: 7 # query from DB and send email after group by and filter # Import the necessary libraries import psycopg2 import pandas as pd # Connect to the database conn = psycopg2.