<s> from django . core . paginator import EmptyPage <EOL> from django . core . paginator import Paginator <EOL> from django . core . paginator import PageNotAnInteger <EOL> def paginator ( page , object_list , per_page = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> paginator = Paginator ( <EOL> object_list , per_page ) <EOL> try : <EOL> objects = paginator . page ( page ) <EOL> except PageNotAnInteger : <EOL> objects = paginator . page ( <NUM_LIT:1> ) <EOL> except EmptyPage : <EOL> objects = [ ] <EOL> return objects </s>
