We will check normality with two different techniques so that we can exemplify the usage of a technique known as the strategy pattern, which is part of a set of patterns from object-oriented programming. We will go deeper into these patterns in Chapter 8, Object-Oriented System to Track Cryptocurrencies.
For now, you can think of the strategy pattern as a technique that will re-use code that would otherwise be duplicated and simply changes a way of doing things called the strategy. In the following code you can see that we create a function called save_png() which contains the code that would be duplicated (saving PNG files) and doesn't need to be. We will have two strategies, ...