suppress warnings inside function python code example Example: ignore warnings python import warnings warnings.filterwarnings("ignore")