text
stringlengths
0
1.05M
meta
dict
from fooapp import FooApp, start_app import feedparser import logging from time import sleep, time from ncore.data import FileStore from ncore.daemon import become_daemon from ncore.rest import request, tinyurl try: import json except ImportError: import simplejson as json class Digg(FooApp): name = 'digg' config_...
{ "repo_name": "JeremyGrosser/foobox", "path": "digg.py", "copies": "1", "size": "1697", "license": "bsd-3-clause", "hash": 1995740602596490200, "line_mean": 25.9365079365, "line_max": 200, "alpha_frac": 0.6700058928, "autogenerated": false, "ratio": 2.9108061749571186, "config_test": false, "...
from fooapp import FooApp, start_app import feedparser import sys from time import sleep from ncore.data import FileStore from ncore.daemon import become_daemon try: import json except ImportError: import simplejson as json class RSS(FooApp): name = 'rss' config_opts = {} def __init__(self, user): FooApp.__ini...
{ "repo_name": "JeremyGrosser/foobox", "path": "rss.py", "copies": "1", "size": "1159", "license": "bsd-3-clause", "hash": -5944064984405658000, "line_mean": 18.9827586207, "line_max": 48, "alpha_frac": 0.6453839517, "autogenerated": false, "ratio": 2.840686274509804, "config_test": false, "ha...
from fooapp import FooApp, start_app import logging import sys from time import sleep from urllib import urlopen, quote import re from ncore.data import FileStore from ncore.daemon import become_daemon from ncore.rest import request try: import json except ImportError: import simplejson as json class GoogleSMS...
{ "repo_name": "JeremyGrosser/foobox", "path": "google_sms.py", "copies": "1", "size": "2759", "license": "bsd-3-clause", "hash": 5721953248445456000, "line_mean": 29.3186813187, "line_max": 77, "alpha_frac": 0.5030808264, "autogenerated": false, "ratio": 4.0101744186046515, "config_test": false...
from fooapp import FooApp, start_app import pownce import logging from time import sleep from ncore.data import FileStore from ncore.daemon import become_daemon try: import json except ImportError: import simplejson as json class Pownce(FooApp): name = 'pownce' def __init__(self, server=None): FooApp.__init__(s...
{ "repo_name": "JeremyGrosser/foobox", "path": "powncer.py", "copies": "1", "size": "1204", "license": "bsd-3-clause", "hash": 1297975981814700800, "line_mean": 21.7169811321, "line_max": 90, "alpha_frac": 0.6602990033, "autogenerated": false, "ratio": 2.9152542372881354, "config_test": false, ...
from fooapp import FooApp, start_app import twitter import logging import sys from time import sleep from traceback import format_exc from ncore.data import FileStore from ncore.daemon import become_daemon try: import json except ImportError: import simplejson as json class Twitter(FooApp): name = 'twitter...
{ "repo_name": "JeremyGrosser/foobox", "path": "tweet.py", "copies": "1", "size": "1880", "license": "bsd-3-clause", "hash": -105390752623963140, "line_mean": 29.8196721311, "line_max": 120, "alpha_frac": 0.5505319149, "autogenerated": false, "ratio": 4.32183908045977, "config_test": false, "h...
from fooapp import FooApp, start_app import xmpp from time import sleep from ncore.data import FileStore from ncore.daemon import become_daemon from traceback import format_exc import logging class Jabber(FooApp): name = 'jabber' config_opts = { 'username': 'The User ID to connect to the Jabber service...
{ "repo_name": "JeremyGrosser/foobox", "path": "jabber.py", "copies": "1", "size": "2218", "license": "bsd-3-clause", "hash": 3250420646786223600, "line_mean": 34.2063492063, "line_max": 111, "alpha_frac": 0.6082055906, "autogenerated": false, "ratio": 3.9256637168141593, "config_test": false, ...
from foodgame.entities import EntityLiving from foodgame.util import Point from pygame.locals import K_UP, K_DOWN, K_LEFT, K_RIGHT ## Class for the player. class Player(): ## Player Constructor. def __init__(self, game): self.game = game self.entity = EntityLiving(game) self.entity.spr...
{ "repo_name": "trashbyte/hungryboys", "path": "foodgame/player.py", "copies": "1", "size": "1425", "license": "mit", "hash": -1862558126061115100, "line_mean": 30, "line_max": 108, "alpha_frac": 0.6077192982, "autogenerated": false, "ratio": 3.527227722772277, "config_test": false, "has_no_ke...
from foodgame.util import Point from .asset_manager import AssetManager ## A structure representing the state of the world viewport. class Camera(): ## Camera constructor. # @param game The owning Game def __init__(self, game): ## The owning Game. self.game = game ## Position of th...
{ "repo_name": "trashbyte/hungryboys", "path": "foodgame/camera.py", "copies": "1", "size": "1341", "license": "mit", "hash": 8526434206727395000, "line_mean": 28.152173913, "line_max": 71, "alpha_frac": 0.5779269202, "autogenerated": false, "ratio": 3.5196850393700787, "config_test": false, "...
from foo import Foo import types def external_document(): return document.getElementById('a') def require_file_module(): f = Foo() return f.bar() def require_sub_file_module(): f = Foo() return f.yum() def test_window_global(): return my_global_foo('suck ass') def what_is_love(): f = Foo() return f.wha...
{ "repo_name": "marshall/titanium", "path": "apps/drillbit/Resources/tests/python/python.py", "copies": "1", "size": "1902", "license": "apache-2.0", "hash": 5293610270457126000, "line_mean": 17.2884615385, "line_max": 42, "alpha_frac": 0.683491062, "autogenerated": false, "ratio": 2.6978723404255...
from foo.project_settings import * from foo.audio_video import excerpt_and_compile_video_file import sys # import json # DEPRECATED import csv import re MIN_CONFIDENCE = 0.0 """ TODO refactor into separate CLI-subcommands CSV makes for bad numerical data... """ if __name__ == '__main__': """ usage: ...
{ "repo_name": "audip/youtubeseek", "path": "watsoncloud/supercut.py", "copies": "1", "size": "2262", "license": "mit", "hash": 3367027846565816000, "line_mean": 33.2727272727, "line_max": 100, "alpha_frac": 0.6383731211, "autogenerated": false, "ratio": 3.381165919282511, "config_test": false, ...
from foosball.games.models import Game, Team, Player def update_player_stats(instance): """ Update player win and played counts for players of a Team. :param instance: Team that will be used to update players. :type instance: Team """ for user in instance.players.all(): totals = {1: 0...
{ "repo_name": "andersinno/foosball", "path": "foosball/games/stats.py", "copies": "1", "size": "2969", "license": "mit", "hash": 4522383374713182700, "line_mean": 31.2717391304, "line_max": 95, "alpha_frac": 0.5025261031, "autogenerated": false, "ratio": 3.891218872870249, "config_test": false,...
from fooster.web import web import mock test_request = 'GET / HTTP/1.1\r\n' + '\r\n' def bad_read(self): raise Exception() def run(request, handler=None, timeout=None, keepalive=True, initial_timeout=None, read_exception=False, close=True, skip=False): if not isinstance(request, bytes): request ...
{ "repo_name": "fkmclane/web.py", "path": "tests/test_request.py", "copies": "1", "size": "5050", "license": "mit", "hash": 4769360395781526000, "line_mean": 24, "line_max": 129, "alpha_frac": 0.6532673267, "autogenerated": false, "ratio": 3.2496782496782495, "config_test": true, "has_no_keywo...
from fooster.web import web import pytest test_key = 'Magical' test_value = 'header' test_header = test_key + ': ' + test_value + '\r\n' poor_key = 'not' poor_value = 'good' poor_header = poor_key + ':' + poor_value + '\r\n' good_header = poor_key + ': ' + poor_value + '\r\n' case_key = 'wEIrd' case_key_title = c...
{ "repo_name": "fkmclane/web.py", "path": "tests/test_header.py", "copies": "1", "size": "5961", "license": "mit", "hash": -7112483124708896000, "line_mean": 20.9963099631, "line_max": 85, "alpha_frac": 0.6594531119, "autogenerated": false, "ratio": 3.295190713101161, "config_test": true, "has...
from football.models import Score, Team from django.views.generic import TemplateView from datetime import date, timedelta from pylab import figure, barh, yticks, xlabel, title, grid, savefig, arange, ylabel, clf from functions import append, add class WeekOverview(TemplateView): # overview of all the data for the ...
{ "repo_name": "keizik/table-football", "path": "src/table-football/football/overview.py", "copies": "1", "size": "2363", "license": "bsd-3-clause", "hash": 7649948659652685000, "line_mean": 29.7012987013, "line_max": 89, "alpha_frac": 0.6707575116, "autogenerated": false, "ratio": 3.0608808290155...
from football.models import Score, Team from django.views.generic import TemplateView from django.db.models import Q class TeamProfile(TemplateView): # shows team info template_name = "team.html" def get_context_data(self, **kwargs): context = super(TeamProfile, self).get_context_data(**kwargs) teamId =...
{ "repo_name": "keizik/table-football", "path": "src/table-football/football/team.py", "copies": "1", "size": "2836", "license": "bsd-3-clause", "hash": 8109352818469288000, "line_mean": 29.8260869565, "line_max": 122, "alpha_frac": 0.6272919605, "autogenerated": false, "ratio": 3.1233480176211454...
from football.models import Team from django.db.models import Count # appends new value to the dictionary (unless it is already there) def append(dict, key, val): if dict.has_key(key): return dict else: dict[key] = val return dict # does addition to the dictionary item based on key (team) def add(dict, team,...
{ "repo_name": "keizik/table-football", "path": "src/table-football/football/functions.py", "copies": "1", "size": "2191", "license": "bsd-3-clause", "hash": -4655959975855434000, "line_mean": 38.8545454545, "line_max": 154, "alpha_frac": 0.7183934277, "autogenerated": false, "ratio": 3.3146747352...
from forbiddenfruit import curse as improve import sys from functools import reduce, partial from itertools import * import operator as op from collections import abc # import all the modules before extending types import requests import json # types ITERABLE = {tuple, list, set, str, dict, abc.Iterable, range, map,...
{ "repo_name": "Dentosal/ImbaPython", "path": "imba.py", "copies": "1", "size": "5086", "license": "mit", "hash": -4348412748602824700, "line_mean": 34.8169014085, "line_max": 101, "alpha_frac": 0.6148250098, "autogenerated": false, "ratio": 3.536856745479833, "config_test": false, "has_no_key...
from forbiddenfruit import curse from forbiddenfruit import reverse as reverse_the_curse import inspect import abc import re from types import FunctionType, CodeType # this whole bit does unspeakable things, # but so does the rest of this library. # if there's an issue with extension methods # not appearing, check he...
{ "repo_name": "DirectXMan12/should_be", "path": "should_be/core.py", "copies": "1", "size": "16377", "license": "isc", "hash": 3052333326164620000, "line_mean": 36.2204545455, "line_max": 78, "alpha_frac": 0.5220125786, "autogenerated": false, "ratio": 4.191707192219094, "config_test": false, ...
from forcegp_module import GaussianProcess from quippy import AtomsList import random import pickle from forcegp_module import GaussianProcess, iv_default_params import numpy as np tmp = iv_default_params() exps = tmp[:,0] r_cuts = tmp[:,1] database_whole = AtomsList('silicon_db.xyz') teach_idx = random.sample(range(...
{ "repo_name": "marcocaccin/MarcoGP", "path": "gogogo.py", "copies": "1", "size": "1277", "license": "apache-2.0", "hash": 2170469560537993500, "line_mean": 27.3777777778, "line_max": 127, "alpha_frac": 0.6961628818, "autogenerated": false, "ratio": 2.6114519427402865, "config_test": false, "h...
from forecaster import Forecaster from time_series.fuzzy_time_series import Fuzzy_time_series from time_series.time_series import Time_Series from time_series.forex_tick import Forex_Tick from time_series.enrollment_tick import Enrollment_tick from time_series.taiex_tick import Taiex_tick from random_walk.random_walk i...
{ "repo_name": "mikesligo/FYP-fuzzy-time-series", "path": "results.py", "copies": "1", "size": "3021", "license": "mit", "hash": 515681836008360500, "line_mean": 44.1044776119, "line_max": 151, "alpha_frac": 0.6285998014, "autogenerated": false, "ratio": 3.4058624577226606, "config_test": false,...
from forecast import make_job_file, JobState, process_arguments, load_sys_cfg import json import logging import sys,glob import os.path as osp simulations_path = osp.abspath('simulations') # copy here job_id/wfc catalog_path = osp.join(simulations_path,'catalog.json') try: catalog = json.load(open(catalog_path,...
{ "repo_name": "vejmelkam/wrfxpy", "path": "src/recover_catalog.py", "copies": "1", "size": "3721", "license": "mit", "hash": 1975557905202621400, "line_mean": 42.7764705882, "line_max": 106, "alpha_frac": 0.5283525934, "autogenerated": false, "ratio": 3.564176245210728, "config_test": false, ...
from forecastio.utils import UnicodeMixin, PropertyUnavailable import datetime import requests class Forecast(UnicodeMixin): def __init__(self, data, response, headers): self.response = response self.http_headers = headers self.json = data self._alerts = [] for alertJSON ...
{ "repo_name": "treeeferrrr/frogcast", "path": "app/lib/forecastio/models.py", "copies": "5", "size": "3642", "license": "apache-2.0", "hash": -6635552961171510000, "line_mean": 27.2325581395, "line_max": 75, "alpha_frac": 0.5345963756, "autogenerated": false, "ratio": 4.157534246575342, "config...
from forecast.ZipCodeUtil import latLonNameForZipcode class Location(object): """ A latitude/longitude-based location with optional zip code and name information. """ def __init__(self, zipOrLatLon): """ :param zipOrLatLon: location to get the forecast for. either a zip code string o...
{ "repo_name": "matthewcornell/peepweather", "path": "forecast/Location.py", "copies": "1", "size": "1605", "license": "apache-2.0", "hash": -8864812896521764000, "line_mean": 38.1463414634, "line_max": 115, "alpha_frac": 0.600623053, "autogenerated": false, "ratio": 3.75, "config_test": false, ...
from foreman import define_parameter from templates import pods (define_parameter('image-version') .with_doc('HAProxy image version.') .with_default('2.0.3')) @pods.app_specifier def haproxy_app(_): return pods.App( name='haproxy', exec=[ '/usr/local/sbin/haproxy', '-f...
{ "repo_name": "clchiou/garage", "path": "shipyard/rules/third-party/haproxy/build.py", "copies": "1", "size": "1265", "license": "mit", "hash": -5341915690565625000, "line_mean": 22.4259259259, "line_max": 76, "alpha_frac": 0.5122529644, "autogenerated": false, "ratio": 3.6142857142857143, "con...
from foreman import get_relpath, rule from garage import scripts from templates.common import define_distro_packages GRAFANA_DEB = 'grafana_5.1.4_amd64.deb' GRAFANA_DEB_URI = 'https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.1.4_amd64.deb' GRAFANA_DEB_CHECKSUM = 'sha256-bbec4cf6112c4c2654b679ae...
{ "repo_name": "clchiou/garage", "path": "shipyard/rules/third-party/grafana/build.py", "copies": "1", "size": "1581", "license": "mit", "hash": -5107738849125998000, "line_mean": 27.2321428571, "line_max": 103, "alpha_frac": 0.6470588235, "autogenerated": false, "ratio": 3.0403846153846152, "co...
from forestry_game.models import Level, Report from django.contrib.auth.models import User from rest_framework import serializers class RegisterSerializer(serializers.ModelSerializer): class Meta: model = User fields = ('id', 'username', 'password', 'email') def create(self, validated_data): user = User.obje...
{ "repo_name": "nime88/forestry-game", "path": "forestry_game/serializers.py", "copies": "1", "size": "1801", "license": "mit", "hash": -7813334450411069000, "line_mean": 31.7636363636, "line_max": 86, "alpha_frac": 0.7196002221, "autogenerated": false, "ratio": 3.3538175046554937, "config_test"...
from forge import Forge import logging import waiting import pytest _logger = logging.getLogger(__name__) @pytest.fixture def forge(request): returned = Forge() @request.addfinalizer def cleanup(): returned.verify() returned.restore_all_replacements() return returned @pytest.fix...
{ "repo_name": "vmalloc/waiting", "path": "tests/conftest.py", "copies": "1", "size": "2293", "license": "bsd-3-clause", "hash": 3010993035834325500, "line_mean": 26.2976190476, "line_max": 100, "alpha_frac": 0.617531618, "autogenerated": false, "ratio": 4.238447319778189, "config_test": true, ...
from forge import UnexpectedCall, ExpectedEventsNotFound, SignatureException from .ut_utils import ForgeTestCase class RecordReplayTest(ForgeTestCase): def setUp(self): super(RecordReplayTest, self).setUp() def some_function(a, b, c): raise NotImplementedError() self.stub = self...
{ "repo_name": "vmalloc/pyforge", "path": "tests/test__record_replay.py", "copies": "1", "size": "4152", "license": "bsd-3-clause", "hash": 905600240153797400, "line_mean": 38.1698113208, "line_max": 76, "alpha_frac": 0.6078998073, "autogenerated": false, "ratio": 3.6135770234986944, "config_tes...
from forgewiki.command.base import WikiCommand from forgewiki.command.wiki2markdown.extractors import MySQLExtractor from forgewiki.command.wiki2markdown.loaders import MediawikiLoader from allura.command import base as allura_base class Wiki2MarkDownCommand(WikiCommand): """Import MediaWiki to Allura Wiki tool""...
{ "repo_name": "Bitergia/allura", "path": "ForgeWiki/forgewiki/command/wiki2markdown/__init__.py", "copies": "2", "size": "3724", "license": "apache-2.0", "hash": 8130948789373191000, "line_mean": 44.4146341463, "line_max": 78, "alpha_frac": 0.5797529538, "autogenerated": false, "ratio": 4.3863368...
from formaggio.models import get_formaggio_form_model from rest_framework import serializers from ..models import FormaggioField FormaggioForm = get_formaggio_form_model() class FormaggioFieldReadSerializer(serializers.ModelSerializer): class Meta: model = FormaggioField fields = ( 'id'...
{ "repo_name": "scotu/django-formaggio", "path": "formaggio/drf_serializers/form_builder.py", "copies": "1", "size": "1375", "license": "bsd-3-clause", "hash": -5073388909864157000, "line_mean": 24.9433962264, "line_max": 78, "alpha_frac": 0.5650909091, "autogenerated": false, "ratio": 4.217791411...
#from formalchemy import FieldSet from flask.ext.wtf import (Form, TextField, Required, TextAreaField, FloatField, BooleanField, DateTimeField, widgets, validators) from wtforms.ext.sqlalchemy.fields import QuerySelectField from cfmi.billing.models import User, Sessi...
{ "repo_name": "nocko/cfmi", "path": "cfmi/billing/forms.py", "copies": "1", "size": "2014", "license": "bsd-3-clause", "hash": 4112521522753452000, "line_mean": 40.9583333333, "line_max": 97, "alpha_frac": 0.6742800397, "autogenerated": false, "ratio": 4.036072144288577, "config_test": false, ...
from formalchemy.tests import * def test_rebind_and_render(self): """Explicitly test rebind + render: >>> g = Grid(User, session=session) >>> g.rebind([bill, john]) >>> print(pretty_html(g.render())) <thead> <tr> <th> Email </th> <th> Password </th> ...
{ "repo_name": "camptocamp/formalchemy", "path": "formalchemy/tests/test_tables.py", "copies": "2", "size": "6525", "license": "mit", "hash": 7764258895122546000, "line_mean": 29.7783018868, "line_max": 332, "alpha_frac": 0.5377777778, "autogenerated": false, "ratio": 3.2641320660330164, "config...
from formalchemy.tests import * from formalchemy.fields import DateTimeFieldRenderer import datetime class Dt(Base): __tablename__ = 'dts' id = Column('id', Integer, primary_key=True) foo = Column('foo', Date, nullable=True) bar = Column('bar', Time, nullable=True) foobar = Column('foobar', DateTim...
{ "repo_name": "abourget/formalchemy-abourget", "path": "formalchemy/tests/test_dates.py", "copies": "1", "size": "36613", "license": "mit", "hash": 6779505472491679000, "line_mean": 13.8772856562, "line_max": 329, "alpha_frac": 0.5363668642, "autogenerated": false, "ratio": 2.977877185847906, "...
from formalchemy.tests import * from formalchemy.fields import DateTimeFieldRenderer import datetime class Dt(Base): __tablename__ = 'dts' id = Column('id', Integer, primary_key=True) foo = Column('foo', Date, nullable=True) bar = Column('bar', Time, nullable=True) foobar = Column('foobar', DateTi...
{ "repo_name": "camptocamp/formalchemy", "path": "formalchemy/tests/test_dates.py", "copies": "2", "size": "11395", "license": "mit", "hash": 292626834294125200, "line_mean": 23.9343544858, "line_max": 329, "alpha_frac": 0.5598946907, "autogenerated": false, "ratio": 2.8782520838595604, "config_...
from .formatbase import FormatBase from .microdvd import MicroDVDFormat from .subrip import SubripFormat from .jsonformat import JSONFormat from .substation import SubstationFormat from .txt_generic import TXTGenericFormat, MPL2Format from .exceptions import * #: Dict mapping file extensions to format identifiers. FIL...
{ "repo_name": "pannal/Subliminal.bundle", "path": "Contents/Libraries/Shared/pysubs2/formats.py", "copies": "1", "size": "2172", "license": "mit", "hash": -4306110457341772000, "line_mean": 30.9411764706, "line_max": 88, "alpha_frac": 0.6855432781, "autogenerated": false, "ratio": 4.0073800738007...
from .format_edges import format_edge def adj_matrix(vertices, formatted_edges, visual = False): """ Generates an adjacency matrix for a graph G with n vertices and E edges Args: vertices: The number of vertices (should be numbered 0 to n - 1 / 1 to n) formatted_edges: List of edges of graph G (formatted) v...
{ "repo_name": "aryrobocode/apothecary", "path": "apothecary/cs/graphs/adjacency.py", "copies": "1", "size": "2720", "license": "mit", "hash": -269178116481824830, "line_mean": 24.6698113208, "line_max": 81, "alpha_frac": 0.6650735294, "autogenerated": false, "ratio": 3.0425055928411635, "config...
from .format import DrmFormat from .framebuffer import DrmFramebuffer from .buffer import DrmDumbBuffer class DrmImageFramebuffer(DrmFramebuffer): def __init__(self, drm=None, format_=None, width=None, height=None, bo=None): if drm and format_ and width and height and bo is None: bo = DrmDumbB...
{ "repo_name": "notro/pydrm", "path": "pydrm/image.py", "copies": "1", "size": "1233", "license": "mit", "hash": 3732994123326634000, "line_mean": 40.1, "line_max": 99, "alpha_frac": 0.6163828062, "autogenerated": false, "ratio": 3.378082191780822, "config_test": false, "has_no_keywords": fals...
from format import Format from message import MessageType from random import randint class Processor(object): def __init__(self): pass def process_message(self, data): m = Format.format(data) m_type = m.get_type() body = m.get_body() cert = "123456" if self....
{ "repo_name": "tantexian/sps-2014-12-4", "path": "sps/api/v1/socket/processor.py", "copies": "1", "size": "1597", "license": "apache-2.0", "hash": 707956436318831000, "line_mean": 29.1320754717, "line_max": 66, "alpha_frac": 0.5754539762, "autogenerated": false, "ratio": 3.7843601895734595, "co...
from format import REXByte from io import BytesIO import xml.etree.ElementTree as ET opCodeData = ET.fromstring(open("x86-64-ref.xml").read()) bytesToName = {} prefixes = [] def extactOpCodes(superHeading): ocs = {} superGroup = opCodeData.find(superHeading) for ocXML in superGroup.findall(".//pri_opcd...
{ "repo_name": "meawoppl/purgatory", "path": "tape/disasm/hardway.py", "copies": "1", "size": "4260", "license": "bsd-2-clause", "hash": -8217833880980387000, "line_mean": 20.9587628866, "line_max": 71, "alpha_frac": 0.5774647887, "autogenerated": false, "ratio": 3.0559540889526544, "config_test...
from formation_flight.aircraft.models import Aircraft from lib.geo.waypoint import Waypoint from lib.geo.route import Route from lib.geo.visualization import GCMapper from formation_flight.hub.builders import Builder import config def run(): planes = [ Aircraft('FLT001', Route([Waypoint('AMS'), Waypoin...
{ "repo_name": "mauzeh/formation-flight", "path": "sandbox/locate_hubs.py", "copies": "1", "size": "1834", "license": "mit", "hash": 1209329474908266500, "line_mean": 34.2884615385, "line_max": 75, "alpha_frac": 0.592693566, "autogenerated": false, "ratio": 3.257548845470693, "config_test": fals...
from formative.models import FormativeBlob, InlineFormativeBlob from formative.registry import FormativeType from tests.testproject.testapp.forms import ( SimpleForm, FieldsetForm, FancyForm, BookRelatedForm) class SimpleType(FormativeType): name = 'simple' form_class = SimpleForm class FieldsetIdentifi...
{ "repo_name": "jaap3/django-formative", "path": "tests/testproject/testapp/formative_types.py", "copies": "1", "size": "1384", "license": "mit", "hash": 2060930273480630800, "line_mean": 26.137254902, "line_max": 71, "alpha_frac": 0.6437861272, "autogenerated": false, "ratio": 3.512690355329949, ...
from formatter2 import Formatter def test_assignment(): assert Formatter.format_string('a = 1') == 'a = 1\n\n' assert Formatter.format_string('a != b') == 'a != b\n\n' assert Formatter.format_string('a % b') == 'a % b\n\n' assert Formatter.format_string('a %= b') == 'a %= b\n\n' assert Formatter.f...
{ "repo_name": "WoLpH/python-formatter", "path": "tests/test_operators.py", "copies": "1", "size": "2309", "license": "bsd-3-clause", "hash": 3700016719945067500, "line_mean": 50.3111111111, "line_max": 68, "alpha_frac": 0.5465569511, "autogenerated": false, "ratio": 2.8021844660194173, "config_...
from formatter2 import (TokenOffsets, TokenOffset, TOKEN_OFFSETS, tokens, _stringio) import pytest import logging def test_default_type(): TOKEN_OFFSETS['something_not_existing'] = None def test_token_offsets(): t = TokenOffsets(None) assert repr(t) assert TOKEN_OFFSETS['=']....
{ "repo_name": "WoLpH/python-formatter", "path": "tests/test_tokens.py", "copies": "1", "size": "1033", "license": "bsd-3-clause", "hash": -1013690508562720800, "line_mean": 19.66, "line_max": 73, "alpha_frac": 0.5343659245, "autogenerated": false, "ratio": 3.011661807580175, "config_test": true...
from formatter.AbstractFormatter import AbstractFormatter import html import os class IndexElement: anchor = 0 def __init__(self, content): self.content = content self.a = IndexElement.anchor self.node_list = [] IndexElement.anchor += 1 def addNode(self, e): self....
{ "repo_name": "vdjagilev/desefu-export", "path": "formatter/html/HtmlFormatter.py", "copies": "1", "size": "7031", "license": "mit", "hash": 8867363136421968000, "line_mean": 39.1771428571, "line_max": 156, "alpha_frac": 0.456976248, "autogenerated": false, "ratio": 4.185119047619048, "config_t...
>>> from formatter import AbstractFormatter , NullWriter >>> from htmllib import HTMLParser >>> from string import join >>> class myWriter ( NullWriter ): ... def send_flowing_data( self, str ): ... self . _bodyText . append ( str ) ... def __init__ ( self ): ... NullWriter.__init__ ( self ) ......
{ "repo_name": "ActiveState/code", "path": "recipes/Python/135005_Simple_Applicatihtmllib_Parsing/recipe-135005.py", "copies": "1", "size": "1259", "license": "mit", "hash": 7350155516825687000, "line_mean": 45.6296296296, "line_max": 265, "alpha_frac": 0.6314535346, "autogenerated": false, "ratio...
from .formatter import ExternalFormatter, Formatter from .formatters import format_json class FormatterRegistry: def __init__(self): self.__formatters = [] def populate(self): self.__formatters = [ ExternalFormatter('Clang', command='clang-format'), ExternalFormatter('...
{ "repo_name": "Rypac/sublime-format", "path": "plugin/registry.py", "copies": "1", "size": "1341", "license": "mit", "hash": 4896026770688036000, "line_mean": 33.3846153846, "line_max": 78, "alpha_frac": 0.5973154362, "autogenerated": false, "ratio": 4.339805825242719, "config_test": false, "...
from formatter import format_string import pyparsing as pp DEBUG = True def debug(*args, **kwargs): if DEBUG: print(*args, **kwargs) class no_depth_list(list): """Class that does not allow any nested lists to be appended, any iterables appended will be unpacked first """ def __lshift__(self, ...
{ "repo_name": "nitros12/Cpu_emulator", "path": "wew compiler/compiler.py", "copies": "1", "size": "23625", "license": "mit", "hash": -2343393302166887400, "line_mean": 31.2305593452, "line_max": 172, "alpha_frac": 0.5578835979, "autogenerated": false, "ratio": 3.8049605411499434, "config_test":...
from .formatter import Formatter from .token import TokenGenerator class NamedTuple(object): """\ Make our own version of namedtuple that isn't so ugly. If the class name is not given, all attributes are capitalized and concatenated to 'NamedTuple' as the class name. :: HelloWorldNamedTuple...
{ "repo_name": "clibc/shorten", "path": "shorten/base.py", "copies": "1", "size": "7178", "license": "mit", "hash": 7354647855316033000, "line_mean": 27.4841269841, "line_max": 84, "alpha_frac": 0.5929228197, "autogenerated": false, "ratio": 3.9966592427616927, "config_test": false, "has_no_ke...
from ..formatter import QuestionFormatter, QuizFormatter from ._utils import _escape_special_chars, CORRECT_ANSWER_CHAR, WRONG_ANSWER_CHAR class GiftQuestionFormatter(QuestionFormatter): pass class DefaultGiftQuestionFormatter(GiftQuestionFormatter): def to_string(self, question): if question.commen...
{ "repo_name": "scls19fr/python-lms-tools", "path": "lms_tools/gift/formatter.py", "copies": "1", "size": "1424", "license": "mit", "hash": 9004563526854232000, "line_mean": 33.7317073171, "line_max": 110, "alpha_frac": 0.5526685393, "autogenerated": false, "ratio": 3.595959595959596, "config_te...
from .formatters import default_formatters class Formatter(object): formatters = default_formatters() def __init__(self, imports=None): self.htchar = " " * 4 self.lfchar = "\n" self.indent = 0 self.imports = imports def __call__(self, value, **args): return self.f...
{ "repo_name": "syrusakbary/snapshottest", "path": "snapshottest/formatter.py", "copies": "1", "size": "1142", "license": "mit", "hash": 2714265830756193000, "line_mean": 29.8648648649, "line_max": 80, "alpha_frac": 0.642732049, "autogenerated": false, "ratio": 4.47843137254902, "config_test": f...
from formatting import print_call import credentials import os.path import re import xmlrpclib def api_call(method_name, endpoint, params=[], user_name="alice", verbose=False): key_path, cert_path = "%s-key.pem" % (user_name,), "%s-cert.pem" % (user_name,) res = ssl_call(method_name, params, endpoint, key_pa...
{ "repo_name": "ict-felix/stack", "path": "modules/resource/manager/stitching-entity/src/core/utils/calls.py", "copies": "2", "size": "4733", "license": "apache-2.0", "hash": 3555748959167627300, "line_mean": 46.8080808081, "line_max": 132, "alpha_frac": 0.6598351997, "autogenerated": false, "rati...
from formatting import print_call import credentials import os.path import re import xmlrpclib def _get_ch_params(): # Initialise variables when required from core.config import FullConfParser fcp = FullConfParser() username = fcp.get("auth.conf").get("certificates").get("username") ch_host = fcp...
{ "repo_name": "dana-i2cat/felix", "path": "modules/resource/orchestrator/src/core/utils/calls.py", "copies": "1", "size": "5912", "license": "apache-2.0", "hash": -1136094323294068000, "line_mean": 44.8294573643, "line_max": 132, "alpha_frac": 0.6579837618, "autogenerated": false, "ratio": 3.4512...
from .formatting import svenv_flavored_markdown from markdown2 import Markdown from textwrap import dedent from unittest import TestCase class MarkdownTest(TestCase): """ Tests svenv flavored markdown against specification found on: http://daringfireball.net/projects/markdown/basics Newlines are ignored ...
{ "repo_name": "svenvandescheur/svenv.nl-app", "path": "svenv/blog/templatetags/test.py", "copies": "1", "size": "10230", "license": "mit", "hash": -2556824872725748000, "line_mean": 26.4289544236, "line_max": 116, "alpha_frac": 0.4746823069, "autogenerated": false, "ratio": 4.177215189873418, "...
from formcreator import Text, Integer, TextArea, File def transform_id_form(): return Text("Transform Id", "The unique id / alias for a node corresponding to a transform, its input, and its parameters.", cmd_opt="transform_id") def data_namespace_form(): return Text("Data Namespace", "The namespace of the dat...
{ "repo_name": "diogo149/ProtoML-clojure", "path": "client/forms.py", "copies": "1", "size": "1872", "license": "apache-2.0", "hash": -5837854314565340000, "line_mean": 45.8, "line_max": 152, "alpha_frac": 0.7142094017, "autogenerated": false, "ratio": 3.8282208588957056, "config_test": false, ...
from .form_data import FormData import uuid try: # pragma: no cover from urllib import quote_plus except ImportError: # pragma: no cover from urllib.parse import quote_plus class Form(object): def __init__(self, data=None, boundary=None): """ Creates a new Form object, which is used to...
{ "repo_name": "EvanDarwin/poster3", "path": "poster/form.py", "copies": "1", "size": "5976", "license": "mit", "hash": 1962025438484965600, "line_mean": 32.5730337079, "line_max": 114, "alpha_frac": 0.5724564926, "autogenerated": false, "ratio": 4.593389700230592, "config_test": false, "has_n...
from form_designer.contrib.cms_plugins.form_designer_form.models import CMSFormDefinition from form_designer.exceptions import HttpRedirectException from form_designer.views import process_form from form_designer import settings from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from dj...
{ "repo_name": "guilleCoro/django-form-designer", "path": "form_designer/contrib/cms_plugins/form_designer_form/cms_plugins.py", "copies": "1", "size": "1659", "license": "bsd-3-clause", "hash": 7454906697719100000, "line_mean": 32.8571428571, "line_max": 117, "alpha_frac": 0.6889692586, "autogenera...
from form_designer.contrib.cms_plugins.form_designer_form.models import CMSFormDefinition from form_designer.views import process_form from form_designer import settings from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext as _ class FormDes...
{ "repo_name": "housleyjk/django-form-designer", "path": "form_designer/contrib/cms_plugins/form_designer_form/cms_plugins.py", "copies": "1", "size": "1025", "license": "bsd-3-clause", "hash": 8222598476270492000, "line_mean": 33.1666666667, "line_max": 108, "alpha_frac": 0.7385365854, "autogenerat...
from form_designer.contrib.exporters import FormLogExporterBase from form_designer import settings from django.http import HttpResponse from django.utils.encoding import smart_str, smart_unicode try: import xlwt except ImportError: XLWT_INSTALLED = False else: XLWT_INSTALLED = True class XlsExporter(Form...
{ "repo_name": "MagicSolutions/django-form-designer", "path": "form_designer/contrib/exporters/xls_exporter.py", "copies": "1", "size": "1265", "license": "bsd-3-clause", "hash": 9056056076651971000, "line_mean": 28.4186046512, "line_max": 98, "alpha_frac": 0.6758893281, "autogenerated": false, "r...
from form_designer.contrib.exporters import FormLogExporterBase from form_designer import settings from django.utils.translation import ugettext_lazy as _ from django.http import HttpResponse from django.utils.encoding import smart_unicode try: import xlwt except ImportError: XLWT_INSTALLED = False else: X...
{ "repo_name": "darbula/django-form-designer", "path": "form_designer/contrib/exporters/xls_exporter.py", "copies": "3", "size": "1294", "license": "bsd-3-clause", "hash": -6555176945188220000, "line_mean": 28.4090909091, "line_max": 98, "alpha_frac": 0.6816074189, "autogenerated": false, "ratio":...
from form_designer import settings as app_settings from django.core.files.base import File from django.forms.forms import NON_FIELD_ERRORS from django.utils.translation import ugettext_lazy as _ from django.db.models.fields.files import FieldFile from django.template.defaultfilters import filesizeformat import os impor...
{ "repo_name": "garmoncheg/django-form-designer", "path": "form_designer/uploads.py", "copies": "8", "size": "3516", "license": "bsd-3-clause", "hash": 7221352123959527000, "line_mean": 37.6373626374, "line_max": 117, "alpha_frac": 0.6157565415, "autogenerated": false, "ratio": 3.9863945578231292,...
from form_designer import settings as app_settings from django.core.files.base import File from django.utils.translation import ugettext_lazy as _ from django.db.models.fields.files import FieldFile from django.template.defaultfilters import filesizeformat import os import hashlib, uuid def get_storage(): return ...
{ "repo_name": "guilleCoro/django-form-designer", "path": "form_designer/uploads.py", "copies": "2", "size": "2882", "license": "bsd-3-clause", "hash": -8693968141143415000, "line_mean": 35.9487179487, "line_max": 95, "alpha_frac": 0.6179736294, "autogenerated": false, "ratio": 4.013927576601671, ...
from form_designer import settings from form_designer.templatetags.friendly import friendly from django.db.models import Count from django.utils.translation import ugettext as _ from django.utils.encoding import smart_str class ExporterBase(object): def __init__(self, model): self.model = model ...
{ "repo_name": "darbula/django-form-designer", "path": "form_designer/contrib/exporters/__init__.py", "copies": "10", "size": "3048", "license": "bsd-3-clause", "hash": -7609809991245582000, "line_mean": 32.4945054945, "line_max": 110, "alpha_frac": 0.5784120735, "autogenerated": false, "ratio": 4...
from formencode.api import FancyValidator, NoDefault class JSONTyped(FancyValidator): """ Wrap formencode validator with JSON schema's types & properties. :: validator = JSONTyped( {'type': 'string'}, validators.UnicodeString(), required=True, descripti...
{ "repo_name": "Hardtack/formencode_jsonschema", "path": "formencode_jsonschema/typed.py", "copies": "1", "size": "3627", "license": "mit", "hash": 1161015243006551600, "line_mean": 29.225, "line_max": 71, "alpha_frac": 0.5690653433, "autogenerated": false, "ratio": 4.089064261555806, "config_te...
from formencode import All, Schema from formencode.validators import FieldsMatch, UnicodeString, OneOf, Email from tw2 import forms import pytz from kai.lib.highlight import langdict from kai.model.validators import ExistingSnippetTitle, ExistingEmail, UniqueDisplayname, UniqueEmail, ValidLogin, ValidPassword class ...
{ "repo_name": "Pylons/kai", "path": "kai/model/forms.py", "copies": "1", "size": "5976", "license": "bsd-3-clause", "hash": 1818508038353289000, "line_mean": 34.1529411765, "line_max": 127, "alpha_frac": 0.6849062918, "autogenerated": false, "ratio": 4.018829858776059, "config_test": false, "...
from formencode import htmlfill from formencode import variabledecode from formencode import Invalid from pyramid.i18n import get_localizer, TranslationStringFactory, TranslationString from pyramid.renderers import render class State(object): """ Default "empty" state object. Keyword arguments are automa...
{ "repo_name": "vsobolmaven/pyramid_simpleform", "path": "pyramid_simpleform/__init__.py", "copies": "1", "size": "9358", "license": "bsd-3-clause", "hash": 564750223374279550, "line_mean": 29.5816993464, "line_max": 109, "alpha_frac": 0.5684975422, "autogenerated": false, "ratio": 4.5295256534365...
from formencode import Invalid, htmlfill, Schema, validators from WebKit.Page import Page page_style = ''' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Tell me about yourself</title> <style type="text/c...
{ "repo_name": "genixpro/formencode", "path": "examples/WebwareExamples/index.py", "copies": "1", "size": "2711", "license": "mit", "hash": -8601894768953122000, "line_mean": 25.8415841584, "line_max": 69, "alpha_frac": 0.6189597934, "autogenerated": false, "ratio": 3.3677018633540374, "config_t...
from formencode import Invalid from tw2.core import Widget, Param, DisplayOnlyWidget, ValidationError, RepeatingWidget from tw2.forms import (CalendarDatePicker, CalendarDateTimePicker, TableForm, DataGrid, SingleSelectField, MultipleSelectField, InputField, HiddenField, Te...
{ "repo_name": "TurboGears/sprox", "path": "sprox/widgets/tw2widgets/widgets.py", "copies": "1", "size": "9167", "license": "mit", "hash": -3165932233127691000, "line_mean": 37.359832636, "line_max": 104, "alpha_frac": 0.657794262, "autogenerated": false, "ratio": 3.9701169337375486, "config_tes...
from formencode import Invalid from nomenklatura.core import db from nomenklatura.core import celery as app from nomenklatura.model import Dataset, Entity, Account, Upload def apply_mapping(row, mapping): out = {'attributes': {}, 'reviewed': mapping['reviewed']} for column, prop in mapping['columns'].items()...
{ "repo_name": "robbi5/nomenklatura", "path": "nomenklatura/importer.py", "copies": "1", "size": "2093", "license": "mit", "hash": -1740905002808424000, "line_mean": 32.2380952381, "line_max": 72, "alpha_frac": 0.5609173435, "autogenerated": false, "ratio": 4.2028112449799195, "config_test": fal...
from formencode import Schema, validators as v, compound from formencode_jsonschema import JSONSchema, typed from .utils import compare_schema def test_simple_dump(): class UserCreate(Schema): username = v.PlainText(not_empty=True) name = v.UnicodeString(not_empty=True) description = v.U...
{ "repo_name": "Hardtack/formencode_jsonschema", "path": "tests/test_dump.py", "copies": "1", "size": "2089", "license": "mit", "hash": -6164299019328259000, "line_mean": 24.4756097561, "line_max": 69, "alpha_frac": 0.5122067975, "autogenerated": false, "ratio": 4.128458498023716, "config_test":...
from formencode import Schema, validators, FancyValidator, All, Invalid from models import DBSession, User class UniqueEmail(FancyValidator): def to_python(self, value, state): if DBSession.query(User).filter(User.email == value).count(): raise Invalid( 'That email already exi...
{ "repo_name": "nadavge/notejam", "path": "pyramid/notejam/forms.py", "copies": "6", "size": "2508", "license": "mit", "hash": 5661195763243191000, "line_mean": 26.5604395604, "line_max": 77, "alpha_frac": 0.6574960128, "autogenerated": false, "ratio": 4.019230769230769, "config_test": false, ...
from formencode import validators as fev from dateutil import parser class DateTime(fev.FancyValidator): def _to_python(self, value, state=None): return parser.parse(value) def _from_python(self, value, state=None): return value.isoformat() class Object(fev.FancyValidator): '''Basic do...
{ "repo_name": "synappio/swagger-pyramid", "path": "swagger/lib.py", "copies": "1", "size": "1633", "license": "apache-2.0", "hash": -1173662895910071000, "line_mean": 24.9206349206, "line_max": 74, "alpha_frac": 0.5535823637, "autogenerated": false, "ratio": 3.8605200945626477, "config_test": f...
from formencode import validators, NoDefault, Invalid, Schema, NestedVariables, ForEach, All, Any from columns.lib import rfc3339 __all__ = [ 'Invalid', 'CreateArticle', 'UpdateArticle', 'CreatePage', 'UpdatePage', 'CreateUser', 'UpdateUser', 'CreateAccount', 'UpdateAccount', 'CreateComment', 'UpdateComment'...
{ "repo_name": "yoshrote/Columns", "path": "columns/model/form.py", "copies": "1", "size": "6640", "license": "bsd-3-clause", "hash": 2075385405344402200, "line_mean": 29.0452488688, "line_max": 97, "alpha_frac": 0.7447289157, "autogenerated": false, "ratio": 3.2453567937438903, "config_test": f...
from formencode.validators import FancyValidator from formencode.api import * import formencode import re _ = lambda s: s class Utf8MaxLength(FancyValidator): """ Invalid if the value is longer than `maxLength`. Uses len(), so it can work for strings, lists, or anything with length. Examples:: ...
{ "repo_name": "feilaoda/FlickBoard", "path": "project/app/base/validator.py", "copies": "1", "size": "7398", "license": "mit", "hash": 5601747957358838000, "line_mean": 32.0267857143, "line_max": 104, "alpha_frac": 0.5363611787, "autogenerated": false, "ratio": 4.1843891402714934, "config_test"...
from formencode.validators import Invalid as InvalidForm from tornado.web import authenticated from amonone.web.apps.core.baseview import BaseView from amonone.web.apps.alerts.models import alerts_model, alerts_group_model from amonone.web.apps.core.models import server_model from amonone.web.apps.settings.forms impor...
{ "repo_name": "m2lan/amonone", "path": "amonone/web/apps/settings/views/servers.py", "copies": "5", "size": "3224", "license": "mit", "hash": 6903149213229823000, "line_mean": 23.8076923077, "line_max": 75, "alpha_frac": 0.7006823821, "autogenerated": false, "ratio": 3.0881226053639845, "config...
from formencode.validators import Invalid as InvalidForm from tornado.web import authenticated from amonone.web.apps.core.baseview import BaseView from amonone.web.apps.auth.models import user_model from amonone.web.apps.core.models import server_model from amonone.web.apps.settings.forms import CreateUserForm class ...
{ "repo_name": "m2lan/amonone", "path": "amonone/web/apps/settings/views/users.py", "copies": "5", "size": "3161", "license": "mit", "hash": -6348052461937233000, "line_mean": 24.9180327869, "line_max": 92, "alpha_frac": 0.6972477064, "autogenerated": false, "ratio": 3.0570599613152805, "config_...
from formencode.validators import Invalid as InvalidForm from tornado.web import authenticated from amonone.web.apps.core.baseview import BaseView from amonone.web.apps.settings.models import data_model from amonone.web.apps.core.models import server_model from amonone.utils.dates import utc_now_to_localtime, datestri...
{ "repo_name": "outbounder/amonone", "path": "amonone/web/apps/settings/views/data.py", "copies": "5", "size": "3592", "license": "mit", "hash": 8788766434757221000, "line_mean": 25.2262773723, "line_max": 102, "alpha_frac": 0.7152004454, "autogenerated": false, "ratio": 3.099223468507334, "conf...
from formencode.validators import Invalid as InvalidForm from tornado.web import authenticated from tornado import escape as tornado_escape from amonone.web.apps.core.baseview import BaseView from amonone.sms.models import sms_model, sms_recepient_model from amonone.web.apps.settings.forms import SMSForm, SMSRecepient...
{ "repo_name": "Ju2ender/amonone", "path": "amonone/web/apps/settings/views/sms.py", "copies": "5", "size": "4094", "license": "mit", "hash": 1483659119272334000, "line_mean": 24.917721519, "line_max": 70, "alpha_frac": 0.7093307279, "autogenerated": false, "ratio": 2.790729379686435, "config_te...
from formencode.validators import StringBool from formencode import Invalid from tw2.core import Widget, Param, DisplayOnlyWidget, ValidationError from tw2.forms import (CalendarDatePicker, CalendarDateTimePicker, TableForm, DataGrid, SingleSelectField, MultipleSelectField, InputField, HiddenFiel...
{ "repo_name": "gjhiggins/sprox", "path": "sprox/widgets/tw2widgets/widgets.py", "copies": "1", "size": "5546", "license": "mit", "hash": 4766875585835166000, "line_mean": 37.5138888889, "line_max": 104, "alpha_frac": 0.6923909124, "autogenerated": false, "ratio": 3.875611460517121, "config_test...
from formencode.variabledecode import variable_encode from allura.tests import decorators as td from allura.tests import TestController class TestUserProfile(TestController): @td.with_user_project('test-admin') def test_profile(self): response = self.app.get('/u/test-admin/profile/') assert '...
{ "repo_name": "leotrubach/sourceforge-allura", "path": "Allura/allura/tests/functional/test_user_profile.py", "copies": "1", "size": "1773", "license": "apache-2.0", "hash": 2588032493818614300, "line_mean": 41.2142857143, "line_max": 134, "alpha_frac": 0.6288776086, "autogenerated": false, "rati...
from formexample.models import * from django.shortcuts import render from django.http import HttpResponseRedirect def freeCropView(request): if request.method == 'POST': # If the form has been submitted... form = freeCrop(request.POST) # A form bound to the POST data if form.is_valid(): # All val...
{ "repo_name": "DOOMer/clean-image-crop-uploader-v3", "path": "example/formexample/views.py", "copies": "1", "size": "2000", "license": "bsd-3-clause", "hash": -4323749356261229000, "line_mean": 36.037037037, "line_max": 97, "alpha_frac": 0.6165, "autogenerated": false, "ratio": 3.8314176245210727...
from formica.s3 import temporary_bucket import pytest from .constants import STACK @pytest.fixture def bucket(mocker, boto_resource, boto_client): return boto_resource.return_value.Bucket STRING_BODY = "string" # MD5 hash of body STRING_KEY = "b45cffe084dd3d20d928bee85e7b0f21" BINARY_BODY = "binary".encode() BIN...
{ "repo_name": "flomotlik/formica", "path": "tests/unit/test_s3.py", "copies": "1", "size": "2780", "license": "mit", "hash": -8662619227889192000, "line_mean": 37.6111111111, "line_max": 160, "alpha_frac": 0.721942446, "autogenerated": false, "ratio": 3.169897377423033, "config_test": true, "...
from formidable.forms import ( FormidableForm, fields ) from formidable import constants class DropdownConditionsTestCaseTestForm(FormidableForm): checkbox_a = fields.BooleanField( label='My checkbox', accesses={'padawan': constants.EDITABLE, 'jedi': constants.EDITABLE, ...
{ "repo_name": "novafloss/django-formidable", "path": "demo/tests/fixtures/test_conditions.py", "copies": "1", "size": "2470", "license": "mit", "hash": -3841909132110610000, "line_mean": 31.5, "line_max": 61, "alpha_frac": 0.5546558704, "autogenerated": false, "ratio": 4.371681415929204, "confi...
from .form import Form from django.contrib.auth.models import User from django.contrib.postgres.fields import JSONField from django.core.exceptions import ValidationError from django.db import models import re class FormSubmission(models.Model): """ Form Submission Database Model A Form Submission instan...
{ "repo_name": "ConstellationApps/Forms", "path": "constellation_forms/models/formSubmission.py", "copies": "1", "size": "3719", "license": "isc", "hash": 6676341954146598000, "line_mean": 38.9892473118, "line_max": 78, "alpha_frac": 0.5877924173, "autogenerated": false, "ratio": 4.743622448979591...
from form import Form from wtforms.fields import ( Field, IntegerField, StringField, SelectField, ) from wtforms.validators import ( ValidationError, StopValidation, InputRequired, EqualTo, Length, ) import models from .. import baseForms from .. import baseValidators class Regist...
{ "repo_name": "hrl/Protoend", "path": "generator/template/api/User/forms.py", "copies": "1", "size": "2475", "license": "mit", "hash": 7110372259973493000, "line_mean": 24, "line_max": 71, "alpha_frac": 0.5729292929, "autogenerated": false, "ratio": 4.608938547486034, "config_test": false, "h...
from .form import (PointAnnotation, PointAnnotationType, IntervalAnnotation, IntervalAnnotationType) from .content import (OrthographyAnnotation, OrthographyAnnotationType, TranscriptionAnnotation, TranscriptionAnnotationType, NumericAnnotation, NumericAnn...
{ "repo_name": "PhonologicalCorpusTools/PolyglotDB", "path": "polyglotdb/io/types/parsing.py", "copies": "4", "size": "3870", "license": "mit", "hash": -7044705793791638000, "line_mean": 32.9473684211, "line_max": 91, "alpha_frac": 0.7162790698, "autogenerated": false, "ratio": 4.073684210526316, ...
from formlayout import fedit from StringIO import StringIO class recommended_learning: def __init__(self): #initalize filenames self.skills_db = './knowledge_base/skills.csv' self.robot_features_db = './knowledge_base/robot_features.csv' self.environment_features_db = './knowledge_b...
{ "repo_name": "deebuls/RecommenderSystemInRobotics", "path": "code/knowledge_base_creator/recommended_learning.py", "copies": "1", "size": "4956", "license": "mit", "hash": -8553862642907119000, "line_mean": 42.8584070796, "line_max": 90, "alpha_frac": 0.5367231638, "autogenerated": false, "ratio...
from .form_output import * from .singleton_form import is_singleton_form from sympy import Pow, Mul,Number,Integer,log import itertools def minimised_exp_bases(expr): '''Determines whether individual bases in a term can be broken down. \ Ex: 8^3 = 2^(3*3) = 2^9 = 512, where 2^9 has minimized expressio...
{ "repo_name": "lemmalearning/sympy-form-analysis", "path": "numerical_base_form.py", "copies": "2", "size": "3547", "license": "bsd-3-clause", "hash": -5770947104762320000, "line_mean": 31.5412844037, "line_max": 77, "alpha_frac": 0.5847194813, "autogenerated": false, "ratio": 3.9542920847268674,...
from form_parser import form_parser from filing import filing # load up a form parser fp = form_parser() filingnumbers=(767585, 800502, 808218, 842576, 841933) for filingnum in filingnumbers: # read from cache if it's available; by default it won't save to cache f1 = filing(filingnum, True) #f1.downlo...
{ "repo_name": "sunlightlabs/read_FEC", "path": "fecreader/parsing/read_FEC_demo.py", "copies": "1", "size": "1209", "license": "bsd-3-clause", "hash": 1818428572899600600, "line_mean": 32.6111111111, "line_max": 123, "alpha_frac": 0.6368899917, "autogenerated": false, "ratio": 3.1, "config_test...
from forms.forms import FormDetailSet from forms.models import TurnexForm import requests from django.conf import settings def get_forms(): return TurnexForm.objects.published().order_by('order') def get_forms_config(): """return the details of the form (should have a better name for this)""" # I know, ...
{ "repo_name": "mleger45/turnex", "path": "msn/services.py", "copies": "1", "size": "1930", "license": "mit", "hash": -4515018830828206000, "line_mean": 23.125, "line_max": 77, "alpha_frac": 0.5352331606, "autogenerated": false, "ratio": 3.356521739130435, "config_test": false, "has_no_keyword...
from forms.haiku import HaikuForm from forms.because import BecauseForm from forms.acrostic import AcrosticForm from forms.atoz import AtozForm from forms.rhymingcouplet import RhymingCoupletForm from forms.iambicpentameter import IambicPentameterForm from forms.limerick import LimerickForm from forms.alliterative impo...
{ "repo_name": "mlesicko/automaticpoetry", "path": "handle_forms.py", "copies": "1", "size": "2308", "license": "mit", "hash": 6035794087332188000, "line_mean": 31.0555555556, "line_max": 68, "alpha_frac": 0.7006065858, "autogenerated": false, "ratio": 3.320863309352518, "config_test": false, ...
from .forms import BirthdayWRandomNumberExtForm from .models import BirthdayWRandomNumberExt from django.core.urlresolvers import reverse_lazy from django.http import HttpResponse from django.views import generic import csv class AddView(generic.edit.CreateView): model = BirthdayWRandomNumberExt form_class = ...
{ "repo_name": "luke-powers/django_exercise", "path": "birthday_w_random_number_ext/views.py", "copies": "1", "size": "1674", "license": "unlicense", "hash": 5436038560735109000, "line_mean": 28.8928571429, "line_max": 95, "alpha_frac": 0.7275985663, "autogenerated": false, "ratio": 3.631236442516...
from .forms import BlockForm from django.core.urlresolvers import reverse from django.forms.models import inlineformset_factory from django.views.generic import ( ListView, CreateView, UpdateView, ) from nested_formset import nestedformset_factory from blocks import models class BlockView(object): m...
{ "repo_name": "mbertheau/jquery.django-formset-example", "path": "blocks/views.py", "copies": "1", "size": "1550", "license": "mit", "hash": -1221237639473224700, "line_mean": 23.21875, "line_max": 85, "alpha_frac": 0.7419354839, "autogenerated": false, "ratio": 3.9440203562340965, "config_test...
from .forms import BlogPostForm from .models import QandA, Answer, Page, ContentBlock from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.http import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from what_apps.utility.models im...
{ "repo_name": "SlashRoot/WHAT", "path": "what_apps/cms/views.py", "copies": "1", "size": "3295", "license": "mit", "hash": -3168314428516615000, "line_mean": 38.2380952381, "line_max": 248, "alpha_frac": 0.6391502276, "autogenerated": false, "ratio": 3.904028436018957, "config_test": false, "...
from .forms import ContactForm from django.shortcuts import render from django.http import HttpResponseBadRequest, HttpResponse from django.core.mail import mail_admins def contact_view(request): if request.method == "POST": form = ContactForm(request.POST or None) # Have Django validate the form f...
{ "repo_name": "neldom/qessera", "path": "support/views.py", "copies": "1", "size": "2559", "license": "mit", "hash": 2794806888442130000, "line_mean": 36.0869565217, "line_max": 109, "alpha_frac": 0.5740523642, "autogenerated": false, "ratio": 4.33728813559322, "config_test": false, "has_no_k...
from .forms import CustomAuthenticationForm from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib.auth import views as auth_views ### Static url pattern...
{ "repo_name": "bangoocms/bangoo", "path": "examplesite/examplesite/urls.py", "copies": "3", "size": "1801", "license": "mit", "hash": 945964436526820200, "line_mean": 50.4571428571, "line_max": 154, "alpha_frac": 0.7129372571, "autogenerated": false, "ratio": 3.6531440162271807, "config_test": ...
from .forms import DrawAttentionAjaxForm, MessageForm from .models import DrawAttention, TopLevelMessage, Acknowledgement, \ FileAttachedToMessage, TopLevelMessageManager from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib.contenttypes.models imp...
{ "repo_name": "SlashRoot/WHAT", "path": "what_apps/social/views.py", "copies": "1", "size": "6433", "license": "mit", "hash": -1268960824327955000, "line_mean": 34.9441340782, "line_max": 156, "alpha_frac": 0.6269236748, "autogenerated": false, "ratio": 4.215596330275229, "config_test": false, ...
from ..forms import ExtensionForm from ..database import db, Extension from flask_login import login_required, current_app from flask import Blueprint, render_template, redirect, url_for, flash, request blueprint = Blueprint('extensions', __name__, url_prefix='/extensions') @blueprint.route('/') def index(): ext...
{ "repo_name": "john-wei/flaskr", "path": "package/views/extensions.py", "copies": "1", "size": "3473", "license": "mit", "hash": -6117145816885268000, "line_mean": 42.4125, "line_max": 79, "alpha_frac": 0.6443996545, "autogenerated": false, "ratio": 4.256127450980392, "config_test": false, "h...
from .forms import FilterForm from .helpers import (connect_n_parse, format_date, get_filters, remove_tags, test_conditions, url_vars, word_wrap) from filterss import app from flask import (Blueprint, abort, make_response, redirect, render_template, request, send_from_directory)...
{ "repo_name": "cuducos/filterss", "path": "filterss/views.py", "copies": "1", "size": "5131", "license": "mit", "hash": 5887096396654332000, "line_mean": 28.8313953488, "line_max": 79, "alpha_frac": 0.5864353927, "autogenerated": false, "ratio": 3.9469230769230768, "config_test": false, "has_...
from .forms import ForgotUsernameForm from django.conf import settings from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.http import HttpResponseRedirect from django.shortcuts import render from django.views.generic import View class ForgotUsername(View): form_cl...
{ "repo_name": "garnertb/firecares", "path": "firecares/firecares_core/views.py", "copies": "1", "size": "1312", "license": "mit", "hash": 2843902704960215600, "line_mean": 41.3225806452, "line_max": 81, "alpha_frac": 0.6150914634, "autogenerated": false, "ratio": 4.493150684931507, "config_test...
from forms import Form from airy.core.exceptions import ValidationError from airy.utils.encoding import StrAndUnicode from airy.utils.safestring import mark_safe from airy.utils.translation import ugettext as _ from fields import IntegerField, BooleanField from widgets import Media, HiddenInput from util import ErrorLi...
{ "repo_name": "letolab/airy", "path": "airy/forms/formsets.py", "copies": "1", "size": "14863", "license": "bsd-2-clause", "hash": 5294751454511147000, "line_mean": 40.0580110497, "line_max": 115, "alpha_frac": 0.5988696764, "autogenerated": false, "ratio": 4.125173466555648, "config_test": fal...