I've got about 10 functions that all share a bit of code. They all look something like this:
def func(arg): statement1 statement2 statement3 unique code statement4 statement5
Each function does similar statements at the beginning and end, but has unique stuff in the middle. Is there a way for me to simplify this as not to repeat code?