text stringlengths 4 1.02M | meta dict |
|---|---|
from datetime import date
import logging
import operator
from operator import contains, eq
from couchdbkit import NoResultFound, MultipleResultsFound, ResourceNotFound, QueryMixin
from dimagi.ext.couchdbkit import StringProperty, DateProperty, DictProperty, Document
from django.db import models
from casexml.apps.case.... | {
"content_hash": "fb8c4559438f75c550de7f201f006a05",
"timestamp": "",
"source": "github",
"line_count": 564,
"max_line_length": 132,
"avg_line_length": 50.062056737588655,
"alnum_prop": 0.6996281211262617,
"repo_name": "qedsoftware/commcare-hq",
"id": "2eb9bedcf0ec5b8b5deb45ec3e7f9c5187a04de8",
"si... |
from setuptools import setup, find_packages
setup(
name='django-password-strength',
version='1.1.1',
url='http://thegoods.aj7may.com/django-password-strength',
author='A.J. May',
author_email='aj7may@gmail.com',
description='This package contains an extention of the Django password widget inclu... | {
"content_hash": "7edb57924aa2550c296cec1d455d2842",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 153,
"avg_line_length": 37.888888888888886,
"alnum_prop": 0.6471163245356794,
"repo_name": "merwan/django-password-strength",
"id": "4a1360fc49127565fbbbcc39f82d912b9cf577a4"... |
from django.utils import timezone
from django.db import models
class User(models.Model):
email = models.EmailField(primary_key=True)
last_login = models.DateTimeField(default=timezone.now)
REQUIRED_FIELDS = ()
USERNAME_FIELD = "email"
def is_authenticated(self):
return True
| {
"content_hash": "a87764134d5b0a167d40be536c392c81",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 59,
"avg_line_length": 25.5,
"alnum_prop": 0.7124183006535948,
"repo_name": "migglu/todo-lists",
"id": "c08529f72881236cd263a9a9816cb3a65a502bc5",
"size": "306",
"binary"... |
import os
import sys
import lxml.etree
import urllib2
def download(url, file_name, work_path='.'):
assert isinstance(url, str)
try:
response = urllib2.urlopen('%s' % url)
except urllib2.HTTPError, e:
sys.stderr.write('%s\n' %e)
sys.stderr.write("Could not retrieve file: %s\n" % url)... | {
"content_hash": "92e9b40ca37bebfd49b87d9bf7dd3c01",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 81,
"avg_line_length": 26.690140845070424,
"alnum_prop": 0.5778364116094987,
"repo_name": "daineseh/python_code",
"id": "c22f15a244f742f83e212e4365adeda41c6c3557",
"size": ... |
from django.conf.urls import include, url, patterns
from accounts import views
urlpatterns = patterns(
'',
url('^accounts/', include('django.contrib.auth.urls')),
url(r'^accounts/profile/$', views.profile, name='profile'),
url(r'^change-language/$', views.change_language, name='change_language'),
)
| {
"content_hash": "8db1f7b80a6ffce3482562055d4073de",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 78,
"avg_line_length": 35.22222222222222,
"alnum_prop": 0.694006309148265,
"repo_name": "erickmendonca/django-materialize-template",
"id": "9ff856d7ad6f1d890c4dec7cb1d64cd4878... |
import sublime, sublime_plugin, os, re
from .formatter import *
from . import merge_utils
def is_js_context( view ):
fName = view.file_name()
syntaxPath = view.settings().get( 'syntax' )
syntax = ""
ext = ""
if ( fName != None ):
# File exists, pull syntax type from extension.
ext = os.path.splitext( fName ... | {
"content_hash": "1b98509b40953e728346b3f128121bea",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 77,
"avg_line_length": 27.859375,
"alnum_prop": 0.663768928771733,
"repo_name": "pjasiun/bella",
"id": "03f8fd3b6af61ee8b085bc7bd76ee82a0572b50c",
"size": "3566",
"binar... |
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response, redirect
from django.core i... | {
"content_hash": "1f3ef24371c88fbf4fbb98d608e64ce4",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 192,
"avg_line_length": 31.576923076923077,
"alnum_prop": 0.6428745432399513,
"repo_name": "rcchirwa/geotweet",
"id": "43ada8224f257d3468811282cc21e46cb85d9681",
"size": "... |
from poet.poet import formula_for
from subprocess import Popen, PIPE
from script import make_release
import os
def main():
with open('eralchemy.template.rb') as f:
template = f.readlines()
formula = formula_for('eralchemy')
with open('/usr/local/Library/Formula/eralchemy.rb', 'w+') as f:
f... | {
"content_hash": "7c9b200406f915dc8d2aaf434688f2cc",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 70,
"avg_line_length": 32.90625,
"alnum_prop": 0.6362773029439696,
"repo_name": "aaron0browne/eralchemy",
"id": "76057c026c6b49f7469eb156694737bcd4251d32",
"size": "1053",
... |
from __future__ import absolute_import
from pychron.spectrometer.thermo.detector.base import ThermoDetector
class ArgusDetector(ThermoDetector):
pass
# ============= EOF =============================================
| {
"content_hash": "73e9c03c3dad392425d348eaae254d53",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 68,
"avg_line_length": 27.875,
"alnum_prop": 0.5829596412556054,
"repo_name": "UManPychron/pychron",
"id": "e9cb36bf103b5ff8f7a98e06ced0ca364365a78b",
"size": "1155",
"bin... |
import os
from setuptools import setup
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
VERSION = '0.1.8'
setup(
name="django-dowser",
version=VERSION,
author="Mateusz Lapsa-Malawski",
author_email="m@cr3.io",
description="Django fork of amazing memory leaks tracking app... | {
"content_hash": "f9be37685865a6d7ce942be3214b1e32",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 104,
"avg_line_length": 30.833333333333332,
"alnum_prop": 0.6441441441441441,
"repo_name": "munhitsu/django-dowser",
"id": "0edbdf2f35a0e61d0e6f557c55a3c31db4ac30f5",
"size... |
import contextlib
import copy
import uuid
import mock
import mox
from neutronclient.common import exceptions
from neutronclient.v2_0 import client
from oslo.config import cfg
import six
from nova.compute import flavors
from nova import context
from nova import exception
from nova.network import model
from nova.networ... | {
"content_hash": "da764e2b358fd7c726f27f49c76055a0",
"timestamp": "",
"source": "github",
"line_count": 2728,
"max_line_length": 79,
"avg_line_length": 45.29288856304985,
"alnum_prop": 0.534295356874044,
"repo_name": "srajag/nova",
"id": "3f33c5c2164360b30582c6a12a80e796c64b0a6e",
"size": "124196",... |
from django.core.urlresolvers import reverse_lazy
from django.views.generic import ListView
from django.views.generic.detail import DetailView
from django.views.generic.edit import (
CreateView,
UpdateView,
DeleteView,
)
from .models import Person
#ListView.
class PersonList(ListView):
model = Person... | {
"content_hash": "81b9b5c889b9ee0f6143ff95ab8d93d5",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 62,
"avg_line_length": 25.216216216216218,
"alnum_prop": 0.7181136120042872,
"repo_name": "GoberInfinity/ExampleDjango",
"id": "c717b2a97605b961d062662238a18774ef053148",
"... |
from gevent import monkey
monkey.patch_all()
import json
import gc
from bottle import Bottle, abort, request
from bottle.ext.websocket import websocket
from bottle.ext.mongo import MongoPlugin
from pandas import DataFrame
from mining.utils import conf
from mining.utils._pandas import df_generate, DataFrameSearchCo... | {
"content_hash": "0d89388f6249b25bbaab5655e6fb8252",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 78,
"avg_line_length": 30.913385826771652,
"alnum_prop": 0.5667345899133979,
"repo_name": "mlgruby/mining",
"id": "1f4331b43d916ae2c4f7e6d5b06253560fce7d4c",
"size": "3972... |
import mock
from rally.plugins.openstack.scenarios.keystone import basic
from tests.unit import test
BASE = "rally.plugins.openstack.scenarios.keystone."
BASIC = BASE + "basic.KeystoneBasic."
class KeystoneBasicTestCase(test.TestCase):
@staticmethod
def _get_context():
return {
"user": ... | {
"content_hash": "eea8cd612f016f4d7fd0e806b676bf3e",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 79,
"avg_line_length": 49.666666666666664,
"alnum_prop": 0.584618175222202,
"repo_name": "vponomaryov/rally",
"id": "1d314a26b6dfd9dd4eb294f740f1db123d0c1151",
"size": "11... |
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import dirname, abspath, join
from indra.benchmarks import bioprocesses as bp
from indra.benchmarks import complexes as cp
from indra.benchmarks import phosphorylations as phos
from indra.util import uni... | {
"content_hash": "c469bf8cbd5215b6f9f29e4dcf9e2af4",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 72,
"avg_line_length": 33.96,
"alnum_prop": 0.7114252061248527,
"repo_name": "jmuhlich/indra",
"id": "2a93c511ea790e2a8e7f4127098dff56246433e5",
"size": "849",
"binary": ... |
from __future__ import absolute_import, print_function, division
import fitsio
import pandas as pd
import numpy as np
import os
from .lightcurve import LightCurve
from astropy.table import Table, Column
__all__ = ['SNANASims']
lsst_bandNames = 'ugrizY'
lsst_bandpassNames = tuple('lsst' + band
... | {
"content_hash": "1921054b9fb906602921ae7a287d297d",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 83,
"avg_line_length": 36.50273224043716,
"alnum_prop": 0.5902694610778443,
"repo_name": "rbiswas4/AnalyzeSN",
"id": "9f18d2fdd161136c5eb7314c67e580c5cec609b5",
"size": "6... |
from __future__ import print_function
import itk
from itk import RTK as rtk
import sys
import os
if len ( sys.argv ) < 2:
print( "Usage: rtkFirstReconstruction.py <output.mha>" )
sys.exit ( 1 )
TImageType = itk.Image[itk.F,3]
# Defines the RTK geometry object
geometry = rtk.ThreeDCircularProjectionG... | {
"content_hash": "53601eb92e957e04f44bcf5db1d3b6bc",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 75,
"avg_line_length": 32.675324675324674,
"alnum_prop": 0.7519872813990461,
"repo_name": "SimonRit/RTK",
"id": "9e92a208dd07547bf0c7c3c9443eaf32a19cacd9",
"size": "2539",
... |
"""Tests Home Assistant location helpers."""
from homeassistant.const import ATTR_FRIENDLY_NAME, ATTR_LATITUDE, ATTR_LONGITUDE
from homeassistant.core import State
from homeassistant.helpers import location
def test_has_location_with_invalid_states():
"""Set up the tests."""
for state in (None, 1, "hello", ob... | {
"content_hash": "6ca5d5587a4b2d4d63869cb072553683",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 87,
"avg_line_length": 33.22222222222222,
"alnum_prop": 0.6509794553272814,
"repo_name": "nkgilley/home-assistant",
"id": "5ae1891e45acf9b134fa2fb29bffec9a7cdae1f6",
"size... |
import torch
from .Module import Module
class ELU(Module):
"""
Djork-Arné Clevert, Thomas Unterthiner, Sepp Hochreiter
Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)
http.//arxiv.org/pdf/1511.07289.pdf
"""
def __init__(self, alpha=1., inplac... | {
"content_hash": "6680275beaa1080ab57070c0c0445bbd",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 86,
"avg_line_length": 27.365853658536587,
"alnum_prop": 0.5525846702317291,
"repo_name": "RPGOne/Skynet",
"id": "56e3a853524e5bc72bf675cda5e7da15392b892a",
"size": "1146",... |
from collections import OrderedDict
import os
import re
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as... | {
"content_hash": "203950f8ed271d65666b81f35d3fe25f",
"timestamp": "",
"source": "github",
"line_count": 1752,
"max_line_length": 120,
"avg_line_length": 40.419520547945204,
"alnum_prop": 0.5857657276000847,
"repo_name": "googleapis/python-dataplex",
"id": "79b51fca721310bb465371cd6732c36b4813cb64",
... |
"""Certificate chain with 1 intermediate and a trusted root. The intermediate
has an unknown X.509v3 extension that is marked as non-critical. Verification
is expected to succeed because although unrecognized, the extension is not
critical."""
import common
# Self-signed root certificate (part of trust store).
root =... | {
"content_hash": "168d9a407a24d90220130bbc2213ebe3",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 77,
"avg_line_length": 36.56521739130435,
"alnum_prop": 0.7752675386444708,
"repo_name": "danakj/chromium",
"id": "b4bbb9e58d1819b0353bf6c8050e835c31c7fdbd",
"size": "1026"... |
import pbr.version
from bileanclient.client import Client
from bileanclient import exc as exceptions
__version__ = pbr.version.VersionInfo('python-bileanclient').version_string()
__all__ = [
'Client',
'exc',
'exceptions',
]
| {
"content_hash": "1452057e3c4f84c9eaa5f12ba4f2633c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 77,
"avg_line_length": 18.46153846153846,
"alnum_prop": 0.7,
"repo_name": "lvdongbing/python-bileanclient",
"id": "b6755dbd83d0dc5cba712afb167207b24bb5f07d",
"size": "891",... |
from helper import *
# Environment
Import( 'env' )
def add_dependencies(env):
'''[[[cog
import cogging as c
c.tpl(cog,templateFile,c.a(prefix=configFile))
]]]'''
AddDependency(env,'mapBuffer_cnets_osblinnikov_github_com','github.com/osblinnikov/cnets/mapBuffer')
AddDependency(env,'readerWriter_c... | {
"content_hash": "117d83952ddaddcb057012098b30724d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 120,
"avg_line_length": 39.074074074074076,
"alnum_prop": 0.7279620853080568,
"repo_name": "osblinnikov/cnets",
"id": "19e5f13dd677c6372814b70cec96d5c7effe73c0",
"size": "1... |
from unittest import TestCase
from robber import expect
from tests import must_fail
class TestRegexpIntegrations(TestCase):
def test_match_success(self):
expect('foo').to.match(r'foo')
@must_fail
def test_match_failure(self):
expect('bar').to.match(r'foo')
def test_not_match_success... | {
"content_hash": "5bde3b0b039b2c150e1dff568f29bdc5",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 43,
"avg_line_length": 23.5,
"alnum_prop": 0.6510638297872341,
"repo_name": "vesln/robber.py",
"id": "aa74a24b504b0d6ecab64b1084e518c7cb806bc5",
"size": "470",
"binary": ... |
from xml.dom import minidom
from grit.format.policy_templates.writers import xml_formatted_writer
def GetWriter(config):
'''Factory method for instanciating the ADMLWriter. Every Writer needs a
GetWriter method because the TemplateFormatter uses this method to
instantiate a Writer.
'''
return ADMLWriter(['w... | {
"content_hash": "3358e8cc9a8a013ba61b64116e4f9de6",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 80,
"avg_line_length": 42.4390243902439,
"alnum_prop": 0.6531609195402299,
"repo_name": "wistoch/meego-app-browser",
"id": "d2f476f9d7bb95b3b82ddba0bde39bfb5dbacf7c",
"siz... |
"""OSF mailing utilities.
Email templates go in website/templates/emails
Templates must end in ``.txt.mako`` for plaintext emails or``.html.mako`` for html emails.
You can then create a `Mail` object given the basename of the template and
the email subject. ::
CONFIRM_EMAIL = Mail(tpl_prefix='confirm', subject="... | {
"content_hash": "22ec3ad33e699869ddd55155d73496ae",
"timestamp": "",
"source": "github",
"line_count": 422,
"max_line_length": 145,
"avg_line_length": 30.424170616113745,
"alnum_prop": 0.7043383441077966,
"repo_name": "sloria/osf.io",
"id": "c731c3df77bb179efeef0208ac6872a1f6e5362d",
"size": "1286... |
import sublime, sublime_plugin, os
# settings = {}
# def plugin_loaded():
# global settings
# settings = sublime.load_settings("FileComplete.sublime-settings")
class FileComplete(sublime_plugin.EventListener):
reopenCompletions = False
def on_selection_modified_async(self,view):
if not view... | {
"content_hash": "b10a58b247fbf8d3ab7a2d1590a6d288",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 87,
"avg_line_length": 31.91044776119403,
"alnum_prop": 0.5720299345182414,
"repo_name": "oleksiyk/FileComplete",
"id": "ec3cab292394f9ab532d95ea00d2e2a1c039d105",
"size": ... |
import argparse
import logging
from rabbit_youtube import youtube_utils
def main():
parser = argparse.ArgumentParser(description='Passing parameter for rabbit youtube....')
parser.add_argument('--youtube_user_id', '-u', help='youtube user id')
parser.add_argument('--playlist_id', '-p', help='youtube pla... | {
"content_hash": "d9304a65a223ad9afc7814f32a4cd6d9",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 101,
"avg_line_length": 37.125,
"alnum_prop": 0.6579124579124579,
"repo_name": "guoliang-dev/rabbit-youtube",
"id": "ebf41c7d8cf031b8b387224db9a1a4a3c8310095",
"size": "150... |
import copy
import math
import os
import os.path as osp
import chainer
import cv2
import imgaug.augmenters as iaa
import numpy as np
import skimage.io
try:
from sklearn.model_selection import train_test_split
except ImportError:
from sklearn.cross_validation import train_test_split
import grasp_fusion_lib.aug... | {
"content_hash": "30974a6d01cfbea8524f258c55eaa0eb",
"timestamp": "",
"source": "github",
"line_count": 583,
"max_line_length": 102,
"avg_line_length": 38.677530017152655,
"alnum_prop": 0.5662335358552486,
"repo_name": "pazeshun/jsk_apc",
"id": "7a25b10d43ffd019b64574fdd9d69f62d2682d66",
"size": "2... |
from .correct import Corrections
| {
"content_hash": "5dc9db4565ff84b540dc81fe2d40ee7e",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 32,
"avg_line_length": 33,
"alnum_prop": 0.8484848484848485,
"repo_name": "shreyb/gracc-request",
"id": "3fc0ffd622306e92268590fc279d30844d6c320c",
"size": "33",
"binary":... |
from django import forms
from django.conf import settings
from django.core.mail import send_mail
from django.utils.translation import ugettext_lazy
class EmailForm(forms.Form):
sender = forms.EmailField(max_length=100, initial=settings.POSTMARK_SENDER)
to = forms.CharField(initial='bill@averline.co... | {
"content_hash": "5d230a1b6c75179bfbe7bfa99eaf38bf",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 95,
"avg_line_length": 37.5,
"alnum_prop": 0.6411111111111111,
"repo_name": "Mitali-Sodhi/CodeLingo",
"id": "0edd0358d80559e1d529171faefb274652746821",
"size": "901",
"bi... |
r"""Generates api_docs for tensorflow_ranking.
```shell
pip install git+http://github.com/tensorflow/docs
python build_docs.py --output_dir=/tmp/tfr_api
```
"""
import os
import sys
from absl import app
from absl import flags
from tensorflow_docs.api_generator import generate_lib
from tensorflow_docs.api_generator ... | {
"content_hash": "42cb2379dd291ad45e465e412432ebeb",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 78,
"avg_line_length": 27.42105263157895,
"alnum_prop": 0.7178502879078695,
"repo_name": "tensorflow/ranking",
"id": "e4b98fb4fb555402b9681d47b706424fffc22543",
"size": "32... |
import datetime
import re
import sys
from contextlib import contextmanager
from unittest import SkipTest, skipIf
from xml.dom.minidom import parseString
import pytz
from django.contrib.auth.models import User
from django.core import serializers
from django.core.exceptions import ImproperlyConfigured
from django.db im... | {
"content_hash": "3ca8c10b41dd550028ee9b28c2f07252",
"timestamp": "",
"source": "github",
"line_count": 1196,
"max_line_length": 119,
"avg_line_length": 45.614548494983275,
"alnum_prop": 0.6106498029511502,
"repo_name": "charettes/django",
"id": "7a63bac6700057f631c52424e0bd30c975b73eff",
"size": "... |
r"""ViT-L/32.
"""
# pylint: enable=line-too-long
import ml_collections
from experiments import common_fewshot # local file import from baselines.jft
def get_config():
"""Config for training a patch-transformer on JFT."""
config = ml_collections.ConfigDict()
config.seed = 0
# Directory for the version de-... | {
"content_hash": "ed9fac38f7593de49c81bee8b536d55b",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 125,
"avg_line_length": 34.13414634146341,
"alnum_prop": 0.705966416577349,
"repo_name": "google/uncertainty-baselines",
"id": "1631272df7504a6ff3df34e3eed30c93205e2aa2",
"... |
import bluetool
from bluetool.core import HCIDataTransCoordinator, HCIDataTransWorker, LEHelper
import bluetool.bluez as bluez
import bluetool.command as btcmd
import bluetool.event as btevt
import bluetool.error as bterr
from bluetool.utils import bytes2str, htole16
CONN_TIMEOUT_MS = 10000
class HCIVendorWriteLocal... | {
"content_hash": "bf64195f9dff5a89b8de12c7ea7268f6",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 79,
"avg_line_length": 30.838983050847457,
"alnum_prop": 0.6358889804891453,
"repo_name": "imprazaguy/bluetool",
"id": "e5b4b89df951382bf71aab90e7882375bd74fc6c",
"size": ... |
import logging
import requests
import semver
from redash import __version__ as current_version
from redash import redis_connection
from redash.models import db, Organization
from redash.utils import json_dumps
REDIS_KEY = "new_version_available"
def usage_data():
counts_query = """
SELECT 'users_count' as n... | {
"content_hash": "d47c2d4cc9bd9c7f1d7039d9ee80edfa",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 93,
"avg_line_length": 27.699115044247787,
"alnum_prop": 0.6651757188498403,
"repo_name": "getredash/redash",
"id": "d4f83f6ac83a0341a9929549c594d0e826852c77",
"size": "31... |
DEBUG = True | {
"content_hash": "8f53600d2af53ad5aa31ad432c457238",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 12,
"avg_line_length": 12,
"alnum_prop": 0.75,
"repo_name": "cirocosta/ciro-s-costa-AppEngine",
"id": "55635db10a8482bbf57a94a7aae87db9e947bef0",
"size": "12",
"binary": f... |
import sys
from pprint import pformat
import fixtures
import testtools
from testtools import content
import httpretty
import json
import logging
sys.path.insert(0, '../../../../build/debug/api-lib/')
sys.path.insert(0, '../../../../build/debug/config/api-server/')
sys.path.insert(0, '../../../../build/debug/config/com... | {
"content_hash": "d2f0fdf44740cd9772f91dbea6f8f73d",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 75,
"avg_line_length": 30.131147540983605,
"alnum_prop": 0.5729053318824809,
"repo_name": "nischalsheth/contrail-controller",
"id": "26b7fd5c1cc5fbbd89ac200896ce721286c608a6"... |
filename = "data/problem022.dat";
inputFile = open(filename, "r")
def alphaval(name):
counter = 0
for c in name:
counter += ord(c) - ord('A') + 1
return counter
def score(name, pos):
return alphaval(name) * pos
def load(filename):
return inputFile.read().replace('"', "").split(",")
i... | {
"content_hash": "c47bfc6531cbc0982075d323bd364592",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 55,
"avg_line_length": 17.137931034482758,
"alnum_prop": 0.5734406438631791,
"repo_name": "buyuk-dev/project-euler-solutions",
"id": "1e2ca030aca0f8f4ea6f88ea2ebbbf9d385c55e4... |
import os
__author__ = 'Bohdan Mushkevych'
from flow.core.execution_context import ExecutionContext
def splitpath(uri_path):
head, tail = os.path.split(uri_path)
return splitpath(head) + [tail] if head and head != uri_path else [head or tail]
class AbstractFilesystem(object):
""" abstraction for files... | {
"content_hash": "55f343852a0e1d25e6ae19a3e1dd4a22",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 84,
"avg_line_length": 23.818181818181817,
"alnum_prop": 0.6211832061068703,
"repo_name": "mushkevych/synergy_flow",
"id": "63b2aae8c7438b9611e429ea62225a8d9ec10ef2",
"size... |
from datetime import datetime
import pandas.util.testing as tm
from pandas.tseries.holiday import (
USFederalHolidayCalendar, USMemorialDay, USThanksgivingDay,
nearest_workday, next_monday_or_tuesday, next_monday,
previous_friday, sunday_to_monday, Holiday, DateOffset,
MO, Timestamp, AbstractHolidayCale... | {
"content_hash": "0f2a62fec64f70c556504c2c3302dbbf",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 82,
"avg_line_length": 41.587044534412954,
"alnum_prop": 0.5334890965732088,
"repo_name": "dssg/wikienergy",
"id": "c2300481eca4319d61717dfe9eb8f4bf7113f489",
"size": "102... |
"""Utilities for handling Java code."""
import os
def JavaHomeAndSuffix():
"""Find the directory that the JDK is installed in.
The JDK install directory is expected to have a bin directory that contains
at a minimum the java and javac executables. If the environment variable
JAVA_HOME is set then it must po... | {
"content_hash": "36202b2e973dbae3dc3e450c02409b7e",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 80,
"avg_line_length": 33.86206896551724,
"alnum_prop": 0.6675152749490835,
"repo_name": "ychen820/microblog",
"id": "21cafad9564e8f97a63c16dec29016f972429132",
"size": "25... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exams', '0015_added_description_and_course_run'),
]
operations = [
migrations.AddField(
model_name='examauthorization',
name='exam_coupon_url',
field=mod... | {
"content_hash": "5e24a21b61aaf83326bc03daa8a97247",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 59,
"avg_line_length": 23.375,
"alnum_prop": 0.5962566844919787,
"repo_name": "mitodl/micromasters",
"id": "8d5672efe177df54172109de0153bb5f487f30a6",
"size": "424",
"bin... |
import errno
import os
import socket
import ovs.poller
import ovs.socket_util
import ovs.vlog
vlog = ovs.vlog.Vlog("stream")
def stream_or_pstream_needs_probes(name):
""" 1 if the stream or pstream specified by 'name' needs periodic probes to
verify connectivity. For [p]streams which need probes, it can ta... | {
"content_hash": "b40a326280c32facd6b1cf127e5f5472",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 79,
"avg_line_length": 33.33810888252149,
"alnum_prop": 0.5861624409110443,
"repo_name": "StephenKing/summerschool-2015-ryu",
"id": "b584398aeb31d590eb7fe33b1e954229d44f156d... |
"""Load a yaml from from the local filesystem"""
from yamlsettings.extensions.base import YamlSettingsExtension
class LocalExtension(YamlSettingsExtension):
"""Local filesystem, works with any valid system path. This
is the default and will be used if you don't include the scheme.
examples:
* file:... | {
"content_hash": "e60028f22063db2ce732a48d1ee4e3b9",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 68,
"avg_line_length": 35,
"alnum_prop": 0.6404761904761904,
"repo_name": "KyleJamesWalker/yamlsettings",
"id": "3a4002f14dbd6fd86f88d715674e3f54484892f2",
"size": "840",
... |
from osf.models.metaschema import RegistrationSchemaBlock, RegistrationSchema, FileMetadataSchema # noqa
from osf.models.base import Guid, BlackListGuid # noqa
from osf.models.user import OSFUser, Email # noqa
from osf.models.contributor import Contributor, RecentlyAddedContributor, PreprintContributor, DraftRegistr... | {
"content_hash": "841729cd48752badb75a49633cc9bcbc",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 150,
"avg_line_length": 64.94915254237289,
"alnum_prop": 0.8217640918580376,
"repo_name": "CenterForOpenScience/osf.io",
"id": "416477ba932b07180228a71eb11d7cb925e0d5c1",
"... |
import os
import decorator
from oslo_utils import strutils
from rally.common import fileutils
from rally.common.i18n import _
from rally import exceptions
ENV_DEPLOYMENT = "RALLY_DEPLOYMENT"
ENV_TASK = "RALLY_TASK"
ENV_VERIFIER = "RALLY_VERIFIER"
ENV_VERIFICATION = "RALLY_VERIFICATION"
ENVVARS = [ENV_DEPLOYMENT, ENV... | {
"content_hash": "940fde2af3254a87a7124ac03d3c37d3",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 79,
"avg_line_length": 38.58955223880597,
"alnum_prop": 0.580545349062077,
"repo_name": "yeming233/rally",
"id": "37d7698aa1366a0fe1d54bee0d6969c3b1b08c17",
"size": "5801"... |
import os, sqlite3
from config_default import CFG_CACHEDBPATH
try:
from config import CFG_CACHEDBPATH
except:
pass
def schemaDb():
db = sqlite3.connect(CFG_CACHEDBPATH)
db.execute("""CREATE TABLE IF NOT EXISTS cache
(id INTEGER PRIMARY KEY,
filesid TEXT,
hashlist TEXT)""")
if __name__ =... | {
"content_hash": "f438ce0b24f8df96f3d318baed376d1b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 50,
"avg_line_length": 20.529411764705884,
"alnum_prop": 0.664756446991404,
"repo_name": "France-ioi/taskgrader",
"id": "bbdc6a2c32e033daef76b60608e29fff44d0afe4",
"size": ... |
import sys, csv
from functools import partial
e_cutoff = 1e-3
def printHelp():
sys.exit("NAME\n\treciprocalCompare: A tool for sorting through the results of a reciprocal blast.\nSYNOPSIS\n\treciprocalCompare --help\n\treciprocalCompare [-[|]e12] [-s] file1 file2 [outputfile]\nDESCRIPTION\n\treciprocalCompare find... | {
"content_hash": "fef45dcc0c04a16a3615f5cd000582b3",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 986,
"avg_line_length": 39.2,
"alnum_prop": 0.6207482993197279,
"repo_name": "mattsoulanille/Protein-reciprocal-compare",
"id": "4be916630163a66307211cc96929f4fb192b6c48",
... |
import argparse
import os
from pathlib import Path
import re
import sys
import textwrap
from west import log
from west.commands import WestCommand
sys.path.append(os.fspath(Path(__file__).parent.parent))
import list_boards
class Boards(WestCommand):
def __init__(self):
super().__init__(
'boa... | {
"content_hash": "d721eefdbb67fc7b826bb272340bb6b2",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 76,
"avg_line_length": 32.57746478873239,
"alnum_prop": 0.5590142671854734,
"repo_name": "nashif/zephyr",
"id": "8b81a2fa612b7faf2ffe357f9a41eac7b579eaec",
"size": "2400",
... |
import fnmatch
from rosbridge_library.capability import Capability
from rosbridge_library.internal.publishers import manager
class Registration:
"""Keeps track of how many times a client has requested to advertise
a publisher.
A client could advertise and unadvertise a topic multiple times, and we
m... | {
"content_hash": "2c55f2d647b6f7e2fb83afb6fbf35e6f",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 98,
"avg_line_length": 35.854304635761586,
"alnum_prop": 0.5892131510897672,
"repo_name": "RobotWebTools/rosbridge_suite",
"id": "7e2f950210bf226303ec0b46d0446cc8a44ba063",
... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 7, transform = "BoxCox", sigma = 0.0, exog_count = 20, ar_order = 0); | {
"content_hash": "0c098a67abfbb49f0c3116a40e717886",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 164,
"avg_line_length": 37.714285714285715,
"alnum_prop": 0.7045454545454546,
"repo_name": "antoinecarme/pyaf",
"id": "802f358b90cb4b4f8383d901f785d1019984de94",
"size": "26... |
import os
import sys
import codecs
from django.core.management import call_command
from django.core.management.base import CommandError
from onadata.apps.main.tests.test_base import TestBase
from onadata.apps.logger.models.xform import XForm
from onadata.libs.utils.logger_tools import report_exception
class TestPub... | {
"content_hash": "3589d2528a5b600afb3a9a45ddc347f5",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 79,
"avg_line_length": 41.58064516129032,
"alnum_prop": 0.6082234290147401,
"repo_name": "mainakibui/kobocat",
"id": "f21b043fc009f9a4d65af57713d22c4ac7cf525e",
"size": "38... |
'''
Takes a repeat-masker formated output file and converts it to FASTA format.
It will optionally only output specific classes of repeats (rRNA, tRNA,
simple repeats, etc...)
'''
import sys
import os
import gzip
import pysam
def repeat2fasta(repeat_fname, ref_fname, repeat_family=None):
if repeat_fname[-3:] == ... | {
"content_hash": "6ff9fb473b57d0b8b4d4888ef06d5f37",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 98,
"avg_line_length": 25.1,
"alnum_prop": 0.5398406374501992,
"repo_name": "ngsutils/ngsutils",
"id": "62c9f5d5c534e9283acc1db4657190dc4b0adfa0",
"size": "2114",
"binary... |
'''Collection of per-caller summary statistics.
The data are specific for each caller.
'''
import os
from CGATReport.Tracker import *
from PeakcallingReport import *
class FilteringSummary(DefaultTracker, SingleTableTrackerRows):
table = 'exported_intervals'
fields = ('track', 'method')
class MacsSummary(... | {
"content_hash": "81d1a23d97fdf73f33cbfd9e906e3463",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 79,
"avg_line_length": 25.057142857142857,
"alnum_prop": 0.6176358798935766,
"repo_name": "CGATOxford/CGATPipelines",
"id": "20d934816a654b4d5050eed1e8e7ccb8ee8b3ede",
"si... |
import threading
import logging
import unittest
import gc
from stockviderApp.utils import retryLogger
from stockviderApp.sourceDA.symbols.referenceSymbolsDA import ReferenceSymbolsDA
from stockviderApp.localDA.symbols.dbReferenceSymbolsDA import DbReferenceSymbolsDA
from stockviderApp.sourceDA.symbols.googleSymbolsD... | {
"content_hash": "87a2bae580bd0a9d8a2c1bea061e501d",
"timestamp": "",
"source": "github",
"line_count": 873,
"max_line_length": 118,
"avg_line_length": 38.18671248568156,
"alnum_prop": 0.5841857395686475,
"repo_name": "aberdah/Stockvider",
"id": "2aaa2f56f6c03174769d3f920367f16412ace49e",
"size": "... |
"""
The TropoPython module. This module implements a set of classes and methods for manipulating the Voxeo Tropo WebAPI.
Usage:
----
from tropo import Tropo
tropo = Tropo()
tropo.say("Hello, World")
json = tropo.RenderJson()
----
You can write this JSON back to standard output to get Tropo to perform
the action. Fo... | {
"content_hash": "fbea7d923a470021914e8623689abff9",
"timestamp": "",
"source": "github",
"line_count": 725,
"max_line_length": 226,
"avg_line_length": 33.08689655172414,
"alnum_prop": 0.588877772219443,
"repo_name": "kwantopia/shoppley-migrate",
"id": "27b20aa0f32af86513f9a8bb8c7a5ca30ec2a94e",
"s... |
import sys
if __name__ == '__main__':
if len(sys.argv) < 2 or len(sys.argv) > 3 or sys.argv[1] == '--help':
print 'Usage: %s sound_to_play.(ogg|wav) [volume]'%sys.argv[0]
print
print 'Plays an .OGG or .WAV file. The path to the file should be absolute, and be valid on the computer on which ... | {
"content_hash": "15cd8e5f735a96a936f0ffce17e2464c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 256,
"avg_line_length": 37.708333333333336,
"alnum_prop": 0.6453038674033149,
"repo_name": "fujy/ROS-Project",
"id": "c94336b148ff9dc31f4b071912dddfccbd1a08fe",
"size": "27... |
"""
NLTK corpus readers. The modules in this package provide functions
that can be used to read corpus files in a variety of formats. These
functions can be used to read both the corpus files that are
distributed in the NLTK corpus package, and corpus files that are part
of external corpora.
Available Corpora
======... | {
"content_hash": "386f713c300b90e3ecc4693fbd8ed97c",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 127,
"avg_line_length": 41.168168168168165,
"alnum_prop": 0.6791888540374936,
"repo_name": "sfrenza/test-for-bot",
"id": "d9ccb542ee9c121247dc60b24b2842fdc5ae7128",
"size"... |
"""
Implementation for of the configuration object.
"""
import os,time,socket,sys
from .data import *
import scapy.base_classes
import scapy.themes
from .error import log_scapy
############
## Config ##
############
class ConfClass(object):
def configure(self, cnf):
self.__dict__ = cnf.__dict__.copy()
... | {
"content_hash": "1588215090032f204c5667c5eec36362",
"timestamp": "",
"source": "github",
"line_count": 389,
"max_line_length": 115,
"avg_line_length": 33.552699228791774,
"alnum_prop": 0.579451425068955,
"repo_name": "zverevalexei/trex-http-proxy",
"id": "88c324f8539cc6064af9761d3c81dd4a48f30503",
... |
"""Plugin for text file or URL feeds via regex."""
import re
from pathlib import Path
from loguru import logger
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils.cached_input import cached
logger = logger.bind(name='text')
class Text:
"""
Parse an... | {
"content_hash": "1d5c8d4e76358852ec05680deb709200",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 146,
"avg_line_length": 34.40714285714286,
"alnum_prop": 0.45360182686319284,
"repo_name": "crawln45/Flexget",
"id": "70f3250af9e51890617b648c486487316574f9e7",
"size": "4... |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename('hyperlink15.xlsx')
def test_create_file... | {
"content_hash": "28720f1f617a41f22610e2055578bf4e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 162,
"avg_line_length": 27.724137931034484,
"alnum_prop": 0.6890547263681592,
"repo_name": "jmcnamara/XlsxWriter",
"id": "9be8a9f1dc6b296683a8a71ea43b408b2837cb67",
"size":... |
"""
VirtWhat
========
Combiner to check if the host is running on a virtual or physical machine. It
uses the results of the ``DMIDecode`` and ``VirtWhat`` parsers. Prefer
``VirtWhat`` to ``DMIDecode``.
Examples:
>>> vw = shared[VirtWhat]
>>> vw.is_virtual
True
>>> vw.is_physical
False
>>> vw... | {
"content_hash": "a732ad0b730d916ca2fe98c97e9aca56",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 113,
"avg_line_length": 32.07865168539326,
"alnum_prop": 0.5674255691768827,
"repo_name": "wcmitchell/insights-core",
"id": "0f6eaf4b655c2d1970f7ca5a249eb700e0455326",
"siz... |
from django.core.management.base import BaseCommand, CommandError
from metadata.models import RUContentType
from django.conf import settings
import csv
# This file is part of https://github.com/cpina/science-cruise-data-management
#
# This project was programmed in a hurry without any prior Django experience,
# while ... | {
"content_hash": "5c9c817f3ecdf9bdfd3122235dabe2b0",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 83,
"avg_line_length": 42.023809523809526,
"alnum_prop": 0.6776203966005666,
"repo_name": "cpina/science-cruise-data-management",
"id": "fd9605ccb126891510c18ef566b35e44042b3... |
"""
pint.compat
~~~~~~~~~~~
Compatibility layer.
:copyright: 2013 by Pint Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import division, unicode_literals, print_function, absolute_import
import sys
from io import BytesIO
from numbers imp... | {
"content_hash": "16260cd8a886cb5b06baf5e4e1491de3",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 85,
"avg_line_length": 24.4609375,
"alnum_prop": 0.655381667198978,
"repo_name": "dmwelch/pint",
"id": "74429675c638233562870a5fc47522285aec7299",
"size": "3155",
"binar... |
from __future__ import print_function
from pandas import Series, DataFrame
import time
import re
import requests
import json
'''
__author__ = 'kmu'
'''
url = "http://h-web01.nve.no/chartserver/ShowData.aspx?req=getchart&ver=1.0&vfmt=json&time=-3;0&chd=ds=htsre,id=17150.16,rt=1:0,mth=inst|ds=htsry,id=metx[17150].60... | {
"content_hash": "49fcf26390f57659c9a973a5a7a7d0dd",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 302,
"avg_line_length": 27.98611111111111,
"alnum_prop": 0.6903225806451613,
"repo_name": "kmunve/TSanalysis",
"id": "c7fc2fbe94114c22312df20fb99afe27fa055e7f",
"size": "20... |
from django.apps import AppConfig
class PaymentConfig(AppConfig):
name = 'findyour3d.payment'
| {
"content_hash": "3ad0e7f94d585d7de1a54de26f0bf2e6",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 20,
"alnum_prop": 0.77,
"repo_name": "hqpr/findyour3d",
"id": "4a3d087a4bbd2b2d233bc7557cf52fdee7ca8cc1",
"size": "100",
"binary": false,
"copies"... |
import unittest
import os.path as op
import ssbio.protein.structure.properties.fatcat as fatcat
class TestFATCAT(unittest.TestCase):
"""Unit tests for FATCAT"""
def test_run_fatcat_all_by_all(self):
OUT_DIR = op.join('test_files', 'out')
FATCAT_SH = '/home/nathan/software/fatcat/runFATCAT.sh'... | {
"content_hash": "37c1db95db6b33a036e5a4083106fb60",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 94,
"avg_line_length": 38,
"alnum_prop": 0.6377708978328174,
"repo_name": "nmih/ssbio",
"id": "e62e42881336479bb2c8ffabaa115bf4382deb44",
"size": "646",
"binary": false,
... |
from drive_controller import DriveController
from coordinates import Coordinates
from bolt_settings import BoltSettings
from referee_controller import RefereeController
from mainboard_controller import MainBoardController
import time
from datetime import datetime
import numpy as np
import cv2
import threading
import se... | {
"content_hash": "6665d1e36b9a02270417ccd3ef5d13ce",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 122,
"avg_line_length": 36.61827956989247,
"alnum_prop": 0.5097636176772867,
"repo_name": "valuko/team_st33ve",
"id": "d509690aea49065f98f61f308fbce265e4304049",
"size": "... |
from mitmproxy import flowfilter
print('<table class="table filtertable"><tbody>')
for i in flowfilter.help:
print("<tr><th>%s</th><td>%s</td></tr>" % i)
print("</tbody></table>")
| {
"content_hash": "725713ffad4f23f5b9afb2a0ce7ce698",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 49,
"avg_line_length": 26.571428571428573,
"alnum_prop": 0.6451612903225806,
"repo_name": "mhils/mitmproxy",
"id": "32634196a87520312a96f66904e9f4eec4bde939",
"size": "210",... |
"""
SDIPy package initalization file
(c) Charles Fracchia 2013
charlesfracchia@gmail.com
"""
#Import Sender class
from sdipy.sender import Sender
from sdipy.data import Data
from sdipy.packet import Packet | {
"content_hash": "101558ffbe01fce27d8de6d908b81fbc",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 32,
"avg_line_length": 18.818181818181817,
"alnum_prop": 0.8019323671497585,
"repo_name": "paolotozzo/SDIPy",
"id": "0037de2f0c757a42b61b23fdf5a2222beb0b9905",
"size": "207... |
import logging
import multiprocessing
import os
import shutil
import subprocess
import sys
import tempfile
import time
from dependency_manager import exceptions as dependency_exceptions
from telemetry.internal.util import binary_manager
class MinidumpSymbolizer(object):
def __init__(self, os_name, arch_name, dump_... | {
"content_hash": "3be7e6471b406e1e6b9901d839b7c257",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 80,
"avg_line_length": 41.710144927536234,
"alnum_prop": 0.6723419041000694,
"repo_name": "endlessm/chromium-browser",
"id": "9d150d4d87df49bdf7c3c43ce5ddfca4d5c5b4ff",
"s... |
import unittest
from s3.s3utils import *
from s3.s3data import S3DataTable
from s3.s3datetime import S3Calendar, S3DefaultTZ
from unit_tests import run_suite
# =============================================================================
class S3TypeConverterTests(unittest.TestCase):
""" Test S3TypeConverter """... | {
"content_hash": "998686adc87b83e18a4cde4254c6e77a",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 90,
"avg_line_length": 37.46190476190476,
"alnum_prop": 0.5626032795220541,
"repo_name": "flavour/eden",
"id": "1772d5d5a95d4b2b9543312f6bd7913733da1da7",
"size": "8026",
... |
from direct.distributed.DistributedObjectAI import DistributedObjectAI
class DistributedCameraAI(DistributedObjectAI):
def __init__(self, air):
DistributedObjectAI.__init__(self, air)
self.parent = 0
self.fixtures = []
def getCamParent(self):
return self.parent
def getFix... | {
"content_hash": "a9b634afec8bf8f6c72df7cb27500a25",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 70,
"avg_line_length": 25.857142857142858,
"alnum_prop": 0.6795580110497238,
"repo_name": "tobspr/panda3d",
"id": "54bcc8f02876aa15df6fec25accca2929c5546c9",
"size": "362",... |
import re
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[0]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0)
assert contact_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(contact_from_edit_page)
#def test_phon... | {
"content_hash": "a150808a73504a5e089ac87a7d526ae5",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 171,
"avg_line_length": 46.04,
"alnum_prop": 0.7106863596872285,
"repo_name": "Godmod13/python_training",
"id": "edd8bed8045b34b3e1cce85b863a0396a16954cb",
"size": "1151",
... |
import math
from BaseInteractor import _BaseInteractor
from boxSum import PointInteractor
from boxSum import VerticalDoubleLine
from boxSum import HorizontalDoubleLine
class BoxMask(_BaseInteractor):
"""
BoxMask Class: determine 2 rectangular area to find the pixel of
a Data inside of box.
Uses Point... | {
"content_hash": "e5a2a5ee33e478fb2b8f940a3f210d42",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 83,
"avg_line_length": 37.643153526970956,
"alnum_prop": 0.5329585537918872,
"repo_name": "lewisodriscoll/sasview",
"id": "71cb4da0510a548382937744418f165339b5c552",
"size... |
import operator
from django.core.exceptions import ImproperlyConfigured
from rest_framework import exceptions, permissions
from api.base.utils import has_admin_scope
from framework.auth import oauth_scopes
from framework.auth.cas import CasResponse
from website.models import ApiOAuth2Application, ApiOAuth2PersonalT... | {
"content_hash": "ffc0308754c5232228647d0dfe53cbfe",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 163,
"avg_line_length": 44.7887323943662,
"alnum_prop": 0.6679245283018868,
"repo_name": "emetsger/osf.io",
"id": "042be4f2b92064d3f605d700bf1afd005b087047",
"size": "6360... |
"""
Tests for file upload field; view as hyperlink.
"""
from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2015, G. Klyne"
__license__ = "MIT (http://opensource.org/licenses/MIT)"
impo... | {
"content_hash": "a10e7b3e27a3bb7c2deed7421d68a53e",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 103,
"avg_line_length": 33.24271844660194,
"alnum_prop": 0.5519859813084113,
"repo_name": "gklyne/annalist",
"id": "acef31267d518830c245bbce43d7392821e75e31",
"size": "342... |
from pecan import load_app
from webtest import TestApp
def load_test_app(config=None):
"""
Used for functional tests where you need to test your
literal application and its integration with the framework.
:param config: Can be a dictionary containing configuration, a string which
... | {
"content_hash": "192f0bed712567366eb9fbc4bf9475ba",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 79,
"avg_line_length": 32.371428571428574,
"alnum_prop": 0.6381288614298323,
"repo_name": "jimrollenhagen/pecan",
"id": "ee2896ecd466c128a056470487fc3145b73d066e",
"size": ... |
import os
import shutil
import os.path
import tempfile
from os.path import join
import pytest
from BalancedDiscStorage import BalancedDiscStorageZ
from test_balanced_disc_storage import data_file_context
# Variables ===================================================================
TEMP_DIR = None
# Fixtures =... | {
"content_hash": "f7a1785045b4e2b4d8b624d0ea01f31d",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 81,
"avg_line_length": 25.16949152542373,
"alnum_prop": 0.632996632996633,
"repo_name": "Bystroushaak/BalancedDiscStorage",
"id": "4da2759f77a19b72da1c11222f279c7164a174d9",... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import pytest
import yaml
class TestInputRSS(object):
config = """
tasks:
_:
rss: &rss
url: rss.xml
silent: yes
... | {
"content_hash": "b082a48dd58155e88eafcc4cc900e508",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 108,
"avg_line_length": 39.832402234636874,
"alnum_prop": 0.5784011220196353,
"repo_name": "oxc/Flexget",
"id": "4a3d4bb3b9332e66cc2b15ff5e2661c657f5149d",
"size": "7130",... |
import time
from datetime import datetime, timedelta
from traits.api import Property, String, Float, Any, Int, List, Instance
from pychron.core.helpers.timer import Timer
from pychron.experiment.duration_tracker import AutomatedRunDurationTracker
from pychron.loggable import Loggable
from pychron.pychron_constants im... | {
"content_hash": "6ce54d1c4d24a6d721d0908875b3c8bb",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 98,
"avg_line_length": 28.36842105263158,
"alnum_prop": 0.5240027829313544,
"repo_name": "USGSDenverPychron/pychron",
"id": "bfa690faf752183287c06d80f5caeb270f88bc53",
"si... |
"""Support for OVO Energy sensors."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import timedelta
from typing import Callable, Final
from ovoenergy import OVODailyUsage
from ovoenergy.ovoenergy import OVOEnergy
from homeassistant.components.sensor import (
STATE_CLASS_TOTA... | {
"content_hash": "1fca3a9b43d9acad794d5f6e390c58bd",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 84,
"avg_line_length": 35.59281437125748,
"alnum_prop": 0.681864064602961,
"repo_name": "FreekingDean/home-assistant",
"id": "16fd15bfbde6e03199afc9e3f49cceaf26db3660",
"s... |
"""
WSGI config for tenant_subfolder_tutorial project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``W... | {
"content_hash": "2d7d79ab39a7bf94e2a7d7ecd44f8e50",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 85,
"avg_line_length": 46.125,
"alnum_prop": 0.7967479674796748,
"repo_name": "tomturner/django-tenants",
"id": "ca264c41679d73c8402744a18bc8fe506d0b4250",
"size": "1476",
... |
"""A library for general use by the advanced shell history utilities.
This library provides components used by _ash_log.py and ash_query.py for
logging, flag parsing, configuration and database management.
"""
__author__ = 'Carl Anderson (carl.anderson@gmail.com)'
__version__ = '0.8r2'
import argparse
import loggin... | {
"content_hash": "210e80ec8bbaba6f563cd5a4820cad0c",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 81,
"avg_line_length": 34.13106796116505,
"alnum_prop": 0.6322002560091026,
"repo_name": "sjjf/advanced-shell-history",
"id": "7e45ba3378a4b52c6453ca225b9be5a634fea311",
"... |
import os
import config
import basehandler
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext import db
# This page isn't dynamic
MAX_AGE_SECONDS = 60 * 60 * 24
class Search(basehandler.BaseHandler):
def get(self):
# Get player name, if any
... | {
"content_hash": "078f2bb79db9417de28124756a9ebfeb",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 71,
"avg_line_length": 32.214285714285715,
"alnum_prop": 0.6529933481152993,
"repo_name": "spiffcode/hostile-takeover",
"id": "512accb255f6e1a201d43defe3b76f2517f97d69",
"s... |
import Queue
import threading
import logging
import msgpack
from org.o3project.odenos.remoteobject.transport.base_message_transport import (
BaseMessageTransport
)
from org.o3project.odenos.remoteobject.message.response import Response
import message_dispatcher
class RemoteMessageTransport(BaseMessageTransport):... | {
"content_hash": "aa93f09c8fabdb9feace42fcc3c7917f",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 88,
"avg_line_length": 32.5625,
"alnum_prop": 0.5902111324376199,
"repo_name": "y-higuchi/odenos",
"id": "a5ae5552e32318e9e53e259b6ae8cb0ecd27503f",
"size": "4152",
"bina... |
from __future__ import division, print_function, absolute_import
import pytest
from numpy.testing import assert_array_equal
from scipy._lib._numpy_compat import suppress_warnings
import scipy.ndimage as ndi
import os
try:
from PIL import Image
pil_missing = False
except ImportError:
pil_missing = True
... | {
"content_hash": "69874d87b594f25c569c1b8fd57317aa",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 87,
"avg_line_length": 31.94736842105263,
"alnum_prop": 0.6672158154859967,
"repo_name": "mbayon/TFG-MachineLearning",
"id": "36966f2ffbaebe48ab7f66057a4c149a8248288e",
"si... |
"""
Resource Filtering Logic
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
from datetime import timedelta
import fnmatch
import logging
import operator
import re
from dateutil.tz import tzutc
from dateutil.parser import parse
import jmespath
import six
from c7... | {
"content_hash": "8e2dce28bf474bdf3019be8bf165b1af",
"timestamp": "",
"source": "github",
"line_count": 544,
"max_line_length": 97,
"avg_line_length": 32.11580882352941,
"alnum_prop": 0.5582966058039036,
"repo_name": "scotwk/cloud-custodian",
"id": "a0f72a80b900c5e025431f7f0a50f7dfc647ee89",
"size"... |
import platform
from asyncio import gather, new_event_loop
from pulsar.api import ensure_future, EventHandler, as_coroutine
from pulsar.apps.data import create_store
from pulsar.apps.greenio import GreenHttp
from pulsar.apps.http import HttpClient
from pulsar.utils.importer import module_attribute
from ..utils.serial... | {
"content_hash": "9155ee6468f083173abfe89841a5cfcc",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 79,
"avg_line_length": 30.232142857142858,
"alnum_prop": 0.5953927938570585,
"repo_name": "quantmind/pulsar-queue",
"id": "93ea8764b7480a0e63ea667f88d1c92297ac17c1",
"size... |
'''
Factory object
==============
The factory can be used to automatically register any class or module
and instantiate classes from it anywhere in your project. It is an
implementation of the
`Factory Pattern <http://en.wikipedia.org/wiki/Factory_pattern>`_.
The class list and available modules are automatically gen... | {
"content_hash": "63203b81951c45ceb803386319198027",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 79,
"avg_line_length": 33.648936170212764,
"alnum_prop": 0.584571609231742,
"repo_name": "inclement/kivy",
"id": "286dfaf1bab43d6b662398374fbecc8b4adfff2b",
"size": "6326"... |
__author__ = "Jwely"
import math
import numpy
class LambOseenVortex:
def __init__(self, circulation_strength, viscosity):
"""
Creates a Lamb Oseen vortex
:param circulation_strength: The circulation strength of the vortex
:param viscosity: The kinematic viscosity ... | {
"content_hash": "fe5845bf40bdfcf877b2d687363508db",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 115,
"avg_line_length": 39.625,
"alnum_prop": 0.6111270433036995,
"repo_name": "Jwely/pivpr",
"id": "b6777f9b7a4ff22bd129cf86ed5a615f79a96734",
"size": "3487",
"binary": ... |
"""Transport adapter for urllib3."""
from __future__ import absolute_import
import logging
# Certifi is Mozilla's certificate bundle. Urllib3 needs a certificate bundle
# to verify HTTPS requests, and certifi is the recommended and most reliable
# way to get a root certificate bundle. See
# http://urllib3.readthedo... | {
"content_hash": "dc8040472c179d60e351f5cc0864e037",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 78,
"avg_line_length": 34.67782426778243,
"alnum_prop": 0.6382722007722008,
"repo_name": "dstrockis/outlook-autocategories",
"id": "a08f4275c5711db78e76c239e26165a05e4eae20"... |
from __future__ import absolute_import
from __future__ import unicode_literals
from .cli import main
if __name__ == '__main__':
exit(main())
| {
"content_hash": "238f10493a23e9412ac873dafe31663a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 39,
"avg_line_length": 21,
"alnum_prop": 0.6530612244897959,
"repo_name": "smallredbean/pgctl",
"id": "192fd5f98acbde30036967e6a4757e7e3c1e6740",
"size": "147",
"binary": ... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "bc016ee04ce3e22281a93fe987db5a47",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 100,
"avg_line_length": 35.036144578313255,
"alnum_prop": 0.7111416781292985,
"repo_name": "basvdl/incubator-metron",
"id": "a097dff5d6e5be76f9eedb32817bdcf7fe70fddb",
"siz... |
def selection_sort(arr):
n = len(arr)
for i in range(0, n):
for j in range(i+1, n):
# if the value at i is > value at j -> swap
if arr[i] > arr[j]:
arr[i], arr[j] = arr[j], arr[i]
# input arr
arr = [3, 2, 4, 1, 5]
print('Before selection sort:', arr)
# call sel... | {
"content_hash": "8a58ea5d0c6180c5702e185a3627f33e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 55,
"avg_line_length": 24.8125,
"alnum_prop": 0.5440806045340051,
"repo_name": "anubhavshrimal/Data_Structures_Algorithms_In_Python",
"id": "c047a429ce672912dde2a806f984eec4b... |
"""Unit tests for the cloud_transaction_services.py"""
from __future__ import annotations
from core.platform.transactions import cloud_transaction_services
from core.tests import test_utils
class CloudTransactionServicesTests(test_utils.GenericTestBase):
"""Unit tests for the cloud_transaction_services.py"""
... | {
"content_hash": "ed2491b88c77198ce59b22a0a44edfeb",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 89,
"avg_line_length": 33.5,
"alnum_prop": 0.6029850746268657,
"repo_name": "oppia/oppia",
"id": "09cf424cc4ef2c56d9b813e654d00e85e638819b",
"size": "1945",
"binary": fal... |
from pudzu.charts import *
# wikifame comparison
fg, bg = "white", "black"
DEFAULT_IMG = "https://s-media-cache-ak0.pinimg.com/736x/0d/36/e7/0d36e7a476b06333d9fe9960572b66b9.jpg"
TITLE = "the most famous person born each century"
SUBTITLE = "according to different language Wikipedias"
FOOTNOTE = "fame measu... | {
"content_hash": "1130e1eed3c8425daa3028cdc9c243cd",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 139,
"avg_line_length": 52,
"alnum_prop": 0.657190635451505,
"repo_name": "Udzu/pudzu",
"id": "f9357f62e6c89fb65ea92c787191391724a1a11c",
"size": "2392",
"binary": false,... |
"""
"""
from django.test import Client
from django.test import TestCase
from todo.views import show_json
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
class TodoTest(TestCase):
def test_show_json(... | {
"content_hash": "943a3bcffabe9a2b9c043fee0909267f",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 41,
"avg_line_length": 21,
"alnum_prop": 0.625,
"repo_name": "davisein/jitsudone",
"id": "8cad7bc25505c3086d72831eb6ef31346fc948fc",
"size": "336",
"binary": false,
"co... |
from __future__ import unicode_literals
import csv
import datetime
import json
import glob
import multiprocessing as mp
import os
import platform
import random
import re
import signal
import six
import struct
import sys
import threading
import time
import traceback
from bisect import bisect_right
from calendar import ... | {
"content_hash": "0eb16340eb696e0b7ee0ee776b736550",
"timestamp": "",
"source": "github",
"line_count": 2726,
"max_line_length": 135,
"avg_line_length": 41.296404988994865,
"alnum_prop": 0.5916286176204096,
"repo_name": "blerer/cassandra",
"id": "ce4d35d8b4c66999589875968f8b7f64ed997f70",
"size": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.