moved model slicing from model.__getitem__ method
Automatic style corrections courtesy of autopep8