Implementations of various basic sorts in Python