<s> from datetime import date , datetime , time , timedelta <EOL> from django . http import HttpResponsePermanentRedirect , HttpResponseRedirect <EOL> from django . utils . http import urlencode <EOL> def redirect ( request , url = None , type = '<STR_LIT>' , extra = None ) : <EOL> """<STR_LIT>""" <EOL> if type == '<STR_LIT>' : <EOL> return HttpResponsePermanentRedirect ( url ) <EOL> else : <EOL> return HttpResponseRedirect ( url ) <EOL> def normalize_to_datetime ( object ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( object , date ) and not isinstance ( object , datetime ) : <EOL> return datetime . combine ( object , time . min ) <EOL> else : <EOL> return object </s>
