from __future__ import unicode_literals

from calendar import timegm
from datetime import datetime

from django.conf import settings
from django.utils import six
from django.utils.functional import lazy
from django.utils.timezone import is_aware, make_aware, utc


def make_utc(dt):
    if settings.USE_TZ and not is_aware(dt):
        return make_aware(dt, timezone=utc)

    return dt


def aware_utcnow():
    return make_utc(datetime.utcnow())


def datetime_to_epoch(dt):
    return timegm(dt.utctimetuple())


def datetime_from_epoch(ts):
    return make_utc(datetime.utcfromtimestamp(ts))


def format_lazy(s, *args, **kwargs):
    return s.format(*args, **kwargs)

format_lazy = lazy(format_lazy, six.text_type)

@@ -233,20 +233,20 @@
 port is_
-awar
+naiv
 e, make_
@@ -307,19 +307,15 @@
 and 
-not is_awar
+is_naiv
 e(dt

Use is_naive here for clarity