text stringlengths 4 1.02M | meta dict |
|---|---|
from setuptools import setup, find_packages
setup(
name='django-pipeline',
version='1.2.12',
description='Pipeline is an asset packaging library for Django.',
long_description=open('README.rst').read() + '\n\n' +
open('HISTORY.rst').read(),
author='Timothée Peignier',
author_email='tim... | {
"content_hash": "4fadcd379e55b00148dbc92da2b13e51",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 69,
"avg_line_length": 32.08,
"alnum_prop": 0.6346633416458853,
"repo_name": "edx/django-pipeline",
"id": "867297344df39a57de3ddae1bdd6965f73cb63ae",
"size": "827",
"bina... |
import wx
from wx import glcanvas
from OpenGL.GL import *
from OpenGL.GLUT import *
from jumeg.tsv.plot2d.jumeg_tsv_plot2d_ogl import JuMEG_TSV_PLOT2D_OGL
# from jumeg.tsv.test.axis01 import JuMEG_TSV_AXIS
attribList = (glcanvas.WX_GL_RGBA, # RGBA
glcanvas.WX_GL_DOUBLEBUFFER, # Double Buffer... | {
"content_hash": "6669bafc253b18096df9cb37533c9f8c",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 90,
"avg_line_length": 30.429718875502008,
"alnum_prop": 0.47683779860102943,
"repo_name": "fboers/jumegX",
"id": "670c651032740679658b8f4328c95f3b04e24b56",
"size": "7577... |
from django.conf import settings
USER_ONLINE_TIMEOUT = getattr(settings, 'USER_ONLINE_TIMEOUT', 600)
USER_LAST_LOGIN_EXPIRE = getattr(settings, 'USER_LAST_LOGIN_EXPIRE', 60 * 60 * 24 * 7)
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') | {
"content_hash": "407bf77f3cba27463ebdc25f80092879",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 86,
"avg_line_length": 51.2,
"alnum_prop": 0.73828125,
"repo_name": "r26zhao/django_blog",
"id": "b38c0730b510e986e24675f0c497f255578033c3",
"size": "256",
"binary": false... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../src'))
sys.path.insert(0, '... | {
"content_hash": "aa5599a02293b9b2c373113ed9b98fcc",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 80,
"avg_line_length": 32.243478260869566,
"alnum_prop": 0.7019956850053938,
"repo_name": "sciapp/pyMolDyn",
"id": "acf9d9ab061f249d9bc94be78c11422565dde883",
"size": "783... |
from sqlalchemy import Column
from sqlalchemy import MetaData, Integer, Table, ForeignKey
def upgrade(migrate_engine):
"""Add allocated_id to the reservations table."""
meta = MetaData()
meta.bind = migrate_engine
reservations = Table('storage_reservations', meta, autoload=True)
Table('storage_qu... | {
"content_hash": "08078382d540e20fd00a5661ce343f45",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 83,
"avg_line_length": 36.9375,
"alnum_prop": 0.6971235194585449,
"repo_name": "HybridF5/jacket",
"id": "8c256e5dfba8a875de12aa91346bb98ca39e26b9",
"size": "1164",
"binar... |
from django.db import models
class LilBox(models.Model):
title = models.CharField(max_length=255, blank=False, null=False, db_index=True, unique=True)
content = models.TextField(blank=False, null=False)
published = models.BooleanField(default=False)
def __unicode__(self):
return self.title
| {
"content_hash": "767aa3c1ec9e4bfcf539d36852671079",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 97,
"avg_line_length": 35.22222222222222,
"alnum_prop": 0.7160883280757098,
"repo_name": "asmedrano/django-lilbox",
"id": "f0016d263835d3e24127576ad5576e37104e9977",
"size":... |
"""
Some models purely for testing
"""
from django.db import models
from django.core.files.storage import FileSystemStorage
def _get_storage():
"""
Create a filesystemstorage
"""
return FileSystemStorage(location="simple_resizer/tests/assets/",
base_url="http://www.exampl... | {
"content_hash": "06a7ea644122d1c679b474eedbc45022",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 24.958333333333332,
"alnum_prop": 0.6360601001669449,
"repo_name": "zakdoek/django-simple-resizer",
"id": "4600a7ae537ce02f7484d65c4d5279b5a0d09e1b",
... |
from datetime import datetime
from hakoblog.action.user import UserAction
from hakoblog.loader.blog import BlogLoader
class BlogAction:
@classmethod
def create(self, db, owner_id, title):
now = datetime.now()
new_id = db.uuid_short()
with db.cursor() as cursor:
cursor.exec... | {
"content_hash": "15eb9eb64580807a57994a557d614c34",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 77,
"avg_line_length": 30.441176470588236,
"alnum_prop": 0.5217391304347826,
"repo_name": "hakobe/hakoblog-python",
"id": "aa292b9bcbdaae618701ed9d0a3b199d1cfda005",
"size"... |
from __future__ import absolute_import, division, print_function
from pandora import check_mx_records
from pandora.utils import _mx_records_cache
from time import sleep
from time import time
import pandora
class TestUtils(object):
def test_check_mx_records(self):
assert check_mx_records('google.com', 1) ... | {
"content_hash": "e6425aad3eaaedd1913150d0469049ed",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 67,
"avg_line_length": 30.8,
"alnum_prop": 0.627435064935065,
"repo_name": "CorverDevelopment/Pandora",
"id": "3860f235e10310f89846e6c2a8be8becfa06db31",
"size": "1257",
... |
import pprint
import re
import argparse
import subprocess
import json
import os
from itertools import combinations
from common import settings, debug, error, status_update, get_router
from common import dump_json, load_json, get_subnet, is_network_public
import yaml
tick = '✔'
cross = '✘'
def get_... | {
"content_hash": "51dae2a8ed92d89f2c83ea8b457b76e6",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 156,
"avg_line_length": 40.33516483516483,
"alnum_prop": 0.530036779730282,
"repo_name": "codebauss/don",
"id": "82dd17835b6b91e60f256da7e414489c444f83dd",
"size": "14830"... |
import os
import subprocess
import sys
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
PATCHES_DIR = os.path.join(SOURCE_ROOT, 'patches')
SRC_DIR = os.path.join(SOURCE_ROOT, '..', '..', 'src')
GIT_EXE = 'git'
def main():
error = apply_patches_for_dir(PATCHES_DIR)
if not error:
retu... | {
"content_hash": "01280ebfccdb6d462d920cbc407b5df7",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 73,
"avg_line_length": 25.487179487179485,
"alnum_prop": 0.6207243460764588,
"repo_name": "brave/electron",
"id": "491ba21f94b9b19dd99ddab2bd1068afa4fbf429",
"size": "1017"... |
from re_test_patterns import test_patterns
test_patterns(
'This is some text -- with punctuation.',
[('[^-. ]+', 'sequences without -, ., or space')],
)
| {
"content_hash": "45bde1e0a31ba48258fe55b99f662a69",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 54,
"avg_line_length": 23.285714285714285,
"alnum_prop": 0.6134969325153374,
"repo_name": "jasonwee/asus-rt-n14uhp-mrtg",
"id": "547720e83836c38da4ca29e002914a328f610098",
"... |
import enum
from django.utils.translation import ugettext_lazy as _
class NotifyLevel(enum.IntEnum):
involved = 1
all = 2
none = 3
NOTIFY_LEVEL_CHOICES = (
(NotifyLevel.involved, _("Involved")),
(NotifyLevel.all, _("All")),
(NotifyLevel.none, _("None")),
)
| {
"content_hash": "028d1eb657b9909fa5506783ab7c3b2b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 55,
"avg_line_length": 19,
"alnum_prop": 0.6385964912280702,
"repo_name": "curiosityio/taiga-docker",
"id": "a6fdfe31d3ba098e634cb113e6f6f4a6415a3d23",
"size": "1197",
"b... |
from csacompendium.research.models import Author
from csacompendium.utils.pagination import APILimitOffsetPagination
from csacompendium.utils.permissions import IsOwnerOrReadOnly
from csacompendium.utils.viewsutils import DetailViewUpdateDelete, CreateAPIViewHook
from rest_framework.filters import DjangoFilterBackend
f... | {
"content_hash": "9218547e01187dc7f1ecc8fed27162fa",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 84,
"avg_line_length": 34.84615384615385,
"alnum_prop": 0.7179911699779249,
"repo_name": "nkoech/csacompendium",
"id": "2087bba2332ea7779aeb33a72a5bbe04e77f666b",
"size": "... |
"""
Migration for the Submitty system.
adds email_enabled boolean to config/email.json
"""
from pathlib import Path
import json
import os
def up(config):
email_filename = str(Path(config.submitty['submitty_install_dir'], 'config', 'email.json'))
# read json and add email_enabled field
try:
with op... | {
"content_hash": "4ca969a524f7174ac2217d55ba60cc00",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 95,
"avg_line_length": 31.647058823529413,
"alnum_prop": 0.6171003717472119,
"repo_name": "RCOS-Grading-Server/HWserver",
"id": "e66758a2fa54e3e9324daf01149fc69ad6327f6b",
... |
"""Receives documents from the oplog worker threads and indexes them
into the backend.
This file is a document manager for the Solr search engine, but the intent
is that this file can be used as an example to add on different backends.
To extend this to other systems, simply implement the exact same class and
replace ... | {
"content_hash": "a4540d4e565be424643ddbff91a9c802",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 80,
"avg_line_length": 37.325,
"alnum_prop": 0.5619557937039518,
"repo_name": "llvtt/mongo-connector",
"id": "956f66ac41a3a081d820d61fd605d8fc5b475430",
"size": "11030",
... |
import logging
import os
import re
import yaml
from .utils import tempdir, setup_gpg_confs, which
from .crypt import ensure_keys, import_keys, get_default_recipient
HOMEDIR = os.path.expanduser("~")
DEFAULT_CONFIG_PATH = os.path.join(os.path.join(HOMEDIR, '.passpierc'))
DEFAULT = {
'path': os.path.join(os.path.... | {
"content_hash": "8388bf6895b8495224dfd731468f2345",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 85,
"avg_line_length": 31.397260273972602,
"alnum_prop": 0.6055846422338569,
"repo_name": "eiginn/passpie",
"id": "e3b10093b2748c7df7951fded91b3aa6b1b17dcf",
"size": "2316"... |
import argparse
import joubini
import os
class CLIDispatcher:
operation_info={
'list_environments':{
'help':'List the stored environments.',
'initial':'l'
},
'print_environment':{
'help':'Print all entries in the specified environment.',
... | {
"content_hash": "b0444f2fd7a90016ffc2bd3daae93333",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 256,
"avg_line_length": 42.578512396694215,
"alnum_prop": 0.5861801242236024,
"repo_name": "edofleini/joubini",
"id": "75bc42fa74ae88d7997a8d5727d862926610a236",
"size": "... |
from __future__ import division
__all__ = ['Categorical', 'CategoricalAndConcentration', 'Multinomial',
'MultinomialAndConcentration', 'GammaCompoundDirichlet', 'CRP']
import numpy as np
from warnings import warn
import scipy.stats as stats
import scipy.special as special
from pybasicbayes.abstractions imp... | {
"content_hash": "155f1c71bc3bfae4afd2f6adaed6e325",
"timestamp": "",
"source": "github",
"line_count": 465,
"max_line_length": 100,
"avg_line_length": 36.645161290322584,
"alnum_prop": 0.6164906103286385,
"repo_name": "fivejjs/pybasicbayes",
"id": "64ea15504284f100e5cabecdaaac47e764bab291",
"size"... |
import numpy as np
import theano
import os
import pickle
def all_samples(sentences, confusion_set):
token_a = confusion_set[0]
token_b = confusion_set[1]
samples = []
for sentence in sentences:
for i, token in enumerate(sentence):
if token == token_a:
... | {
"content_hash": "ace4af1417780ceddaa2ae4b54c7ca61",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 145,
"avg_line_length": 27.75,
"alnum_prop": 0.5267979844251031,
"repo_name": "Gnork/confusion-words",
"id": "004416345303aad266c22ca29397feacf6b52959",
"size": "6549",
... |
import logging
import os
from unittest import mock
import fixtures
from oslo_concurrency import lockutils
from oslo_config import fixture as config_fixture
from oslo_utils import strutils
import testtools
from os_brick.initiator.connectors import nvmeof
class TestCase(testtools.TestCase):
"""Test case base clas... | {
"content_hash": "45c5d0a3060ecdc72e49001b04a4b619",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 79,
"avg_line_length": 38.74766355140187,
"alnum_prop": 0.6133622768933912,
"repo_name": "openstack/os-brick",
"id": "8f57b69b9d80cf0b759a312f220998468e334578",
"size": "4... |
import json
from django.shortcuts import render, redirect, get_object_or_404
from django.core.urlresolvers import reverse
from django.core.paginator import Paginator
from django.http import Http404, HttpResponseBadRequest
from django.contrib.auth.decorators import permission_required
from django.db.models import Q
from... | {
"content_hash": "458fc9c029b56e8839a9a12e0ff99371",
"timestamp": "",
"source": "github",
"line_count": 472,
"max_line_length": 106,
"avg_line_length": 35.853813559322035,
"alnum_prop": 0.5790344501565916,
"repo_name": "tkliuxing/bookspider",
"id": "08d26defa60c5715ce46808eb62ac4e58feea9ac",
"size"... |
"""
Contains code that takes a representation of a Genome and cantus firmus and
turns them into a .ly file so GNU Lilypond (http://lilypond.org/) can turn it
into printed sheet music and a midi file.
For duration, given counterpoint of species < 5, it is possible to work out the
number of notes and their durations fro... | {
"content_hash": "81649b3e495a37cda1f5e0be3c7b4e80",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 79,
"avg_line_length": 27.141552511415526,
"alnum_prop": 0.5984185733512786,
"repo_name": "LoganRickert/foox",
"id": "2bea0200f586a78222831328b028cc71599cb2bd",
"size": "5... |
from nose.tools import assert_equal, raises
from .. import Pokemon
class TestPokemon(object):
def __init__(self):
self.name = ''
self.full_name = ''
def setup(self):
self.name = 'eggs'
self.full_name = 'eggs-spam'
@raises(TypeError)
def test_init_zero_arguments(self... | {
"content_hash": "5ba95700f391ce24af7fcfedfd2c035b",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 67,
"avg_line_length": 27.096774193548388,
"alnum_prop": 0.6345238095238095,
"repo_name": "dnguyen0304/clare",
"id": "2b168b00101c61372e75552fd95ce4cdcd2d91f7",
"size": "86... |
import mechanize
from storage import WordLog
from BeautifulSoup import BeautifulSoup
def reference(word):
br = mechanize.Browser()
response = br.open('http://www.dictionary.reference.com')
br.select_form(nr=0)
br.form['q'] = word
br.submit()
definition = BeautifulSoup(br.response().read())
... | {
"content_hash": "159b1a9e6cad1ca1839b48fafaed0014",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 77,
"avg_line_length": 30.875,
"alnum_prop": 0.6180836707152496,
"repo_name": "tijko/VocabDB",
"id": "aaef8a24f0e1451934693b42099746985ff273c2",
"size": "788",
"binary": ... |
_USE_PYFFTW = False #Change to True for always using pyFFTW
| {
"content_hash": "b4191801096284872e5867206cb8c85f",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 59,
"avg_line_length": 60,
"alnum_prop": 0.7666666666666667,
"repo_name": "opticspy/lightpipes",
"id": "006c393638368af00c5433efc799bf21c76f609f",
"size": "60",
"binary": ... |
from django.utils import timezone
from django.db import models
from django.db.models import Max
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from geocamUtil.models.AbstractEnum import AbstractEnumModel
from geocamUtil.UserUtil impor... | {
"content_hash": "45ca4359042506e3c8998bcef8c7319f",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 177,
"avg_line_length": 36.83460559796438,
"alnum_prop": 0.5984387952473059,
"repo_name": "xgds/xgds_sample",
"id": "b0780696fe73b2461e8928cec49ddf30619f989d",
"size": "15... |
def check_plug_measurement(data):
"""
checks if a plug measurement includes
None value for measures, which means the plug
has been shut down
:param data: a dictionary representing a plug measurement
:return: boolean
"""
if not (data['load'] and data['irms'] and data['vrms'] and
data['freq'] and data['work'])... | {
"content_hash": "3f2926a46cd73dabe5d299f9531ad3f7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 29.46153846153846,
"alnum_prop": 0.6971279373368147,
"repo_name": "i13tum/i13monserver",
"id": "968a37bb28560440524e9ee5f8cd70059e238a82",
"size": "3... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../src/'))
# -- Genera... | {
"content_hash": "48c61ddd51373787f63082f84f55d059",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 81,
"avg_line_length": 31.481012658227847,
"alnum_prop": 0.7045972389760086,
"repo_name": "dinoboff/schemabuilder",
"id": "61c95ea8e353d0fae08f11c5ae9ee311f7c5aec5",
"size... |
import pcalendar
import datetime
import utils
import string
import bisect
import plocale
#@-node:<< Imports >>
#@nl
_is_source = True
_to_datetime = pcalendar.to_datetime
_ = plocale.get_gettext()
#@+others
#@+node:_isattrib
#@+doc
#@nonl
# is used to find snapshot attributes
#@-doc
#@@code
def _isattrib(obj, a):
... | {
"content_hash": "f9f611c20169a588f2adb0537c78e4c0",
"timestamp": "",
"source": "github",
"line_count": 837,
"max_line_length": 83,
"avg_line_length": 29.548387096774192,
"alnum_prop": 0.5478732007116287,
"repo_name": "chjw8016/GreenOdoo7-haibao",
"id": "faee81749943c13f1123c72b184562c30ec6cee0",
"... |
"""
A "grab bag" of relatively small general-purpose utilities that don't have
a clear module/package to live in.
"""
import abc
import contextlib
import difflib
import inspect
import json
import os
import signal
import sys
import traceback
import unicodedata
import locale
import threading
import re
from contextlib i... | {
"content_hash": "9830d59b16cc4cf7225a8abc272ade99",
"timestamp": "",
"source": "github",
"line_count": 882,
"max_line_length": 124,
"avg_line_length": 33.941043083900226,
"alnum_prop": 0.6006146445750935,
"repo_name": "aleksandr-bakanov/astropy",
"id": "e8a929621b9c1debd5c2e5376c821959dfa6e511",
"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('skyshaker', '0026_project_user'),
]
operations = [
migrations.RenameField(
model_name='project',
old_name='user',
... | {
"content_hash": "0a6b37c7f0218b121522bf0fe74554e1",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 43,
"avg_line_length": 19.833333333333332,
"alnum_prop": 0.5714285714285714,
"repo_name": "tlpinney/geomakers",
"id": "d15fe06750eb3e1d41d8563ead1b0bc2b423227f",
"size": "3... |
import argparse
import itertools
import json
import os
import re
import logging
import sys
from c7n.credentials import SessionFactory
from c7n.config import Config
from c7n.policy import load as policy_load, PolicyCollection
from c7n import mu
# TODO: mugc has alot of aws assumptions
from c7n.resources.aws import AW... | {
"content_hash": "c1fd2ef143da2dbf038a7b98a88d2dd6",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 93,
"avg_line_length": 33.86486486486486,
"alnum_prop": 0.6062782654961426,
"repo_name": "thisisshi/cloud-custodian",
"id": "ffacac40567c9ef25327124fae30baf9eac460bc",
"si... |
import sys
from os import path
def check_inputs(*pathstrs):
for pathstr in pathstrs:
if not path.exists(pathstr):
print "ERROR: input '%s' doesn't exist" % pathstr
raise SystemExit(2)
_,ext = path.splitext(pathstr)
if ext != ".py":
print "ERROR: input '%s... | {
"content_hash": "9f012bdb232669ad18effdcafa756fa6",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 78,
"avg_line_length": 29.16,
"alnum_prop": 0.635116598079561,
"repo_name": "sgiavasis/C-PAC",
"id": "4d2024a47b5e3f3510259e52dc27c52a3b34021e",
"size": "752",
"binary": ... |
"""
This is the implementation of Copy-NET
We start from the basic Seq2seq framework for a auto-encoder.
"""
import logging
import time
import numpy as np
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from experiments.config import setup_syn
from emolga.utils.generic_utils import *
from emolga.... | {
"content_hash": "e1cc6b9f5fc68c33b0f0136140ab0c24",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 109,
"avg_line_length": 36.50915750915751,
"alnum_prop": 0.5171064512892546,
"repo_name": "MingyuanXie/CopyNet",
"id": "5a85e98ea298817e65d29bc199f5380a094b5c1b",
"size": ... |
"""Tests for the heteroscedastic ViT on JFT-300M model script."""
import os.path
import pathlib
import tempfile
from absl import flags
from absl import logging
from absl.testing import flagsaver
from absl.testing import parameterized
import jax
import numpy as np
import tensorflow as tf
import tensorflow_datasets as t... | {
"content_hash": "1f208319e6d180a4812bf6ba0b34863f",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 118,
"avg_line_length": 44.30681818181818,
"alnum_prop": 0.6472172351885098,
"repo_name": "google/uncertainty-baselines",
"id": "b04607b834fe148c3c64134503cc58877bf3a62c",
... |
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.conf import settings
from django.contrib.gis.db import models
from django.forms import ModelForm, TextInput
class Post(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL)
title = models.Char... | {
"content_hash": "ba22fc1279fee3812097368b8fdc01b4",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 85,
"avg_line_length": 37.136986301369866,
"alnum_prop": 0.6702323865732203,
"repo_name": "wkww/art-c",
"id": "d533518ca105ac257e01787563386a49f6206450",
"size": "2711",
... |
import numpy as np
import warnings
try:
import matplotlib.pyplot as plt
import matplotlib
except ImportError:
warnings.warn("matplotlib could not be loaded!")
pass
from ._labels import labels
from ..utils import safe_isinstance, format_value
from . import colors
# TODO: If we make a JS version of this... | {
"content_hash": "4d6b2ebf89aa9da29ded5f3bc38d9e81",
"timestamp": "",
"source": "github",
"line_count": 613,
"max_line_length": 121,
"avg_line_length": 43.34747145187602,
"alnum_prop": 0.6182824025289779,
"repo_name": "slundberg/shap",
"id": "50d1a8a14a0e5419fb5db879d3eed06119757376",
"size": "2657... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'File.halstead_volume'
db.add_column(u'parsr_file', 'halstead_volume',
self.gf('django.db.model... | {
"content_hash": "76ed0c8352f1c58391ebed8dea1937d5",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 151,
"avg_line_length": 62.58771929824562,
"alnum_prop": 0.5690259285213735,
"repo_name": "frontendphil/analyzr",
"id": "f03209a12b9ed28540d0c1c24548e881376d3fc4",
"size":... |
import binascii
import os
import random
import re
import time
from datetime import datetime
from django import forms
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.contrib.auth.signals import user_logged_in
from django.core import validators
from ... | {
"content_hash": "4730efd14c9139118060810722d67056",
"timestamp": "",
"source": "github",
"line_count": 622,
"max_line_length": 79,
"avg_line_length": 37.450160771704184,
"alnum_prop": 0.6297329784493861,
"repo_name": "aviarypl/mozilla-l10n-addons-server",
"id": "03e24f297fa080b012b0d04dd0433f73b8722... |
'''
rrsig_time - Record test: RrsigTime
.. Copyright (c) 2015 Neustar, Inc. All rights reserved.
.. See COPYRIGHT.txt for full notice. See LICENSE.txt for terms and conditions.
'''
import dns_sprockets_lib.validators as validators
class RrsigTime(validators.RecTest):
# pylint: disable=too-few-public-methods
... | {
"content_hash": "1fe736f6cefc1131b8669d185775f6b5",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 80,
"avg_line_length": 26.285714285714285,
"alnum_prop": 0.6725543478260869,
"repo_name": "ultradns/dns_sprockets",
"id": "c38b93427fe8366ecf721a224349ff822139c3b0",
"size"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('partner', '0085_auto_20181106_0852'),
]
operations = [
migrations.AlterField(
model_name='partnerreporting',
name='link_repo... | {
"content_hash": "e81273c7a301774a1abaad6cddbe0b3f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 74,
"avg_line_length": 23.166666666666668,
"alnum_prop": 0.6115107913669064,
"repo_name": "unicef/un-partner-portal",
"id": "1e754e503f7ebf495681314979cc83400cfcd818",
"siz... |
from google.cloud import vmmigration_v1
def sample_create_group():
# Create a client
client = vmmigration_v1.VmMigrationClient()
# Initialize request argument(s)
request = vmmigration_v1.CreateGroupRequest(
parent="parent_value",
group_id="group_id_value",
)
# Make the reques... | {
"content_hash": "6a4902e1769d4378477861f9fb7eec65",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 61,
"avg_line_length": 23.791666666666668,
"alnum_prop": 0.691768826619965,
"repo_name": "googleapis/python-vm-migration",
"id": "b7d5433aa0b7121c3d787f5f72882853cf56d58e",
... |
from concurrent.futures import ThreadPoolExecutor
import re
import asyncio
from time import time
class Bcolors(object):
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class Ba... | {
"content_hash": "5db75a60958a0fb1e7fc6a61234aa646",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 118,
"avg_line_length": 30.973509933774835,
"alnum_prop": 0.6196279666452854,
"repo_name": "pypeflow/pypeflow",
"id": "88aa480be0b86f09163453a1a0d75d6bb512cadb",
"size": "... |
import matplotlib.pyplot as plt
import numpy as np
import time
from cvxpy import *
SAMPLES = 10 | {
"content_hash": "f00bbf02a51d001fed88848293455a80",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 31,
"avg_line_length": 13.857142857142858,
"alnum_prop": 0.7835051546391752,
"repo_name": "haoyio/stock-opt",
"id": "9ad771e70141d070a07174c29873f1135f019986",
"size": "97",... |
from apptools.logger.plugin.view.logger_preferences_page import *
| {
"content_hash": "f1c173334d58633e4abf72921691d6dc",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 65,
"avg_line_length": 66,
"alnum_prop": 0.8333333333333334,
"repo_name": "enthought/etsproxy",
"id": "86d560905a3beab11596734411ccf9c505a9b0b1",
"size": "81",
"binary": f... |
from functools import total_ordering
import unittest
import mock
def _make_database(name="name"):
from google.cloud.spanner_v1.database import Database
return mock.create_autospec(Database, instance=True)
def _make_session():
from google.cloud.spanner_v1.database import Session
return mock.create... | {
"content_hash": "c9ffbab15672499de39222013906422d",
"timestamp": "",
"source": "github",
"line_count": 899,
"max_line_length": 88,
"avg_line_length": 30.32814238042269,
"alnum_prop": 0.612800293416468,
"repo_name": "dhermes/google-cloud-python",
"id": "549044b1f423b4f982a4c83d5f6a6c7f60451a93",
"s... |
"""Germline and somatic calling with Strelka2: https://github.com/illumina/strelka
"""
import collections
import os
import six
import sys
import numpy as np
from bcbio import utils
from bcbio.log import logger
from bcbio.distributed.transaction import file_transaction
from bcbio.heterogeneity import chromhacks
from bc... | {
"content_hash": "dba1db24a7d30ac26958e2f52e683f87",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 139,
"avg_line_length": 52.63092269326683,
"alnum_prop": 0.5801468846244966,
"repo_name": "lbeltrame/bcbio-nextgen",
"id": "801809077c8d701447c57fde3be8c310d9d59b9c",
"siz... |
'''
Created on Nov 20, 2012
Copyright © 2013
The Board of Trustees of The Leland Stanford Junior University.
All Rights Reserved
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apa... | {
"content_hash": "47242149eba257a4dad85589120181e7",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 95,
"avg_line_length": 31.51851851851852,
"alnum_prop": 0.6950646298472385,
"repo_name": "daStrauss/subsurface",
"id": "e71626d80c974343ad0181c054156b951b22e600",
"size": "... |
import matplotlib.pyplot as plt
from matplotlib import animation
# Line3Dcollection
# Params
# sim_or_exp = 'simulation' # 'experiment', 'simulation'
# experiment = eval(sim_or_exp)
# highlight_inside_plume = False
# show_plume = False
# trajectory_i = None
# def local_init(x=x, t=t, data=data):
# return init... | {
"content_hash": "188f1bcf8a1bff7aa40f55113786f332",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 139,
"avg_line_length": 30.954954954954953,
"alnum_prop": 0.5291036088474971,
"repo_name": "isomerase/RoboSkeeter",
"id": "3b9e4ecfb7f16ebb25a7771b63d85c46cf946cd3",
"size... |
pop_list = settings.get_base_prepopulate()
if pop_list == 0:
pop_list = []
else:
table = db[auth.settings.table_group_name]
# The query used here takes 2/3 the time of .count().
if db(table.id > 0).select(table.id, limitby=(0, 1)).first():
pop_list = []
if not isinstance(pop_list, (list, tup... | {
"content_hash": "8735d671df8e8e74e4578463a8a3a9db",
"timestamp": "",
"source": "github",
"line_count": 358,
"max_line_length": 129,
"avg_line_length": 40.26815642458101,
"alnum_prop": 0.5065899001109878,
"repo_name": "mrGeen/eden",
"id": "ed53e65433a421cc4b506c53ac1bd4449afdc771",
"size": "14553",... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from congress import Congress
from core import get, template
from flask import redirect
@get('/', 'Search')
@template('/index.html')
def query(q=''):
if q:
... | {
"content_hash": "e52558d02aecad9f7733c61ce57aa496",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 43,
"avg_line_length": 19.545454545454547,
"alnum_prop": 0.6496124031007752,
"repo_name": "jreese/congress",
"id": "08bc0ff2a422be4ee73567d5f1c67fc61e327991",
"size": "707"... |
"""Multi label head."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import lookup_ops
from tensorflow.python.util.tf_export import estimator_export... | {
"content_hash": "e7ad4f15621686c1a279b290797c73e0",
"timestamp": "",
"source": "github",
"line_count": 579,
"max_line_length": 88,
"avg_line_length": 45.01381692573403,
"alnum_prop": 0.6462417987184899,
"repo_name": "tensorflow/estimator",
"id": "22cf6a5efa7e11d5a8aa40f56ca67ea8d3dc90ae",
"size": ... |
from django.db import models
from django.db.models import Q
class CountrySearchManager(models.Manager):
def search(self, **kwargs):
qs = self.get_query_set()
query = kwargs.get('q', '')
government = kwargs.get('government', '')
if government:
qs = qs.filter(government_... | {
"content_hash": "da0cd86eb643269a61210e5c9c6ca6f2",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 55,
"avg_line_length": 29.875,
"alnum_prop": 0.5920502092050209,
"repo_name": "bennylope/ciafactbook",
"id": "3db3c212297f7add4c27656c706bc02e91f31a15",
"size": "478",
"b... |
import pytest
@pytest.fixture(scope='session')
def cities():
from flight_paths import import_cities
cities = import_cities()
return cities
@pytest.fixture(scope='session')
def cd():
'''returns a dictionary'''
from flight_paths import populate_city_dict
cities = [{'airport': 'Stockholm-Bromma... | {
"content_hash": "d13a4e511f82601ecd29c44a84d1edc0",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 213,
"avg_line_length": 36.15068493150685,
"alnum_prop": 0.6199317923455855,
"repo_name": "crashtack/code-katas",
"id": "bfa9453cb01640743e4a69e91e1ee3c4f6da6abf",
"size":... |
from deploy_board.webapp.helpers.rodimus_client import RodimusClient
rodimus_client = RodimusClient()
def create_host_type(request, host_type_info):
return rodimus_client.post("/host_types", request.teletraan_user_id.token, data=host_type_info)
def get_all(request, index, size):
params = [('pageIndex', ind... | {
"content_hash": "1471569175fff81d0f4ecf3224ac4666",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 100,
"avg_line_length": 35.85,
"alnum_prop": 0.7336122733612274,
"repo_name": "lilida/teletraan",
"id": "b434bb7f7af75d60b32383d81eb72a9750fc9d60",
"size": "1322",
"binar... |
from django.db import models
class Subspecialty(models.Model):
name = models.CharField(max_length=40)
slug = models.SlugField(unique=True)
abbr = models.CharField(max_length=8)
class Meta:
ordering = ['name']
def __unicode__(self):
return self.name
| {
"content_hash": "fd1ca236f5a7da04660bdf8f3b9aa314",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 40,
"avg_line_length": 22.5,
"alnum_prop": 0.7,
"repo_name": "swiharta/radres",
"id": "537c7934db17978b3a29b64be857f0c806ddb852",
"size": "270",
"binary": false,
"copie... |
import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(
{'reduce': 'no'},
{'reduce': 'sum_along_second_axis'}
)
class TestHuberLoss(unitt... | {
"content_hash": "3c8c4b8c22189393b2723287c308f98d",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 79,
"avg_line_length": 34.721739130434784,
"alnum_prop": 0.6120711244678186,
"repo_name": "ronekko/chainer",
"id": "2856daebee3c478e103b71b3d2a96861dbc1287b",
"size": "399... |
from src.platform.tomcat.authenticate import checkAuth
from src.platform.tomcat.interfaces import TINTERFACES
from auxiliary import Auxiliary
from log import LOG
import utility
class Auxiliary:
""" Obtain a list of deployed WARs
"""
def __init__(self):
self.name = 'List deployed WARs'
sel... | {
"content_hash": "01ae8481f553ad324912002d3325b5f9",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 87,
"avg_line_length": 33.5625,
"alnum_prop": 0.5223463687150838,
"repo_name": "breenmachine/clusterd",
"id": "e535f1715c202f02f6f61d19dbd348b3f596d395",
"size": "2148",
... |
from django import template
from privileges.registration import registry
register = template.Library()
class CheckPrivilegeNode(template.Node):
@classmethod
def handle_token(cls, parser, token):
bits = token.split_contents()
if len(bits) != 6:
raise template.TemplateSyntaxError... | {
"content_hash": "1eae7e51971fd595ec8a8e9a41ee789b",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 71,
"avg_line_length": 26.642857142857142,
"alnum_prop": 0.6210902591599643,
"repo_name": "eldarion/privileges",
"id": "212dd982f324bc8c14ec5b80f06b75a511b7c8f7",
"size": "... |
from ncclient import manager
from getpass import getpass
from lxml import etree
def xml_print(xml_str):
root = etree.fromstring(str(xml_str))
print etree.tostring(root, pretty_print=True)
if __name__ == "__main__":
ip_addr = raw_input("Enter IP address: ")
my_conn = manager.connect(host=ip_addr, port=... | {
"content_hash": "724e9a4cd870df95f0282df690407593",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 87,
"avg_line_length": 34.035714285714285,
"alnum_prop": 0.6138509968520461,
"repo_name": "ktbyers/pynet-ons-jan17",
"id": "3f2f311ab92de015ed38133d17928b4c84fe8223",
"size... |
from PyQt4 import QtGui
from BaseStudy import BaseStudy
from Action import Speech
from UI.ActionPushButton import ActionPushButton
class MentalChallenge(BaseStudy):
def __init__(self):
super(MentalChallenge, self).__init__()
self._widgets = []
self._buttons = []
self._widgets.appe... | {
"content_hash": "5d0d2873726cb5fe43a43597263859e2",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 199,
"avg_line_length": 81.92307692307692,
"alnum_prop": 0.6388106416275431,
"repo_name": "mattBrzezinski/Hydrogen",
"id": "e0310324e241a76bebecb37f2f315b3683139b23",
"size... |
from google.cloud import gaming_v1beta
def sample_get_game_server_config():
# Create a client
client = gaming_v1beta.GameServerConfigsServiceClient()
# Initialize request argument(s)
request = gaming_v1beta.GetGameServerConfigRequest(
name="name_value",
)
# Make the request
respo... | {
"content_hash": "0cf2740931af42dc4ac1df09e2753afc",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 87,
"avg_line_length": 26.789473684210527,
"alnum_prop": 0.7347740667976425,
"repo_name": "googleapis/python-game-servers",
"id": "64a9557e746df4c21736d8dc0a217d181845efbb",
... |
from .basepattern import BasePattern
class Invoke(BasePattern):
@property
def enabled(self):
raise NotImplementedError(
'enabled'
)
def click(self):
raise NotImplementedError(
'click()'
)
| {
"content_hash": "9e68ab318338401b71785937e57f3c89",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 36,
"avg_line_length": 18.5,
"alnum_prop": 0.5714285714285714,
"repo_name": "WesleyPeng/uiXautomation",
"id": "f6786aa5ea48b1b360ae24b0d9fc41248b4aa3d7",
"size": "853",
"... |
import re
import unittest
import marshmallow
from airflow.api_connexion.schemas.connection_schema import (
ConnectionCollection,
connection_collection_item_schema,
connection_collection_schema,
connection_schema,
)
from airflow.models import Connection
from airflow.utils.session import create_session,... | {
"content_hash": "b319cb85e5a6904ccc184665e30077dd",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 90,
"avg_line_length": 31.718592964824122,
"alnum_prop": 0.49540557667934093,
"repo_name": "mrkm4ntr/incubator-airflow",
"id": "5a4c580099a2149434a41a33a9e01c9d341e3458",
... |
from openflow.optin_manager.sfa.util.sfalogging import logger
from openflow.optin_manager.sfa.util.xml import XpathFilter
from openflow.optin_manager.sfa.util.xrn import Xrn
from openflow.optin_manager.sfa.rspecs.elements.element import Element
from openflow.optin_manager.sfa.rspecs.elements.node import Node
from open... | {
"content_hash": "131e7e45037c39e3f33d53ce4a8bc0f7",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 108,
"avg_line_length": 43.83561643835616,
"alnum_prop": 0.6940625,
"repo_name": "dana-i2cat/felix",
"id": "d99780cf948cb9f107383f43aa032a03632d995b",
"size": "3200",
"bi... |
from builtins import object
from bq_data_access.v1.feature_search.gexp_searcher import GEXPSearcher
from bq_data_access.v1.feature_search.clinical_searcher import ClinicalSearcher
from bq_data_access.v1.feature_search.methylation_searcher import METHSearcher
from bq_data_access.v1.feature_search.copynumber_search impor... | {
"content_hash": "49a0bd3d9a036e7185e955fd13c3b1e4",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 36.84375,
"alnum_prop": 0.7005937234944869,
"repo_name": "isb-cgc/ISB-CGC-Webapp",
"id": "a3909ff0fa6e5e3adf85b537ed4840b9ca4ab3d4",
"size": "1782",
... |
"""
Implemented the following paper:
Jie Hu, Li Shen, Gang Sun. "Squeeze-and-Excitation Networks" https://arxiv.org/pdf/1709.01507v1.pdf
This implementation is based on ResNet v2, which come from
Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun. "Identity Mappings in Deep Residual Networks"
Coded by Lin Xio... | {
"content_hash": "d07b251fe55acb7a641fa10163771043",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 148,
"avg_line_length": 58.284946236559136,
"alnum_prop": 0.5660916889585832,
"repo_name": "bruinxiong/SENet.mxnet",
"id": "c8a0bf26fec67ea5b1edcac7542c7f6980115769",
"siz... |
"""
Django settings for swallow project.
Generated by 'django-admin startproject' using Django 1.8.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build path... | {
"content_hash": "6f4c4a2a68a68bafacc96538916e3e1d",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 90,
"avg_line_length": 29.22772277227723,
"alnum_prop": 0.6858062330623306,
"repo_name": "yongli82/swallow",
"id": "fea5bcd02be281e1e31823656ca1bc4722945cd9",
"size": "590... |
"""Run some automations to test things"""
from __future__ import unicode_literals
from __future__ import print_function
try:
from pywinauto import application
except ImportError:
import os.path
pywinauto_path = os.path.abspath(__file__)
pywinauto_path = os.path.split(os.path.split(pywinauto_... | {
"content_hash": "2d95ad43bca617f3c815e3b0f1eb1584",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 75,
"avg_line_length": 29.545454545454547,
"alnum_prop": 0.6465934065934066,
"repo_name": "MagazinnikIvan/pywinauto",
"id": "13174b5827f9f182e76eb414c9ed9179a1d4e38a",
"siz... |
from msrest.serialization import Model
class CreateRunResponse(Model):
"""Response body with a run identifier.
:param run_id: Identifier of a run.
:type run_id: str
"""
_validation = {
'run_id': {'required': True},
}
_attribute_map = {
'run_id': {'key': 'runId', 'type': ... | {
"content_hash": "46b618b92d713f7df7c29683acf1416c",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 50,
"avg_line_length": 21.238095238095237,
"alnum_prop": 0.5560538116591929,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "696b3fcea4c477bdecb9d79b3bf04145c8da5182",
... |
import logging
import logging.handlers
logger = logging.getLogger('mylogger')
formatter = logging.Formatter('[%(levelname)s|%(filename)s:%(lineno)s] %(asctime)s > %(message)s')
fileHandler = logging.FileHandler('./loggerTest2.log')
streamHandler = logging.StreamHandler()
fileHandler.setFormatter(formatter)
strea... | {
"content_hash": "5d975a6315dfa8d10667775f81d9dc88",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 98,
"avg_line_length": 21.678571428571427,
"alnum_prop": 0.742998352553542,
"repo_name": "SELO77/seloPython",
"id": "be340e5bb82f7883d7aea0349bc3c3716959f879",
"size": "607... |
"""
Base class for Filters, Factors and Classifiers
"""
from abc import ABCMeta, abstractproperty, abstractmethod
from bisect import insort
from collections.abc import Mapping
from weakref import WeakValueDictionary
from numpy import (
array,
dtype as dtype_class,
ndarray,
)
from six import with_metaclass
... | {
"content_hash": "bf6b67981bf5682cec8155826476b2e8",
"timestamp": "",
"source": "github",
"line_count": 995,
"max_line_length": 83,
"avg_line_length": 33.42211055276382,
"alnum_prop": 0.5801232897308676,
"repo_name": "humdings/zipline",
"id": "cf98c9ad8537e8ed6a770eaa0e842d6e708e9550",
"size": "332... |
from django.db.models import FloatField, Func, IntegerField
__all__ = [
'CumeDist', 'DenseRank', 'FirstValue', 'Lag', 'LastValue', 'Lead',
'NthValue', 'Ntile', 'PercentRank', 'Rank', 'RowNumber',
]
class CumeDist(Func):
function = 'CUME_DIST'
output_field = FloatField()
window_compatible = True
... | {
"content_hash": "18a215c4c5e3f035ae5fb7b76cafcf2b",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 100,
"avg_line_length": 25.364485981308412,
"alnum_prop": 0.6016949152542372,
"repo_name": "frankvdp/django",
"id": "4ee01ec803ee43d1f956a1f0d585c3b9de7b7b77",
"size": "27... |
from argparse import ArgumentParser
import os
import numpy as np
from pyspark import SparkContext
from operator import add
from input.load_data import load_csv_spark, normalize_trust_spark
def scale_votes(v):
agg_v = v.map(lambda x: (x[0],x[1][1])).reduceByKey(lambdas['sum'])
return v.join(agg_v).map(lambda ... | {
"content_hash": "bc445b871762ae93d5a327bb69b34f2d",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 164,
"avg_line_length": 34.51219512195122,
"alnum_prop": 0.569964664310954,
"repo_name": "allentran/trust-rank",
"id": "0576eed7a0f08c4db0c703976c06d83095dd9691",
"size": "... |
from kai.tests import *
class TestSnippetsController(TestController):
def test_index(self):
response = self.app.get(url(controller='snippets', action='index'))
# Test response...
| {
"content_hash": "3d69bef34133c1b68fe62291f2e7f196",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 75,
"avg_line_length": 28.714285714285715,
"alnum_prop": 0.681592039800995,
"repo_name": "Pylons/kai",
"id": "fa27df8efa55ec7b9fd2c5bf0e3b1aad0ffda7a8",
"size": "201",
"bi... |
from JumpScale import j
import re
import os
import jinja2
import os.path
fs = j.sal.fs
class HeaderTools():
@staticmethod
def getHeadnr(line):
if line.find(".") != -1:
part1, part2 = line.strip().split(".", 1)
part1 = part1.lower()
headingnr = int(part1.replace("h... | {
"content_hash": "dc514b3c108420643bb9a498e53359c9",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 118,
"avg_line_length": 36.32,
"alnum_prop": 0.5514179515418502,
"repo_name": "Jumpscale/jumpscale_portal8",
"id": "368c9f1d29c98592a0e8df71ae1a602826e10872",
"size": "145... |
from a10sdk.common.A10BaseClass import A10BaseClass
class Ipv6Host(A10BaseClass):
"""Class Description::
Specify IPV6 hosts to receive SNMP traps.
Class ipv6-host supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param uu... | {
"content_hash": "a514052eca14b8307346018a6f904531",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 198,
"avg_line_length": 45.47826086956522,
"alnum_prop": 0.6175908221797323,
"repo_name": "amwelch/a10sdk-python",
"id": "d0be0af9c10f4dad0ef9bca87a42ac4cf4302229",
"size":... |
from django.conf.urls import patterns, url
from ..views import BoardView
urlpatterns = patterns(
'',
url(r'^$', BoardView.as_view(board='advisory-board'),
name='advisory-board'),
)
| {
"content_hash": "7bd726da28580d3d06c807900d6a94c0",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 57,
"avg_line_length": 22.11111111111111,
"alnum_prop": 0.6633165829145728,
"repo_name": "MjAbuz/foundation",
"id": "bc3e0cbe06aa5480ddb63c3602664c21dc03792c",
"size": "199"... |
import dlib
# Now let's make some testing data. To make it really simple, let's suppose
# that we are ranking 2D vectors and that vectors with positive values in the
# first dimension should rank higher than other vectors. So what we do is make
# examples of relevant (i.e. high ranking) and non-relevant (i.e. low r... | {
"content_hash": "c17f1ff4df6b28d1f87bed3ff71df0bb",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 80,
"avg_line_length": 46.900826446280995,
"alnum_prop": 0.7504845814977974,
"repo_name": "weinitom/robot",
"id": "a3a754cf4c2be66708144a3bd0dc51327cacd3a4",
"size": "6996... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0006_post_author'),
]
operations = [
migrations.AlterIndexTogether(
name='post',
index_together=set(
... | {
"content_hash": "993e70c735175af5da96dbdca9fd61b0",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 40,
"avg_line_length": 20.166666666666668,
"alnum_prop": 0.5537190082644629,
"repo_name": "jambonrose/DjangoUnleashed-1.8",
"id": "a8cf6db136661fc0fd583cc60634c2e49f52db1d",
... |
"""The Mayavi UI plugin
"""
# Author: Prabhu Ramachandran <prabhu [at] aero . iitb . ac . in>
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
import logging
# Enthought library imports.
from traits.api import List, on_trait_change
from envisage.api import Plugin
from pyface.wor... | {
"content_hash": "fb4ef339dbd2be9797fe0a77230e896a",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 140,
"avg_line_length": 36.73394495412844,
"alnum_prop": 0.5511988011988012,
"repo_name": "dmsurti/mayavi",
"id": "5bdda28226a81fba312b2f45baf2ea15b3aef5ef",
"size": "8008... |
header = '=' * 50
docker_is_dead = """
Docker died during the upgrade. Run these commands and then restart the upgrade
Make sure that docker is dead
# docker ps
2014/08/19 14:28:15 Cannot connect to the Docker daemon.
Is 'docker -d' running on this host?
# umount -l $(grep '/dev/mapper/docker-' /... | {
"content_hash": "dcfa1bf69c99d4d94d0e5e42017014b6",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 79,
"avg_line_length": 23.75,
"alnum_prop": 0.7078947368421052,
"repo_name": "nebril/fuel-web",
"id": "8f47379e00cefb2dee5c573f780ccd6a003ef15b",
"size": "2155",
"binary"... |
from django.conf.urls import patterns
urlpatterns = patterns('')
| {
"content_hash": "5c11f142dc52e2291915eb6df1abb5c8",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 37,
"avg_line_length": 16.75,
"alnum_prop": 0.7611940298507462,
"repo_name": "pansapiens/mytardis",
"id": "f496bea384137bbd5b480092d65433210e74df26",
"size": "67",
"binary... |
"""Tests for google.appengine.tools.devappserver2.url_handler."""
import re
import unittest
import wsgiref.util
from google.appengine.api import appinfo
from google.appengine.tools.devappserver2 import constants
from google.appengine.tools.devappserver2 import url_handler
from google.appengine.tools.devappserver2 i... | {
"content_hash": "48ce458dde0023f6dd508bd466678a5a",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 80,
"avg_line_length": 38.20625,
"alnum_prop": 0.6433011614591854,
"repo_name": "ychen820/microblog",
"id": "519115b63478f97bf352a4124ab13437d67c79cc",
"size": "12827",
... |
class BeanBagException(Exception):
"""Exception thrown when a BeanBag request fails.
Data members:
* msg -- exception string, brief and human readable
* response -- response object
You can get the original request via bbe.response.request.
"""
__slots__ = ('msg', 'res... | {
"content_hash": "f661b67de51ec0ce305d138f3cf1596e",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 73,
"avg_line_length": 28.035714285714285,
"alnum_prop": 0.5643312101910828,
"repo_name": "ajtowns/beanbag",
"id": "31343ae26aa037591ccf016896cbc7e46ba28ae3",
"size": "947"... |
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import object, str
from future.utils import string_types
from pants.build_graph.intermediate_target_factory import IntermediateTargetFactoryBase
class Scope(frozenset):
"""Represents a set of dependency scope names.
... | {
"content_hash": "5b14176fa3807207d0158b98046f9da9",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 100,
"avg_line_length": 31.170068027210885,
"alnum_prop": 0.6649934526407683,
"repo_name": "twitter/pants",
"id": "5c515ece6ffe0215071f7b569dd7841a567bfa3a",
"size": "4729... |
import logging
import icat
import icat.config
from icat.query import Query
from icat.dumpfile import open_dumpfile
try:
import icat.dumpfile_xml
except ImportError:
pass
try:
import icat.dumpfile_yaml
except ImportError:
pass
logging.basicConfig(level=logging.INFO)
formats = icat.dumpfile.Backends.key... | {
"content_hash": "9a267241987a28cd1dba397490705b04",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 69,
"avg_line_length": 30.163265306122447,
"alnum_prop": 0.6339648173207036,
"repo_name": "icatproject/python-icat",
"id": "3bdd57fa39c6873135a4cab8956bff95afb2f536",
"size... |
from setuptools import setup
def readme():
with open('README.rst.example') as f:
return f.read()
setup(
name='marble',
version='1.0',
description=('Study residential segregation, explore its different dimensions.'),
url='http://github.com/scities/marble',
author='Remi Louf',
author... | {
"content_hash": "2b7413a4cb5b3945fb5de05d25ab0053",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 85,
"avg_line_length": 23.956521739130434,
"alnum_prop": 0.6116152450090744,
"repo_name": "scities/marble",
"id": "125aa04799bd2baea04b74f440d0ce888e7807f1",
"size": "551",... |
"""Converts semantic triples (RDF triples) to GraphTensor objects."""
import collections
import tensorflow as tf
from tensorflow_gnn.graph import adjacency as adj
from tensorflow_gnn.graph import graph_tensor as gt
def triple_to_graphtensor(triples):
"""Converts a set of semantic triples (ie RDF triples) into Grap... | {
"content_hash": "d1219ea50da1ed43eeecb3feb172ab2b",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 78,
"avg_line_length": 28.866666666666667,
"alnum_prop": 0.6651270207852193,
"repo_name": "tensorflow/gnn",
"id": "d54e40a73031ca6f4f7ad5cef5aa9d4f0b3f0418",
"size": "3291"... |
from datetime import datetime, timedelta, timezone
import sqlite3
from lightstreamer_client import LightstreamerClient, ConsoleLoggerProvider, ConsoleLogLevel, Subscription
from telemetry_ids import IDENTIFIERS
FIVE_SECONDS_AS_HOURS = 5.0 / 3600 #3600 seconds/hr
class LSSubscriptionListener:
"""Though Subscript... | {
"content_hash": "c8d3a43cc8250ae81fa602629b5fa78e",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 108,
"avg_line_length": 37.054054054054056,
"alnum_prop": 0.6281911013858498,
"repo_name": "ISS-Mimic/Mimic",
"id": "1bdf38cdbf01c83055af74c1a8ab8ccc7aa32420",
"size": "55... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models.pluginmodel import CMSPlugin
class ResponsiveWrapperPlugin(CMSPlugin):
desktop = models.BooleanField(_('Visible on desktops'), help_text=_('higher than 860px'), default=True)
tablet = models.BooleanField(_('V... | {
"content_hash": "1e7c00336100e874a20bdea18b547ae2",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 107,
"avg_line_length": 37.642857142857146,
"alnum_prop": 0.594876660341556,
"repo_name": "aldryn/aldryn-responsive",
"id": "d541bee5f45b52002225d9ad5002646e6b0d8aa9",
"siz... |
import datetime
import decimal
import functools
import hashlib
import logging
import time
from contextlib import contextmanager
from django.db import NotSupportedError
logger = logging.getLogger('django.db.backends')
class CursorWrapper:
def __init__(self, cursor, db):
self.cursor = cursor
self.... | {
"content_hash": "c73d3872b9d04eb945caa5f12d7d275b",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 99,
"avg_line_length": 33.992,
"alnum_prop": 0.5957872440574252,
"repo_name": "atul-bhouraskar/django",
"id": "c342cf79b58f03bdeb030fd9a4192e7a9dba864e",
"size": "8498",
... |
import datetime
import uuid
from six.moves import http_client
from keystone.tests import unit
from keystone.tests.unit import test_v3
class TestTrustOperations(test_v3.RestfulTestCase):
"""Test module for create, read, update and delete operations on trusts.
This module is specific to tests for trust CRUD ... | {
"content_hash": "169b9044a0990521262c162a8618601b",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 79,
"avg_line_length": 41.452685421994886,
"alnum_prop": 0.582675222112537,
"repo_name": "klmitch/keystone",
"id": "d60ce36d3a8bc234559098b04cf368f5bea71409",
"size": "167... |
import stock_traceability
import stock_move
import stock_splitinto
import stock_partial_picking
import stock_partial_move
import stock_inventory_merge
import stock_fill_inventory
import stock_inventory_line_split
import stock_invoice_onshipping
import stock_location_product
import stock_change_standard_price
import sto... | {
"content_hash": "1e2ffa323f52fe3273511e4ce423ed1d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 65,
"avg_line_length": 29.133333333333333,
"alnum_prop": 0.851258581235698,
"repo_name": "ntiufalara/openerp7",
"id": "e37483bfb379d20f4c7aec10c95353ec9c2a65fc",
"size": "1... |
"""
af.py - An actin filament
Create and maintain a thin filament and the subgroups that comprise it.
Created by Dave Williams on 2010-01-04.
"""
import numpy as np
class BindingSite:
"""A singular globular actin site"""
def __init__(self, parent_thin_fil, index, orientation):
"""Create a binding s... | {
"content_hash": "c1a36714eedd5234f8f57b234a8db489",
"timestamp": "",
"source": "github",
"line_count": 653,
"max_line_length": 119,
"avg_line_length": 43.4104134762634,
"alnum_prop": 0.613962676826472,
"repo_name": "cdw/multifil",
"id": "085d0031c2f016e4e22ccfba6984b56d5554602d",
"size": "28387",
... |
from decimal import Decimal
from unittest import TestCase
import json
import requests
import responses
from odata.tests import Service, ProductManufacturerSales
class TestCompositeKeys(TestCase):
def test_insert_entity(self):
def request_callback(request):
content = json.loads(request.body)... | {
"content_hash": "e77379ad338096f124ab026a4e1a97ee",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 79,
"avg_line_length": 37.89393939393939,
"alnum_prop": 0.5745701719312275,
"repo_name": "tuomur/python-odata",
"id": "ddaf6aa0cf01a172c4489214ae6cecf90c08d701",
"size": "2... |
import requests
import json
import sys
import re
request_id = 0
def translate(text, source="auto", target=None, preferred_langs=[]):
paragraphs = _split_paragraphs(text)
sentences = _request_split_sentences(paragraphs, source, preferred_langs)
result = _request_translate(sentences, source, target, prefer... | {
"content_hash": "ceca3fd836e393c6603bc17228803c12",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 102,
"avg_line_length": 30.585526315789473,
"alnum_prop": 0.599268659926866,
"repo_name": "freundTech/deepl-cli",
"id": "5d53e4d165b301eeb0ffbd966c0af7fbf0867f31",
"size":... |
"""
<Program>
seattleclearinghouse_xmlrpc.py
<Started>
6/28/2009
<Author>
Jason Chen
Justin Samuel
<Purpose>
A client library for communicating with the SeattleClearinghouse XMLRPC Server.
Your Python scripts can import this library, create an instance of the
SeattleClearinghouseClien... | {
"content_hash": "a1260551954ad547f2102dc0ecc899ea",
"timestamp": "",
"source": "github",
"line_count": 583,
"max_line_length": 90,
"avg_line_length": 34.13722126929674,
"alnum_prop": 0.6621445080896392,
"repo_name": "sburnett/seattle",
"id": "3f0896c2d77a7e62c29970808465a108b0614110",
"size": "199... |
from collections import OrderedDict
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from google.api_core import client_options as client_options_lib
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credent... | {
"content_hash": "4b60a9d214f4b252b12f0ddc0f7bd555",
"timestamp": "",
"source": "github",
"line_count": 523,
"max_line_length": 153,
"avg_line_length": 40.97131931166348,
"alnum_prop": 0.6127496733246219,
"repo_name": "googleads/google-ads-python",
"id": "f5b4a3070cf3414d88f7a5e83c1f656f8f3553f7",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.