text stringlengths 0 1.05M | meta dict |
|---|---|
from forms import Form
from django.core.exceptions import ValidationError
from django.utils.encoding import StrAndUnicode
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from fields import IntegerField, BooleanField
from widgets import Media, HiddenInput
from util import... | {
"repo_name": "ychen820/microblog",
"path": "y/google-cloud-sdk/platform/google_appengine/lib/django-1.2/django/forms/formsets.py",
"copies": "44",
"size": "14303",
"license": "bsd-3-clause",
"hash": 6637038467698742000,
"line_mean": 40.338150289,
"line_max": 115,
"alpha_frac": 0.5981262672,
"autog... |
from forms import Form
from django.utils.encoding import StrAndUnicode
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from fields import IntegerField, BooleanField
from widgets import Media, HiddenInput
from util import ErrorList, ErrorDict, ValidationError
__all__ = (... | {
"repo_name": "sanjuro/RCJK",
"path": "vendor/django/forms/formsets.py",
"copies": "2",
"size": "13292",
"license": "apache-2.0",
"hash": 6073018351380563000,
"line_mean": 40.4080996885,
"line_max": 115,
"alpha_frac": 0.5997592537,
"autogenerated": false,
"ratio": 4.172002510985561,
"config_tes... |
from forms import Form
from django.utils.encoding import StrAndUnicode
from django.utils.safestring import mark_safe
from fields import IntegerField, BooleanField
from widgets import Media, HiddenInput, TextInput
from util import ErrorList, ValidationError
__all__ = ('BaseFormSet', 'all_valid')
# special field names
... | {
"repo_name": "diofeher/django-nfa",
"path": "django/newforms/formsets.py",
"copies": "1",
"size": "12445",
"license": "bsd-3-clause",
"hash": -2102450013114724400,
"line_mean": 41.7663230241,
"line_max": 111,
"alpha_frac": 0.5971876256,
"autogenerated": false,
"ratio": 4.162207357859532,
"conf... |
from forms import Form
from django.utils.encoding import StrAndUnicode
from fields import IntegerField, BooleanField
from widgets import Media, HiddenInput, TextInput
from util import ErrorList, ValidationError
__all__ = ('BaseFormSet', 'all_valid')
# special field names
TOTAL_FORM_COUNT = 'TOTAL_FORMS'
INITIAL_FORM_... | {
"repo_name": "rawwell/django",
"path": "django/newforms/formsets.py",
"copies": "2",
"size": "11633",
"license": "bsd-3-clause",
"hash": 7674110603090929000,
"line_mean": 41.3018181818,
"line_max": 111,
"alpha_frac": 0.6002750795,
"autogenerated": false,
"ratio": 4.1725251076040175,
"config_te... |
from .forms import Form
def filter_form_factory(model):
fields = []
for field in model._meta.fields:
formfield = field.formfield()
if formfield:
formfield.required = False
field_name = field.column if field.rel else field.name
fields.append((field_name, for... | {
"repo_name": "marcinn/restosaur",
"path": "restosaur/filters.py",
"copies": "1",
"size": "1060",
"license": "bsd-2-clause",
"hash": 1748043373152784000,
"line_mean": 31.1212121212,
"line_max": 78,
"alpha_frac": 0.5971698113,
"autogenerated": false,
"ratio": 4.1568627450980395,
"config_test": f... |
from forms import Form
from django.core.exceptions import ValidationError
from django.utils.encoding import StrAndUnicode
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from fields import IntegerField, BooleanField
from widgets import Media, HiddenInput
from util... | {
"repo_name": "hunch/hunch-sample-app",
"path": "django/forms/formsets.py",
"copies": "9",
"size": "15036",
"license": "mit",
"hash": 4222372203702600000,
"line_mean": 40.5949008499,
"line_max": 115,
"alpha_frac": 0.5858606012,
"autogenerated": false,
"ratio": 4.216489063376332,
"config_test": ... |
from forms import Form
from django.utils.encoding import StrAndUnicode
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext as _
from fields import IntegerField, BooleanField
from widgets import Media, HiddenInput
from util import ErrorList, ErrorDict, ValidationError
__a... | {
"repo_name": "greggian/TapdIn",
"path": "django/forms/formsets.py",
"copies": "1",
"size": "13568",
"license": "apache-2.0",
"hash": -4769442607603611000,
"line_mean": 40.6666666667,
"line_max": 115,
"alpha_frac": 0.5835053066,
"autogenerated": false,
"ratio": 4.278776411226742,
"config_test":... |
from forms import LoginForm, RegistrationForm
from django.views import generic
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import render
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
# Create your views here.
class LoginView(generic.... | {
"repo_name": "ncphillips/django_rpg",
"path": "accounts/views.py",
"copies": "1",
"size": "1873",
"license": "mit",
"hash": 5182021298917856000,
"line_mean": 32.4464285714,
"line_max": 77,
"alpha_frac": 0.6753870796,
"autogenerated": false,
"ratio": 4.071739130434783,
"config_test": false,
"... |
from .forms import *
from django.views.generic import View, TemplateView, ListView
from django.views.generic.edit import FormView
from django.contrib import messages
import calendar
from django.db.models import Sum,Count
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from dat... | {
"repo_name": "Heteroskedastic/Dr-referral-tracker",
"path": "tracking/views.py",
"copies": "1",
"size": "20763",
"license": "mit",
"hash": -2179593539767138000,
"line_mean": 38.3984819734,
"line_max": 118,
"alpha_frac": 0.6195636469,
"autogenerated": false,
"ratio": 3.97377990430622,
"config_t... |
from .forms import *
from .models import *
from datetime import timedelta
from django.contrib import messages
from django.contrib.auth import authenticate, login as auth_login, logout as auth_logout
from django.contrib.auth.models import User
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.meas... | {
"repo_name": "actofgoods/actofgoods",
"path": "basics/views.py",
"copies": "1",
"size": "70821",
"license": "mit",
"hash": -6743720333300642000,
"line_mean": 44.6870967742,
"line_max": 254,
"alpha_frac": 0.5925157099,
"autogenerated": false,
"ratio": 3.8937152911420245,
"config_test": false,
... |
from .forms import *
from .models import *
from django.contrib import admin
from django.core.exceptions import ValidationError
from django.forms import BaseInlineFormSet
from django.utils.translation import ugettext_lazy as _
admin.site.register(Type)
class InlineValidationDate(BaseInlineFormSet):
def clean(sel... | {
"repo_name": "neuromat/nira",
"path": "scientific_mission/admin.py",
"copies": "1",
"size": "1729",
"license": "mpl-2.0",
"hash": 1312383110231070000,
"line_mean": 33.58,
"line_max": 115,
"alpha_frac": 0.6622325043,
"autogenerated": false,
"ratio": 4.227383863080685,
"config_test": false,
"h... |
from forms import ParameterTypes
import sqlite3
DEF_SQLITE_TYPES = {
ParameterTypes.INTEGER : "INT",
ParameterTypes.FLOAT : "REAL",
ParameterTypes.BOOLEAN: "INT",
ParameterTypes.STRING: "TEXT",
ParameterTypes.LABEL: "TEXT",
ParameterTypes.URL: "TEXT",
ParameterTypes.ENUM: "INT",
}
def get... | {
"repo_name": "bricetebbs/dj_extras",
"path": "result_table.py",
"copies": "1",
"size": "9695",
"license": "mit",
"hash": 7626261537869089000,
"line_mean": 30.5798045603,
"line_max": 138,
"alpha_frac": 0.5565755544,
"autogenerated": false,
"ratio": 3.613492359299292,
"config_test": false,
"ha... |
from .forms import ParticipantForm
from misc.views import AbstractEditView, AbstractDeleteView
from django.shortcuts import render, redirect
from .models import Participation
from django.utils.translation import ugettext as _
from django.contrib.auth.decorators import login_required
import logging
log = logging.getLo... | {
"repo_name": "firemark/yellowjuice",
"path": "participation/views.py",
"copies": "1",
"size": "2937",
"license": "mit",
"hash": -7863975877307466000,
"line_mean": 28.37,
"line_max": 79,
"alpha_frac": 0.669731018,
"autogenerated": false,
"ratio": 3.74140127388535,
"config_test": false,
"has_n... |
from ..forms import PostForm, CommentForm
from ..database import db, Extension, Post, Comment, Tag
from flask_login import current_user, current_app, login_required
from flask import Blueprint, render_template, redirect, url_for, flash, \
request, abort, make_response
blueprint = Blueprint('posts', _... | {
"repo_name": "john-wei/flaskr",
"path": "package/views/posts.py",
"copies": "1",
"size": "5057",
"license": "mit",
"hash": 3908592658347787000,
"line_mean": 35.1214285714,
"line_max": 79,
"alpha_frac": 0.6288313229,
"autogenerated": false,
"ratio": 3.463698630136986,
"config_test": false,
"h... |
from .forms import ProfileForm
from .models import Profile
from django.db.models import Count
from app_forum.models import Forum, Comment
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect, get_object_or_404
def author_single_view(request, slug):
"""
Render... | {
"repo_name": "django-id/website",
"path": "app_author/views.py",
"copies": "1",
"size": "1872",
"license": "mit",
"hash": 5377842436916510000,
"line_mean": 35.7058823529,
"line_max": 116,
"alpha_frac": 0.6741452991,
"autogenerated": false,
"ratio": 3.6923076923076925,
"config_test": false,
"... |
from .forms import RegisterForm, LoginForm, PasswordResetForm, \
PasswordChangeForm
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from dj... | {
"repo_name": "theju/f1oracle",
"path": "accounts/views.py",
"copies": "1",
"size": "3911",
"license": "bsd-3-clause",
"hash": -7807126261808822000,
"line_mean": 45.0117647059,
"line_max": 86,
"alpha_frac": 0.6090513935,
"autogenerated": false,
"ratio": 4.938131313131313,
"config_test": false,
... |
from forms import RegistrationForm
from app import app, db
from models import User
from flask import render_template, jsonify
@app.route('/', methods=['GET'])
@app.route('/index', methods=['GET'])
def index():
form = RegistrationForm()
return render_template('register.html',
title='H... | {
"repo_name": "ibrahim12/challeng_demo",
"path": "app/views.py",
"copies": "1",
"size": "1157",
"license": "mit",
"hash": -1172043712740388900,
"line_mean": 28.6666666667,
"line_max": 101,
"alpha_frac": 0.5738980121,
"autogenerated": false,
"ratio": 4.031358885017422,
"config_test": false,
"h... |
from .forms import RegistrationForm
from django.contrib.auth.decorators import login_required # helps wrap views with login_required
from django.contrib.auth import logout # to allow views logout functionality
from django.views.decorators.csrf import csrf_protect # protect forms with csrf tokens
from django.http import... | {
"repo_name": "adam2392/smile",
"path": "smile/accounts/views.py",
"copies": "1",
"size": "1565",
"license": "apache-2.0",
"hash": -6123291430369172000,
"line_mean": 34.5909090909,
"line_max": 96,
"alpha_frac": 0.7610223642,
"autogenerated": false,
"ratio": 4.05440414507772,
"config_test": fals... |
from .forms import SchoolFilterForm, LimitedDistictFilterForm,\
RolesFilterForm, ReporterFreeSearchForm, SchoolDistictFilterForm, FreeSearchSchoolsForm, MassTextForm
from .models import EmisReporter, School
from .reports import messages, othermessages, reporters, all_schools
from .sorters import LatestSubmissionSo... | {
"repo_name": "unicefuganda/edtrac",
"path": "edtrac_project/rapidsms_edtrac/education/urls.py",
"copies": "1",
"size": "19421",
"license": "bsd-3-clause",
"hash": 6681795958778536000,
"line_mean": 60.653968254,
"line_max": 147,
"alpha_frac": 0.6544977087,
"autogenerated": false,
"ratio": 3.25691... |
from .forms import SearchForm
from .models import Profile, Debtor
from django.shortcuts import render
from django.contrib import messages
from django.views.generic import ListView
from django.views.generic.edit import FormMixin
from django.db.models import Q
from django.template.defaultfilters import pluralize
from dja... | {
"repo_name": "giantas/remoteref",
"path": "debtinfo/views.py",
"copies": "1",
"size": "5516",
"license": "mit",
"hash": -4628867350228083000,
"line_mean": 34.5870967742,
"line_max": 102,
"alpha_frac": 0.6424945613,
"autogenerated": false,
"ratio": 3.8573426573426572,
"config_test": false,
"h... |
from .forms import SubmissionForm
from django.views.generic.edit import CreateView
#for MakeView
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
import pafy
from gtool import models
from gtool.models import Gfy
from urllib2 import URLError
class SubmissionCreateVie... | {
"repo_name": "alex-jerez/gfysound",
"path": "gfysound/gfysound/views.py",
"copies": "1",
"size": "2627",
"license": "mit",
"hash": -6298142298248783000,
"line_mean": 33.5657894737,
"line_max": 96,
"alpha_frac": 0.5591929958,
"autogenerated": false,
"ratio": 3.6385041551246537,
"config_test": f... |
from .forms import TaskForm, TaskPrototypeNameForm, TaskPrototypeForm, \
GenerateTaskForm, RestOfTheTaskPrototypeForm
from .models import Task, TaskProgeny, Verb, TaskPrototype, TaskPrototypeProgeny, \
TaskOwnership, TaskResolution, TaskAccessPrototype, TaskAccess, Protocol
from django import forms
from django.... | {
"repo_name": "SlashRoot/WHAT",
"path": "what_apps/do/views.py",
"copies": "1",
"size": "23210",
"license": "mit",
"hash": 6919415892415682000,
"line_mean": 41.2786885246,
"line_max": 212,
"alpha_frac": 0.6308487721,
"autogenerated": false,
"ratio": 4.018351800554017,
"config_test": false,
"h... |
from .forms import UserAddForm, UserUpdateForm, CustomerAddForm, CustomerUpdateForm, PersonnelAddForm, PersonnelUpdateForm
# # # Dictionaries # # #
user_add_modal = {'id': 'User-Add-Modal',
'aria_label': 'User-Add-Modal',
'title_id': 'User-Add-Modal',
'title'... | {
"repo_name": "joeflack4/vanillerp",
"path": "app/modals.py",
"copies": "1",
"size": "4220",
"license": "mit",
"hash": 1257431110113656300,
"line_mean": 42.5051546392,
"line_max": 122,
"alpha_frac": 0.4985781991,
"autogenerated": false,
"ratio": 3.8858195211786373,
"config_test": false,
"has_... |
from .forms import UserChangeForm, UserCreationForm
from django.contrib import admin
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin
from .models import CustUser
class CustUserAdmin(UserAdmin):
# The forms to add and change user instances
form = UserChangeForm
... | {
"repo_name": "jimbeaudoin/django-custuser",
"path": "custuser/admin.py",
"copies": "1",
"size": "1432",
"license": "mit",
"hash": 2547807356209655000,
"line_mean": 33.9268292683,
"line_max": 73,
"alpha_frac": 0.655027933,
"autogenerated": false,
"ratio": 3.934065934065934,
"config_test": false... |
from .forms import UserContactForm, UserContactInfoForm, UserProfileForm, \
handle_user_profile_form, PhoneNumberForm
from .models import ContactInfo, Message, DialList, DialListParticipation, \
PhoneNumber, BICYCLE_DAY
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models im... | {
"repo_name": "SlashRoot/WHAT",
"path": "what_apps/contact/views.py",
"copies": "1",
"size": "10747",
"license": "mit",
"hash": 4528284596592525000,
"line_mean": 46.3480176211,
"line_max": 187,
"alpha_frac": 0.6104029031,
"autogenerated": false,
"ratio": 4.358069748580697,
"config_test": false,... |
from .forms import UserInGroupForm
from .models import Role, Group, RoleInGroup, UserInGroup
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
import json
@login_required
... | {
"repo_name": "SlashRoot/WHAT",
"path": "what_apps/people/views.py",
"copies": "1",
"size": "1299",
"license": "mit",
"hash": -5741433544528143000,
"line_mean": 30.7073170732,
"line_max": 78,
"alpha_frac": 0.7051578137,
"autogenerated": false,
"ratio": 3.7982456140350878,
"config_test": false,
... |
from formspree_test_case import FormspreeTestCase
from formspree.utils import next_url
class UtilsTest(FormspreeTestCase):
def test_next_url(self):
# thanks route should have the referrer as its 'next'
self.assertEqual('/thanks?next=http%3A%2F%2Ffun.io', next_url(referrer='http://fun.io'))
... | {
"repo_name": "OVERLOADROBOTICA/OVERLOADROBOTICA.github.io",
"path": "mail/formspree-master/tests/test_utils.py",
"copies": "1",
"size": "1412",
"license": "mit",
"hash": 31962804908058548,
"line_mean": 57.8333333333,
"line_max": 130,
"alpha_frac": 0.6862606232,
"autogenerated": false,
"ratio": 3... |
from .formSubmission import FormSubmission
from django.contrib.auth.models import User
from django.db import models
from django.template.defaultfilters import slugify
class Log(models.Model):
"""
Form Submission Log Database Model
Attributes:
* owner - user submitting the message
* submission - ... | {
"repo_name": "ConstellationApps/Forms",
"path": "constellation_forms/models/log.py",
"copies": "1",
"size": "1879",
"license": "isc",
"hash": -3831457609151334400,
"line_mean": 30.3166666667,
"line_max": 79,
"alpha_frac": 0.6146886642,
"autogenerated": false,
"ratio": 4.241534988713318,
"confi... |
from formtools.preview import FormPreview
from django.views.generic import DetailView
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from .models import Article
from .forms import ArticleForm
class ArticlePreviewUsingRequest(FormPreview):
def done(self, request, cleaned_d... | {
"repo_name": "thinkAmi-sandbox/Django_form_preview_sample",
"path": "myapp/views.py",
"copies": "1",
"size": "1179",
"license": "unlicense",
"hash": 3661447012635966500,
"line_mean": 29.8333333333,
"line_max": 62,
"alpha_frac": 0.6717763751,
"autogenerated": false,
"ratio": 3.8912280701754387,
... |
from formtools.wizard.views import NamedUrlSessionWizardView
from django.shortcuts import redirect, render
from .emails import (
send_application_confirmation, send_application_notification)
from .forms import (
PreviousEventForm, ApplicationForm, WorkshopForm, OrganizersFormSet)
from .models import EventAppli... | {
"repo_name": "patjouk/djangogirls",
"path": "organize/views.py",
"copies": "1",
"size": "2212",
"license": "bsd-3-clause",
"hash": 5988253227422147000,
"line_mean": 31.0579710145,
"line_max": 75,
"alpha_frac": 0.6993670886,
"autogenerated": false,
"ratio": 3.761904761904762,
"config_test": fal... |
from formtools.wizard.views import normalize_name
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.forms import widgets
from django.utils.encoding import force_str
from django.utils.functional import cached_property
from django.utils.safestring import mark_s... | {
"repo_name": "awesto/django-shop",
"path": "shop/forms/base.py",
"copies": "1",
"size": "4751",
"license": "bsd-3-clause",
"hash": 2410745361093306000,
"line_mean": 37.008,
"line_max": 116,
"alpha_frac": 0.6152388971,
"autogenerated": false,
"ratio": 4.407235621521336,
"config_test": false,
... |
from formula.Formula import EMA
# MACD
class DATA():
def __init__(self, diff, dea):
self.Set(diff, dea)
def Set(self, diff, dea):
self.diff = diff;
self.dea = dea;
self.macd = 2 * (self.diff - self.dea);
def __str__(self):
return 'diff={0},dea={1},macd... | {
"repo_name": "WaitGodot/peatio-client-python",
"path": "formula/MACD.py",
"copies": "1",
"size": "1349",
"license": "cc0-1.0",
"hash": -4094199780087416300,
"line_mean": 26.7446808511,
"line_max": 82,
"alpha_frac": 0.5033358043,
"autogenerated": false,
"ratio": 3.2427884615384617,
"config_test... |
from formulaic.errors import FormulaSyntaxError
from .types.ast_node import ASTNode
from .types.token import Token
def exc_for_token(token, message, errcls=FormulaSyntaxError):
token = __get_token_for_ast(token)
token_context = token.get_source_context(colorize=True)
if token_context:
return errcl... | {
"repo_name": "matthewwardrop/formulaic",
"path": "formulaic/parser/utils.py",
"copies": "1",
"size": "1663",
"license": "mit",
"hash": -4920134423319278000,
"line_mean": 36.7954545455,
"line_max": 125,
"alpha_frac": 0.6837041491,
"autogenerated": false,
"ratio": 3.235408560311284,
"config_test... |
from formulaic.parser.types import Factor
class EvaluatedFactor:
def __init__(self, factor, values, kind=None, spans_intercept=False):
self.factor = factor
self.values = values
self.kind = kind
self.spans_intercept = spans_intercept
@property
def kind(self):
retur... | {
"repo_name": "matthewwardrop/formulaic",
"path": "formulaic/materializers/types/evaluated_factor.py",
"copies": "1",
"size": "1049",
"license": "mit",
"hash": -1140384252406677400,
"line_mean": 24.5853658537,
"line_max": 83,
"alpha_frac": 0.6139180172,
"autogenerated": false,
"ratio": 4.35269709... |
from formulaic.parser.types import Factor, Term
def differentiate_term(term, vars, use_sympy=False):
factors = term.factors
for var in vars:
affected_factors = set(
factor
for factor in factors
if var in _factor_symbols(factor, use_sympy=use_sympy)
)
... | {
"repo_name": "matthewwardrop/formulaic",
"path": "formulaic/utils/calculus.py",
"copies": "1",
"size": "1635",
"license": "mit",
"hash": -6776096500078764000,
"line_mean": 35.3333333333,
"line_max": 133,
"alpha_frac": 0.6152905199,
"autogenerated": false,
"ratio": 3.9397590361445785,
"config_t... |
from .formulas import dbetadt as _a
import logging as _logging
import numpy as _np
import scipy.constants as _spc
import scisalt as _ss
import time as _time
_logger = _logging.getLogger(__name__)
__all__ = [
'SimFrame'
]
class SimFrame(object):
"""
Coordinates and steps through the simulation.
"... | {
"repo_name": "joelfrederico/Blowout",
"path": "blowout/simframework.py",
"copies": "1",
"size": "3950",
"license": "mit",
"hash": 932135096041423700,
"line_mean": 36.9807692308,
"line_max": 154,
"alpha_frac": 0.4455696203,
"autogenerated": false,
"ratio": 3.772683858643744,
"config_test": fals... |
from formulator.models import Form, FieldSet, Field
from django.utils.translation import ugettext_lazy as _
# FORM1
# =====
form_class = Form(name='adce jury registration')
form_class.save()
# Composition of a Fieldset
fieldset = FieldSet(form=form_class,
name='fieldset1',
lege... | {
"repo_name": "Cahersan/SexySignOn",
"path": "multilogger/multilogger/register/factory.py",
"copies": "1",
"size": "1657",
"license": "bsd-3-clause",
"hash": -7222865718191314000,
"line_mean": 29.6851851852,
"line_max": 80,
"alpha_frac": 0.5334942667,
"autogenerated": false,
"ratio": 4.3952254641... |
from forseti.deployers.base import BaseDeployer
from forseti.models import GoldenEC2Instance
from forseti.utils import balloon_timer
class GoldenInstanceDeployer(BaseDeployer):
"""Deployer for ticketea's infrastructure"""
name = "golden_instances"
def __init__(self, application, configuration, command_a... | {
"repo_name": "ticketea/forseti",
"path": "forseti/deployers/golden_instance.py",
"copies": "1",
"size": "2238",
"license": "isc",
"hash": 4038913106673299500,
"line_mean": 34.5238095238,
"line_max": 94,
"alpha_frac": 0.6425379803,
"autogenerated": false,
"ratio": 4.129151291512915,
"config_tes... |
from fortdepend.units import FortranFile
from distutils import dir_util
import pytest
import os
class TestEmptyFortranFile:
def test_empty(self):
empty = FortranFile(filename='empty', readfile=False)
assert empty.filename == "empty"
assert empty.uses is None
assert empty.modules is... | {
"repo_name": "ZedThree/fort_depend.py",
"path": "tests/test_fortranfile.py",
"copies": "1",
"size": "7607",
"license": "mit",
"hash": 430469125773238500,
"line_mean": 38.6197916667,
"line_max": 88,
"alpha_frac": 0.5906401998,
"autogenerated": false,
"ratio": 3.957856399583767,
"config_test": t... |
from fort_dump import fort_dump
import yt
import numpy as np
from yt.units import parsec, Msun, gram, centimeter, second, Kelvin
from yt.fields.particle_fields import add_volume_weighted_smoothed_field
from astropy import units as u
from astropy import constants
def yt_from_jim(fname, n_ref=8):
"""
Load one o... | {
"repo_name": "keflavich/jimpy",
"path": "yt/to_yt.py",
"copies": "2",
"size": "3168",
"license": "bsd-2-clause",
"hash": -8348045228073967000,
"line_mean": 36.2705882353,
"line_max": 113,
"alpha_frac": 0.5729166667,
"autogenerated": false,
"ratio": 3.6164383561643834,
"config_test": false,
"... |
from fortpy.code import CodeParser
from . import builtin
import time
import re
import pyparsing
from . import rtupdate
#Time cache has expiration on the items inside that get used only
#temporarily during code completion
_time_caches = []
#This is our instance of the CodeParser. It handles the parsing
#of all the Fort... | {
"repo_name": "rosenbrockc/fortpy",
"path": "fortpy/isense/cache.py",
"copies": "1",
"size": "4648",
"license": "mit",
"hash": 1832346601850006500,
"line_mean": 36.7886178862,
"line_max": 92,
"alpha_frac": 0.6090791738,
"autogenerated": false,
"ratio": 3.445515196441809,
"config_test": false,
... |
from fortpy.elements import Function, Subroutine, CustomType, ValueElement
from fortpy.elements import Module, Executable, Interface
from fortpy.docelements import DocElement
from . import cache
from .classes import Completion
class Evaluator(object):
"""Uses the user context and code parsers to perform code
c... | {
"repo_name": "rosenbrockc/fortpy",
"path": "fortpy/isense/evaluator.py",
"copies": "1",
"size": "22589",
"license": "mit",
"hash": -2181635860780981200,
"line_mean": 43.8194444444,
"line_max": 108,
"alpha_frac": 0.591881004,
"autogenerated": false,
"ratio": 4.589394555058919,
"config_test": fa... |
from forwarder import OSCUDPServerForwarder
from collections import defaultdict
import reloading_tabview as t
import logging
logging.disable(logging.CRITICAL)
class OscDataPresenter:
def __init__(self, serverA, serverB):
self.serverA = serverA
self.serverB = serverB
def cols(self):
return ["Address",... | {
"repo_name": "philipbjorge/osc-spy",
"path": "main.py",
"copies": "1",
"size": "1295",
"license": "mit",
"hash": 8717787018765786000,
"line_mean": 27.7777777778,
"line_max": 98,
"alpha_frac": 0.7150579151,
"autogenerated": false,
"ratio": 3.105515587529976,
"config_test": false,
"has_no_keyw... |
from ._forward import ForwardPasser
from ._pruning import PruningPasser, FEAT_IMP_CRITERIA
from ._util import ascii_table, apply_weights_2d, gcv
from ._types import BOOL
from sklearn.base import RegressorMixin, BaseEstimator, TransformerMixin
from sklearn.utils.validation import (assert_all_finite, check_is_fitted,
... | {
"repo_name": "jcrudy/py-earth",
"path": "pyearth/earth.py",
"copies": "2",
"size": "59949",
"license": "bsd-3-clause",
"hash": 1921309059726507300,
"line_mean": 42.0050215208,
"line_max": 102,
"alpha_frac": 0.5904185224,
"autogenerated": false,
"ratio": 4.267744002278066,
"config_test": false,... |
from ._forward import ForwardPasser
from ._pruning import PruningPasser
from ._util import ascii_table, apply_weights_2d, apply_weights_1d, gcv
from sklearn.base import RegressorMixin, BaseEstimator, TransformerMixin
from sklearn.utils.validation import (assert_all_finite, check_is_fitted,
... | {
"repo_name": "DucQuang1/py-earth",
"path": "pyearth/earth.py",
"copies": "1",
"size": "31698",
"license": "bsd-3-clause",
"hash": 1924551613586762000,
"line_mean": 38.9219143577,
"line_max": 80,
"alpha_frac": 0.6086819358,
"autogenerated": false,
"ratio": 4.2910518478408015,
"config_test": fal... |
from .forwarding_rule import ForwardingRule
class Server(object):
"""Server.
:param id: Unique identifier for the server. Used as username for
SMTP/POP3 authentication.
:type id: str
:param password: SMTP/POP3 password.
:type password: str
:param name: A name used to identify the server.
... | {
"repo_name": "mailosaurapp/mailosaur-python",
"path": "mailosaur/models/server.py",
"copies": "1",
"size": "1121",
"license": "mit",
"hash": 3094429550628373000,
"line_mean": 34.03125,
"line_max": 92,
"alpha_frac": 0.6485280999,
"autogenerated": false,
"ratio": 3.9195804195804196,
"config_test... |
#from fos.actor.network import AttributeNetwork
from nose.tools import assert_true, assert_false, \
assert_equal, assert_raises
from numpy.testing import assert_array_equal, assert_array_almost_equal
import numpy as np
from fos.actor.network import NodeGLPrimitive
def test_nodeglprimitive_makecube():
... | {
"repo_name": "fos/fos-legacy",
"path": "fos/actor/tests/test_network.py",
"copies": "1",
"size": "1081",
"license": "bsd-3-clause",
"hash": -4323326238334294500,
"line_mean": 29.9142857143,
"line_max": 75,
"alpha_frac": 0.540240518,
"autogenerated": false,
"ratio": 3.5794701986754967,
"config_... |
from fos.core.actors import Actor
import numpy as np
class Empty(Actor):
def __init__(self):
pass
def init(self):
pass
def display(self):
print 'Near_pick', self.near_pick
print 'Far_pick', self.far_pick
def map_colors(object, colors):
''' Map colors fo... | {
"repo_name": "fos/fos-legacy",
"path": "scratch/very_scratch/core/primitives.py",
"copies": "1",
"size": "3187",
"license": "bsd-3-clause",
"hash": -5356462813848106000,
"line_mean": 21.2867132867,
"line_max": 101,
"alpha_frac": 0.436774396,
"autogenerated": false,
"ratio": 3.7760663507109005,
... |
from fos import *
import numpy as np
import sys
import h5py
f=h5py.File(sys.argv[1], 'r')
vertices_id = f['Microcircuit']['vertices']['id'].value
vertices_location = f['Microcircuit']['vertices']['location'].value
connectivity_id = f['Microcircuit']['connectivity']['id'].value
connectivity_skeletonid = f['Microcircui... | {
"repo_name": "fos/fos",
"path": "examples/microcircuit_neurohdf.py",
"copies": "1",
"size": "2440",
"license": "bsd-3-clause",
"hash": -3637242942208257500,
"line_mean": 33.3661971831,
"line_max": 137,
"alpha_frac": 0.662295082,
"autogenerated": false,
"ratio": 3.1362467866323906,
"config_test... |
from fos import *
import numpy as np
# testcircuit from the microcircuit package
from microcircuit.dataset.testcircuit002 import testcircuit as tc
con_prob = {
"label" : { "data" : np.ones( (tc.vertices.shape[0],1), ),
"metadata" : {
"semantics" : [
{ "n... | {
"repo_name": "fos/fos",
"path": "examples/microcircuit_testcircuit.py",
"copies": "1",
"size": "1049",
"license": "bsd-3-clause",
"hash": -1550712535635803400,
"line_mean": 28.1666666667,
"line_max": 79,
"alpha_frac": 0.5376549094,
"autogenerated": false,
"ratio": 3.394822006472492,
"config_te... |
from foundation.Bid import Bid
from foundation.ChannelClockServer import Channel_ClockServer
from foundation.ChannelMarketplace import Channel_Marketplace
from foundation.FoundationException import FoundationException
from foundation.Message import Message
from foundation.Service import Service
from multiprocessing imp... | {
"repo_name": "lmarent/network_agents_ver2_python",
"path": "agents/foundation/AgentServer.py",
"copies": "1",
"size": "24582",
"license": "mit",
"hash": 8908715504662643000,
"line_mean": 44.6914498141,
"line_max": 162,
"alpha_frac": 0.574526076,
"autogenerated": false,
"ratio": 4.151663570342848... |
from foundation.Bid import Bid
from foundation.ChannelClockServer import Channel_ClockServer
from foundation.ChannelMarketplace import Channel_Marketplace
from foundation.FoundationException import FoundationException
from foundation.Message import Message
from foundation.Service import Service
from AgentType imp... | {
"repo_name": "lmarent/network_agents_ver2_python",
"path": "agents/foundation/AgentClient.py",
"copies": "1",
"size": "12761",
"license": "mit",
"hash": -305268230403306400,
"line_mean": 41.852233677,
"line_max": 131,
"alpha_frac": 0.611864274,
"autogenerated": false,
"ratio": 4.382211538461538,... |
from FoundationException import FoundationException
from Message import Message
import agent_properties
import socket
class Channel_ClockServer(object):
'''
The Channel_ClockServer class defines the methods for creating
the socket communication between the clock server and the simulation
environment (... | {
"repo_name": "lmarent/network_agents_ver2_python",
"path": "agents/foundation/ChannelClockServer.py",
"copies": "1",
"size": "2470",
"license": "mit",
"hash": 7049174092160336000,
"line_mean": 32.8356164384,
"line_max": 84,
"alpha_frac": 0.6668016194,
"autogenerated": false,
"ratio": 3.805855161... |
from FoundationException import FoundationException
from Message import Message
import socket
class ChannelProvider(object):
'''
The Channel_Provider class defines the methods for creating
the socket communication between the presenter and providers.
It includes the methods get and send message, as w... | {
"repo_name": "lmarent/network_agents_ver2_python",
"path": "agents/foundation/ChannelProvider.py",
"copies": "1",
"size": "2232",
"license": "mit",
"hash": -6878527274061964000,
"line_mean": 31.347826087,
"line_max": 84,
"alpha_frac": 0.6666666667,
"autogenerated": false,
"ratio": 3.828473413379... |
from FoundationException import FoundationException
class Message(object):
'''
The Message class declares methods to handle the messaging part of
the system. These methods include set and get message parameters
and body, and check if the message was received by the marketplace.
'''
# Initializ... | {
"repo_name": "lmarent/network_agents_ver2_python",
"path": "agents/foundation/Message.py",
"copies": "1",
"size": "11686",
"license": "mit",
"hash": -1877483152334655000,
"line_mean": 37.9533333333,
"line_max": 82,
"alpha_frac": 0.5563922642,
"autogenerated": false,
"ratio": 4.403165033911078,
... |
from foundation.FoundationException import FoundationException
import uuid
import logging
from foundation.AgentServer import AgentServerHandler
from foundation.AgentType import AgentType
from foundation.Agent import Agent
from foundation.Message import Message
from foundation.DecisionVariable import DecisionVariable
fr... | {
"repo_name": "lmarent/network_agents_ver2_python",
"path": "agents/ProviderPublic.py",
"copies": "1",
"size": "14188",
"license": "mit",
"hash": 1247966551614343400,
"line_mean": 54.6431372549,
"line_max": 302,
"alpha_frac": 0.6098815901,
"autogenerated": false,
"ratio": 4.391210151655834,
"co... |
from foundation import forms, rest
from foundation.backend import register
from . import models
class FormViewMixin(object):
""" Add overrides to view code here, or replace the view classes in the
dictionary on the controller. """
def formfield_for_dbfield(self, db_field, **kwargs):
formfield =... | {
"repo_name": "altio/foundation",
"path": "sample/blogs/controllers.py",
"copies": "2",
"size": "1899",
"license": "mit",
"hash": 3521469784592892000,
"line_mean": 25.0136986301,
"line_max": 78,
"alpha_frac": 0.5508162191,
"autogenerated": false,
"ratio": 4.426573426573427,
"config_test": false... |
from Foundation import *
from AppKit import *
from PyObjCTools import AppHelper
import objc
import traceback
import urllib
import urllib2
def serviceSelector(fn):
# this is the signature of service selectors
return objc.selector(fn, signature="v@:@@o^@")
def ERROR(s):
#NSLog(u"ERROR: %s", s)
return s
... | {
"repo_name": "Khan/pyobjc-framework-Cocoa",
"path": "Examples/AppKit/TinyURLService/TinyURLService.py",
"copies": "3",
"size": "2768",
"license": "mit",
"hash": -3679961507973837300,
"line_mean": 32.756097561,
"line_max": 82,
"alpha_frac": 0.5769508671,
"autogenerated": false,
"ratio": 3.8876404... |
from Foundation import *
from AppKit import *
from PyObjCTools import NibClassBuilder
from FileSettings import *
class PreferencesWindowController(NSWindowController):
commandline = objc.IBOutlet()
debug = objc.IBOutlet()
filetype = objc.IBOutlet()
honourhashbang = objc.IBOutlet()
inspect = objc.IB... | {
"repo_name": "ariabuckles/pyobjc-framework-Cocoa",
"path": "Examples/AppKit/PyObjCLauncher/PreferencesWindowController.py",
"copies": "3",
"size": "3906",
"license": "mit",
"hash": 3888206629548278000,
"line_mean": 32.9652173913,
"line_max": 100,
"alpha_frac": 0.6426011265,
"autogenerated": false,... |
from Foundation import *
from AppKit import *
from PyObjCTools import NibClassBuilder
import os
from FileSettings import *
from doscript import doscript
class MyDocument(NSDocument):
commandline = objc.IBOutlet()
debug = objc.IBOutlet()
honourhashbang = objc.IBOutlet()
inspect = objc.IBOutlet()
int... | {
"repo_name": "ariabuckles/pyobjc-framework-Cocoa",
"path": "Examples/AppKit/PyObjCLauncher/MyDocument.py",
"copies": "3",
"size": "4031",
"license": "mit",
"hash": -8228932568028853000,
"line_mean": 30.2480620155,
"line_max": 90,
"alpha_frac": 0.6172165716,
"autogenerated": false,
"ratio": 3.963... |
from Foundation import *
from AppKit import *
from robofab.pens.pointPen import AbstractPointPen
import vanilla
from defconAppKit.controls.placardScrollView import PlacardScrollView, PlacardPopUpButton
backgroundColor = NSColor.whiteColor()
metricsColor = NSColor.colorWithCalibratedWhite_alpha_(.4, .5)
metricsTitlesCo... | {
"repo_name": "Ye-Yong-Chi/defconAppKit",
"path": "Lib/defconAppKit/controls/glyphView.py",
"copies": "1",
"size": "28882",
"license": "mit",
"hash": -2526875953974061000,
"line_mean": 35.1929824561,
"line_max": 118,
"alpha_frac": 0.5920296378,
"autogenerated": false,
"ratio": 4.0581705774905155,... |
from Foundation import *
from AppKit import *
from session import Session
class AppDelegate(NSObject):
def applicationDidFinishLaunching_(self, app):
self.session = None
self.init_status_bar()
self.init_menu()
def init_status_bar(self):
self.status_bar = NSStatusBar.systemStatusBar()
self.stat... | {
"repo_name": "pilu/bloody-mary",
"path": "app_delegate.py",
"copies": "1",
"size": "1078",
"license": "mit",
"hash": 4475198752251831000,
"line_mean": 32.6875,
"line_max": 104,
"alpha_frac": 0.7077922078,
"autogenerated": false,
"ratio": 3.422222222222222,
"config_test": false,
"has_no_keywo... |
from Foundation import *
from AppKit import *
from vanillaBase import VanillaBaseControl
_modeMap = {
"graphical": NSClockAndCalendarDatePickerStyle,
"text": 2, #NSTextFieldDatePickerStyle raises an error
"textStepper": NSTextFieldAndStepperDatePickerStyle,
}
_timeDisplayFlagMap = {
None : 0,
"ho... | {
"repo_name": "bitforks/vanilla",
"path": "Lib/vanilla/vanillaDatePicker.py",
"copies": "3",
"size": "5039",
"license": "mit",
"hash": -8048295713131612000,
"line_mean": 34.9928571429,
"line_max": 121,
"alpha_frac": 0.4955348283,
"autogenerated": false,
"ratio": 4.467198581560283,
"config_test"... |
from Foundation import *
from AppKit import *
import applesms
from third.vector import vector
class BouncingBrush(NSObject):
'''
A screensaver which demonstrates Apple's Sudden Motion Sensor (SMS), based on an Io demo program
'''
def initWithFrame_(self, frame):
self = super(BouncingBrush,... | {
"repo_name": "dethe/pastels",
"path": "brush3.py",
"copies": "1",
"size": "2301",
"license": "mit",
"hash": -8459068553997062000,
"line_mean": 33.3432835821,
"line_max": 100,
"alpha_frac": 0.5906127771,
"autogenerated": false,
"ratio": 3.6236220472440945,
"config_test": false,
"has_no_keywor... |
from Foundation import *
from AppKit import *
import objc
class DashboardController (NSViewController):
def show(self):
self.window = NSWindow.alloc().init()
self.DashboardViewController = NSViewController.alloc().initWithNibName_bundle_("Dashboard", None)
self.dashboardView = self.DashboardViewController... | {
"repo_name": "jyr/opentumblr-cocoa",
"path": "DashboardController.py",
"copies": "1",
"size": "2441",
"license": "mit",
"hash": -8315299575468666000,
"line_mean": 34.9117647059,
"line_max": 100,
"alpha_frac": 0.7439573945,
"autogenerated": false,
"ratio": 3.3855755894590844,
"config_test": fal... |
from Foundation import *
from AppKit import *
import objc
import urllib2
import tumblr
from tumblr import Api
from DashboardController import *
class LoginController(NSWindowController):
blog = objc.IBOutlet()
password = objc.IBOutlet()
user = objc.IBOutlet()
def init(self):
self.errors = {'403':... | {
"repo_name": "jyr/opentumblr-cocoa",
"path": "LoginController.py",
"copies": "1",
"size": "1166",
"license": "mit",
"hash": -4015286507459814000,
"line_mean": 26.7619047619,
"line_max": 119,
"alpha_frac": 0.6963979417,
"autogenerated": false,
"ratio": 2.9444444444444446,
"config_test": false,
... |
from Foundation import *
from AppKit import *
import random
from twisted.internet import ssl
from friendly.model import Account
class CreateAccountModel(NSObject):
def init(self):
self = NSObject.init(self)
if self is None:
return None
self.onlyContacts = True
self.ann... | {
"repo_name": "jrydberg/friendly",
"path": "friendly/account.py",
"copies": "1",
"size": "2598",
"license": "mit",
"hash": -2833732429787589600,
"line_mean": 29.2093023256,
"line_max": 68,
"alpha_frac": 0.5673595073,
"autogenerated": false,
"ratio": 4.565905096660808,
"config_test": false,
"h... |
from Foundation import *
from AppKit import *
import random
from zope.interface import Interface
from twisted.plugin import getPlugins
from friendly import plugins, ifriendly
from friendly.model import Contact
class ImportContactsController(NSWindowController):
"""
Coordinating controller for importing conta... | {
"repo_name": "jrydberg/friendly",
"path": "friendly/contacts.py",
"copies": "1",
"size": "6184",
"license": "mit",
"hash": -1408420968544375800,
"line_mean": 30.2323232323,
"line_max": 69,
"alpha_frac": 0.6290426908,
"autogenerated": false,
"ratio": 4.477914554670528,
"config_test": false,
"... |
from Foundation import *
from AppKit import *
import time
def application(appName):
appPath = NSWorkspace.sharedWorkspace().fullPathForApplication_(appName);
if (not appPath):
print("Could not find application '" + appName + "'")
return None
appBundle = NSBundle.bundleWithPat... | {
"repo_name": "ccgus/jstalk",
"path": "example_scripts/JSTalk.py",
"copies": "1",
"size": "1235",
"license": "mit",
"hash": -6454366959978930000,
"line_mean": 29.9,
"line_max": 207,
"alpha_frac": 0.6712550607,
"autogenerated": false,
"ratio": 4.379432624113475,
"config_test": false,
"has_no_k... |
from Foundation import *
from AppKit import *
class FileSettings(NSObject):
fsdefault_py = None
fsdefault_pyw = None
fsdefault_pyc = None
default_py = None
default_pyw = None
default_pyc = None
factorySettings = None
prefskey = None
settings = None
def getFactorySettingsForFile... | {
"repo_name": "albertz/music-player",
"path": "mac/pyobjc-framework-Cocoa/Examples/AppKit/PyObjCLauncher/FileSettings.py",
"copies": "3",
"size": "6020",
"license": "bsd-2-clause",
"hash": 2661072002642458600,
"line_mean": 36.625,
"line_max": 112,
"alpha_frac": 0.6079734219,
"autogenerated": false,... |
#from Foundation import *
#from AppKit import *
import compiler
parse = compiler.parse
import compiler.ast
Sub = compiler.ast.Sub
UnarySub = compiler.ast.UnarySub
Add = compiler.ast.Add
import Foundation
import AppKit
NSObject = AppKit.NSObject
NSColor = AppKit.NSColor
NSMutableParagraphStyle = AppKit.NSMutablePar... | {
"repo_name": "karstenw/nodebox-pyobjc",
"path": "nodebox/gui/mac/ValueLadder.py",
"copies": "1",
"size": "11679",
"license": "mit",
"hash": -5965952268167383000,
"line_mean": 39.8356643357,
"line_max": 100,
"alpha_frac": 0.5902046408,
"autogenerated": false,
"ratio": 4.236126224156692,
"config... |
from Foundation import *
from AppKit import *
MAGICVAR = "__magic_var__"
class ValueLadder:
view = None
visible = False
value = None
origValue = None
dirty = False
type = None
negative = False
unary = False
add = False
def __init__(self, textView, value, clickPos, screenPoint... | {
"repo_name": "gt-ros-pkg/rcommander-core",
"path": "nodebox_qt/src/nodebox/gui/mac/ValueLadder.py",
"copies": "1",
"size": "10651",
"license": "bsd-3-clause",
"hash": -135349581263037250,
"line_mean": 41.604,
"line_max": 142,
"alpha_frac": 0.5878321284,
"autogenerated": false,
"ratio": 4.2282651... |
# from Foundation import *
from AppKit import NSDate, NSDatePicker, NSClockAndCalendarDatePickerStyle, NSTextFieldAndStepperDatePickerStyle, NSHourMinuteDatePickerElementFlag, NSHourMinuteSecondDatePickerElementFlag, NSYearMonthDatePickerElementFlag, NSYearMonthDayDatePickerElementFlag
from vanilla.vanillaBase import V... | {
"repo_name": "typesupply/vanilla",
"path": "Lib/vanilla/vanillaDatePicker.py",
"copies": "1",
"size": "5524",
"license": "mit",
"hash": -3920034251838323000,
"line_mean": 35.582781457,
"line_max": 259,
"alpha_frac": 0.5217233888,
"autogenerated": false,
"ratio": 4.387609213661636,
"config_test... |
# from Foundation import *
from AppKit import NSDatePicker, NSClockAndCalendarDatePickerStyle, NSTextFieldAndStepperDatePickerStyle, NSHourMinuteDatePickerElementFlag, NSHourMinuteSecondDatePickerElementFlag, NSYearMonthDatePickerElementFlag, NSYearMonthDayDatePickerElementFlag
from vanilla.vanillaBase import VanillaBa... | {
"repo_name": "moyogo/vanilla",
"path": "Lib/vanilla/vanillaDatePicker.py",
"copies": "1",
"size": "5280",
"license": "mit",
"hash": 6990085280853478000,
"line_mean": 36.7142857143,
"line_max": 251,
"alpha_frac": 0.5159090909,
"autogenerated": false,
"ratio": 4.425817267393127,
"config_test": f... |
from Foundation import *
from IOBluetooth import *
from objc import *
from pyble._roles import Peripheral
from gatt import OSXBLEService, OSXBLECharacteristic, OSXBLEDescriptor
from util import CBUUID2String
import uuid
import logging
import struct
from pprint import pformat
import time
from threading import Conditi... | {
"repo_name": "brettchien/PyBLEWrapper",
"path": "pyble/osx/peripheral.py",
"copies": "1",
"size": "13349",
"license": "mit",
"hash": -2037063080758622000,
"line_mean": 35.5726027397,
"line_max": 156,
"alpha_frac": 0.6501610608,
"autogenerated": false,
"ratio": 4.018362432269717,
"config_test":... |
from Foundation import *
from PyObjCTools import AppHelper
class FileObserver(NSObject):
def initWithFileDescriptor_readCallback_errorCallback_(self,
fileDescriptor, readCallback, errorCallback):
self = self.init()
self.readCallback = readCallback
self.errorCallback = errorCallb... | {
"repo_name": "ariabuckles/pyobjc-core",
"path": "Examples/Scripts/stdinreader.py",
"copies": "2",
"size": "2450",
"license": "mit",
"hash": 4929040414520839000,
"line_mean": 33.5070422535,
"line_max": 87,
"alpha_frac": 0.6465306122,
"autogenerated": false,
"ratio": 4.351687388987567,
"config_t... |
from Foundation import *
from PyObjCTools import AppHelper
from CGraphModel import *
from CGraphView import *
from fieldMath import *
#____________________________________________________________
class CGraphController(NSObject):
graphModel = objc.IBOutlet()
graphView = objc.IBOutlet()
fieldNormalizeChec... | {
"repo_name": "Khan/pyobjc-framework-Cocoa",
"path": "Examples/AppKit/FieldGraph/CGraphController.py",
"copies": "3",
"size": "5532",
"license": "mit",
"hash": 4565490706155292700,
"line_mean": 32.125748503,
"line_max": 108,
"alpha_frac": 0.6292480116,
"autogenerated": false,
"ratio": 3.534824281... |
from Foundation import *
from PyObjCTools.TestSupport import *
import Foundation
try:
unicode
except NameError:
unicode = str
class TestHelper (NSObject):
def incFoo_(self, foo):
foo[0] += 1
class TestNSUndoManager(TestCase):
def testUndoManager(self):
x = TestHelper.new()
m =... | {
"repo_name": "Khan/pyobjc-framework-Cocoa",
"path": "PyObjCTest/test_nsundomanager.py",
"copies": "3",
"size": "3623",
"license": "mit",
"hash": 5187678662994484000,
"line_mean": 33.179245283,
"line_max": 94,
"alpha_frac": 0.6892078388,
"autogenerated": false,
"ratio": 3.813684210526316,
"conf... |
from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestNSRange (TestCase):
def testStructs(self):
v = NSRange()
self.assertHasAttr(v, 'location')
self.assertHasAttr(v, '... | {
"repo_name": "albertz/music-player",
"path": "mac/pyobjc-framework-Cocoa/PyObjCTest/test_nsrange.py",
"copies": "3",
"size": "1400",
"license": "bsd-2-clause",
"hash": -7704221615900855000,
"line_mean": 25.9230769231,
"line_max": 73,
"alpha_frac": 0.6292857143,
"autogenerated": false,
"ratio": 3... |
from Foundation import *
from ToDoCell import *
from ToDoItem import *
from SelectionNotifyMatrix import *
ToDoItemChangedNotification = "ToDoItemChangedNotification"
class ToDoDocument (NSDocument):
calendar = objc.IBOutlet()
dayLabel = objc.IBOutlet()
itemList = objc.IBOutlet()
statusList = objc.IB... | {
"repo_name": "Khan/pyobjc-framework-Cocoa",
"path": "Examples/AppKit/Todo/ToDoDocument.py",
"copies": "3",
"size": "11139",
"license": "mit",
"hash": 5916706144950790000,
"line_mean": 35.5213114754,
"line_max": 142,
"alpha_frac": 0.5874854116,
"autogenerated": false,
"ratio": 4.25802752293578,
... |
from Foundation import *
import objc
class RPCMethod(NSObject):
def initWithDocument_name_(self, aDocument, aName):
self = super(RPCMethod, self).init()
self.document = aDocument
self.k_methodName = aName
self.k_methodSignature = None
self.k_methodDescription = None
... | {
"repo_name": "albertz/music-player",
"path": "mac/pyobjc-framework-Cocoa/Examples/Twisted/WebServicesTool-CocoaBindings/RPCMethod.py",
"copies": "3",
"size": "1123",
"license": "bsd-2-clause",
"hash": -769448619926685700,
"line_mean": 32.0294117647,
"line_max": 73,
"alpha_frac": 0.679430098,
"auto... |
from Foundation import *
# enum ToDoItemStatus
INCOMPLETE=0
COMPLETE=1
DEFER_TO_NEXT_DAY=2
SECS_IN_MINUTE=60
SECS_IN_HOUR=SECS_IN_MINUTE*60
SECS_IN_DAY=SECS_IN_HOUR*24
SECS_IN_WEEK=SECS_IN_DAY*7
class ToDoItem (NSObject):
__slots__ = (
'_day',
'_itemName',
'_notes',
'_timer',
... | {
"repo_name": "albertz/music-player",
"path": "mac/pyobjc-framework-Cocoa/Examples/AppKit/Todo/ToDoItem.py",
"copies": "3",
"size": "4451",
"license": "bsd-2-clause",
"hash": 2305598237088146200,
"line_mean": 22.0621761658,
"line_max": 84,
"alpha_frac": 0.5708829477,
"autogenerated": false,
"rati... |
from Foundation import NSBundle
import halfcaff.util
APPDIR = None
if not halfcaff.util.is_dev_mode():
APPDIR = NSBundle.mainBundle().bundlePath()
def is_login_enabled():
if not APPDIR:
return False
return APPDIR in list_login_items()
def enable_startup_at_login():
add_login_item(APPDIR)
def... | {
"repo_name": "dougn/HalfCaff",
"path": "halfcaff/login.py",
"copies": "1",
"size": "9234",
"license": "mit",
"hash": -6490095444801592000,
"line_mean": 49.7417582418,
"line_max": 230,
"alpha_frac": 0.6626597358,
"autogenerated": false,
"ratio": 3.7248890681726503,
"config_test": false,
"has_... |
from Foundation import NSBundle, NSLog
import urllib, urllib2
import sys
import os
import json
import base64
import glob
#sensorpath = os.path.join("~", "Documents", "VMware", "WorkspaceONESensorMigration") #"~/Documents/VMware/WorkspaceOneSensorMigration/"
sensorpath = "SensorData/"
def oslog(text):
try:
... | {
"repo_name": "vmwaresamples/AirWatch-samples",
"path": "macOS-Samples/Tools/CustomAttributesToSensorsMigration/migrator.py",
"copies": "1",
"size": "8991",
"license": "bsd-3-clause",
"hash": 4124600617743453000,
"line_mean": 31.4620938628,
"line_max": 136,
"alpha_frac": 0.619730842,
"autogenerated... |
from Foundation import NSData
from objc import *
from pyble._gatt import Service, Characteristic, Descriptor
from util import CBUUID2String
import uuid
import logging
from pprint import pprint, pformat
import struct
logger = logging.getLogger(__name__)
from pyble.patterns import Trace
from pyble.handlers import Pro... | {
"repo_name": "brettchien/PyBLEWrapper",
"path": "pyble/osx/gatt.py",
"copies": "1",
"size": "10489",
"license": "mit",
"hash": 3378833135565165000,
"line_mean": 32.9449838188,
"line_max": 93,
"alpha_frac": 0.5807989322,
"autogenerated": false,
"ratio": 4.361330561330561,
"config_test": false,
... |
from Foundation import NSDate
from AppKit import NSRunLoop, NSProgressIndicator, NSProgressIndicatorBarStyle, NSProgressIndicatorSpinningStyle
from vanilla.vanillaBase import VanillaBaseObject, _sizeStyleMap, osVersion10_11, osVersionCurrent
class ProgressBar(VanillaBaseObject):
"""
A standard progress bar.::... | {
"repo_name": "moyogo/vanilla",
"path": "Lib/vanilla/vanillaProgressBar.py",
"copies": "1",
"size": "4547",
"license": "mit",
"hash": 568544268864587300,
"line_mean": 31.9492753623,
"line_max": 123,
"alpha_frac": 0.6012755663,
"autogenerated": false,
"ratio": 4.322243346007604,
"config_test": f... |
from Foundation import NSInvocation, NSString, NSMakeRange, NSMaxRange, NSLocationInRange, NSNotFound, NSMakeRect, NSMinY, NSWidth, NSHeight
from AppKit import NSRulerView, NSMiniControlSize, NSTextView, NSNotificationCenter, \
NSFontAttributeName, NSForegroundColorAttributeName, NSTextStorageDidProcessEditingNotif... | {
"repo_name": "schriftgestalt/drawbot",
"path": "drawBot/ui/lineNumberRulerView.py",
"copies": "3",
"size": "7612",
"license": "bsd-2-clause",
"hash": -3555628811278889000,
"line_mean": 34.9056603774,
"line_max": 155,
"alpha_frac": 0.630189175,
"autogenerated": false,
"ratio": 4.139206090266449,
... |
from Foundation import NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge
from AppKit import *
from vanillaBase import VanillaBaseObject, _breakCycles
_drawerEdgeMap = {
"left": NSMinXEdge,
"right": NSMaxXEdge,
"top": NSMaxYEdge,
"bottom": NSMinYEdge,
}
class Drawer(VanillaBaseObject):
"""
A dr... | {
"repo_name": "bitforks/vanilla",
"path": "Lib/vanilla/vanillaDrawer.py",
"copies": "3",
"size": "4048",
"license": "mit",
"hash": -4163901866368052000,
"line_mean": 30.3798449612,
"line_max": 107,
"alpha_frac": 0.5946146245,
"autogenerated": false,
"ratio": 4.072434607645875,
"config_test": fa... |
from Foundation import NSMaxXEdge, NSMaxYEdge, NSMinXEdge, NSMinYEdge
from AppKit import NSDrawer
from vanilla.vanillaBase import VanillaBaseObject, _breakCycles
_drawerEdgeMap = {
"left": NSMinXEdge,
"right": NSMaxXEdge,
"top": NSMaxYEdge,
"bottom": NSMinYEdge,
}
class Drawer(VanillaBaseObject):
... | {
"repo_name": "typesupply/vanilla",
"path": "Lib/vanilla/vanillaDrawer.py",
"copies": "1",
"size": "4350",
"license": "mit",
"hash": -7011963176605780000,
"line_mean": 29.2083333333,
"line_max": 96,
"alpha_frac": 0.5977011494,
"autogenerated": false,
"ratio": 4.027777777777778,
"config_test": f... |
from Foundation import NSObject
from AppKit import NSApplication, NSMenu, NSMenuItem, NSBundle
from PyObjCTools import AppHelper
class _VanillaMiniAppDelegate(NSObject):
def applicationShouldTerminateAfterLastWindowClosed_(self, notification):
return True
def executeVanillaTest(cls, nibPath=None, calls... | {
"repo_name": "moyogo/vanilla",
"path": "Lib/vanilla/test/testTools.py",
"copies": "1",
"size": "1659",
"license": "mit",
"hash": -1904598765625577000,
"line_mean": 32.18,
"line_max": 95,
"alpha_frac": 0.6877637131,
"autogenerated": false,
"ratio": 3.796338672768879,
"config_test": false,
"ha... |
from Foundation import NSObject
from AppKit import NSApplication, NSMenu, NSMenuItem, NSBundle
from PyObjCTools import AppHelper
class _VanillaMiniApp(NSApplication): pass
class _VanillaMiniAppDelegate(NSObject):
def applicationShouldTerminateAfterLastWindowClosed_(self, notification):
return True
de... | {
"repo_name": "typesupply/vanilla",
"path": "Lib/vanilla/test/testTools.py",
"copies": "1",
"size": "1706",
"license": "mit",
"hash": 37817626497900696,
"line_mean": 31.1886792453,
"line_max": 95,
"alpha_frac": 0.6905041032,
"autogenerated": false,
"ratio": 3.7494505494505495,
"config_test": fa... |
from Foundation import NSObject
from AppKit import NSApp, NSWindow, NSPanel, NSScreen, NSWindowController, NSToolbar, NSToolbarItem, NSImage, NSNormalWindowLevel, NSFloatingWindowLevel, NSClosableWindowMask, NSMiniaturizableWindowMask, NSResizableWindowMask, NSTexturedBackgroundWindowMask, NSUnifiedTitleAndToolbarWindo... | {
"repo_name": "typesupply/vanilla",
"path": "Lib/vanilla/vanillaWindows.py",
"copies": "1",
"size": "49777",
"license": "mit",
"hash": -2328158993842472000,
"line_mean": 43.8441441441,
"line_max": 841,
"alpha_frac": 0.5451513751,
"autogenerated": false,
"ratio": 4.880098039215686,
"config_test"... |
from Foundation import NSObject
from AppKit import NSBeep
from grow.server import manager
class Pod(NSObject, manager.PodServer):
def __new__(cls, *args, **kwargs):
return cls.alloc().init()
class GrowLauncherModel(NSObject):
"""A delegate and a data source for NSTableView."""
def __init__(self):
se... | {
"repo_name": "jeremydw/macgrow",
"path": "macgrow/GrowLauncherModel.py",
"copies": "1",
"size": "1641",
"license": "mit",
"hash": 2544841794492075500,
"line_mean": 24.640625,
"line_max": 75,
"alpha_frac": 0.6825106642,
"autogenerated": false,
"ratio": 3.598684210526316,
"config_test": false,
... |
from Foundation import NSObject
from AppKit import NSTabView, NSTabViewItem, NSNoTabsNoBorder, NSFont
from vanilla.vanillaBase import VanillaBaseObject, _breakCycles, _sizeStyleMap, VanillaCallbackWrapper, \
_reverseSizeStyleMap
class VanillaTabItem(VanillaBaseObject):
nsTabViewItemClass = NSTabViewItem
... | {
"repo_name": "typesupply/vanilla",
"path": "Lib/vanilla/vanillaTabs.py",
"copies": "1",
"size": "5287",
"license": "mit",
"hash": -1776383616702785500,
"line_mean": 31.237804878,
"line_max": 105,
"alpha_frac": 0.6075278986,
"autogenerated": false,
"ratio": 3.8732600732600733,
"config_test": fa... |
from Foundation import NSObject
from AppKit import NSTextView, NSScrollView, NSBezelBorder, NSViewWidthSizable, NSViewHeightSizable
from vanilla.nsSubclasses import getNSSubclass
from vanilla.vanillaBase import VanillaBaseObject, VanillaCallbackWrapper
from vanilla.py23 import unicode
class VanillaTextEditorDelegate(... | {
"repo_name": "moyogo/vanilla",
"path": "Lib/vanilla/vanillaTextEditor.py",
"copies": "1",
"size": "4795",
"license": "mit",
"hash": 334249094878770300,
"line_mean": 33.0070921986,
"line_max": 118,
"alpha_frac": 0.6412930136,
"autogenerated": false,
"ratio": 4.105308219178082,
"config_test": fa... |
from Foundation import NSObject
from objc import *
from AppKit import NSBezierPath
from fieldMath import *
#____________________________________________________________
class CGraphModel(NSObject):
def init(self):
self.field = [1.0, 1.12, 0.567]
self.phase = [degToRad(0), degToRad(152.6), degToRa... | {
"repo_name": "albertz/music-player",
"path": "mac/pyobjc-framework-Cocoa/Examples/AppKit/FieldGraph/CGraphModel.py",
"copies": "3",
"size": "2373",
"license": "bsd-2-clause",
"hash": -5393417703185170000,
"line_mean": 28.2962962963,
"line_max": 122,
"alpha_frac": 0.5465655289,
"autogenerated": fal... |
from Foundation import NSObject, NSBundle
from objc import selector, getClassList, objc_object, IBOutlet, IBAction
import objc
import AppKit
objc.setVerbose(1)
try:
import AddressBook
except ImportError:
pass
try:
import PreferencePanes
except ImportError:
pass
try:
import InterfaceBuilder
excep... | {
"repo_name": "Khan/pyobjc-framework-Cocoa",
"path": "Examples/AppKit/iClass/datasource.py",
"copies": "3",
"size": "6216",
"license": "mit",
"hash": 3254778077971088400,
"line_mean": 27.5137614679,
"line_max": 87,
"alpha_frac": 0.5937902188,
"autogenerated": false,
"ratio": 3.9795134443021767,
... |
from Foundation import NSURL
from AppKit import NSDragOperationNone, NSBezelBorder
from Quartz import PDFView, PDFThumbnailView, PDFDocument
from vanilla import Group
epsPasteBoardType = "CorePasteboardFlavorType 0x41494342"
class DrawBotPDFThumbnailView(PDFThumbnailView):
def draggingUpdated_(self, draggingIn... | {
"repo_name": "schriftgestalt/drawbot",
"path": "drawBot/ui/drawView.py",
"copies": "4",
"size": "3054",
"license": "bsd-2-clause",
"hash": -8564963319781553000,
"line_mean": 27.5420560748,
"line_max": 97,
"alpha_frac": 0.6178781925,
"autogenerated": false,
"ratio": 4.0828877005347595,
"config_... |
from foundation.Message import Message
import logging
import FoundationException
import xml.dom.minidom
import uuid
'''
The Bid class defines methods required for the operation of the
offers, including values and decision variables, as well as
Id, service provider, and service to be offered.
'''
class Bid(object):
... | {
"repo_name": "lmarent/network_agents_ver2_python",
"path": "agents/foundation/Bid.py",
"copies": "1",
"size": "11557",
"license": "mit",
"hash": -7561416983152681000,
"line_mean": 32.6967930029,
"line_max": 136,
"alpha_frac": 0.633555421,
"autogenerated": false,
"ratio": 4.404344512195122,
"co... |
from fov import fov
import curses, random
DUNGEON = """
##### #########
#
# ###########
#
## ######### #
#
#
# ######## ######## #
# # ... | {
"repo_name": "elemel/python-fov",
"path": "src/fov_demo.py",
"copies": "1",
"size": "6872",
"license": "mit",
"hash": 7736111517944579000,
"line_mean": 32.0384615385,
"line_max": 77,
"alpha_frac": 0.4701688009,
"autogenerated": false,
"ratio": 3.63790365272631,
"config_test": false,
"has_no_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.