# Path: boilerplate/models.py
# class User(User):
# class LogVisit(ndb.Model):
# class LogEmail(ndb.Model):
# class SocialUser(ndb.Model):
#     def get_by_email(cls, email):
#     def create_resend_token(cls, user_id):
#     def validate_resend_token(cls, user_id, token):
#     def delete_resend_token(cls, user_id, token):
#     def get_social_providers_names(self):
#     def get_social_providers_info(self):
#     def get_by_user(cls, user):
#     def get_by_user_and_provider(cls, user, provider):
#     def get_by_provider_and_uid(cls, provider, uid):
#     def check_unique_uid(cls, provider, uid):
#     def check_unique_user(cls, provider, user):
#     def check_unique(cls, user, provider, uid):
#     def open_id_providers():
#     PROVIDERS_INFO = { # uri is for OpenID only (not OAuth)
#         'google': {'name': 'google', 'label': 'Google', 'uri': 'gmail.com'},
#         'github': {'name': 'github', 'label': 'Github', 'uri': ''},
#         'facebook': {'name': 'facebook', 'label': 'Facebook', 'uri': ''},
#         'linkedin': {'name': 'linkedin', 'label': 'LinkedIn', 'uri': ''},
#         'myopenid': {'name': 'myopenid', 'label': 'MyOpenid', 'uri': 'myopenid.com'},
#         'twitter': {'name': 'twitter', 'label': 'Twitter', 'uri': ''},
#         'yahoo': {'name': 'yahoo', 'label': 'Yahoo!', 'uri': 'yahoo.com'},
#     }
# 
# Path: boilerplate/handlers.py
# class AbTestHandler(BaseHandler):
# class LoginRequiredHandler(BaseHandler):
# class RegisterBaseHandler(BaseHandler):
# class SendEmailHandler(BaseHandler):
# class LoginHandler(BaseHandler):
# class SocialLoginHandler(BaseHandler):
# class CallbackSocialLoginHandler(BaseHandler):
# class DeleteSocialProviderHandler(BaseHandler):
# class LogoutHandler(BaseHandler):
# class RegisterHandler(RegisterBaseHandler):
# class AccountActivationHandler(BaseHandler):
# class ResendActivationEmailHandler(BaseHandler):
# class ContactHandler(BaseHandler):
# class EditProfileHandler(BaseHandler):
# class EditPasswordHandler(BaseHandler):
# class EditEmailHandler(BaseHandler):
# class PasswordResetHandler(BaseHandler):
# class PasswordResetCompleteHandler(BaseHandler):
# class EmailChangedCompleteHandler(BaseHandler):
#     def get(self):
#     def get(self):
#     def form(self):
#     def post(self):
#     def get(self):
#     def post(self):
#     def form(self):
#     def get(self, provider_name):
#     def get(self, provider_name):
#     def create_account_from_social_provider(self, provider_name, uid, email=None, continue_url=None, user_data=None):
#     def post(self, provider_name):
#     def get(self):
#     def get(self):
#     def post(self):
#     def get(self, user_id, token):
#     def get(self, user_id, token):
#     def get(self):
#     def post(self):
#     def form(self):
#     def get(self):
#     def post(self):
#     def form(self):
#     def get(self):
#     def post(self):
#     def form(self):
#     def get(self):
#     def post(self):
#     def form(self):
#     def get(self):
#     def post(self):
#     def get(self, user_id, token):
#     def post(self, user_id, token):
#     def form(self):
#     def get(self, user_id, encoded_email, token):


import webapp2
from boilerplate import models
from boilerplate import forms
from boilerplate.handlers import BaseHandler
from google.appengine.datastore.datastore_query import Cursor
from google.appengine.ext import ndb
from google.appengine.api import users as googleusers
from collections import OrderedDict, Counter
from wtforms import fields
        for user in users:
            if user.country:
                users_by_country[user.country] += 1
        params = {
            "data": users_by_country.items()
         }
        return self.render_template('admin/geochart.html', **params)


class EditProfileForm(forms.EditProfileForm):
    activated = fields.BooleanField('Activated')


class List(BaseHandler):
    def get(self):
        p = self.request.get('p')
        q = self.request.get('q')
        c = self.request.get('c')
        forward = True if p not in ['prev'] else False
        cursor = Cursor(urlsafe=c)

        if q:
            qry = models.User.query(ndb.OR(models.User.last_name == q,
                                           models.User.email == q,
                                           models.User.username == q))
        else:
            qry = models.User.query()

        PAGE_SIZE = 5
        if forward:

# Path: boilerplate/models.py
# class User(User):
# class LogVisit(ndb.Model):
# class LogEmail(ndb.Model):
# class SocialUser(ndb.Model):
#     def get_by_email(cls, email):
#     def create_resend_token(cls, user_id):
#     def validate_resend_token(cls, user_id, token):
#     def delete_resend_token(cls, user_id, token):
#     def get_social_providers_names(self):
#     def get_social_providers_info(self):
#     def get_by_user(cls, user):
#     def get_by_user_and_provider(cls, user, provider):
#     def get_by_provider_and_uid(cls, provider, uid):
#     def check_unique_uid(cls, provider, uid):
#     def check_unique_user(cls, provider, user):
#     def check_unique(cls, user, provider, uid):
#     def open_id_providers():
#     PROVIDERS_INFO = { # uri is for OpenID only (not OAuth)
#         'google': {'name': 'google', 'label': 'Google', 'uri': 'gmail.com'},
#         'github': {'name': 'github', 'label': 'Github', 'uri': ''},
#         'facebook': {'name': 'facebook', 'label': 'Facebook', 'uri': ''},
#         'linkedin': {'name': 'linkedin', 'label': 'LinkedIn', 'uri': ''},
#         'myopenid': {'name': 'myopenid', 'label': 'MyOpenid', 'uri': 'myopenid.com'},
#         'twitter': {'name': 'twitter', 'label': 'Twitter', 'uri': ''},
#         'yahoo': {'name': 'yahoo', 'label': 'Yahoo!', 'uri': 'yahoo.com'},
#     }
# 
# Path: boilerplate/handlers.py
# class AbTestHandler(BaseHandler):
# class LoginRequiredHandler(BaseHandler):
# class RegisterBaseHandler(BaseHandler):
# class SendEmailHandler(BaseHandler):
# class LoginHandler(BaseHandler):
# class SocialLoginHandler(BaseHandler):
# class CallbackSocialLoginHandler(BaseHandler):
# class DeleteSocialProviderHandler(BaseHandler):
# class LogoutHandler(BaseHandler):
# class RegisterHandler(RegisterBaseHandler):
# class AccountActivationHandler(BaseHandler):
# class ResendActivationEmailHandler(BaseHandler):
# class ContactHandler(BaseHandler):
# class EditProfileHandler(BaseHandler):
# class EditPasswordHandler(BaseHandler):
# class EditEmailHandler(BaseHandler):
# class PasswordResetHandler(BaseHandler):
# class PasswordResetCompleteHandler(BaseHandler):
# class EmailChangedCompleteHandler(BaseHandler):
#     def get(self):
#     def get(self):
#     def form(self):
#     def post(self):
#     def get(self):
#     def post(self):
#     def form(self):
#     def get(self, provider_name):
#     def get(self, provider_name):
#     def create_account_from_social_provider(self, provider_name, uid, email=None, continue_url=None, user_data=None):
#     def post(self, provider_name):
#     def get(self):
#     def get(self):
#     def post(self):
#     def get(self, user_id, token):
#     def get(self, user_id, token):
#     def get(self):
#     def post(self):
#     def form(self):
#     def get(self):
#     def post(self):
#     def form(self):
#     def get(self):
#     def post(self):
#     def form(self):
#     def get(self):
#     def post(self):
#     def form(self):
#     def get(self):
#     def post(self):
#     def get(self, user_id, token):
#     def post(self, user_id, token):
#     def form(self):
#     def get(self, user_id, encoded_email, token):


# Path: admin/users.py
import webapp2
from boilerplate import models
from boilerplate import forms
from boilerplate.handlers import BaseHandler
from google.appengine.datastore.datastore_query import Cursor
from google.appengine.ext import ndb
from google.appengine.api import users as googleusers
from collections import OrderedDict, Counter
from wtforms import fields

        for user in users:
            if user.country:
                users_by_country[user.country] += 1
        params = {
            "data": users_by_country.items()
         }
        return self.render_template('admin/geochart.html', **params)


class EditProfileForm(forms.EditProfileForm):
    activated = fields.BooleanField('Activated')


class List(BaseHandler):
    def get(self):
        p = self.request.get('p')
        q = self.request.get('q')
        c = self.request.get('c')
        forward = True if p not in ['prev'] else False
        cursor = Cursor(urlsafe=c)

        if q:
            qry = models.User.query(ndb.OR(models.User.last_name == q,
                                           models.User.email == q,
                                           models.User.username == q))
        else:
            qry = models.User.query()

        PAGE_SIZE = 5
        if forward:

            users, next_cursor, more = qry.order(models.User.key).fetch_page(PAGE_SIZE, start_cursor=cursor)