Here we ensure that the key student_id is part of the request. Although this validation works, it really does not belong in the function itself. Plus, perhaps there are other routes that use the exact same validation. So, let’s keep it DRY and abstract out any unnecessary logic with a decorator. The following @validate_json decorator will do the job:

The first example of modernism in painting was impressionism, a school of painting that initially focused on work done, not in studios, but outdoors (en plein air). Impressionist paintings demonstrated that human beings do not see objects, but instead see light itself. The school gathered adherents despite internal divisions among its leading practitioners, and became increasingly influential. Initially rejected from the most important commercial show of the time, the government-sponsored Paris Salon, the Impressionists organized yearly group exhibitions in commercial venues during the 1870s and 1880s, timing them to coincide with the official Salon. A significant event of 1863 was the Salon des Refusés, created by Emperor Napoleon III to display all of the paintings rejected by the Paris Salon.

The decorator pattern can be used to extend (decorate) the functionality of a certain object statically, or in some cases at run-time, independently of other instances of the same class, provided some groundwork is done at design time. This is achieved by designing a new Decorator class that wraps the original class. This wrapping could be achieved by the following sequence of steps:
Decorator Abstractions: Our decorator abstraction takes the form of the abstract MessageDecorator class, which also implements IMessage. The MessageDecorator class has a constructor that accepts an IMessage object as a parameter and then assigns it to a private variable. For its part, MessageDecorator doesn’t have any special behaviors and simply delegates GetMessage and PrintMessage calls to whichever IMessage object was injected into it.
Thanks to enhanced support for multi-core processors and CPUs that use AVX2 extensions and extensive code optimizations, this is the fastest version of Painter yet. A huge selection of brushes are noticeably faster — some as much as twice as fast. You can also take advantage of faster document rendering when zooming, panning and rotating — up to 50% faster.