#NEWLINE# def make_aware( value , timezone ) : #NEWLINE# #INDENT# '\n    Makes a naive datetime.datetime in a given time zone aware.\n    ' #NEWLINE# if hasattr ( timezone , 'localize' ) : #NEWLINE# #INDENT# return timezone . localize ( value , is_dst = None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return value . replace ( tzinfo = timezone )