text
stringlengths
0
1.05M
meta
dict
from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.security import UserMixin, RoleMixin import datetime db = SQLAlchemy() ### Add models here roles_users = db.Table('roles_users', db.Column('user_id', db.Integer(), db.ForeignKey('user.id', ondelete='CASCADE')), d...
{ "repo_name": "Infinidat/lanister", "path": "flask_app/models.py", "copies": "1", "size": "3193", "license": "bsd-3-clause", "hash": 6723750696599749000, "line_mean": 37.4698795181, "line_max": 104, "alpha_frac": 0.6695897275, "autogenerated": false, "ratio": 3.4040511727078893, "config_test": ...
from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.security import UserMixin, RoleMixin # Create database connection object db = SQLAlchemy() # Define models roles_users = db.Table('roles_users', db.Column('user_id', db.Integer(), db.ForeignKey('user.id')), db.Column('role_id', db.Integer(), db.Foreig...
{ "repo_name": "ludwinas/editore", "path": "editor/models/__init__.py", "copies": "1", "size": "1228", "license": "mit", "hash": -1033578271757359400, "line_mean": 28.9512195122, "line_max": 72, "alpha_frac": 0.671009772, "autogenerated": false, "ratio": 3.3643835616438356, "config_test": false,...
from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.wtf import Form from wtforms import StringField, BooleanField, TextAreaField, SelectField, SubmitField, RadioField from wtforms.validators import Required, Length, Email, Regexp, EqualTo from wtforms import ValidationError from ..models import Interestedpeople,...
{ "repo_name": "codeforamerica/westsac-farm-stand", "path": "app/main/forms.py", "copies": "2", "size": "2123", "license": "mit", "hash": 6361796598745979000, "line_mean": 43.2291666667, "line_max": 98, "alpha_frac": 0.661328309, "autogenerated": false, "ratio": 4.146484375, "config_test": false...
from flask.ext.sqlalchemy import SQLAlchemy from flask import Flask import json app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root@localhost/test' db = SQLAlchemy(app) class User(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=1) username = db.Column(db.String(8...
{ "repo_name": "larusx/yunmark", "path": "design_sqlalchemy.py", "copies": "1", "size": "1449", "license": "mit", "hash": 7510336103178801000, "line_mean": 26.8846153846, "line_max": 69, "alpha_frac": 0.6570048309, "autogenerated": false, "ratio": 3.1846153846153844, "config_test": false, "has...
from flask.ext.sqlalchemy import SQLAlchemy from flask import Flask import os basedir = os.path.abspath(os.path.dirname(__file__)) app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = \ 'sqlite:///' + os.path.join(basedir, 'data.sqlite') app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True db = SQLAlchem...
{ "repo_name": "iannil/CarBack", "path": "models.py", "copies": "1", "size": "2884", "license": "unlicense", "hash": 2421585216193422000, "line_mean": 27.5643564356, "line_max": 61, "alpha_frac": 0.6230929265, "autogenerated": false, "ratio": 3.1144708423326133, "config_test": false, "has_no_k...
from flask.ext.sqlalchemy import SQLAlchemy from flask import Flask import os app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'postgres://jkrbnkekcosnxb:jOrPwurv94mnMu7acVpIX0W2sA@ec2-54-197-230-161.compute-1.amazonaws.com:5432/da79ahfav90021' db = SQLAlchemy(app) class Item(db.Model): __tablenam...
{ "repo_name": "hermaa02/cs330-final", "path": "db.py", "copies": "1", "size": "5927", "license": "apache-2.0", "hash": -1146811036715022200, "line_mean": 35.1463414634, "line_max": 183, "alpha_frac": 0.6844946853, "autogenerated": false, "ratio": 2.9182668636139835, "config_test": false, "has...
from flask.ext.sqlalchemy import SQLAlchemy from flask import Markup import calendar from datetime import datetime, timedelta class Model(): def __init__(self, app): self.db = SQLAlchemy(app) db = self.db class Category(self.db.Model): __tablename__ = 'category' ...
{ "repo_name": "mabruckner/reviews", "path": "model.py", "copies": "1", "size": "2436", "license": "mit", "hash": 5553047160574668000, "line_mean": 32.8333333333, "line_max": 124, "alpha_frac": 0.5402298851, "autogenerated": false, "ratio": 4.229166666666667, "config_test": false, "has_no_keyw...
from flask.ext.sqlalchemy import SQLAlchemy from flask import Markup import markdown import calendar from datetime import datetime, timedelta class Model(): def __init__(self, app): self.db = SQLAlchemy(app) db = self.db class Room(db.Model): __tablename__ = 'rooms' ...
{ "repo_name": "BenDoan/CosmicAC", "path": "model.py", "copies": "1", "size": "3645", "license": "mit", "hash": 2814303922319135000, "line_mean": 34.0480769231, "line_max": 124, "alpha_frac": 0.5429355281, "autogenerated": false, "ratio": 4.283196239717979, "config_test": false, "has_no_keywor...
from flask.ext.sqlalchemy import SQLAlchemy from flask_sqlalchemy import sqlalchemy import hashlib db = SQLAlchemy() class_mapper = sqlalchemy.orm.class_mapper class Base(db.Model): """ Base model from which other models will inherit from """ __abstract__ = True id = db.Column(db.Integer, primary_key=Tr...
{ "repo_name": "andela-ggikera/Bucket-list-app-API", "path": "app/models.py", "copies": "1", "size": "3764", "license": "mit", "hash": 9203162812454402000, "line_mean": 31.4482758621, "line_max": 78, "alpha_frac": 0.6049415515, "autogenerated": false, "ratio": 4.008519701810437, "config_test": f...
from flask.ext.sqlalchemy import SQLAlchemy from historyemergent import db, bcrypt from datetime import datetime import random import string class User(db.Model): """Basic user model with associated roles and documents.""" __tablename__ = 'user' uid = db.Column(db.Integer, primary_key = True) firstnam...
{ "repo_name": "kylewmoser/HistoryEmergent", "path": "historyemergent/users/models.py", "copies": "1", "size": "2669", "license": "mit", "hash": -2491125622344319000, "line_mean": 31.5609756098, "line_max": 109, "alpha_frac": 0.6178343949, "autogenerated": false, "ratio": 3.8737300435413644, "co...
from flask.ext.sqlalchemy import SQLAlchemy from . import app app.config['SQLALCHEMY_DATABASE_URI'] db = SQLAlchemy(app) class Artist(db.Model): """ A favorite music artist. """ __tablename__ = 'artists' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(200), unique=True...
{ "repo_name": "patrickbeeson/music-time-machine", "path": "app/models.py", "copies": "1", "size": "1776", "license": "mit", "hash": 6260307486872827000, "line_mean": 28.6, "line_max": 75, "alpha_frac": 0.6306306306, "autogenerated": false, "ratio": 3.3258426966292136, "config_test": false, "h...
from flask.ext.sqlalchemy import SQLAlchemy from models import DB, Team from fllipit import APP import api import random DB.app = APP DB.create_all() teams = [] for i in range(80): team = Team( number=i, name="My Team %i" % (i), affiliation="Some %i School" % (i), round1=random.ran...
{ "repo_name": "rtfoley/fllipit", "path": "create_db.py", "copies": "1", "size": "1053", "license": "mit", "hash": -7897119968383028000, "line_mean": 23.488372093, "line_max": 67, "alpha_frac": 0.6429249763, "autogenerated": false, "ratio": 2.9745762711864407, "config_test": false, "has_no_key...
from flask.ext.sqlalchemy import SQLAlchemy from passlib.apps import custom_app_context as pwd_context from conf import * import random import time import string db = SQLAlchemy() class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(USERNAME_MAXLEN)) password...
{ "repo_name": "spb201/rest-api", "path": "models.py", "copies": "2", "size": "4531", "license": "unlicense", "hash": 501464606674849700, "line_mean": 27.31875, "line_max": 117, "alpha_frac": 0.6482012801, "autogenerated": false, "ratio": 3.2809558291093412, "config_test": false, "has_no_keywo...
from flask.ext.sqlalchemy import SQLAlchemy from passlib.apps import custom_app_context as pwd_context import datetime import hashlib DB = SQLAlchemy() class Event(DB.Model): __tablename__ = "events" id = DB.Column(DB.Integer, primary_key=True) title = DB.Column(DB.Unicode) description = DB.Colu...
{ "repo_name": "pdxacm/acmapi", "path": "acmapi/models.py", "copies": "1", "size": "6231", "license": "bsd-3-clause", "hash": 2753625585580501500, "line_mean": 27.5825688073, "line_max": 81, "alpha_frac": 0.6040763922, "autogenerated": false, "ratio": 3.641729982466394, "config_test": false, "...
from flask.ext.sqlalchemy import SQLAlchemy from passlib.hash import bcrypt_sha256 from msla import db, app import os db = SQLAlchemy() class FileUpload(db.Model): """ Log file location on server """ __tablename__='upload' id = db.Column(db.Integer, primary_key=True) path = db.Column(db.String()) filename = db...
{ "repo_name": "Nguyen-Dang-Thu/MSLA", "path": "src/msla/models.py", "copies": "1", "size": "1861", "license": "mit", "hash": -1775891977681129700, "line_mean": 24.1486486486, "line_max": 125, "alpha_frac": 0.6738312735, "autogenerated": false, "ratio": 2.794294294294294, "config_test": false, ...
from flask.ext.sqlalchemy import SQLAlchemy from project_main import db import json def to_dictionary(inst, cls): """ dictionarize the sql alchemy query result. """ convert = dict() # add your coversions for things like datetime's # and what-not that aren't serializable. d = dict() for...
{ "repo_name": "krist-jin/flask_rest_template", "path": "project_main/models.py", "copies": "1", "size": "1129", "license": "apache-2.0", "hash": 441009762803549600, "line_mean": 26.5609756098, "line_max": 83, "alpha_frac": 0.5730735164, "autogenerated": false, "ratio": 3.5955414012738856, "conf...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.dialects.postgresql import HSTORE from sqlalchemy.ext.mutable import MutableDict db = SQLAlchemy() PersonType = db.Enum('driver', 'team-owner', 'crew-chief', 'vehicle-owner', 'team-principal', 'technical-chief', 'race-engineer', name='p...
{ "repo_name": "pitrho/motorsports-historic-data-api", "path": "app/models.py", "copies": "1", "size": "11163", "license": "mit", "hash": -5844749268592129000, "line_mean": 35.8415841584, "line_max": 104, "alpha_frac": 0.6927349279, "autogenerated": false, "ratio": 3.2803408756979135, "config_te...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.dialects.postgresql import TIMESTAMP from sqlalchemy import text db = SQLAlchemy() class Url(db.Model): __tablename__ = 'url' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String()) url = db.Column(db.String()) githu...
{ "repo_name": "trobert2/gitRoulette", "path": "models.py", "copies": "1", "size": "2615", "license": "apache-2.0", "hash": 5348252023074935000, "line_mean": 30.8902439024, "line_max": 78, "alpha_frac": 0.6126195029, "autogenerated": false, "ratio": 3.44532279314888, "config_test": false, "has...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.exc import DatabaseError from sqlalchemy.sql import func from socket import inet_aton, inet_ntoa from struct import unpack, pack from passlib.hash import bcrypt_sha256 import datetime import hashlib import json def sha512(string): return hashlib.sha512...
{ "repo_name": "breadchris/CTFd", "path": "CTFd/models.py", "copies": "1", "size": "6910", "license": "apache-2.0", "hash": 7682319627022268000, "line_mean": 29.4405286344, "line_max": 168, "alpha_frac": 0.6214182344, "autogenerated": false, "ratio": 3.260972156677678, "config_test": false, "h...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.exc import SQLAlchemyError from marshmallow import Schema, fields, validate db = SQLAlchemy() class Users(db.Model): id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(250), unique=True, nullable=False) name = db.Column(db.S...
{ "repo_name": "rosterloh/flask", "path": "app/users/models.py", "copies": "1", "size": "1063", "license": "mit", "hash": 898413875753517800, "line_mean": 24.9268292683, "line_max": 69, "alpha_frac": 0.6453433678, "autogenerated": false, "ratio": 3.729824561403509, "config_test": false, "has_n...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy import ForeignKey from sqlalchemy.sql import select from sqlalchemy.orm import relationship from sqlalchemy.dialects.postgresql import JSON, TEXT db = SQLAlchemy() #Column('user_id', Integer, ForeignKey("user.user_id"), nullable=False), class Persona(db.Mo...
{ "repo_name": "Patataman/StudentApi", "path": "models/modelos.py", "copies": "1", "size": "2565", "license": "mit", "hash": -129771963412806690, "line_mean": 28.1590909091, "line_max": 185, "alpha_frac": 0.7013645224, "autogenerated": false, "ratio": 2.691500524658972, "config_test": false, "...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy import Index db = SQLAlchemy() class Posts(db.Model): id = db.Column(db.Integer(), primary_key=True) post_id = db.Column(db.String(), index=True) post_date = db.Column(db.DateTime()) candidate = db.Column(db.String(), index=True) post_ms...
{ "repo_name": "scottydelta/fb_data_scraper", "path": "src/models.py", "copies": "1", "size": "1800", "license": "mit", "hash": 4598707615102745000, "line_mean": 39, "line_max": 124, "alpha_frac": 0.6444444444, "autogenerated": false, "ratio": 3.3088235294117645, "config_test": false, "has_no_...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy import inspect from sqlalchemy.orm import relationship, subqueryload, joinedload import datetime import json from pprint import pprint from inspect import getmembers db = SQLAlchemy() class BaseMixin(object): id = db.Column(db.Integer, primary_key=True)...
{ "repo_name": "tinta/uwrtourist", "path": "server/uwrtourist/models.py", "copies": "1", "size": "7303", "license": "mit", "hash": 2312562252831577600, "line_mean": 36.2602040816, "line_max": 179, "alpha_frac": 0.6004381761, "autogenerated": false, "ratio": 3.7470497691123654, "config_test": fal...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.orm import backref from flask.ext.presst import signals, fields, ModelResource, Relationship from tests import PresstTestCase class TestResourceMethod(PresstTestCase): def setUp(self): super(TestResourceMethod, self).setUp() app = self.a...
{ "repo_name": "stfp/flask-presst", "path": "tests/test_signals.py", "copies": "2", "size": "6116", "license": "mit", "hash": -3694109377653436400, "line_mean": 38.464516129, "line_max": 120, "alpha_frac": 0.5860039241, "autogenerated": false, "ratio": 4, "config_test": true, "has_no_keywords"...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.schema import UniqueConstraint import re class Model(): def __init__(self, app): self.db = SQLAlchemy(app) db = self.db class User(self.db.Model): __tablename__ = 'users' id = db.Column(db.Integer, prima...
{ "repo_name": "BenDoan/SPA", "path": "model.py", "copies": "1", "size": "5288", "license": "mit", "hash": -8054188590386787000, "line_mean": 37.0431654676, "line_max": 117, "alpha_frac": 0.5444402421, "autogenerated": false, "ratio": 4.288726682887267, "config_test": false, "has_no_keywords":...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.sql.expression import ClauseElement from sqlalchemy import event from sqlalchemy.orm import Session from app import app import re db = SQLAlchemy(app) # Checks if the model with given parameters exists. Returns an existing one if # it does, creates one and r...
{ "repo_name": "UoMCS/syllabus-visualisation", "path": "server/models.py", "copies": "1", "size": "4143", "license": "mit", "hash": -1965669654717656800, "line_mean": 29.0217391304, "line_max": 96, "alpha_frac": 0.6463915037, "autogenerated": false, "ratio": 3.368292682926829, "config_test": fal...
from flask.ext.sqlalchemy import SQLAlchemy from urllib.request import urlopen from urllib.parse import urlencode from website import app import codecs, json db = SQLAlchemy(app) def get_steam_userinfo(steam_id): options = { 'key': app.config['STEAM_API_KEY'], 'steamids': steam_id } url ...
{ "repo_name": "fparma/events", "path": "website/database.py", "copies": "1", "size": "3809", "license": "mit", "hash": 4186884139479653400, "line_mean": 28.3, "line_max": 115, "alpha_frac": 0.6127592544, "autogenerated": false, "ratio": 3.280792420327304, "config_test": false, "has_no_keyword...
from flask.ext.sqlalchemy import SQLAlchemy from util import hex_to_rgb, rgb_to_hex from time2words import relative_time_to_text from datetime import datetime from dateutil.tz import tzutc import pytz db = SQLAlchemy() def created_on_default(): return datetime.utcnow() class Counter(db.Model): __tablename__ ...
{ "repo_name": "YavorPaunov/await_backend", "path": "models.py", "copies": "1", "size": "3634", "license": "mit", "hash": 2203494156341407000, "line_mean": 30.0598290598, "line_max": 94, "alpha_frac": 0.6031920748, "autogenerated": false, "ratio": 3.566241413150147, "config_test": false, "has_...
from flask.ext.sqlalchemy import SQLAlchemy from werkzeug import generate_password_hash, check_password_hash import binascii import os import sqlalchemy db = SQLAlchemy() class Users(db.Model): __tablebname__ = "Users" uid = db.Column(db.Integer, primary_key = True) username = db.Column(db.String(100), un...
{ "repo_name": "GridProtectionAlliance/ARMORE", "path": "source/webServer/static/python/models.py", "copies": "1", "size": "2982", "license": "mit", "hash": 2671993687651904000, "line_mean": 27.1320754717, "line_max": 153, "alpha_frac": 0.6307847082, "autogenerated": false, "ratio": 3.554231227651...
from flask.ext.sqlalchemy import SQLAlchemy from werkzeug import generate_password_hash, check_password_hash import geocoder import urllib2 import json db = SQLAlchemy() class User(db.Model): __tablename__ = 'users' uid = db.Column(db.Integer, primary_key=True) firstname = db.Column(db.String(100)) ...
{ "repo_name": "ZhaoC/FlaskWebApp", "path": "models.py", "copies": "1", "size": "2025", "license": "mit", "hash": 8701031110205980000, "line_mean": 28.7794117647, "line_max": 152, "alpha_frac": 0.6395061728, "autogenerated": false, "ratio": 3.3088235294117645, "config_test": false, "has_no_key...
from flask.ext.sqlalchemy import SQLAlchemy from werkzeug import generate_password_hash, check_password_hash import geocoder import urllib2 import json db = SQLAlchemy() class User(db.Model): __tablename__ = 'users' uid = db.Column(db.Integer, primary_key = True) firstname = db.Column(db.String(100)) lastna...
{ "repo_name": "rxhl/Landmark", "path": "models.py", "copies": "2", "size": "2056", "license": "mit", "hash": -489200568612019650, "line_mean": 26.0526315789, "line_max": 152, "alpha_frac": 0.6459143969, "autogenerated": false, "ratio": 3.2791068580542264, "config_test": false, "has_no_keyword...
from flask.ext.sqlalchemy import SQLAlchemy import arrow import markdown2 import smartypants import blog db = SQLAlchemy(blog.app) # Models categories = db.Table('post_categories', db.Column('id', db.Integer, primary_key=True), db.Column('post_id', db.Integer, db.ForeignK...
{ "repo_name": "bpollack/blag", "path": "blog/utils.py", "copies": "1", "size": "3590", "license": "mit", "hash": 4501230651486249500, "line_mean": 30.4912280702, "line_max": 101, "alpha_frac": 0.5364902507, "autogenerated": false, "ratio": 3.604417670682731, "config_test": false, "has_no_keyw...
from flask.ext.sqlalchemy import SQLAlchemy import random from perform import zbarimg import json class Model(): def __init__(self, app): self.db = SQLAlchemy(app) db = self.db class Lichen(db.Model): id = db.Column(db.Integer, primary_key=True) short_name = db.Colu...
{ "repo_name": "mabruckner/urban-colonization", "path": "Model.py", "copies": "2", "size": "4366", "license": "mit", "hash": 6089239908024558000, "line_mean": 34.7868852459, "line_max": 100, "alpha_frac": 0.5, "autogenerated": false, "ratio": 4.166030534351145, "config_test": false, "has_no_ke...
from flask.ext.sqlalchemy import SQLAlchemy import random class Model(): def __init__(self, app): self.db = SQLAlchemy(app) db = self.db class Lichen(db.Model): id = db.Column(db.Integer, primary_key=True) short_name = db.Column(db.String) name = db.Colu...
{ "repo_name": "BenDoan/fhb", "path": "model.py", "copies": "1", "size": "2616", "license": "mit", "hash": 5043593526285043000, "line_mean": 32.974025974, "line_max": 100, "alpha_frac": 0.5179663609, "autogenerated": false, "ratio": 4.1856, "config_test": false, "has_no_keywords": false, "fe...
from flask.ext.sqlalchemy import SQLAlchemy import time db = SQLAlchemy() class User(db.Model): __tablename__ = 'User' id = db.Column(db.Integer, primary_key=True, autoincrement=True) username = db.Column(db.String, unique=True) post_karma = db.Column(db.Integer) comment_karma = db.Column(db.Inte...
{ "repo_name": "Jakeable/rforms", "path": "models.py", "copies": "1", "size": "2908", "license": "unlicense", "hash": 4326419034412987000, "line_mean": 42.4029850746, "line_max": 78, "alpha_frac": 0.6825997249, "autogenerated": false, "ratio": 3.449584816132859, "config_test": false, "has_no_k...
from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy() # Assocaition Tables question_tag = db.Table( 'QuestionTag', db.Column( 'QuestionID', db.Integer, db.ForeignKey('question.ID', ondelete="CASCADE")), db.Column( 'TagID', db.Integer, db.ForeignKey('tag.ID', ondelete="CASCADE"))) user_b...
{ "repo_name": "Bit-Monkeys/openfaqs", "path": "models.py", "copies": "2", "size": "6460", "license": "mit", "hash": -9016362116045172000, "line_mean": 32.8272251309, "line_max": 87, "alpha_frac": 0.7106811146, "autogenerated": false, "ratio": 3.1806991629739043, "config_test": false, "has_no_...
from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy() class CRUDMixin(object): __table_args__ = {'extend_existing': True} id = db.Column(db.Integer, primary_key=True) @classmethod def create(cls, commit=True, **kwargs): instance = cls(**kwargs) return instance.save(commit=co...
{ "repo_name": "JakubNvk/school", "path": "tia/project/project/data.py", "copies": "1", "size": "1486", "license": "mit", "hash": -5691959643271024000, "line_mean": 26.0363636364, "line_max": 76, "alpha_frac": 0.6110363392, "autogenerated": false, "ratio": 3.724310776942356, "config_test": false...
from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy() class Job(db.Model): id = db.Column(db.Integer, primary_key=True) number_one = db.Column(db.Integer) number_two = db.Column(db.Integer) answer = db.Column(db.Integer) status = db.Column(db.String) def __init__(self, number_one=Non...
{ "repo_name": "smoynes/get_a_job", "path": "get_a_job/models.py", "copies": "1", "size": "1269", "license": "mit", "hash": 4759985262598229000, "line_mean": 29.9512195122, "line_max": 80, "alpha_frac": 0.5587076438, "autogenerated": false, "ratio": 3.7544378698224854, "config_test": false, "h...
from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy() tags = db.Table( 'post_tags', db.Column('post_id', db.Integer, db.ForeignKey('post.id')), db.Column('tag_id', db.Integer, db.ForeignKey('tag.id')) ) class User(db.Model): id = db.Column(db.Integer(), primary_key=True) username = db.Col...
{ "repo_name": "abacuspix/NFV_project", "path": "Mastering Flask_Code Bundle/section4/wfdb/wfdb/models.py", "copies": "1", "size": "3020", "license": "mit", "hash": 2664751099939702300, "line_mean": 28.6078431373, "line_max": 73, "alpha_frac": 0.6059602649, "autogenerated": false, "ratio": 3.32965...
from flask.ext.sqlalchemy import SQLAlchemy from app import views # adding all from flask import Flask, session, redirect, url_for, escape, request, render_template,flash from flask_wtf import Form from flask import Blueprint import json, subprocess, os import datetime, logging from logging import Formatter, FileHand...
{ "repo_name": "rsubra13/atlasproj", "path": "app/__init__.py", "copies": "1", "size": "2071", "license": "apache-2.0", "hash": -7985113373482204000, "line_mean": 23.6547619048, "line_max": 91, "alpha_frac": 0.6924191212, "autogenerated": false, "ratio": 3.463210702341137, "config_test": false, ...
from flask.ext.sqlalchemy import SQLAlchemy from deadlines.app import app db = SQLAlchemy(app) class Schedule(db.Model): __tablename__ = 'schedules' id = db.Column(db.Integer, primary_key=True) class Task(db.Model): __tablename__ = 'schedules' # This translates to a package that would be inst...
{ "repo_name": "yougov/deadlines", "path": "deadlines/models.py", "copies": "1", "size": "1180", "license": "bsd-3-clause", "hash": 5602099535076855000, "line_mean": 27.0952380952, "line_max": 76, "alpha_frac": 0.6186440678, "autogenerated": false, "ratio": 3.4808259587020647, "config_test": fal...
from flask.ext.sqlalchemy import SQLAlchemy from socket import inet_aton, inet_ntoa from struct import unpack, pack from passlib.hash import bcrypt_sha256 import datetime import hashlib def sha512(string): return hashlib.sha512(string).hexdigest() def ip2long(ip): return unpack('!I', inet_aton(ip))[0] def ...
{ "repo_name": "Campbellb/CTFd", "path": "CTFd/models.py", "copies": "3", "size": "5878", "license": "apache-2.0", "hash": 8954702301959580000, "line_mean": 29.9368421053, "line_max": 168, "alpha_frac": 0.6150051038, "autogenerated": false, "ratio": 3.220821917808219, "config_test": false, "ha...
from flask.ext.sqlalchemy import SQLAlchemy class SQLAlchemyWrapper(SQLAlchemy): def __init__(self, app): super(SQLAlchemyWrapper, self).__init__(app) self.models = {} @classmethod def make(cls, app, *model_adders): inst = cls(app) for add_models...
{ "repo_name": "psusloparov/sneeze", "path": "pocket_change/pocket_change/database.py", "copies": "1", "size": "1159", "license": "apache-2.0", "hash": 1896011236665310700, "line_mean": 24.2173913043, "line_max": 57, "alpha_frac": 0.5383951682, "autogenerated": false, "ratio": 4.373584905660377, ...
from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy() class BasicModel(object): id_ = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(100)) def to_dict(self): raise NotImplementedError # Exception('NotImplemented') def to_json(self): pass def ...
{ "repo_name": "kxxoling/horus", "path": "horus/models.py", "copies": "1", "size": "1203", "license": "mit", "hash": 5953892811322792000, "line_mean": 21.6981132075, "line_max": 72, "alpha_frac": 0.6408977556, "autogenerated": false, "ratio": 3.2958904109589042, "config_test": false, "has_no_k...
from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy(session_options={'autocommit': True}) class Lecturer(db.Model): id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(254), unique=True, nullable=False) password = db.Column(db.String(100), nullable=False) active = db.Co...
{ "repo_name": "MACSIFS/IFS", "path": "server/models.py", "copies": "1", "size": "4645", "license": "mit", "hash": 3688713223547588000, "line_mean": 31.4825174825, "line_max": 96, "alpha_frac": 0.6441334769, "autogenerated": false, "ratio": 3.4715994020926755, "config_test": false, "has_no_key...
from flask.ext.sqlalchemy import SQLAlchemy # Setup SQLAlchemy database stub, which will be initialized inside create_app() factory. db = SQLAlchemy() class Data(object): """ Base class that all service-layer classes will inherit from. This provides basic service-layer functionality such as CRUD. ""...
{ "repo_name": "chiangf/flask-boiler", "path": "flaskboiler/data.py", "copies": "1", "size": "2510", "license": "apache-2.0", "hash": 2892943068388954000, "line_mean": 29.987654321, "line_max": 111, "alpha_frac": 0.615936255, "autogenerated": false, "ratio": 4.312714776632302, "config_test": fal...
from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.exc import SQLAlchemyError from marshmallow import Schema, fields, validate db = SQLAlchemy() # Relationships class Users(db.Model): id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(250), unique=True, nullable=Fal...
{ "repo_name": "Leo-G/Flask-Angularjs-JSON-Auth", "path": "app/users/models.py", "copies": "1", "size": "1634", "license": "mit", "hash": -6151543494249984000, "line_mean": 25.6949152542, "line_max": 69, "alpha_frac": 0.6138310894, "autogenerated": false, "ratio": 3.918465227817746, "config_test...
from flask.ext.sqlalchemy import SQLAlchemy, SignallingSession, SessionBase class _SignallingSession(SignallingSession): """A subclass of `SignallingSession` that allows for `binds` to be specified in the `options` keyword arguments. """ def __init__(self, db, autocommit=False, autoflush=True, **opti...
{ "repo_name": "Teddy-Schmitz/temperature_admin", "path": "app/database.py", "copies": "1", "size": "1102", "license": "mit", "hash": -6883440776404519000, "line_mean": 34.5483870968, "line_max": 90, "alpha_frac": 0.5843920145, "autogenerated": false, "ratio": 4.3046875, "config_test": false, ...
from flask.ext.stats import Stats from . import TestStats class TestAppRoutes(TestStats): def test_200(self): app = self._create_app('hello') stats = Stats().init_app(app) pipeline = self._setup_mocks(stats) client = app.test_client() client.get('/') pipeline.in...
{ "repo_name": "solarnz/Flask-Stats", "path": "tests/test_status_codes.py", "copies": "1", "size": "3324", "license": "bsd-3-clause", "hash": -2404934337227306000, "line_mean": 22.5744680851, "line_max": 47, "alpha_frac": 0.5592659446, "autogenerated": false, "ratio": 3.67292817679558, "config_t...
from flask.ext.testing import TestCase from flask.ext.fillin import FormWrapper from . import UserSessionTestCase from dexter.models import Document, db from tests.fixtures import dbfixture, DocumentData, UserData class TestEditArticleAnalysis(UserSessionTestCase): def setUp(self): super(TestEditArticleA...
{ "repo_name": "Code4SA/mma-dexter", "path": "tests/functional/test_edit_article_analysis.py", "copies": "1", "size": "1151", "license": "apache-2.0", "hash": 4008064134582415400, "line_mean": 30.9722222222, "line_max": 91, "alpha_frac": 0.674196351, "autogenerated": false, "ratio": 3.737012987012...
from flask.ext.testing import TestCase from flask import url_for, request import unittest from sample_application.models import Base from sample_application import app import json import os from mock import mock class TestServices(TestCase): '''Tests that each route is an http response''' def create_app(self)...
{ "repo_name": "adsabs/adsabs-webservices-blueprint", "path": "sample_application/tests/test_webservice.py", "copies": "1", "size": "1567", "license": "mit", "hash": 2455996820944772000, "line_mean": 30.9795918367, "line_max": 92, "alpha_frac": 0.6011486918, "autogenerated": false, "ratio": 3.5452...
from flask.ext.testing import TestCase from mc.app import create_app from mc.models import db, Commit, Build import datetime from dateutil.tz import tzlocal from sqlalchemy.exc import IntegrityError class TestModels(TestCase): """ Test flask-sqlalchemy database operations """ def create_app(self): ...
{ "repo_name": "adsabs/mission-control", "path": "mc/tests/unittests/test_database.py", "copies": "3", "size": "3168", "license": "mit", "hash": -1177907539336182000, "line_mean": 27.5405405405, "line_max": 82, "alpha_frac": 0.5741792929, "autogenerated": false, "ratio": 4.1520314547837485, "con...
from flask.ext.testing import TestCase from sample_application.app import create_app from sample_application.models import db, FavoriteColor class TestDatabase(TestCase): """ Test flask-sqlalchemy database operations """ def create_app(self): """ Called once at the beginning of the tes...
{ "repo_name": "jonnybazookatone/adsabs-webservices-blueprint", "path": "sample_application/tests/unittests/test_database.py", "copies": "1", "size": "1557", "license": "mit", "hash": -4920997146257554000, "line_mean": 30.16, "line_max": 78, "alpha_frac": 0.6043673732, "autogenerated": false, "rat...
from flask.ext.testing import TestCase import unittest import gb from flask import Flask, json, jsonify from gb import app, db, session from gb.models import User,Track import logging logging.basicConfig() LOG = logging.getLogger(__name__) class TrackTestCase(TestCase): def create_app(self): app = Flask(_...
{ "repo_name": "mbiokyle29/geno-browser", "path": "tests/test_tracks.py", "copies": "1", "size": "4972", "license": "mit", "hash": -6864619588264956000, "line_mean": 30.075, "line_max": 97, "alpha_frac": 0.5675784393, "autogenerated": false, "ratio": 3.949166004765687, "config_test": true, "ha...
from flask.ext.testing import TestCase import unittest, os import gb import copy from flask import Flask, json, jsonify from gb import app, db, session from gb.models import User,Track import logging logging.basicConfig() LOG = logging.getLogger(__name__) class TrackTestCase(TestCase): def create_app(self): ...
{ "repo_name": "mbiokyle29/geno-browser", "path": "tests/test_views.py", "copies": "1", "size": "7556", "license": "mit", "hash": 5818011719318073000, "line_mean": 29.4677419355, "line_max": 98, "alpha_frac": 0.5533350979, "autogenerated": false, "ratio": 3.9936575052854124, "config_test": true,...
from flask.ext.testing import TestCase from monetario.app import create_app from monetario.app import db from monetario.models import App from monetario.models import Token class BaseTestCase(TestCase): SQLALCHEMY_DATABASE_URI = "sqlite://" TESTING = True def setUp(self): db.create_all() de...
{ "repo_name": "monetario/core", "path": "monetario/tests/__init__.py", "copies": "1", "size": "1120", "license": "bsd-3-clause", "hash": -7546347625700205000, "line_mean": 21.8571428571, "line_max": 70, "alpha_frac": 0.6223214286, "autogenerated": false, "ratio": 3.5555555555555554, "config_tes...
from flask.ext.tuktuk.helpers import DotExpandedDict, Attribute class User(DotExpandedDict): """ :type login: str :type id: int """ def __init__(self, login=None, id=None): super(User, self).__init__(login=login, id=id) login = Attribute('login') id = Attribute('id') class Projec...
{ "repo_name": "aromanovich/flask-tuktuk", "path": "tests/testapp/app/helpers.py", "copies": "1", "size": "1163", "license": "bsd-3-clause", "hash": 1463583571626088200, "line_mean": 22.7346938776, "line_max": 99, "alpha_frac": 0.6122098022, "autogenerated": false, "ratio": 3.680379746835443, "c...
#from flask.ext.wtf import Form as WTForm #from wtforms.ext.sqlalchemy.orm import model_form from wtforms import validators from wtforms import BooleanField from wtforms import DecimalField from wtforms import Form from wtforms import IntegerField from wtforms import PasswordField from wtforms import SelectField from w...
{ "repo_name": "nkuttler/flaskwallet", "path": "walletapp/forms/wallet.py", "copies": "1", "size": "2061", "license": "bsd-3-clause", "hash": 7333741282594593000, "line_mean": 34.5344827586, "line_max": 90, "alpha_frac": 0.7297428433, "autogenerated": false, "ratio": 3.9710982658959537, "config_...
from flask.ext.wtf import Form, fields, validators, widgets from flask.ext.wtf import Required, Email, ValidationError from models import User from app import db def validate_login(form, field): user = form.get_user() if user is None: raise validators.ValidationError('Invalid user') # if user...
{ "repo_name": "rkk09c/Flask_Boilerplate", "path": "app/forms.py", "copies": "1", "size": "1499", "license": "mit", "hash": 4642709633673056000, "line_mean": 36.475, "line_max": 95, "alpha_frac": 0.6971314209, "autogenerated": false, "ratio": 4.222535211267606, "config_test": false, "has_no_ke...
from flaskext.wtf import Form, HiddenField, TextField, RecaptchaField, \ SubmitField, ValidationError, required, email, url from flaskext.babel import lazy_gettext as _ from newsmeme.models import User from .validators import is_username class OpenIdSignupForm(Form): next = HiddenField() usern...
{ "repo_name": "ericx10ng/newsmeme", "path": "newsmeme/forms/openid.py", "copies": "3", "size": "1433", "license": "bsd-3-clause", "hash": -1762056890177375700, "line_mean": 30.8444444444, "line_max": 72, "alpha_frac": 0.6092114445, "autogenerated": false, "ratio": 4.622580645161291, "config_tes...
from flask.ext.wtf import Form, HiddenField, TextField, RecaptchaField, \ SubmitField, ValidationError, required, email, url from flaskext.babel import lazy_gettext as _ from newsmeme.models import User from .validators import is_username class OpenIdSignupForm(Form): next = HiddenField() username...
{ "repo_name": "yangjiandong/newsmeme", "path": "newsmeme/forms/openid.py", "copies": "1", "size": "1418", "license": "bsd-3-clause", "hash": 7605849514192147000, "line_mean": 30.5111111111, "line_max": 73, "alpha_frac": 0.6156558533, "autogenerated": false, "ratio": 4.649180327868852, "config_t...
from flask.ext.wtf import Form, html5 from wtforms import StringField, PasswordField, BooleanField, HiddenField from wtforms.validators import DataRequired, Required from wtforms.widgets import TextArea class LoginForm(Form): ''' WTF-Forms for login, email is a string field, password is a password ...
{ "repo_name": "BaySchoolCS2/ProjectRepo", "path": "application/forms.py", "copies": "2", "size": "2091", "license": "mit", "hash": -2901995034247653400, "line_mean": 39.2115384615, "line_max": 86, "alpha_frac": 0.7025346724, "autogenerated": false, "ratio": 4.487124463519313, "config_test": fal...
from flask.ext.wtf import Form from flask.ext.babel import gettext from wtforms import StringField, BooleanField, TextAreaField from wtforms.validators import DataRequired, Length from app.models import User class LoginForm(Form): openid = StringField('openid', validators=[DataRequired()]) remember_me = Boolea...
{ "repo_name": "Akelio-zhang/sxk-microblog", "path": "app/forms.py", "copies": "2", "size": "1592", "license": "bsd-3-clause", "hash": 8669866539057826000, "line_mean": 40.9210526316, "line_max": 145, "alpha_frac": 0.6884422111, "autogenerated": false, "ratio": 4.314363143631437, "config_test": ...
from flask.ext.wtf import Form from flask.ext.babel import gettext from wtforms import StringField, BooleanField, TextAreaField from wtforms.validators import DataRequired, Length from .models import User class LoginForm(Form): openid = StringField('openid', validators=[DataRequired()]) remember_me = BooleanF...
{ "repo_name": "mahantheshhv/microblog", "path": "app/forms.py", "copies": "20", "size": "1604", "license": "bsd-3-clause", "hash": 5215605523254557000, "line_mean": 34.6444444444, "line_max": 78, "alpha_frac": 0.6546134663, "autogenerated": false, "ratio": 4.370572207084469, "config_test": fals...
from flask.ext.wtf import Form from flask.ext.babel import gettext from wtforms import StringField, BooleanField, TextAreaField from wtforms.validators import DataRequired, Length from wtforms.widgets import TextArea from .models import User class LoginForm(Form): openid = StringField('openid', validators=[DataRe...
{ "repo_name": "evanma92/routeh", "path": "app/forms.py", "copies": "1", "size": "1662", "license": "bsd-3-clause", "hash": -6551867533290150000, "line_mean": 35.1304347826, "line_max": 80, "alpha_frac": 0.6606498195, "autogenerated": false, "ratio": 4.339425587467363, "config_test": false, "h...
from flask.ext.wtf import Form from flask.ext.babel import gettext from wtforms import StringField, BooleanField, TextAreaField # DataRequired is a validator, a function that # can be attached to a field to perform validation # on the data submitted by the user. from wtforms.validators import DataRequired, Length from...
{ "repo_name": "staeff/megaflask", "path": "app/forms.py", "copies": "1", "size": "1916", "license": "bsd-3-clause", "hash": 6469731062248482000, "line_mean": 38.9166666667, "line_max": 84, "alpha_frac": 0.6638830898, "autogenerated": false, "ratio": 4.424942263279446, "config_test": false, "h...
from flask.ext.wtf import Form from flask.ext.babel import gettext from wtforms import TextField, BooleanField, RadioField from wtforms.validators import Required, Regexp, Optional from wtforms import IntegerField, HiddenField from wtforms import ValidationError from wtforms.validators import StopValidation from wtform...
{ "repo_name": "nukru/projectQ", "path": "app/surveys/forms.py", "copies": "1", "size": "13100", "license": "apache-2.0", "hash": 1587732927276072700, "line_mean": 44.6480836237, "line_max": 124, "alpha_frac": 0.5426717557, "autogenerated": false, "ratio": 4.640453418349273, "config_test": false...
from flask.ext.wtf import Form from flask.ext.babel import gettext from wtforms.validators import Required, Email, Length from wtforms import TextField,StringField, PasswordField, BooleanField, SubmitField from wtforms.validators import Required, Length, Email from validator import ValidateEmail, ValidateDNI class Lo...
{ "repo_name": "nukru/Swarm-Surveys", "path": "app/auth/forms.py", "copies": "1", "size": "1323", "license": "apache-2.0", "hash": 3451350487602829000, "line_mean": 40.34375, "line_max": 83, "alpha_frac": 0.6802721088, "autogenerated": false, "ratio": 4.469594594594595, "config_test": false, "...
from flask.ext.wtf import Form from flask.ext.login import login_required, current_user from wtforms import StringField, TextAreaField, BooleanField, SelectField,\ SubmitField, IntegerField, DateField, SelectMultipleField, HiddenField from wtforms.validators import Required, Length, Email, Regexp from wtforms impor...
{ "repo_name": "sargentfrancesca/newlynpolls", "path": "app/main/forms.py", "copies": "1", "size": "5800", "license": "mit", "hash": 75696972647822510, "line_mean": 48.5726495726, "line_max": 204, "alpha_frac": 0.6493103448, "autogenerated": false, "ratio": 4.116394606103619, "config_test": fals...
from flask.ext.wtf import Form from flask.ext.pagedown.fields import PageDownField from wtforms import StringField, PasswordField, BooleanField, SelectField, FileField from wtforms.validators import DataRequired class LoginForm(Form): username = StringField('username', validators=[DataRequired()]) password = ...
{ "repo_name": "embik/bloks", "path": "bloks/forms.py", "copies": "1", "size": "1176", "license": "mit", "hash": 5601211206341901000, "line_mean": 31.6666666667, "line_max": 84, "alpha_frac": 0.7329931973, "autogenerated": false, "ratio": 4.260869565217392, "config_test": false, "has_no_keywor...
from flask.ext.wtf import Form from flask.ext.pagedown.fields import PageDownField from wtforms import StringField, SubmitField, TextAreaField, BooleanField, SelectField from wtforms.validators import Required, Length, Email, EqualTo, Regexp from ..models import Role,User class NameForm(Form): name = StringField(...
{ "repo_name": "menghao2015/MyBlog", "path": "myapp/main/forms.py", "copies": "1", "size": "2039", "license": "mit", "hash": -8993666713000792000, "line_mean": 37.4716981132, "line_max": 108, "alpha_frac": 0.7150564002, "autogenerated": false, "ratio": 3.5646853146853146, "config_test": false, ...
from flask.ext.wtf import Form from flask.ext.pagedown.fields import PageDownField from wtforms import StringField, TextAreaField, BooleanField, SelectField,\ SubmitField from wtforms.validators import DataRequired, Length, Email, Regexp from wtforms import ValidationError from ..models import Role, User class Na...
{ "repo_name": "vmintam/flasky_older", "path": "app/main/forms.py", "copies": "1", "size": "2260", "license": "mit", "hash": 6036101960255717000, "line_mean": 40.0909090909, "line_max": 78, "alpha_frac": 0.6296460177, "autogenerated": false, "ratio": 4.264150943396227, "config_test": false, "h...
from flask.ext.wtf import Form from flask.ext.pagedown.fields import PageDownField from wtforms import StringField, TextAreaField, BooleanField, SelectField, SubmitField from wtforms.validators import Required, Length, Email, Regexp from wtforms import ValidationError from ..models import Role, User class NameForm(Fo...
{ "repo_name": "LokiSharp/Sharloki-Blog", "path": "app/main/forms.py", "copies": "1", "size": "2238", "license": "mit", "hash": -2426980547397547500, "line_mean": 40.4444444444, "line_max": 86, "alpha_frac": 0.627792672, "autogenerated": false, "ratio": 4.2628571428571425, "config_test": false, ...
from flask.ext.wtf import Form from flask.ext.pagedown.fields import PageDownField from wtforms import StringField, TextAreaField, SubmitField,BooleanField,SelectField from wtforms.validators import Length,Email,Required,Regexp from ..models import Role,User class EditProfileForm(Form): name = StringField('Real ...
{ "repo_name": "chenke91/LearnFlask", "path": "app/main/forms.py", "copies": "1", "size": "2175", "license": "mit", "hash": -1878669038911590400, "line_mean": 40.8461538462, "line_max": 84, "alpha_frac": 0.6243678161, "autogenerated": false, "ratio": 4.248046875, "config_test": false, "has_no_...
from flask.ext.wtf import Form from flask.ext.pagedown.fields import PageDownField from wtforms import TextField, SubmitField from wtforms.validators import Required, Length class EditProfileForm(Form): first_name = TextField('First Name', [Required(), Length(1, 255)]) last_name = TextField('Last Name', [Requ...
{ "repo_name": "maxnovais/Flapy_Blog", "path": "app/admin/forms.py", "copies": "1", "size": "1120", "license": "apache-2.0", "hash": -8335184601648228000, "line_mean": 30.1111111111, "line_max": 70, "alpha_frac": 0.6633928571, "autogenerated": false, "ratio": 3.6482084690553744, "config_test": f...
from flask.ext.wtf import Form from flask.ext.wtf.file import FileField, FileAllowed, FileRequired from wtforms import StringField, SubmitField, BooleanField, PasswordField, ValidationError from wtforms.validators import InputRequired, Length, Regexp, EqualTo from app.models import User class SettingsForm(Form): ...
{ "repo_name": "dkmva/igem-wiki-wizard", "path": "app/admin/forms.py", "copies": "1", "size": "1894", "license": "mit", "hash": 944362369749865000, "line_mean": 43.0465116279, "line_max": 107, "alpha_frac": 0.6135163675, "autogenerated": false, "ratio": 4.945169712793733, "config_test": false, ...
from flask.ext.wtf import Form # from flask.ext.wtf.file import FileField, FileRequired, FileAllowed from wtforms import TextField, PasswordField, validators from app import db from models import User, Locator #---------------------------------------------------------------------------- class LoginForm(Form): ema...
{ "repo_name": "samitnuk/urlsaver", "path": "app/forms.py", "copies": "1", "size": "2339", "license": "mit", "hash": 2473511311918441000, "line_mean": 40.0350877193, "line_max": 79, "alpha_frac": 0.5365540829, "autogenerated": false, "ratio": 5.174778761061947, "config_test": false, "has_no_ke...
from flask.ext.wtf import Form from flask.ext.wtf.html5 import EmailField from flask.ext.login import current_user from wtforms import ( StringField, PasswordField, BooleanField, SelectField, TextAreaField) from wtforms.validators import InputRequired, Email, Length, EqualTo, Optional from wtforms.validators import...
{ "repo_name": "N402/NoahsArk", "path": "ark/account/forms.py", "copies": "1", "size": "3536", "license": "mit", "hash": -7658510734179365000, "line_mean": 30.2920353982, "line_max": 79, "alpha_frac": 0.6012443439, "autogenerated": false, "ratio": 4.244897959183674, "config_test": false, "has_...
from flask.ext.wtf import Form from flask.ext.wtf.html5 import EmailField, URLField from flask.ext.wtf.recaptcha import RecaptchaField from wtforms.fields import TextField, PasswordField from wtforms.validators import DataRequired, EqualTo from wtforms.validators import Email as EmailValidator from wtforms.validators i...
{ "repo_name": "iamteem/app_mailreg", "path": "app_mailreg/forms.py", "copies": "1", "size": "1107", "license": "mit", "hash": 382925232476818800, "line_mean": 40, "line_max": 79, "alpha_frac": 0.7425474255, "autogenerated": false, "ratio": 4.2251908396946565, "config_test": false, "has_no_key...
from flask.ext.wtf import Form from flask.ext.wtf import BooleanField, QuerySelectField, SubmitField from ..extensions import db from ..fields import * from ..utils import get_season from ..roster.models import Team, PersonTeam class HoursDetailForm(Form): def __init__(self, *args, **kwargs): super(HoursD...
{ "repo_name": "team294/surfmanage", "path": "surfmanage/hours/forms.py", "copies": "1", "size": "1278", "license": "bsd-3-clause", "hash": 6177524874067993000, "line_mean": 29.4285714286, "line_max": 77, "alpha_frac": 0.6291079812, "autogenerated": false, "ratio": 3.6306818181818183, "config_te...
from flask.ext.wtf import Form from flask.ext.wtf import BooleanField, TextField, QuerySelectField, SubmitField from flask.ext.wtf import RadioField from flask.ext.wtf.html5 import IntegerField from flask.ext.wtf import Required, NumberRange from ..extensions import db from ..fields import * from ..utils import get_sea...
{ "repo_name": "team294/surfmanage", "path": "surfmanage/roster/forms.py", "copies": "1", "size": "4539", "license": "bsd-3-clause", "hash": -3949992776364790300, "line_mean": 30.5208333333, "line_max": 83, "alpha_frac": 0.6411103767, "autogenerated": false, "ratio": 3.7204918032786884, "config_...
from flask.ext.wtf import Form from flask.ext.wtf import Form from wtforms import StringField, BooleanField, TextAreaField, IntegerField, SelectField, RadioField, HiddenField, SubmitField from wtforms.validators import DataRequired, Length, InputRequired from app.models import World, Race class MakeWorld(Form): wo...
{ "repo_name": "Summerotter/dawnofworlds", "path": "app/game/forms.py", "copies": "1", "size": "4999", "license": "mit", "hash": 6627318038028712000, "line_mean": 31.8947368421, "line_max": 158, "alpha_frac": 0.6655331066, "autogenerated": false, "ratio": 3.7957479119210324, "config_test": false...
from flask.ext.wtf import Form from flask.ext.wtf import Required, EqualTo, Length, Regexp, ValidationError from flask.ext.wtf import TextField, PasswordField, BooleanField from mmc.models import User, Website class SiteForm(Form): domain = TextField("Domain", [Required(), Regexp("^[a-zA-Z0-9\-]+\.mmcbox\.com$",...
{ "repo_name": "jpeddicord/mmcbox", "path": "mmc/forms.py", "copies": "1", "size": "1038", "license": "mit", "hash": 2202660357628868600, "line_mean": 37.4444444444, "line_max": 157, "alpha_frac": 0.704238921, "autogenerated": false, "ratio": 3.830258302583026, "config_test": false, "has_no_ke...
from flaskext.wtf import Form from flaskext.wtf import SelectMultipleField, IntegerField, HiddenField, TextField, SelectField from flaskext.wtf import TextInput, HiddenInput, Required from flaskext.babel import lazy_gettext as _ class SizedTextInput(TextInput): def __init__(self, size, input_type=None): s...
{ "repo_name": "tokibito/flask-hgwebcommit", "path": "hgwebcommit/forms.py", "copies": "1", "size": "1153", "license": "bsd-3-clause", "hash": -5069402747008314000, "line_mean": 31.0277777778, "line_max": 95, "alpha_frac": 0.7215958369, "autogenerated": false, "ratio": 4.017421602787456, "config...
from flask.ext.wtf import Form from flask import render_template, flash, redirect from wtforms import StringField, BooleanField from wtforms.validators import DataRequired import requests from bs4 import BeautifulSoup import mechanize import cookielib from BeautifulSoup import BeautifulSoup import html2text from urlpar...
{ "repo_name": "vams1991/Security-Tool", "path": "app/XSSModule.py", "copies": "1", "size": "4361", "license": "bsd-3-clause", "hash": 2883741490048963000, "line_mean": 34.1774193548, "line_max": 137, "alpha_frac": 0.5331346022, "autogenerated": false, "ratio": 3.2838855421686746, "config_test":...
from flask.ext.wtf import Form from flask import session from wtforms import TextField, PasswordField, BooleanField, SubmitField, validators from msla import db from .models import Users from passlib.hash import bcrypt_sha256 from .utils import sha512 import os class LoginForm(Form): user = TextField('User',[validato...
{ "repo_name": "Nguyen-Dang-Thu/MSLA", "path": "src/msla/forms.py", "copies": "1", "size": "1151", "license": "mit", "hash": 1728819626751835600, "line_mean": 31.8857142857, "line_max": 136, "alpha_frac": 0.7211120765, "autogenerated": false, "ratio": 3.425595238095238, "config_test": false, "...
from flask.ext.wtf import Form from flask_wtf.file import FileField from wtforms import TextField, HiddenField, RadioField, BooleanField, \ SubmitField, IntegerField, FormField, StringField, PasswordField, \ SelectField from wtforms import validators, ValidationError from wtforms.validators import Requi...
{ "repo_name": "juliannieb/StudentsApp", "path": "forms.py", "copies": "1", "size": "16470", "license": "apache-2.0", "hash": 8980750388214262000, "line_mean": 79.3414634146, "line_max": 111, "alpha_frac": 0.2999392835, "autogenerated": false, "ratio": 6.0131434830230015, "config_test": false, ...
from flask.ext.wtf import Form from flask_wtf.file import InputRequired from wtforms.fields import (FieldList, FormField, RadioField, SelectField, SelectMultipleField, SubmitField) class NavigationForm(Form): submit_next = SubmitField('Next') submit_cancel = SubmitField('Cancel') ...
{ "repo_name": "AsylumConnect/asylum-connect-catalog", "path": "app/bulk_resource/forms.py", "copies": "2", "size": "1207", "license": "mit", "hash": 366253977316793900, "line_mean": 29.9487179487, "line_max": 76, "alpha_frac": 0.7183098592, "autogenerated": false, "ratio": 4.35740072202166, "co...
from flask.ext.wtf import Form from flask_wtf.file import ( InputRequired ) from wtforms.fields import ( FieldList, FormField, RadioField, SubmitField, TextAreaField, StringField, SelectField, SelectMultipleField ) from wtforms.validators import Length class NavigationForm(Form): ...
{ "repo_name": "hack4impact/maps4all-jlc-sp2", "path": "app/bulk_resource/forms.py", "copies": "1", "size": "1434", "license": "mit", "hash": -8687155923844186000, "line_mean": 26.5769230769, "line_max": 104, "alpha_frac": 0.7189679219, "autogenerated": false, "ratio": 4.180758017492711, "config...
from flask.ext.wtf import Form from models import Base, User from wtforms import TextField, PasswordField, validators, SelectField, SelectMultipleField, TextAreaField from wtforms.validators import Required, EqualTo, Length, URL, Email, Optional # Set your classes here. class BaseForm(Form): class Meta: c...
{ "repo_name": "john-osullivan/inContext", "path": "forms.py", "copies": "1", "size": "2745", "license": "mit", "hash": 270610991158924220, "line_mean": 47.1754385965, "line_max": 148, "alpha_frac": 0.6877959927, "autogenerated": false, "ratio": 3.9667630057803467, "config_test": false, "has_n...
from flask.ext.wtf import Form from sqlalchemy import func from wtforms import StringField, BooleanField, SelectField,\ SubmitField, TextAreaField from wtforms.validators import Required, Length, Email, Regexp from wtforms import ValidationError from ..models import Role, User class NameForm(Form): name = Str...
{ "repo_name": "jykntr/wishlist", "path": "app/main/forms.py", "copies": "1", "size": "2271", "license": "mit", "hash": -8793057822363048000, "line_mean": 38.1551724138, "line_max": 95, "alpha_frac": 0.6243945399, "autogenerated": false, "ratio": 4.27683615819209, "config_test": false, "has_no...
from flask.ext.wtf import Form from sqlalchemy import func from wtforms import StringField, PasswordField, BooleanField, SubmitField from wtforms.validators import Required, Length, Email, Regexp, EqualTo from wtforms import ValidationError from ..models import User class LoginForm(Form): user = StringField('Emai...
{ "repo_name": "jykntr/wishlist", "path": "app/auth/forms.py", "copies": "1", "size": "3240", "license": "mit", "hash": 4814470931169442000, "line_mean": 44, "line_max": 95, "alpha_frac": 0.6398148148, "autogenerated": false, "ratio": 4.695652173913044, "config_test": false, "has_no_keywords":...
from flask.ext.wtf import Form from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound from wtforms import fields from wtforms.validators import Email, InputRequired, ValidationError from .models import User class LoginForm(Form): email = fields.StringField(validators=[InputRequired(), Email()]) p...
{ "repo_name": "ChristopherGS/sensor_readings", "path": "app/users/forms.py", "copies": "1", "size": "1480", "license": "bsd-3-clause", "hash": 9010676220843085000, "line_mean": 36, "line_max": 74, "alpha_frac": 0.6885135135, "autogenerated": false, "ratio": 4.610591900311526, "config_test": fal...
from flask.ext.wtf import Form from table import ItemTable, Item from wtforms import TextField, BooleanField, TextAreaField from wtforms.validators import Required, Length from flask.ext.babel import gettext from app.models import User class LoginForm(Form): openid = TextField('openid', validators = [Required()]) ...
{ "repo_name": "Abi1ity/uniclust2.0", "path": "app/forms.py", "copies": "1", "size": "3110", "license": "bsd-3-clause", "hash": -3482263672411955700, "line_mean": 32.8043478261, "line_max": 145, "alpha_frac": 0.6662379421, "autogenerated": false, "ratio": 3.815950920245399, "config_test": false,...
from flask.ext.wtf import Form from webapp.models import User from wtforms import StringField, PasswordField, SubmitField, ValidationError, HiddenField, TextAreaField from wtforms.validators import length, email, regexp, equal_to, required, optional usernname_validators = [ required(), length(User.const.userna...
{ "repo_name": "aleksandergurin/news", "path": "webapp/account/forms.py", "copies": "1", "size": "2589", "license": "bsd-3-clause", "hash": -2091433358074600700, "line_mean": 38.8307692308, "line_max": 104, "alpha_frac": 0.7207415991, "autogenerated": false, "ratio": 4.251231527093596, "config_t...
from flask.ext.wtf import Form from wtforms.ext.sqlalchemy.orm import model_form from wtforms.ext.sqlalchemy.fields import QuerySelectField from wtforms import fields as f, validators from deployer import database as db from . import models from deployer.hosts.models import Host class ConfirmationForm(Form): pa...
{ "repo_name": "GaretJax/docker-deployer", "path": "deployer/applications/forms.py", "copies": "1", "size": "2167", "license": "mit", "hash": -489299817987847360, "line_mean": 27.1428571429, "line_max": 78, "alpha_frac": 0.5939086294, "autogenerated": false, "ratio": 4.042910447761194, "config_t...
from flask.ext.wtf import Form from wtforms.ext.sqlalchemy.orm import model_form from wtforms import TextField, IntegerField, HiddenField, SelectField from wtforms.validators import DataRequired from ..db import db from .location import Location from .driver import Driver schedule_locations_start = db.Table( "schedul...
{ "repo_name": "streed/IndependentStudy", "path": "app/models/schedule.py", "copies": "1", "size": "3226", "license": "mit", "hash": 6564475302571966000, "line_mean": 40.358974359, "line_max": 186, "alpha_frac": 0.6788592684, "autogenerated": false, "ratio": 3.0782442748091605, "config_test": fa...
from flask.ext.wtf import Form from wtforms.fields import (BooleanField, FieldList, SelectField, SelectMultipleField, SubmitField, TextField) from wtforms.validators import InputRequired, Length class NewDescriptorForm(Form): desc_type = SelectField( 'Descriptor type', ...
{ "repo_name": "AsylumConnect/asylum-connect-catalog", "path": "app/descriptor/forms.py", "copies": "2", "size": "1616", "license": "mit", "hash": 5586039756538012000, "line_mean": 31.9795918367, "line_max": 76, "alpha_frac": 0.7122524752, "autogenerated": false, "ratio": 4.297872340425532, "con...
from flask.ext.wtf import Form from wtforms.fields import IntegerField from wtforms.validators import NumberRange, Required from wtforms.widgets import Input class RangeWidget(Input): def __init__(self): self.input_type = 'range' def __call__(self, field, **kwargs): kwargs.setdefault('step',...
{ "repo_name": "crossgovernmentservices/csdigital-prototype", "path": "application/skills/forms.py", "copies": "1", "size": "1268", "license": "mit", "hash": 4753727843747102000, "line_mean": 33.2702702703, "line_max": 70, "alpha_frac": 0.6222397476, "autogenerated": false, "ratio": 4.198675496688...
from flask.ext.wtf import Form from wtforms.fields import ( BooleanField, FieldList, SelectField, SelectMultipleField, SubmitField, TextField ) from wtforms.validators import InputRequired, Length class NewDescriptorForm(Form): desc_type = SelectField('Descriptor type', ...
{ "repo_name": "hack4impact/maps4all-jlc-sp2", "path": "app/descriptor/forms.py", "copies": "1", "size": "1687", "license": "mit", "hash": 2974136987401562600, "line_mean": 29.6727272727, "line_max": 77, "alpha_frac": 0.68227623, "autogenerated": false, "ratio": 4.4162303664921465, "config_test"...