code: def localize_datetime(dt, tz_name='UTC'):
      
      tz_aware_dt = dt
      if dt.tzinfo is None:
          utc = pytz.timezone('UTC')
          aware = utc.localize(dt)
          timezone = pytz.timezone(tz_name)
          tz_aware_dt = aware.astimezone(timezone)
      else:
          logger.warn('tzinfo already set')
      return tz_aware_dt
docs: Provide a timzeone-aware object for a given datetime and timezone name