how to raise an exception in python if functionality is deprecated code example Example: ignore warnings python import warnings warnings.filterwarnings("ignore")