docs: def newlogins(sessions):
      """Brand new logins each day, and total of users each day.
  
      :return: data, total
        2 lists of dictionaries of the following format [{'x':epoch, 'y': value},]
      """
      if not sessions:
          return [], []
      users = {}
      dates = {}
  
      for session in sessions:
          user = session.user
          # time value is discarded to aggregate on days only
          date = session.started_at.strftime("%Y/%m/%d")
          # keep the info only it's the first time we encounter a user
          if user not in users:
              users[user] = date
              # build the list of users on a given day
              if date not in dates:
                  dates[date] = [user]
              else:
                  dates[date].append(user)
  
      data = []
      total = []
      previous = 0
      for date in sorted(dates.keys()):
          # print u"{} : {}".format(date, len(dates[date]))
          date_epoch = unix_time_millis(datetime.strptime(date, "%Y/%m/%d"))
          data.append({"x": date_epoch, "y": len(dates[date])})
          previous += len(dates[date])
          total.append({"x": date_epoch, "y": previous})
  
      return data, total