text stringlengths 4 1.02M | meta dict |
|---|---|
__author__ = 'kotaimen'
__date__ = '4/4/15'
import unittest
import time
import io
import re
from stonemason.util.timer import Timer, human_duration
class TestTimer(unittest.TestCase):
def test_human_duration(self):
self.assertEqual(human_duration(0.00123), '1.23ms')
self.assertEqual(human_durati... | {
"content_hash": "1eb2d0907fb365439e31ea3cdc572a3b",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 68,
"avg_line_length": 25.208333333333332,
"alnum_prop": 0.5768595041322314,
"repo_name": "Kotaimen/stonemason",
"id": "9de4485e83c07f955becbe2e8698c9dc95e157b4",
"size": "... |
import os, sys
import datetime
import iris
import iris.unit as unit
import iris.analysis.cartography
import numpy as np
from iris.coord_categorisation import add_categorised_coord
diag = 'avg.5216'
cube_name_explicit='stratiform_rainfall_rate'
cube_name_param='convective_rainfall_rate'
pp_file_path='/projects/casc... | {
"content_hash": "6ed5587cb03d8e57c7e14ce2cb98c704",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 197,
"avg_line_length": 43.079754601226995,
"alnum_prop": 0.655511250356024,
"repo_name": "peterwilletts24/Monsoon-Python-Scripts",
"id": "bea9f1c5cc8d07c99ab5b03e1a768d7aaf... |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.exceptions import HttpResponseError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from ... import models
T = TypeVar('T')
ClsType =... | {
"content_hash": "a47a83a4df50a14ac65344222f015fb5",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 144,
"avg_line_length": 46.37152777777778,
"alnum_prop": 0.6551104455260203,
"repo_name": "Azure/azure-sdk-for-python",
"id": "f2e3e19342d8e18416e55cb8a12b33813e2e7414",
"... |
"""
Complex data model example modeling stackoverflow-like data.
It is used to showcase several key features of elasticsearch-dsl:
* Object and Nested fields: see User and Comment classes and fields they
are used in
* method add_comment is used to add comments
* Parent/Child relationship
... | {
"content_hash": "8e665b09210d7f7caa79cae083c1ce81",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 86,
"avg_line_length": 28.18421052631579,
"alnum_prop": 0.6034858387799564,
"repo_name": "elastic/elasticsearch-dsl-py",
"id": "df832d650dd3dc5cbf08b8011cc79d52ac6ce9f1",
... |
import os
from .base import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'docs',
'USER': 'postgres', # Not used with sqlite3.
'PASSWORD': '',
'HOST': '10.177.73.97',
'PORT': '',
}
}
DEBUG = False
TEMPLATE_DE... | {
"content_hash": "b1ba84ad7a1d3225953f0104f0663c79",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 85,
"avg_line_length": 23.756410256410255,
"alnum_prop": 0.6341068537506745,
"repo_name": "espdev/readthedocs.org",
"id": "236a02044afff8edf35e635ed2bdae4edc2101db",
"size"... |
import functools
import importlib
import inspect
import threading
from json.decoder import JSONDecoder
from json.encoder import JSONEncoder
from pants.build_graph.address import Address
from pants.engine.internals.objects import Resolvable, Serializable
from pants.engine.internals.parser import ParseError, Parser
from... | {
"content_hash": "54266ab7a4b755a41a8aa77204113fa7",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 108,
"avg_line_length": 37.826530612244895,
"alnum_prop": 0.5793543746066001,
"repo_name": "tdyas/pants",
"id": "987a8390b3155f96d8844de8a113ed0f1c779450",
"size": "11253"... |
from . import register
from spirit.models.comment_like import CommentLike
from spirit.forms.comment_like import LikeForm
@register.inclusion_tag('spirit/comment_like/_form.html')
def render_like_form(comment, like, next=None):
form = LikeForm()
return {'form': form, 'comment_id': comment.pk, 'like': like, 'ne... | {
"content_hash": "82d175a0c7ebbcf12727841717b55664",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 79,
"avg_line_length": 33.19047619047619,
"alnum_prop": 0.703012912482066,
"repo_name": "bjorncooley/rainforest_makers",
"id": "ddfb8c900d468f60e219270355d09626ef830f84",
"... |
from mamba import describe
with describe('Fixture#without_inner_contexts'):
def first_example():
pass
def second_example():
pass
def third_example():
pass
| {
"content_hash": "109635eb74507e0fb2030ce60d2664d3",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 48,
"avg_line_length": 17.636363636363637,
"alnum_prop": 0.6185567010309279,
"repo_name": "jaimegildesagredo/mamba",
"id": "1aaec85460b2feefeb9d1ec64e425c8ce414e434",
"size... |
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import relatively if available to work before installing catkin or overlaying installed version
if os.path.exists(os.path.join('/opt/ros/groovy/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.path.insert(0, os.pat... | {
"content_hash": "bb800169ea6c41700b2d4930fb22eed1",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 111,
"avg_line_length": 44.8,
"alnum_prop": 0.7600446428571429,
"repo_name": "Boberito25/ButlerBot",
"id": "aebb6ba847e9ded20db02bf82e45c4e0e016a699",
"size": "896",
"bin... |
__author__ = 'jonathan'
import test.nova._fixtures as models
from lib.rome.core.orm.query import Query
from lib.rome.core.orm.query import or_
current_milli_time = lambda: int(round(time.time() * 1000))
from threading import Thread
import time
instance_uuid = ""
class SelectorThread(Thread):
def __init__(self,... | {
"content_hash": "20efc2096fdc14ec2772dc5a40967488",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 86,
"avg_line_length": 23.05263157894737,
"alnum_prop": 0.6575342465753424,
"repo_name": "BeyondTheClouds/rome",
"id": "2a7758f7f4a4686360662291954cc7a4f760b71e",
"size": "... |
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | {
"content_hash": "9e90ade7beec001fd8305723ae254c70",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 287,
"avg_line_length": 56.34177215189873,
"alnum_prop": 0.5924511345764997,
"repo_name": "Aladom/django-mailing",
"id": "d62660b5fa32162f6f7511805ddf638f592c6833",
"size":... |
"""Questions about the core Python language.
https://docs.python.org/3.6/reference/index.html
"""
__all__ = ["compound_statements"]
| {
"content_hash": "508cccb09ea1fbf68a47f026ebb033f8",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 48,
"avg_line_length": 26.6,
"alnum_prop": 0.706766917293233,
"repo_name": "samuelfekete/Pythonometer",
"id": "527475d5f67f8ba65adcc3fdecb43f827a065dbf",
"size": "133",
"b... |
import socket
import ssl
import json
class ConnectionManager:
def __init__(self):
self.verify_mode = ssl.CERT_REQUIRED
self.hostname = '127.0.0.1'
self.port = 2099
def getWrappedSocket(self, sock, hostname):
try:
# Get Context
context = ssl.create_defau... | {
"content_hash": "9f69247a635d22ec8af9fe1610b157c8",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 97,
"avg_line_length": 35.19444444444444,
"alnum_prop": 0.6132596685082873,
"repo_name": "lyubomir1993/AlohaServer",
"id": "b0253931e1620d88a52a97c38d171821618bb507",
"size... |
from iso_parser import ENInternationalStandardParser
from month_name_little_endian import ENMonthNameLittleEndianParser
from month_name_middle_endian import ENMonthNameMiddleEndianParser
from slash_format import ENSlashDateFormatParser
from time_expression import ENTimeExpressionParser | {
"content_hash": "73fac9b98540ab3a842d0148b7f15273",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 66,
"avg_line_length": 57.2,
"alnum_prop": 0.9020979020979021,
"repo_name": "wanasit/chrono-python",
"id": "f3f7e35f9f76e648d5a1cec3564cc36429364fd3",
"size": "287",
"bina... |
import grpc
import qrl.generated.qrl_pb2 as qrl__pb2
class PublicAPIStub(object):
"""//////////////////////////
//////////////////////////
//////////////////////////
//// API ///////
//////////////////////////
//////////////////////////
//////////////////////////
This service describes the... | {
"content_hash": "12b427d6d63166135cc18a290eafc2bb",
"timestamp": "",
"source": "github",
"line_count": 442,
"max_line_length": 86,
"avg_line_length": 41.27149321266968,
"alnum_prop": 0.7016226290976867,
"repo_name": "randomshinichi/QRL",
"id": "eacd2749aac4e3942b648abd3528733fed457c76",
"size": "1... |
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 model 'RegistrationProfile'
db.create_table('registration_registrationprofile', (
('id', self.gf('djang... | {
"content_hash": "08ae4d5f9faf947e40de46ff46cd8a6f",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 182,
"avg_line_length": 63.642857142857146,
"alnum_prop": 0.570594837261504,
"repo_name": "mattrobenolt/django-registration",
"id": "92fa7e9abe4faec78ce8fe0dede1227d57a21def"... |
from __future__ import unicode_literals
import re
from sqlalchemy import func, inspect, over
from sqlalchemy.sql import update
TS_REGEX = re.compile(r'([@<>!()&|:\'])')
def limit_groups(query, model, partition_by, order_by, limit=None, offset=0):
"""Limits the number of rows returned for each group
This... | {
"content_hash": "c565c8d5271e6a073e91b869ff3c675b",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 109,
"avg_line_length": 38.075581395348834,
"alnum_prop": 0.6484959535806993,
"repo_name": "mic4ael/indico",
"id": "5db11b7ea15cbb8a300e9d32a24368022c1b8d55",
"size": "676... |
from __future__ import unicode_literals, absolute_import
import django
DEBUG = True
USE_TZ = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "ssssssssssssssssssssssssssssssssssssssssssssssssss"
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
... | {
"content_hash": "d68a90efeb651aeb4f75dbe46c415ec5",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 66,
"avg_line_length": 19.28125,
"alnum_prop": 0.6628849270664505,
"repo_name": "douglasmiranda/django-fine-uploader",
"id": "8450be82ac24ffbb03b533fd993a04999b05a1e1",
"si... |
from model_io import *
import sys
from loss_function import *
import math
import time
def train_model(model, outputChannels, learningRate, trainFeeder, valFeeder,
modelSavePath=None, savePrefix=None, initialIteration=1, batchSize=1):
with tf.Session() as sess:
tfBatchImages = tf.placeholder... | {
"content_hash": "68edb8e46c062f1a892d3d2918cb3be8",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 133,
"avg_line_length": 42.81521739130435,
"alnum_prop": 0.5694338664635694,
"repo_name": "min2209/dwt",
"id": "be35d2192fff0dace8b051a8b95c27ad2125fd23",
"size": "3939",
... |
from __future__ import print_function, division, unicode_literals
import os
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
import numpy as np
from scipy.spatial.distance import euclidean
from pymatgen.core.structure import Structure
from p... | {
"content_hash": "c609ab8e3ede66f0a40f4cf3cd33d942",
"timestamp": "",
"source": "github",
"line_count": 879,
"max_line_length": 82,
"avg_line_length": 36.689419795221845,
"alnum_prop": 0.5504496124031008,
"repo_name": "joshgabriel/MPInterfaces",
"id": "c0acc09d769099ad068048ad011659f4ac23ad72",
"si... |
def add_logging(message):
def logging_decorator(f):
def wrapper(*args, **kwargs):
print("{} f:{} args:{} kwargs: {} ".format(message, f, args, kwargs))
x = f(*args, **kwargs)
return x.upper()
return wrapper
return logging_decorator
@add_log... | {
"content_hash": "d58fbe935ba5435d53f340a167165d30",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 81,
"avg_line_length": 20.681818181818183,
"alnum_prop": 0.4967032967032967,
"repo_name": "fernandozamoraj/py_sandbox",
"id": "4b9a029dda8c4145f15ddd507244f18e7be05aa8",
"s... |
"""
Tests for Volume Code.
"""
import contextlib
import datetime
import mock
import os
import shutil
import socket
import tempfile
import eventlet
import mox
from oslo.config import cfg
from stevedore import extension
from taskflow.engines.action_engine import engine
from cinder.backup import driver as backup_drive... | {
"content_hash": "3f1f6748165d6d3c3f488c7c94e7afa8",
"timestamp": "",
"source": "github",
"line_count": 3201,
"max_line_length": 79,
"avg_line_length": 43.32739768822243,
"alnum_prop": 0.5477211931560086,
"repo_name": "spring-week-topos/cinder-week",
"id": "99752f6596daa3bfd4cfeb48c42a977d1f2ccea7",
... |
from csv import DictWriter
import os
import datetime
import sys
import time
import threading
import traceback
from rdflib.compare import isomorphic
from rdflib import Graph
from bagit import Bag
from .constants import EXT_BINARY_EXTERNAL
from .iterators import FcrepoWalker, LocalWalker
from .resources import FedoraRes... | {
"content_hash": "73a92d4ce0d7d4411dfa0d8130ad18ce",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 78,
"avg_line_length": 39.932203389830505,
"alnum_prop": 0.44991511035653653,
"repo_name": "fcrepo4-labs/fcrepo-import-export-verify",
"id": "e100fd14d5fa1ed174e48474a5491cb... |
import os
import numpy as np
def gen_bbox(attenMapFile, thresh, bboxFile):
"""
A python wrap to generate bbox from a attention(heat) map
:param attenMapFile: map file
:param thresh: threshold para of dt_box function
:param bboxFile: file for dt_box to write the result
:return:
"""
tmp_... | {
"content_hash": "2edbb9a5f2fdb9a43941dfa53a4666c9",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 98,
"avg_line_length": 37.22222222222222,
"alnum_prop": 0.6005970149253731,
"repo_name": "zhangyuygss/WSL",
"id": "c2b93bd456c6c400e8bcfe2dcddac9fea4b2a5ca",
"size": "1675"... |
"""Convolutional-recurrent layers.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.keras import activations
from tensorflow.python.keras import backend as K
from tensorflow.python.keras import constraints
from t... | {
"content_hash": "fe3ad7ec95f916d7e205ade379a0a8be",
"timestamp": "",
"source": "github",
"line_count": 1047,
"max_line_length": 83,
"avg_line_length": 41.10315186246418,
"alnum_prop": 0.6176135703497153,
"repo_name": "jhseu/tensorflow",
"id": "e5fb30083a481144563449988b97b062e1637bd1",
"size": "43... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myinventory.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "c6ba40da3875e81d6b30b486695ef334",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 75,
"avg_line_length": 25.77777777777778,
"alnum_prop": 0.7155172413793104,
"repo_name": "tianz/MyInventory",
"id": "919d5a67ccdd5ac20a6e8c5588bcb5be13c38bcb",
"size": "254"... |
from django import forms
from django.db import models
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.admin import widgets
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from django.contrib.aut... | {
"content_hash": "e25eefe71f5ddb2bb8ce4fda95988cad",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 481,
"avg_line_length": 56.34,
"alnum_prop": 0.5807596734114306,
"repo_name": "YourCyborg/Sun-RPI",
"id": "ab63684cca2615cbacaf0e58da9225d2c03ca50e",
"size": "8526",
"bi... |
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
Resourc... | {
"content_hash": "1822eb755292f430d38eb07f910cb45d",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 129,
"avg_line_length": 43.266666666666666,
"alnum_prop": 0.6319123437767505,
"repo_name": "Azure/azure-sdk-for-python",
"id": "6cc845ed67e427bbf7df42880aae79a406d21862",
... |
import sys
import re
import urllib2
import logging
import lighter.util as util
class VersionRange(object):
SPLIT = re.compile('[^\d\w_]+')
def __init__(self, expression):
result = VersionRange.parseExpression(expression)
if not result:
raise ValueError('%s is not a valid version ra... | {
"content_hash": "e5781ce17b22e9b9ed3ff02cb0684d03",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 148,
"avg_line_length": 43.03164556962025,
"alnum_prop": 0.6331813501985586,
"repo_name": "meltwater/lighter",
"id": "d90b5c1a4a8e3dc2304c032bf8f14d140289e345",
"size": "6... |
from django.conf import settings
from django.core import exceptions
import unittest
import utils
class TestExceptionHandling(unittest.TestCase):
def setUp(self):
# these bogus values should be handled before raising a 500 error
settings.FOG_API_ROOT = 'http://1234.org'
settings.FOG_EMAIL ... | {
"content_hash": "5de1db340393c66bddcdf71d16895c39",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 92,
"avg_line_length": 33.72727272727273,
"alnum_prop": 0.6846361185983828,
"repo_name": "sandersnewmedia/django-fogbugz-gadget",
"id": "238db4e36b8970ccccddc7cef313f5739e468... |
import json
from django.db import transaction
from django.db.transaction import TransactionManagementError
from rest_framework import viewsets
from rest_framework import status
from rest_framework.decorators import detail_route
from rest_framework.response import Response
from billing.models import TaskExpense
from .s... | {
"content_hash": "c29834d5f44fa6cc18480fa402a9dd9f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 105,
"avg_line_length": 37.2037037037037,
"alnum_prop": 0.7142857142857143,
"repo_name": "gen1us2k/django-example",
"id": "5c615bdae89b3e2c2cfa4df96297320f6a93a39d",
"size"... |
import logging
import socket
from functools import partial
import msgpack as packer
from tornado import gen
from tornado import ioloop
from tornado.concurrent import Future
from tornado.iostream import StreamClosedError
from tornado.tcpclient import TCPClient
from trpc.util import _IDGenerator, LoadBance
log = loggi... | {
"content_hash": "d264072cd4296a2be5fa01f5dd518d91",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 95,
"avg_line_length": 28.223350253807105,
"alnum_prop": 0.5181654676258993,
"repo_name": "augustand/trpc",
"id": "4367fd99920134767fa9f71ad2d676e79f245c0b",
"size": "5584... |
from django.db import models
import random
from django.conf import settings
from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField
from mptt.models import MPTTModel, TreeForeignKey
import datetime
import mptt
from mptt.fields import TreeForeignKey
from easy_thumbnails.fie... | {
"content_hash": "b0af59367fe44deef04c9f8f7fad7161",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 125,
"avg_line_length": 36.556650246305416,
"alnum_prop": 0.6530117234874007,
"repo_name": "skylifewww/pangolin-fog",
"id": "f994964cb338e3c9a3c69b954951a39a5a5653c7",
"si... |
"""
To contain language-related ops.
"""
from collections import OrderedDict
import babel
from babel import Locale, UnknownLocaleError
from labmanager.babel import gettext
def obtain_groups():
"""
Obtains the groups that are available for translation, as an Ordered Dictionary.
:return: Ordered dictionary... | {
"content_hash": "4cc39ff61d0dd58a619330ea5e4c134a",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 180,
"avg_line_length": 35.47692307692308,
"alnum_prop": 0.6433217692974849,
"repo_name": "labsland/labmanager",
"id": "0d1c607126e730e1b32a60a70904bc519797d1ac",
"size": ... |
"""
Position Tracking
=================
+-----------------+----------------------------------------------------+
| key | value |
+=================+====================================================+
| asset | the asset held in this p... | {
"content_hash": "6dcc99448e9e1c471b00044773a52c75",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 81,
"avg_line_length": 35.622549019607845,
"alnum_prop": 0.5420393559928444,
"repo_name": "enigmampc/catalyst",
"id": "c263f53c9ca127bbb11c83df2a59e17fd808fc66",
"size": "... |
import tornado.web
class Entry(tornado.web.UIModule):
def render(self, entry, show_comments=False):
print 'entry render'
return self.render_string('module-entry.html', entry=entry,
show_comments=show_comments)
| {
"content_hash": "a5a1459a78c4422500e3521461a47f73",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 67,
"avg_line_length": 29.666666666666668,
"alnum_prop": 0.6217228464419475,
"repo_name": "tao12345666333/Talk-Is-Cheap",
"id": "86e813ea8a39c95fb32a3b83ef38a3c75d8dad30",
"... |
from django.test import TestCase
from django.db import IntegrityError
from users.models import User
from profiles.models import GigPoster
from gigs.models import Gig
class TestGig(TestCase):
def setUp(self):
self.user = User.objects.create(username='myname',
email='... | {
"content_hash": "5de531e19724a7fc2928faeed5e5162c",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 82,
"avg_line_length": 37.02040816326531,
"alnum_prop": 0.6527012127894156,
"repo_name": "aschn/goodtechgigs",
"id": "900fbab7417a8c5c4bb23115223225a449202db6",
"size": "18... |
"""Work with ellipe-relative spaces."""
import numpy
import mel.lib.moleimaging
class Transform:
def __init__(self, ellipse):
self.ellipse = ellipse
# center, up, right, umag, rmag = ellipse_center_up_right(ellipse)
# self.center, self.up, self.right = (
# numpy... | {
"content_hash": "9317f055c904c61cdb9dc97170d26446",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 79,
"avg_line_length": 28,
"alnum_prop": 0.5510680907877169,
"repo_name": "aevri/mel",
"id": "c390554bffb55905bb237629eaf55af48cba5b79",
"size": "2996",
"binary": false,... |
from __future__ import unicode_literals
import logging
from django import forms
from django.conf import settings as django_settings
from django.contrib.auth.models import User
from django.contrib.sites.models import get_current_site
from django.core.exceptions import ValidationError
from django.core.urlresolvers impor... | {
"content_hash": "8b11d49b689773387582bbf8266d79c3",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 79,
"avg_line_length": 38.45238095238095,
"alnum_prop": 0.5877399380804954,
"repo_name": "chop-dbhi/serrano",
"id": "0f5565f2847d929ffa628805c1acc1434bb77953",
"size": "80... |
from django.contrib.auth import get_user_model
from django.db.models.signals import pre_delete, post_save, post_delete
from django.dispatch.dispatcher import receiver
from squads.models import SquadMember, Squad as SquadProfile
from ..models import Profile, Squad, Tour
User = get_user_model()
@receiver(post_save, ... | {
"content_hash": "6f4c9a0435d9876f4b7eb899d571479d",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 99,
"avg_line_length": 39.65625,
"alnum_prop": 0.6985815602836879,
"repo_name": "Flyingfox646/flyingfox",
"id": "b7f9438f2b86ced1a1673c6849243c051c724516",
"size": "2911",
... |
import click
import os
import os.path
import sys
import shutil
import yaml
import shutil
import random
import string
import time
import re
from pkg_resources import get_distribution
from subprocess import call, check_call
from .hichipperHelp import *
from .hichipperProjectClass import *
from .hicproHelper import *
@cl... | {
"content_hash": "6151356b1aef0dae503e17249c518f95",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 223,
"avg_line_length": 46.173758865248224,
"alnum_prop": 0.6872744028876431,
"repo_name": "aryeelab/hichipper",
"id": "842c96824c05f1c8acb53cba3bd3394eda09a882",
"size": ... |
"""
Pygments HTML formatter tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import io
import os
import re
import unittest
import tempfile
from os.path import join, ... | {
"content_hash": "08ec3506e3bbfa4d20ed61ca43547570",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 88,
"avg_line_length": 35.4228855721393,
"alnum_prop": 0.5655898876404495,
"repo_name": "hacksterio/pygments.rb",
"id": "567de51f2cfa2ab6bb56f9474e1977b3b602c9d3",
"size":... |
import pytest
from scripttest import TestFileEnvironment as FileEnvironment
@pytest.fixture
def env():
return FileEnvironment()
def test_no_arguments(env):
res = env.run("gig", expect_error=True)
assert res.returncode == 1
assert "Usage:" in res.stderr
def test_single_language(env):
res = env.... | {
"content_hash": "1056891d95368be3c329cf83cbc644f6",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 61,
"avg_line_length": 25.288888888888888,
"alnum_prop": 0.6362038664323374,
"repo_name": "sloria/gig",
"id": "903c3d864ec560c50b7a4fc0b6b4da78b8474024",
"size": "1138",
... |
from typing import Iterable
__all__ = [
'chunkify',
'chunkify_iterable',
]
def chunkify(rg, n_max=1000):
"""
generates sublists of at most n_max
elements from the provided array
:param rg: list
:param n_max: the maximum sublist length
:return:
"""
m, n_len = 0, len(rg)
wh... | {
"content_hash": "0059c4824cca7ba8202fcb7402f7e37f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 57,
"avg_line_length": 19.44736842105263,
"alnum_prop": 0.5480378890392422,
"repo_name": "2ps/djenga",
"id": "ff3574b1707ee7ac85cea068dbe04e1bbd83130f",
"size": "739",
"b... |
"""
AllinkBasePluginLoadMoreView is going to bes testet in test_plugins.py
"""
# from __future__ import unicode_literals
#
# from django.core.urlresolvers import reverse
# from django.http import Http404
# from django.test.client import RequestFactory
#
# from cms.utils.i18n import force_language
#
#
# from . import D... | {
"content_hash": "12f8d3ae6bf127537d39cb98952222fe",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 71,
"avg_line_length": 40.78431372549019,
"alnum_prop": 0.6615384615384615,
"repo_name": "allink/allink-apps",
"id": "9347da4d63a80431285671f23d79bdc6c76a2b30",
"size": "21... |
import os
import sys
import django
from django.conf import settings
DEFAULT_SETTINGS = dict(
DEBUG=True,
USE_TZ=True,
INSTALLED_APPS=[
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sites",
"django.contrib.messages... | {
"content_hash": "4398156cd091dc86864ab979434b75a0",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 95,
"avg_line_length": 29.988095238095237,
"alnum_prop": 0.5843588725684795,
"repo_name": "jpotterm/django-user-accounts",
"id": "103f3e2417c8ac532755b57ccd7dac6bfe87c2ce",
... |
import unittest
import io
from ppci.binutils.archive import archive, get_archive
from ppci.binutils.linker import link
from ppci.binutils.objectfile import ObjectFile
from ppci.api import get_arch
class ArchiveFileTestCase(unittest.TestCase):
def test_save_load(self):
""" Test some simple code paths of s... | {
"content_hash": "450c516a7cfa3090b4c04302f576d9e9",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 83,
"avg_line_length": 34.04255319148936,
"alnum_prop": 0.591875,
"repo_name": "windelbouwman/ppci-mirror",
"id": "3ecddc8485ef28c87f9544c15622c868413af33c",
"size": "1600"... |
import types
from django.conf import settings
from django.test.testcases import TestCase, SimpleTestCase
from germanium.signals import set_up, set_up_class, tear_down, tear_down_class
from germanium.config import TEST_ALL_DATABASES
class GermaniumSimpleTestCaseMixin:
if TEST_ALL_DATABASES:
databases = ... | {
"content_hash": "92539b6efbf2479d97b7fa124f1f1cab",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 78,
"avg_line_length": 22.317460317460316,
"alnum_prop": 0.6650071123755334,
"repo_name": "druids/germanium",
"id": "f1041061b12bef9af8e85d054a9e3e4c83c3dbfb",
"size": "140... |
import os
import subprocess
from os.path import isfile, join
binary_path = "/home/kivan/source/cv-stereo/build/sgm_cnn/release/sgm_cnn"
#binary_path = "/home/kivan/source/cv-stereo/build/sgm_cnn_new/release/sgm"
#data_folder = "/home/kivan/source/deep-metric-learning/output/results/ThuJun1122:16:492015/results/"
#out... | {
"content_hash": "9e8e4910520c961467b4554d7fcc81c0",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 117,
"avg_line_length": 55.81395348837209,
"alnum_prop": 0.7325,
"repo_name": "ivankreso/stereo-vision",
"id": "7d11793efe207e8ff8db747e7d54d857320e329f",
"size": "2418",
... |
import argparse
import stevedore
exts = stevedore.ExtensionManager(namespace='greeting_apps')
funs = exts.names()
parser = argparse.ArgumentParser()
parser.add_argument('command', metavar='C')
args = parser.parse_args()
try:
exts[args.command].plugin()
except:
print("Command %s not found, valid commands are... | {
"content_hash": "065be112c73282411653739b33f9e287",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 80,
"avg_line_length": 23.333333333333332,
"alnum_prop": 0.7257142857142858,
"repo_name": "michaelgugino/openstack-example",
"id": "501072cab528e4ea27de2ae85d4f0a69304e4f6c",... |
from django.conf import settings
from django.contrib import admin
from django.contrib.admin import AdminSite
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.shortcuts import resolve_url
from django.utils.http import is_safe_url
from .models import... | {
"content_hash": "f4a3152745b16ac20c6337f8414c22c5",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 97,
"avg_line_length": 30.487179487179485,
"alnum_prop": 0.6938603868797308,
"repo_name": "koleror/django-two-factor-auth",
"id": "60a46f7143119e2990c6a9b8691237617f09027c",
... |
from eventlet import greenthread
from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_db import api as oslo_db_api
from oslo_db import exception as os_db_exception
from oslo_log import log
from oslo_serialization import jsonutils
from oslo_utils import excutils
from oslo_utils import importutils... | {
"content_hash": "cde69caa5b5023e41fd83417acbc8ac8",
"timestamp": "",
"source": "github",
"line_count": 1476,
"max_line_length": 79,
"avg_line_length": 47.989837398373986,
"alnum_prop": 0.5719226914009007,
"repo_name": "JioCloud/neutron",
"id": "df831fdc81f52ba33db29186eab00cacfc2a72c9",
"size": "7... |
""" Code to scrap Lyon-Bron weather from a specific date """
from lxml import html
from datetime import datetime, timedelta
from cleaner import cleaner
import requests
import pandas as pd
# Defines which date you want to get data from, january = 1, december = 12
startingDate = datetime(2016,8,1)
endingDate = datetim... | {
"content_hash": "0f6f152bc30fa5fb91371dd30e5db43a",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 220,
"avg_line_length": 30.8,
"alnum_prop": 0.5796536796536796,
"repo_name": "DataScience-appliquee/Plateforme-prediction-velov",
"id": "074fdf19967b70da12812fe2c760148d77367... |
from tests.tests import run
run()
| {
"content_hash": "dcae0d08b02969f6dd36ad5684ce2ac6",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 27,
"avg_line_length": 11.666666666666666,
"alnum_prop": 0.7428571428571429,
"repo_name": "lightd22/smartDraft",
"id": "ece8e6af1de1c678765b00da0cff6ed7682246fd",
"size": "3... |
print("STARTING WEBSERVER\nImporting models...")
from models import *
print("Starting...")
monkey.patch_all()
# SOCKETIO DEFINITIONS
@sio.on('getEvents')
def getEvents(self):
data = []
#print("loading events...")
events = db.session.query(Opps).filter(Opps.date > datetime.now()).filter(Opps.locked == ... | {
"content_hash": "442aa0aa2e906476836d68cc36d7a13e",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 116,
"avg_line_length": 31.1875,
"alnum_prop": 0.5377421509686039,
"repo_name": "theapricot/oppapp2",
"id": "e843fa8c7a2698eedd0109177aebcee01df87a9a",
"size": "1497",
"b... |
'''
FanFilm Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This ... | {
"content_hash": "d795cdea24ccaf32a98f57d9745e1566",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 77,
"avg_line_length": 31.5,
"alnum_prop": 0.6239316239316239,
"repo_name": "rysson/filmkodi",
"id": "b720e5d7eee3bd59901a1f9c6996af5f1a44b995",
"size": "1663",
"binary":... |
"""Checks import position rule"""
# pylint: disable=unused-import,ungrouped-imports,import-error,no-name-in-module,relative-beyond-top-level
import os
| {
"content_hash": "18ae6b51c90284c5c414ef236e281102",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 106,
"avg_line_length": 50.333333333333336,
"alnum_prop": 0.7947019867549668,
"repo_name": "ruchee/vimrc",
"id": "a1808a8fd7554d4acb1b263825fa802723905f82",
"size": "151",
... |
from django.http import HttpResponseNotAllowed, HttpResponseBadRequest, HttpResponseNotFound, HttpResponse, HttpResponseForbidden
from SCAuthExample import settings
def user_request(request, username):
request_method = request.META['REQUEST_METHOD'];
if (request_method == 'POST'):
return register_user... | {
"content_hash": "59aa659598195dedcf4c7b162a241332",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 129,
"avg_line_length": 42.24,
"alnum_prop": 0.709280303030303,
"repo_name": "saikat/SCAuthExample",
"id": "9ebc730b57407895ecd9077353bc1d0889eaaa58",
"size": "1289",
"bi... |
from __future__ import absolute_import, unicode_literals
import json
from django import forms
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from wagtail.tests.testapp.models import FormField, FormPage
from wagtail.tests.utils import WagtailTestUtils
from w... | {
"content_hash": "dd5ae9d802cb96563598283f7d3295c7",
"timestamp": "",
"source": "github",
"line_count": 467,
"max_line_length": 118,
"avg_line_length": 37.33190578158458,
"alnum_prop": 0.6292875989445911,
"repo_name": "hamsterbacke23/wagtail",
"id": "02fd3147a7b8ace26b6aa6e1bf9e35703ec6aaad",
"size... |
"""
EauDouce.plugins.ssoclient
~~~~~~~~~~~~~~
SSO Client
:copyright: (c) 2017 by staugur.
:license: MIT, see LICENSE for more details.
"""
#: Importing these two modules is the first and must be done.
#: 首先导入这两个必须模块
from __future__ import absolute_import
from libs.base import PluginBase
#: Import... | {
"content_hash": "f8ad0c6f6eb380b61ce2e9ba2a99f80a",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 244,
"avg_line_length": 44.40119760479042,
"alnum_prop": 0.6089008766014835,
"repo_name": "staugur/EauDouce",
"id": "6f7f65c2d86f79196494fcbe1f22bb95502c6269",
"size": "80... |
from hs_core.hydroshare.utils import get_resource_file_name_and_extension
from hs_file_types.models import GeoRasterLogicalFile, GeoRasterFileMetaData, GenericLogicalFile
def assert_raster_file_type_metadata(self):
# test the resource now has 2 files (vrt file added as part of metadata extraction)
self.assert... | {
"content_hash": "f9dfdd4a32710efdc4141d8f3f5e788e",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 96,
"avg_line_length": 52.864583333333336,
"alnum_prop": 0.7316256157635468,
"repo_name": "FescueFungiShare/hydroshare",
"id": "4ffcb544d402f356ae80377fcf77e85ce963439d",
"... |
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-locksmith',
version='0.1.1',
packages=['locksmith',
'locksmith.management',
... | {
"content_hash": "9230623714960fde0c7471940c0e5e45",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 78,
"avg_line_length": 34.24324324324324,
"alnum_prop": 0.611681136543015,
"repo_name": "MichalMazurek/django-locksmith",
"id": "f24c8e76c82130d47935cd4b54c39282060784a2",
... |
"""Top-level package for SQLAlchemy Dremio."""
__author__ = """Ajish George"""
__email__ = '[email protected]'
__version__ = '0.1.0'
# Dremio supported data types: https://docs.dremio.com/sql-reference/data-types.html
# BOOLEAN # VARBINARY # DATE # FLOAT
# DECIMAL # DOUBLE # INTERVAL # INT
# BIGINT ... | {
"content_hash": "9492d37b79a9188727d81c87ee85af47",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 86,
"avg_line_length": 36.73684210526316,
"alnum_prop": 0.6747851002865329,
"repo_name": "sqggles/sqlalchemy_dremio",
"id": "6604e4a417e87d5fed3bb3cc03cc042dfad1b365",
"siz... |
import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="namelengthsrc", parent_name="violin.hoverlabel", **kwargs
):
super(NamelengthsrcValidator, self).__init__(
plotly_name=plotly_name,
... | {
"content_hash": "eb116f35baf8d57711dc08d4131b8dab",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 84,
"avg_line_length": 34.285714285714285,
"alnum_prop": 0.6083333333333333,
"repo_name": "plotly/python-api",
"id": "dd0d0e007091d85d8c2b3a429d17382a5168cbc8",
"size": "48... |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 1 16:46:25 2014
@author: micha
"""
# model header, 2 substitutions
# $dt: timestep in MS
# $timestamp: a time stamp
model_header = """
/* GeNN model generated by PyNN */
/* $timestamp */
#define DT $dt
#include "modelSpec.h"
#include "modelSpec.cc"
"""
# ... in bet... | {
"content_hash": "7c7aedee726508c24cda32bb690955ec",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 73,
"avg_line_length": 18.434782608695652,
"alnum_prop": 0.6721698113207547,
"repo_name": "Huitzilo/pynn-genn",
"id": "3d9183deb0b745b72bef1371537b3fc2dda746cf",
"size": "8... |
from __future__ import print_function
import os
import datetime
import socket
from pprint import pprint
import time
import yaml
import six
from fabric.api import (
env,
require,
runs_once,
settings,
)
from burlap import common
from burlap.common import (
run_or_dryrun,
local_or_dryrun,
... | {
"content_hash": "0671701ec679fe70d40040cd66acceb7",
"timestamp": "",
"source": "github",
"line_count": 671,
"max_line_length": 136,
"avg_line_length": 33.41132637853949,
"alnum_prop": 0.5809804183951113,
"repo_name": "chrisspen/burlap",
"id": "8f698b71a7e0fbb98febe3aed1a7cc36eec55854",
"size": "22... |
import numpy as np
from acoustics import Signal
import pytest
import tempfile
import itertools as it
from acoustics.signal import EqualBand
#def test_operator():
#n = 10000
#fs = 5000
class test_wav():
"""Test writing to and reading from wav file."""
duration = 5.0
fs = 10025
sampl... | {
"content_hash": "abf3deab88c2f9bc88558edca1285848",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 118,
"avg_line_length": 30.636942675159236,
"alnum_prop": 0.5562370062370062,
"repo_name": "FRidh/python-acoustics",
"id": "0716279da52e8426167ba86ceaa7c55038194b66",
"siz... |
"""\
This breaks the files in INPUT_DIR into chunks of CHUNK_SIZE, windowed by
OFFSET.
NB: OUTPUT_DIR will be destroyed and recreated."""
import argparse
import os
import shutil
import sys
def tokenize(text):
return text.split()
def explode_chunks(chunk_size, offset, input_file):
with open(input_file) as... | {
"content_hash": "c47df1884d42832760b26ad29890d0e0",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 75,
"avg_line_length": 30.178571428571427,
"alnum_prop": 0.5495069033530572,
"repo_name": "erochest/greek",
"id": "1b11ca3cd8edfdf54d80d3c7e076bf921e081ac7",
"size": "2559"... |
from sleeps import *
from sleepergroups import *
from static import *
from django.template import RequestContext
from django.template.loader import render_to_string
from django.http import *
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, render_to_response
from django.co... | {
"content_hash": "ccea27594c9a51b3c1b00a148592359b",
"timestamp": "",
"source": "github",
"line_count": 592,
"max_line_length": 402,
"avg_line_length": 39.229729729729726,
"alnum_prop": 0.6140199793317258,
"repo_name": "sleepers-anonymous/zscore",
"id": "531dc3d46a0158200f3a4e2789358fe60970f7dc",
"... |
__author__ = 'Janez Stupar'
from tastypie import resources, authorization, authentication, fields
from polls import models as poll_models
class PollResource(resources.ModelResource):
choices = fields.ToManyField('tp_demo.api.polls_api.ChoiceResource', 'choices',null=True, blank=True, full=True)
class Meta:
... | {
"content_hash": "6c05034c0ae6da9e4cc0b14c906725fd",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 116,
"avg_line_length": 47.05434782608695,
"alnum_prop": 0.6830676830676831,
"repo_name": "JanezStupar/tastypie_demo",
"id": "0551c51a7e5fa7749560e0c9ce10f500a31ff05f",
"si... |
"""Tests for `ninjadog` package."""
# TODO: test raises ValueError when pug cli can't be found and not passed explicitly to renderer
def test_npm_installed():
from subprocess import Popen
assert Popen(('which', 'npm')).wait() == 0, 'npm must be installed'
def test_pug_cli_exists():
from pathlib import... | {
"content_hash": "cf869930877e6da2c8b678d324d5f438",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 112,
"avg_line_length": 27.946969696969695,
"alnum_prop": 0.6253727297370562,
"repo_name": "knowsuchagency/ninjadog",
"id": "6c36c7337778993804185f55e34f582ccb3e038c",
"si... |
from out import Out
| {
"content_hash": "7aa0e38e024d36e6dcabf046cb9bff12",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 19,
"avg_line_length": 10.5,
"alnum_prop": 0.7619047619047619,
"repo_name": "Neppord/py2py",
"id": "cb3e63f5d2b2d3e3e392fb1ca6a8e0427ca49d3b",
"size": "21",
"binary": fals... |
"""Clean invalid entries from the dSYM symbol cache."""
import os
import sys
from symbol_cache_schema import SQLITE_SYMBOL_CACHE_PATH
from symbol_cache_schema import SymbolCacheSchema
class CleanSymbolCache(object):
"""Cleans all orphaned entries in the DBGScriptCommands database."""
def CleanMissingDSYMs(self)... | {
"content_hash": "f389a49a6d92b24dfa211ca86f05dd9c",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 78,
"avg_line_length": 30.928571428571427,
"alnum_prop": 0.6797536566589685,
"repo_name": "pinterest/tulsi",
"id": "69ab9b26b17f1635caa13452b71de24faa7b5435",
"size": "1922... |
"""Unit tests of resource records."""
import pytest
from ..utilities.general import is_never_authz, is_no_authz, uses_cataloging, uses_filesystem_only
@pytest.mark.usefixtures("resource_record_class_fixture", "resource_record_test_fixture")
class TestResourceRecord(object):
"""Tests for ResourceRecord"""
@p... | {
"content_hash": "b6c1ef738620f806c3abc66f84078743",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 103,
"avg_line_length": 31.80851063829787,
"alnum_prop": 0.7632107023411371,
"repo_name": "mitsei/dlkit",
"id": "f3c09302148845b194b3aab28500e45b2ff5bcaa",
"size": "1495",
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import os
import sys
from invoke import task, call
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__)))
PROJECTS = [
'demo',
'wapps',
'wapps.blog',
'wapps.gallery',
# 'wapps.forms',
]
LANGUAGES = ['fr']
... | {
"content_hash": "39b9d4351f59e3635b6adc5c23dd8b48",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 109,
"avg_line_length": 26.04186046511628,
"alnum_prop": 0.572959457045901,
"repo_name": "apihackers/wapps",
"id": "54fc6e26bfbe8f8ecfa63b79e502c13f1f537c05",
"size": "560... |
from GroundedScan.world import LogicalForm
from GroundedScan.world import Term
from GroundedScan.world import SemType
from GroundedScan.world import ENTITY
from GroundedScan.world import Variable
from GroundedScan.world import Weights
from GroundedScan.world import EVENT
from GroundedScan.world import COLOR
from Ground... | {
"content_hash": "aabba01c8ec33e45e8e5e0e037ba959e",
"timestamp": "",
"source": "github",
"line_count": 600,
"max_line_length": 121,
"avg_line_length": 41.3,
"alnum_prop": 0.5968523002421308,
"repo_name": "LauraRuis/groundedSCAN",
"id": "a9d5678a0410e142f5adc72636eaa259b2565f88",
"size": "24841",
... |
"""Implementation of SQLAlchemy backend."""
import datetime
import functools
import re
import warnings
from nova import block_device
from nova import db
from nova import exception
from nova import flags
from nova import utils
from nova import log as logging
from nova.compute import aggregate_states
from nova.compute ... | {
"content_hash": "c715e8ca27b03190e0c5e840ac0e0618",
"timestamp": "",
"source": "github",
"line_count": 4473,
"max_line_length": 79,
"avg_line_length": 32.800134138162306,
"alnum_prop": 0.5905394813072965,
"repo_name": "russellb/nova",
"id": "ed9286eff4ab539a589121e835c73e14ec6fdf69",
"size": "1475... |
"""Submit a Spark SQL job to a cluster."""
from apitools.base.py import encoding
from googlecloudsdk.api_lib.dataproc import base_classes
from googlecloudsdk.calliope import arg_parsers
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.GA)
class SparkSql(base_classes.JobSubmitter):
""... | {
"content_hash": "9e2280b34a9a8f7eed07f8550e1683b3",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 140,
"avg_line_length": 31.534246575342465,
"alnum_prop": 0.6639878366637706,
"repo_name": "Sorsly/subtle",
"id": "e9669d69479339eab107ce9bbf41a5026e8bc673",
"size": "5200... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("logs", "0004_auto_20180116_2202")]
operations = [
migrations.AlterField(
model_name="emaillog",
name="status",
field=models.CharField(
choices=[
... | {
"content_hash": "37ae99830d9015eadcc4a6a03f1d608b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 56,
"avg_line_length": 29.51851851851852,
"alnum_prop": 0.4203262233375157,
"repo_name": "watchdogpolska/feder",
"id": "d484d1637184f4afba8daea18e51f174c506c83b",
"size": "... |
class Klass(object):
def __getattr__(self, name):
"""
Locate the function with the dotted
attribute.
"""
def traverse(parent, child):
if instance(parent, str):
parent = getattr(self, parent)
return getattr(parent, child)
retu... | {
"content_hash": "1908c6d6e2f5f4122e4aef18a421ee8e",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 48,
"avg_line_length": 29.75,
"alnum_prop": 0.5322128851540616,
"repo_name": "ActiveState/code",
"id": "c7f611dd2a27b521f02a58e25bb5f9e1432d7591",
"size": "357",
"binary"... |
""" s3 support for remote file interactivity """
from typing import IO, Any, Optional, Tuple
from urllib.parse import urlparse as parse_url
from pandas.compat._optional import import_optional_dependency
from pandas._typing import FilePathOrBuffer
s3fs = import_optional_dependency(
"s3fs", extra="The s3fs package... | {
"content_hash": "5205b351849af2081a2e2d8b17e3e383",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 70,
"avg_line_length": 33.32,
"alnum_prop": 0.6872749099639855,
"repo_name": "kushalbhola/MyStuff",
"id": "7e0a37e8cba209b2f61a30390d82a36f518f183a",
"size": "1666",
"bin... |
"Generate a table of random passwords for people to use"
import random
import string
# No 0Oi1lIL chars
#print(string.printable[:26*2+10])
characters = "23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ"
print(characters)
def password(digits=10):
return ''.join(random.choice(characters) for x in range(digi... | {
"content_hash": "ad3f118d9f9538c2610a4485f9da9dcf",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 69,
"avg_line_length": 23.136363636363637,
"alnum_prop": 0.7328094302554028,
"repo_name": "AnthonyBriggs/Python-101",
"id": "6df5636c18de3469d4f67337f849a8353f0da30e",
"siz... |
import setuptools
setuptools.setup(
name='universe',
version='0.0.1',
author='Jeff Bradberry',
author_email='[email protected]',
description='A space 4X game',
url='https://github.com/jbradberry/universe',
packages=setuptools.find_packages(),
classifiers=[
'Development S... | {
"content_hash": "4ae3a25e51c1487cd9cd3fd40d439cd0",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 62,
"avg_line_length": 29.157894736842106,
"alnum_prop": 0.631768953068592,
"repo_name": "jbradberry/universe",
"id": "c96c8164a3f12f280a573e0a06759f06313ad323",
"size": "5... |
__version__=''' $Id: styles.py 3231 2008-06-03 16:42:41Z rgbecker $ '''
from reportlab.lib.colors import white, black
from reportlab.lib.enums import TA_LEFT, TA_CENTER
###########################################################
# This class provides an 'instance inheritance'
# mechanism for its descendants, s... | {
"content_hash": "ee8b73b583a63689e37ae7cdbd03e787",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 105,
"avg_line_length": 36.08045977011494,
"alnum_prop": 0.47424869916109164,
"repo_name": "jwheare/digest",
"id": "f3540f0a92335b88282135ddf7e0af34ba82079a",
"size": "960... |
from setuptools import setup
from etcli import __version__
with open('README.rst') as f:
readme = f.read()
setup(
name='et-cli',
version=__version__,
packages=['etcli'],
description='ExactTarget CLI Tool',
long_description=readme,
url='https://github.com/tzmfreedom/et-cli',
author='mak... | {
"content_hash": "f01e0b7b44b58a8a61f4dde6a16bb2f5",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 48,
"avg_line_length": 23.38095238095238,
"alnum_prop": 0.6252545824847251,
"repo_name": "tzmfreedom/et-cli",
"id": "cb248693ef8480976c5b36eeaca8d42300ce8bfe",
"size": "491... |
import socket
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.Interfaces import Interface, Interfaces
from PLC.Auth import Auth
from PLC.POD import udp_pod
class RebootNode(Method):
"""
Sends the specified node a spec... | {
"content_hash": "75e21f7db1ee4c63c90a33c20c799e2b",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 116,
"avg_line_length": 31.17808219178082,
"alnum_prop": 0.6164323374340949,
"repo_name": "dreibh/planetlab-lxc-plcapi",
"id": "a6e0439dab7d76cea75cd772087b1ce8f68d2b5c",
"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import json
import re
import unittest2
import warnings
import httpretty as hp
from coinbase.client import Client
from coinbase.client import OAuthClient
from coinbase.e... | {
"content_hash": "bbff5a977414f0dfff3da6d584a65aff",
"timestamp": "",
"source": "github",
"line_count": 1139,
"max_line_length": 80,
"avg_line_length": 34.55926251097454,
"alnum_prop": 0.6380865279577268,
"repo_name": "jorilallo/coinbase-python",
"id": "2c06d6cc22a6de75a15c206705d8ed65e98dd0e7",
"s... |
"""
This should results in an average return of -20 by the end of training.
Usually hits -30 around epoch 50.
Note that one epoch = 5k steps, so 200 epochs = 1 million steps.
"""
import gym
import rlkit.torch.pytorch_util as ptu
from rlkit.data_management.obs_dict_replay_buffer import ObsDictRelabelingBuffer
from rlk... | {
"content_hash": "e41daac2e92e9c0baca1fef797a0ccdc",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 80,
"avg_line_length": 32.06086956521739,
"alnum_prop": 0.6650393273664226,
"repo_name": "google-research/DBAP-algorithm",
"id": "5a7503d834b18604c89f19ecbbad0de1ea5af994",
... |
'''OpenGL extension NV.explicit_multisample
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_NV_explicit_multisample'
_DEPRECATED = False
GL_SAM... | {
"content_hash": "0c86fcf66c1c79efab40d407c6cae68b",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 124,
"avg_line_length": 45.75438596491228,
"alnum_prop": 0.7841257668711656,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "b25340f078a89db09477f28c58d277affe60971e... |
import vb2py.vbparser
import re
import glob
import vb2py.utils
import os
import sys
from docutils.core import publish_string
#
# Turn off logging
import vb2py.extensions
vb2py.extensions.disableLogging()
vb2py.vbparser.log.setLevel(0) # Don't print all logging stuff
def doAutomaticVBConversion(txt):
"""Convert ... | {
"content_hash": "b7db448227e7d00d63fd2ca15a67a10e",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 94,
"avg_line_length": 31.174418604651162,
"alnum_prop": 0.5479298769116001,
"repo_name": "mvz/vb2py",
"id": "ffea821a90fb696806c4da4024dad7e3048383b9",
"size": "2681",
"... |
import os
from django.conf import settings
DEBUG = getattr(settings, 'STATICASSETS_DEBUG', settings.DEBUG)
MIMETYPES = {
'.css': 'text/css',
'.js': 'application/javascript'
}
MIMETYPES.update(**getattr(settings, 'MIMETYPES', {}))
DIRS = getattr(settings, 'STATICASSETS_DIRS', getattr(settings, 'STATICFILES_... | {
"content_hash": "dc1193a6170f9650d01184f2ed5ac70c",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 88,
"avg_line_length": 34.92727272727273,
"alnum_prop": 0.735033836543467,
"repo_name": "davidelias/django-staticassets",
"id": "589a16b44bb2850978695c9e7823a97b8fb7c811",
... |
from .resource import Resource
class ActivityLogAlertResource(Resource):
"""An activity log alert resource.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Azure resource Id
... | {
"content_hash": "3f1699c5ac6d32e323478fa9d0285eb4",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 141,
"avg_line_length": 40.957142857142856,
"alnum_prop": 0.6358562957795605,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "bc03347d612de8f02f627ec3328368c076e88b2a",
... |
from typing import MutableMapping, MutableSequence
from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import proto # type: ignore
__protobuf__ = proto.module(
package="google.cloud.assuredwo... | {
"content_hash": "787eb92f9b186a1d26d7117de4186c74",
"timestamp": "",
"source": "github",
"line_count": 1007,
"max_line_length": 148,
"avg_line_length": 34.93545183714002,
"alnum_prop": 0.6049175667993177,
"repo_name": "googleapis/python-assured-workloads",
"id": "6581717f6e72cc9888636078fda3ff815bba... |
"""Convert clasp & gringo outputs to ASP-GV visualization script JSON files.
This script can be used to convert clasp (monotonically) timestamped output, and optionally gringo text output, to JSON files which are accepted by the ASP-GV javascript package.
Usage:
./convert_outputs_to_json.py --edge-pred=<predicate> ... | {
"content_hash": "7ea148b704e691e9eecc52efb1c70d77",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 178,
"avg_line_length": 45.588235294117645,
"alnum_prop": 0.45729032258064517,
"repo_name": "vukk/asp-gv-convert-py",
"id": "cea896d907ad2244529f72ecc1cf4ce31030ac0e",
"siz... |
"""
github3.github
==============
This module contains the main GitHub session object.
"""
from __future__ import unicode_literals
import json
from .auths import Authorization
from .decorators import (requires_auth, requires_basic_auth,
requires_app_credentials)
from .events import Event
fr... | {
"content_hash": "732c651b7c261ca9229f17829d5d5e4f",
"timestamp": "",
"source": "github",
"line_count": 1762,
"max_line_length": 80,
"avg_line_length": 40.74971623155505,
"alnum_prop": 0.5905628055319564,
"repo_name": "balloob/github3.py",
"id": "d411c2e40f926c0989f9e28ef3451654fb19bb9c",
"size": "... |
from django import template
from events.models import EventRSVP
register = template.Library()
@register.simple_tag
def get_community_event_rsvp(user, event):
if not event or not user:
return None
# use filter + first to return None if there is no subscription
return EventRSVP.objects.filter(user... | {
"content_hash": "3ac7c990ab6607ba838505f85f74d984",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 67,
"avg_line_length": 26.76923076923077,
"alnum_prop": 0.7385057471264368,
"repo_name": "letsmeet-click/letsmeet.click",
"id": "d26afde25f5ecad91a0871fea814b8a4c5822593",
... |
import threading
import asyncio
import weakref
from functools import partial
import inspect
import collections
import rethinkdb as r
r.set_loop_type("asyncio")
from .errors import IllegalAccessError, AlreadyExistsError
from .registry import registry
__all__ = [ "db_conn", "init_app_db", "configure_db_connection", "a... | {
"content_hash": "3ae48e00b993fcef5b4d4834e6bec548",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 82,
"avg_line_length": 33.050632911392405,
"alnum_prop": 0.5979828928890591,
"repo_name": "lars-tiede/aiorethink",
"id": "42611a973db18e74fdfd08afea850dfe4289f0d7",
"size"... |
import wx
import armid
from InterfaceListPanel import InterfaceListPanel
class InterfaceListDialog(wx.Dialog):
def __init__(self,parent,ifName = '',ifType = '',arName = '',pName = ''):
wx.Dialog.__init__(self,parent,armid.INTERFACELISTDIALOG_ID,'Add Interface',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THI... | {
"content_hash": "995aa94cf0112f8831f021817bfa2583",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 173,
"avg_line_length": 39.97560975609756,
"alnum_prop": 0.7553386211104332,
"repo_name": "RobinQuetin/CAIRIS-web",
"id": "f6eda325e9aa17c09b75cb346908477f646ab982",
"size"... |
"""
Tests for L{imaginary.action.LookAt} and L{imaginary.action.LookAround}.
"""
from __future__ import print_function
from textwrap import dedent
from twisted.trial.unittest import TestCase
from zope.interface import implementer
from characteristic import attributes as has_attributes
from axiom import store, item, ... | {
"content_hash": "cc309baebe2d3262dd072bab776704af",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 86,
"avg_line_length": 28.560897435897434,
"alnum_prop": 0.5902816743350915,
"repo_name": "glyph/imaginary",
"id": "64883304c7847fd99388ec2272edfede04ff9035",
"size": "891... |
from hashlib import sha1
import inspect
import re
import collections
from . import compat
def coerce_string_conf(d):
result = {}
for k, v in d.items():
if not isinstance(v, compat.string_types):
result[k] = v
continue
v = v.strip()
if re.match(r'^[-+]?\d+$', v)... | {
"content_hash": "2a3e1499a85039d6eb786f4830284e9a",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 77,
"avg_line_length": 29.184615384615384,
"alnum_prop": 0.5512212264979792,
"repo_name": "YosaiProject/yosai_dpcache",
"id": "767780e15aa5340c17c39eb6afe921c7ed1984a8",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.