text stringlengths 4 1.02M | meta dict |
|---|---|
"""Parallel workflow execution via IPython controller
"""
from future import standard_library
standard_library.install_aliases()
from pickle import dumps
import sys
IPython_not_loaded = False
try:
from IPython import __version__ as IPyversion
from IPython.parallel.error import TimeoutError
except:
IPyth... | {
"content_hash": "9e3dcaf5daf2fbe0bee53038ebba1fcf",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 83,
"avg_line_length": 35.130434782608695,
"alnum_prop": 0.5856435643564356,
"repo_name": "dgellis90/nipype",
"id": "96f47fd6efa0164aee0d7404c56468ac3aa889d5",
"size": "41... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from matplotlib.externals import six
import tempfile
from numpy.testing import assert_allclose, assert_array_equal
import numpy.ma.testutils as matest
import numpy as np
import datetime as datetime
from nose.... | {
"content_hash": "e4c1eb85a917d5bf8c218f123c79f065",
"timestamp": "",
"source": "github",
"line_count": 3082,
"max_line_length": 79,
"avg_line_length": 39.656716417910445,
"alnum_prop": 0.5208309469653581,
"repo_name": "lancezlin/ml_template_py",
"id": "5eca224813c898e2f08a51160468a221c3132ef6",
"s... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Post.mood_positive'
db.add_column(u'social_post', 'mood_positive',
self.gf('django.db.models.f... | {
"content_hash": "71c6e8f1cf41b3c8cf79538721ee04cc",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 187,
"avg_line_length": 58.138297872340424,
"alnum_prop": 0.5586459286367795,
"repo_name": "mindinpanic/codingmood",
"id": "e5ab1ef5f192b85aa7ad3fcc80248b56f5441f3b",
"size... |
import os
import pytest
from unittest import TestCase
import torch
import torchmetrics
from torch import nn
from bigdl.nano.pytorch.lightning import LightningModule
from bigdl.nano.pytorch import Trainer
from bigdl.nano.common import check_avx512
from bigdl.nano.pytorch.utils import TORCH_VERSION_LESS_1_10
from test... | {
"content_hash": "91557987482b8fb66dea8064571b85fe",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 97,
"avg_line_length": 42.76,
"alnum_prop": 0.656688493919551,
"repo_name": "yangw1234/BigDL",
"id": "7d9015aca7d599cb6af1b8cdc0b79b3df95bf3c7",
"size": "3794",
"binary":... |
def song():
for beer_count in range(99, -1, -1):
verse(beer_count)
def verse(beer_count):
if beer_count > 1:
print beer_count, "bottles of beer on the wall,", beer_count, "bottles of beer.\n"
current_count = beer_count - 1
print "Take one down and pass it around,", current_coun... | {
"content_hash": "6f83e19f80b4dc5c3c209b4db559f245",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 98,
"avg_line_length": 41.59090909090909,
"alnum_prop": 0.5956284153005464,
"repo_name": "amalshehu/exercism-python",
"id": "e136042a406d89a92a617566c0cb8ed1d148afd2",
"siz... |
"""
relief.schema.meta
~~~~~~~~~~~~~~~~~~
:copyright: 2013 by Daniel Neuhäuser
:license: BSD, see LICENSE.rst for details
"""
from relief.utils import class_cloner
from relief.constants import Unspecified
from relief.schema.core import BaseElement
class Maybe(BaseElement):
"""
A meta element ... | {
"content_hash": "bbc965975be60db1f6c19f3ada479c22",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 78,
"avg_line_length": 28.539473684210527,
"alnum_prop": 0.6251728907330567,
"repo_name": "DasIch/relief",
"id": "3587702365831b464512bf75714095614e3c9290",
"size": "2186",... |
"""ParenMatch -- for parenthesis matching.
When you hit a right paren, the cursor should move briefly to the left
paren. Paren here is used generically; the matching applies to
parentheses, square brackets, and curly braces.
"""
from idlelib.hyperparser import HyperParser
from idlelib.config import idleConf
_openers... | {
"content_hash": "e8a4cb2a108ead00a89f3ca8f6b7fe71",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 94,
"avg_line_length": 39.36065573770492,
"alnum_prop": 0.61793697070665,
"repo_name": "Microsoft/PTVS",
"id": "983ca20675af1de3c378fb916a414fe5e14e29a4",
"size": "7203",
... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from laws.models.vote_action import VoteAction
import logging
logger = logging.getLogger("open-knesset.laws.models")
class CandidateListVotingStatistics(models.Model):
# TODO: why is this a django model? could be method on Cand... | {
"content_hash": "b2a18cb8c4dec34980726c34e40edf78",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 120,
"avg_line_length": 38.516129032258064,
"alnum_prop": 0.7035175879396985,
"repo_name": "daonb/Open-Knesset",
"id": "28b87ba56842b8390da3993abbdf723ca8929126",
"size": "... |
from flaky import flaky
import numpy
from numpy.testing import assert_array_almost_equal
from keras import backend as K
from keras.initializers import Constant
from keras.layers import Embedding, Input
from keras.models import Model
from keras import activations
from deep_qa.tensors.backend import apply_feed_forward
f... | {
"content_hash": "5985d6736b10c832ccf048b1cc002720",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 112,
"avg_line_length": 54.956204379562045,
"alnum_prop": 0.5913135874618143,
"repo_name": "matt-gardner/deep_qa",
"id": "661742192e350a431194cc717c01e6982736cbd0",
"size"... |
"""
Test cases relating to listVirtualMachine() relating to parameters - id,listall,isrecursive,account and domainid
"""
#Import Local Modules
import marvin
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common imp... | {
"content_hash": "22ffbe3802b3cabab3df60acc2a905b4",
"timestamp": "",
"source": "github",
"line_count": 2815,
"max_line_length": 150,
"avg_line_length": 39.07246891651865,
"alnum_prop": 0.6887052341597796,
"repo_name": "DaanHoogland/cloudstack",
"id": "5ed937f2d4aa37394f95687ee81f97964912101e",
"si... |
import six
from pytest import mark, raises
from sqlalchemy_utils import Currency, i18n
@mark.skipif('i18n.babel is None')
class TestCurrency(object):
def setup_method(self, method):
i18n.get_locale = lambda: i18n.babel.Locale('en')
def test_init(self):
assert Currency('USD') == Currency(Curr... | {
"content_hash": "a44a27b86a7fd58d00fc0e03169c4cec",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 64,
"avg_line_length": 26.723076923076924,
"alnum_prop": 0.5630397236614854,
"repo_name": "rmoorman/sqlalchemy-utils",
"id": "a6c4876ee91d95ba6dc7843f8ef8360a372a4a14",
"si... |
import re
from sqlalchemy import __version__
from sqlalchemy.schema import ForeignKeyConstraint, CheckConstraint, Column
from sqlalchemy import types as sqltypes
from sqlalchemy import schema, sql
from sqlalchemy.sql.visitors import traverse
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql.expression im... | {
"content_hash": "e40a8cf4baec6d0b7ef7c6e5832c39a6",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 78,
"avg_line_length": 31.174418604651162,
"alnum_prop": 0.6743752331219695,
"repo_name": "hexlism/css_platform",
"id": "88bfa3b2f538cb44d6abd2a2e30b76900c786d4d",
"size":... |
from responder import responder
from view import view
def http_error(status):
"""
Create an HTTP error response.
Arguments:
status: string HTTP status including code number and description.
Returns: HTTP response
"""
error_view = view('error.htm', {'error': status})
response = r... | {
"content_hash": "70f39031ae75bf38244b68f35483fc10",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 73,
"avg_line_length": 22.470588235294116,
"alnum_prop": 0.675392670157068,
"repo_name": "samalba/image-spider",
"id": "071939b446e5ec614f9fb387006407bea63007b4",
"size": "... |
"""
An extension of scipy.stats.stats to support masked arrays
"""
# Original author (2007): Pierre GF Gerard-Marchant
# TODO : f_value_wilks_lambda looks botched... what are dfnum & dfden for ?
# TODO : ttest_rel looks botched: what are x1,x2,v1,v2 for ?
# TODO : reimplement ksonesamp
from __future__ import divisi... | {
"content_hash": "94d35864e690c3cf66bc6c89c54473d4",
"timestamp": "",
"source": "github",
"line_count": 2106,
"max_line_length": 103,
"avg_line_length": 32.383190883190885,
"alnum_prop": 0.5727943224973974,
"repo_name": "uglyboxer/linear_neuron",
"id": "e9d3fa6bc7d7f35c9db1b93ff1bb25527cab8135",
"s... |
import logging
import uuid
import json
import esgfpid.utils
import esgfpid.assistant.messages
from esgfpid.utils import loginfo, logdebug, logtrace, logerror, logwarn
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.NullHandler())
class ErrataAssistant(object):
def __init__(self, **args):
... | {
"content_hash": "ca3ad25c06d7fe129d0c043950f259ee",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 121,
"avg_line_length": 39.4,
"alnum_prop": 0.6329147742452578,
"repo_name": "IS-ENES-Data/esgf-pid",
"id": "9a18a058c7c2ad3972ddedb61a560ef38b8d3591",
"size": "3743",
"b... |
import argparse
from aws_services import cloudtrail
from aws_services import cloudwatch
from aws_services import ec2
from aws_services import iam
from aws_services import s3
from section import one, two, three, four
# from section.two import section_two
# from section.three import section_three
# from section.four im... | {
"content_hash": "34d88744213096d01b1ce6ea40c67bf2",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 50,
"avg_line_length": 24.867924528301888,
"alnum_prop": 0.6365705614567526,
"repo_name": "SpoonBoy/python-aws-foundation",
"id": "a57daa0507aa952de81519606e5c3dc0495d2d41",
... |
from __future__ import unicode_literals
import unittest
import responses
import requests
from tapioca.exceptions import (
ClientError, ServerError, ResponseProcessException,
TapiocaException)
from tapioca.tapioca import TapiocaClient
from tests.client import TesterClient, TesterClientAdapter
class TestTap... | {
"content_hash": "3dc63a1b95d171d96b201e49ea07f1cd",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 69,
"avg_line_length": 32,
"alnum_prop": 0.5900568181818182,
"repo_name": "romulocollopy/tapioca-wrapper",
"id": "7a91e6f420a116b612579d4c1a8aabfbdd159469",
"size": "3537"... |
from django import forms
from django.contrib.auth.models import User, Group
from django.contrib.auth.forms import UserCreationForm
from django.utils.translation import ugettext_lazy as _
from mks.models import Party
from models import NOTIFICATION_PERIOD_CHOICES
from persons.models import GENDER_CHOICES
class Registra... | {
"content_hash": "b9ea4284e48583bfe886ab734542d672",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 147,
"avg_line_length": 49.02439024390244,
"alnum_prop": 0.5651741293532339,
"repo_name": "jspan/Open-Knesset",
"id": "ec766d5c7447c10367f2274800e58e7f0839ea68",
"size": "... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from collections import defaultdict
from pants.engine.nodes import Noop, Return, SelectNode, TaskNode
class GraphValidator(object):
"""A concrete object that impl... | {
"content_hash": "bbbee4f040675c7d3d8dd71c60e0719b",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 102,
"avg_line_length": 45.352,
"alnum_prop": 0.701887458105486,
"repo_name": "ity/pants",
"id": "57912c0f40dd75e9118e948b68be70bf7ae6cb32",
"size": "5816",
"binary": fa... |
from gym.envs.classic_control import PendulumEnv, CartPoleEnv
import numpy as np
# MuJoCo may not be installed.
HalfCheetahEnv = HopperEnv = None
try:
from gym.envs.mujoco import HalfCheetahEnv, HopperEnv
except Exception:
pass
class CartPoleWrapper(CartPoleEnv):
"""Wrapper for the CartPole-v1 environme... | {
"content_hash": "be2ecd54e299b03d2b05aaa4c03ab9eb",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 88,
"avg_line_length": 32.00961538461539,
"alnum_prop": 0.585761489936918,
"repo_name": "ray-project/ray",
"id": "845ddffc58a66fbdb73ebae4d8cc8fb7374cb7c9",
"size": "3329"... |
import json
from django.test import TestCase
from django.core.exceptions import ObjectDoesNotExist
from .models import User
class TestLogin(TestCase):
def setUp(self):
user = User(username='testuser')
user.set_password('rightpassword')
user.save()
self.user_id = user.id
def t... | {
"content_hash": "bd0d379d47ff21718a8bc9f3a9a59bad",
"timestamp": "",
"source": "github",
"line_count": 342,
"max_line_length": 82,
"avg_line_length": 34.39181286549707,
"alnum_prop": 0.588930454004421,
"repo_name": "arrayexpress/ae_auto",
"id": "fc7ccee4a889229a8d6ad36ed7f2482e97b38727",
"size": "... |
import ctypes
import msvcrt
import os
import sys
import code
import windows
from .. import winproxy
from ..generated_def import windef
from ..generated_def.winstructs import *
# Function resolution !
def get_func_addr(dll_name, func_name):
# Load the DLL
ctypes.WinDLL(dll_name)
modules = wind... | {
"content_hash": "c82d575e0dd2da903aa795e46b8868c3",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 129,
"avg_line_length": 35.2713567839196,
"alnum_prop": 0.684285510756518,
"repo_name": "sogeti-esec-lab/LKD",
"id": "1a688412a3db94e5aa0c2e4f45550052b3d82fe6",
"size": "7... |
"""Tests for tensor2tensor.utils.bleu_hook."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
import six
from tensor2tensor.data_generators import text_encoder
from tensor2tensor.utils import bleu_hook
import tensorflow as tf
... | {
"content_hash": "64425cc7c3aed4f53000d21ee6146c43",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 77,
"avg_line_length": 36.505494505494504,
"alnum_prop": 0.658639373871162,
"repo_name": "mlperf/training_results_v0.5",
"id": "999a240f8101596543f2ca04e6219b1741604f70",
"... |
"""Constants for the ezviz integration."""
DOMAIN = "ezviz"
MANUFACTURER = "Ezviz"
# Configuration
ATTR_SERIAL = "serial"
CONF_CAMERAS = "cameras"
CONF_FFMPEG_ARGUMENTS = "ffmpeg_arguments"
ATTR_HOME = "HOME_MODE"
ATTR_AWAY = "AWAY_MODE"
ATTR_TYPE_CLOUD = "EZVIZ_CLOUD_ACCOUNT"
ATTR_TYPE_CAMERA = "CAMERA_ACCOUNT"
# S... | {
"content_hash": "1ee8e3a08d820ca7ffb4dc4f9aac2428",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 65,
"avg_line_length": 23.558139534883722,
"alnum_prop": 0.7265547877591313,
"repo_name": "Danielhiversen/home-assistant",
"id": "ec1471d8bc4cd1cdc28c082006b8046879968ea9",
... |
"""
Support for LiteJet switch.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.litejet/
"""
import logging
import homeassistant.components.litejet as litejet
from homeassistant.components.switch import SwitchDevice
DEPENDENCIES = ['litejet']
AT... | {
"content_hash": "477fdd051e1e633fa69c1b7ece0e5778",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 74,
"avg_line_length": 27.301204819277107,
"alnum_prop": 0.6213592233009708,
"repo_name": "LinuxChristian/home-assistant",
"id": "1e7c46733ad431cf90c2f9015d474e10f1ca869b",
... |
from setuptools import setup
readme = open('README.rst').read()
history = open('CHANGES.rst').read().replace('.. :changelog:', '')
setup(
name='sqlalchemy-redshift',
version='0.2.1.dev0',
description='Amazon Redshift Dialect for sqlalchemy',
long_description=readme + '\n\n' + history,
author='Matt... | {
"content_hash": "c46f560198c929729254dd14aec49c2b",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 78,
"avg_line_length": 34.35897435897436,
"alnum_prop": 0.6283582089552239,
"repo_name": "jklukas/redshift_sqlalchemy",
"id": "df88571634b742173d2143e8cc6126ef011e1672",
"s... |
import goal
import challenge
import res_users
import badge
| {
"content_hash": "547745e36b86e718c6fe4f5ad77591eb",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 16,
"avg_line_length": 14.75,
"alnum_prop": 0.847457627118644,
"repo_name": "vileopratama/vitech",
"id": "0b9350c82755d0a85e5fea6640557e1b23384f36",
"size": "159",
"binary... |
from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.ec2.utils import filters_from_querystring
def process_rules_from_querystring(querystring):
try:
group_name_or_id = querystring.get('GroupName')[0]
except:
group_name_or_id = querystring.get('GroupId'... | {
"content_hash": "830cfea49afa2e5da716ab24ca7c3647",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 180,
"avg_line_length": 42.619354838709675,
"alnum_prop": 0.6023312140478353,
"repo_name": "EarthmanT/moto",
"id": "9a9aaafd9fa9f68e40bd86cc35f44bafaeb1a8ef",
"size": "660... |
"""
Plugin responsible for post-installation configuration
"""
from packstack.installer import utils
from packstack.installer import basedefs
# ------------- Postscript Packstack Plugin Initialization --------------
PLUGIN_NAME = "Postscript"
PLUGIN_NAME_COLORED = utils.color_text(PLUGIN_NAME, 'blue')
def initCon... | {
"content_hash": "c99abc5ea9d407dfe2f578f480de81c4",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 73,
"avg_line_length": 32.8125,
"alnum_prop": 0.594920634920635,
"repo_name": "imcsk8/packstack",
"id": "eb0e88a2ee20ca635bc58fdd904e1d9acc879efb",
"size": "2145",
"binar... |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
import os
import shutil
import tempfile
import unittest2 as unittest
from twitter.common.collections import OrderedSet
from pants.base.build_file import BuildFile
fr... | {
"content_hash": "7fbcc2337da204381957a415b38e7673",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 101,
"avg_line_length": 43.911458333333336,
"alnum_prop": 0.7289763966314791,
"repo_name": "square/pants",
"id": "70556127f5e26c4be919587e493a9c0778214cbe",
"size": "8578"... |
from django.contrib import admin
from geotrek.core.models import (Datasource, Stake, Usage, Network, Trail,
Comfort,)
class DatasourceAdmin(admin.ModelAdmin):
list_display = ('source', 'structure')
search_fields = ('source', 'structure')
list_filter = ('structure',)
cla... | {
"content_hash": "23f3d8b0c3fb4da7af16c39a3ef31ec5",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 74,
"avg_line_length": 28.4390243902439,
"alnum_prop": 0.6783876500857633,
"repo_name": "camillemonchicourt/Geotrek",
"id": "00c443fe89f10cee5744185437d6556488920459",
"siz... |
import rethinkdb as r
import os
conn = r.connect(host = 'localhost',
port = int(os.environ['RETHINKDB_PORT']),
db = 'hackathon',
auth_key = str(os.environ['RETHINKDB_AUTH_KEY']))
from AfricasTalkingGateway import AfricasTalkingGateway, AfricasTalkingGatewayException... | {
"content_hash": "f521076a5a3cce28b5089f05a21c2f2f",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 115,
"avg_line_length": 32.21951219512195,
"alnum_prop": 0.6555639666919001,
"repo_name": "USIU-Hackathon/ss2015-hackathon",
"id": "b32b0ddbda6f02ac6480ec18e2e962b6879766ce",... |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'myweb.views.home', name='home'),
# url(r'^myweb/', include('myweb.foo.urls')),
# Uncom... | {
"content_hash": "9c88d47137190960fb85e41b1eb37244",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 71,
"avg_line_length": 32.529411764705884,
"alnum_prop": 0.674502712477396,
"repo_name": "lz1988/django-web2015",
"id": "edd67be3979ffefa0b15d603562f3a0c7082ebe4",
"size": ... |
import math
import sys
import unittest
from cupy import testing
@testing.gpu
class TestRanges(unittest.TestCase):
_multiprocess_can_split_ = True
@testing.for_all_dtypes(no_bool=True)
@testing.numpy_cupy_array_equal()
def test_arange(self, xp, dtype):
return xp.arange(10, dtype=dtype)
... | {
"content_hash": "b66d3ef567ee61c9a56c47d63a9a4b00",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 74,
"avg_line_length": 33.02439024390244,
"alnum_prop": 0.6368783850320039,
"repo_name": "truongdq/chainer",
"id": "4bf60224d25aee3cc448a6ae270c12b5cbcda76a",
"size": "406... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0248_membership_rolled_to_membership'),
]
operations = [
migrations.AlterField(
model_name='membership',
name='variant',
field=models.CharFi... | {
"content_hash": "8611fe430cd930c7c07096a1f0a1fced",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 252,
"avg_line_length": 34.9375,
"alnum_prop": 0.5867620751341681,
"repo_name": "pbanaszkiewicz/amy",
"id": "a5825fa995e86ed3c3fe387fc5ec0c5ae33b5ccf",
"size": "609",
"bi... |
"""
Pagination fields
"""
# pylint: disable=no-init, too-few-public-methods, no-self-use
from rest_framework_3 import serializers
from rest_framework_3 import pagination
from rest_framework_3.views import Response
from rest_framework_3.templatetags.rest_framework_3 import replace_query_param
# DRF 2.4.X compatibilit... | {
"content_hash": "845d4fea7df0a759f9dd7e26ad06f491",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 78,
"avg_line_length": 27.82170542635659,
"alnum_prop": 0.6486486486486487,
"repo_name": "coUrbanize/rest_framework_ember",
"id": "a0cfc7d3fdfd597c124e035910bf88cd09c19726",... |
import uuid
from . url import sanitize_url_fragment
from . exception import *
class BaseEndpoint(object):
def __init__(self, request, endpoint):
self.request = request
self.endpoint = sanitize_url_fragment(endpoint)
def _url_with(self, *params):
def add_to_endpoint(endpoint, param):... | {
"content_hash": "4c909c502ce219baf9143f7e171b732d",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 85,
"avg_line_length": 28.46153846153846,
"alnum_prop": 0.6351351351351351,
"repo_name": "moltin/python-sdk",
"id": "e6e0d6ed903f38cbbffcb627f8c9cfed1b925942",
"size": "259... |
"""`dict` automatically saving it's state to a file on disk."""
import json
import locale
import os
from typing import Generic, MutableMapping, MutableSequence, TypeVar, Union
class Error(Exception):
"""Base class for all exception of this module."""
class InvalidFileError(Error):
"""Error raised if the dict c... | {
"content_hash": "30898836c93e6e450816cddf55f4e9d7",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 79,
"avg_line_length": 28.627450980392158,
"alnum_prop": 0.6406392694063927,
"repo_name": "graveljp/smugcli",
"id": "2cd11ed4fd626916dcb11bd6af4aecdd1a22d4b9",
"size": "43... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
import mock
from dashboard import ttest
class TTestTest(unittest.TestCase):
"""Tests for the t-test functions."""
def setUp(self):
"""Sets the t-table values for the tests below."""... | {
"content_hash": "9a54bd243c98cdcc296439028c3a609f",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 78,
"avg_line_length": 44.83505154639175,
"alnum_prop": 0.6616463554840193,
"repo_name": "catapult-project/catapult",
"id": "47be39a90fc2d86e7be7ad6ef8b9e07c8fe1cfc9",
"si... |
from snakebite.client import Client
client = Client('localhost', 9000)
for p in client.mkdir(['/foo/bar', '/input'], create_parent=True):
print p | {
"content_hash": "2805295ae45c540e451b649cf52a7a5c",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 66,
"avg_line_length": 29.8,
"alnum_prop": 0.7114093959731543,
"repo_name": "MinerKasch/HadoopWithPython",
"id": "11eca31cadb6d85ad01578f53f60dda99648c84d",
"size": "149",
... |
"""
ADF Composite Output
#########################
This module provides the primary (user facing) output parser.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from collections import defaultdict
import re
import six
import numpy as np
import pandas as p... | {
"content_hash": "0e3bcf3e16877f5c82bae042eaa1cae7",
"timestamp": "",
"source": "github",
"line_count": 551,
"max_line_length": 117,
"avg_line_length": 45.3448275862069,
"alnum_prop": 0.5119871923153893,
"repo_name": "exa-analytics/atomic",
"id": "978d52e0933f119970455a4df53044fccaf50c5d",
"size": ... |
from ohno import config
from ohno.client.telnet import Telnet
from ohno.client.pty import Pty
class Client(object):
"""Wraps around a specific NetHack client (telnet, /usr/bin/nethack, ..)"""
def __init__(self, ohno):
self.ohno = ohno
if config.CLIENT == 'telnet':
self.ohno.logger.... | {
"content_hash": "4e0fb1615999211ae2d5db0cbd20b6ed",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 79,
"avg_line_length": 35.542857142857144,
"alnum_prop": 0.6093247588424437,
"repo_name": "helgefmi/ohno",
"id": "6050c80e750fc07cfc3c38de0653814ea6390cc8",
"size": "1244",... |
import ROOT
from array import array
class Marker( ROOT.TMarker ):
def __init__( self, x,y, markerColor=None, markerStyle=5 ):
ROOT.TMarker.__init__( self, x,y, markerStyle )
if markerColor: self.SetMarkerColor( markerColor )
class CrossMarker( ROOT.TMarker ):
""" A special class just for "cr... | {
"content_hash": "3d206cc5f28bbf8ea48bf91da6f5622a",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 87,
"avg_line_length": 33.40350877192982,
"alnum_prop": 0.618172268907563,
"repo_name": "svenkreiss/PyROOTUtils",
"id": "2346330509fc3f1dec9bfca5f6193877696691e7",
"size": ... |
"""
Handle upload and retrieval of files from iRODS. This method requires a preconfigured connection
to an iRODS repository throught the `iinit` command
config options:
upload:
dir: ../final
method: irods
folder: absolute parent path in iRODS repository
resource: (optional) iRODS... | {
"content_hash": "0e9ebfb123cc78d368089e04eb7b8718",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 100,
"avg_line_length": 32.59183673469388,
"alnum_prop": 0.6455854727614276,
"repo_name": "a113n/bcbio-nextgen",
"id": "822513145020cfa688ed31d73e52ef391e70b635",
"size": "... |
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext as _
from arctic.generics import (CreateView, ListView, UpdateView)
from arctic.loading import get_user_role_model
from .forms import (UserChangeMultiForm, UserCreationMultiFo... | {
"content_hash": "7a7c88fc6396464ecb4d5bc827b81e79",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 66,
"avg_line_length": 30.36764705882353,
"alnum_prop": 0.6300242130750605,
"repo_name": "ddaan/django-arctic",
"id": "72c70866761a006c959fcb055a4e6c6de7e9245c",
"size": "2... |
from __future__ import absolute_import
from django.db import models
from django.utils.translation import ugettext_lazy as _
from sentry.db.models import BoundedPositiveIntegerField, FlexibleForeignKey, Model
class GroupHash(Model):
__core__ = False
class State:
UNLOCKED = None
LOCKED_IN_MIG... | {
"content_hash": "582a87e3d93c385871cc6d3618f55ea9",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 93,
"avg_line_length": 31.40740740740741,
"alnum_prop": 0.6910377358490566,
"repo_name": "mvaled/sentry",
"id": "577ff1ec1a4ff19c7474cd90d74c2d7acfef27f2",
"size": "848",
... |
from __future__ import absolute_import, unicode_literals
import sys
from django.apps.registry import Apps, apps
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation
)
from django.contrib.contenttypes import management
from django.contrib.contenttypes.models import ContentType
from d... | {
"content_hash": "b975860ecebbb5c743bb5f5d8befb6f6",
"timestamp": "",
"source": "github",
"line_count": 429,
"max_line_length": 123,
"avg_line_length": 38.438228438228435,
"alnum_prop": 0.6110369921164343,
"repo_name": "YYWen0o0/python-frame-django",
"id": "e89d3dcf0d7a2e0787d4894fab2bafba240db677",
... |
print("Hello World")
# In[7]:
import tweepy
import pandas as pd
#Then create new twitter app: https://apps.twitter.com/
#Then set up Oauth below (filling in the empty double quotes)
# In[5]:
# == OAuth Authentication ==
#
# This mode of authentication is the new preferred way
# of authenticating with Twitter.
# ... | {
"content_hash": "47d0d544a2a50eda2389b43289fe223f",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 136,
"avg_line_length": 23.859060402684563,
"alnum_prop": 0.7279887482419128,
"repo_name": "mjrich/trimming-twitter-friends",
"id": "f10bae869397842090ccaf09c70480d051589338... |
import os
import pytest
from mapproxy.client.http import HTTPClient
from mapproxy.script.wms_capabilities import wms_capabilities_command
from mapproxy.test.http import mock_httpd
from mapproxy.test.helper import capture
TESTSERVER_ADDRESS = ("127.0.0.1", 56413)
TESTSERVER_URL = "http://%s:%s" % TESTSERVER_ADDRESS
... | {
"content_hash": "94d5d0ad208b62de30ff3a3737de614a",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 97,
"avg_line_length": 36.31137724550898,
"alnum_prop": 0.470811345646438,
"repo_name": "camptocamp/mapproxy",
"id": "7e63322468c99855365db68c4ccb2f1995ed1527",
"size": "6... |
'''
Plugin that answers questions from people
'''
from adaptors import google_answers
import logging
logger = logging.getLogger('answers')
def GetFirstName(full_name):
return full_name.split()[0]
def GetLastQuestion(messages):
for message in reversed(messages):
if not message.text:
continue
if me... | {
"content_hash": "2cc531298bea0cae4ea8ced81134d3b6",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 92,
"avg_line_length": 29.44736842105263,
"alnum_prop": 0.6907953529937444,
"repo_name": "andreimatei/congratboto",
"id": "b42b06aaa7d8a7d22cc2d8cde4c5c51f3be58a3c",
"size"... |
import socket
# Cria um objecto socket UDP.
ipv4 = socket.AF_INET
udp = socket.SOCK_DGRAM
sock = socket.socket(ipv4, udp)
print "Socket successfully created"
# Reserve a porta na qual deseja aceitar conexões.
port = 12345
# Ative a porta para o servidor
sock.bind(('127.0.0.1', port))
print "Socket binded to %s" %(po... | {
"content_hash": "1d8f82e59e84643fbaf2331b386e407d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 50,
"avg_line_length": 24,
"alnum_prop": 0.6956521739130435,
"repo_name": "lab-inf/2017.1-cc-rede1",
"id": "e6c7de6ab0f103c7c2edaf6cdad7e1a61a98d374",
"size": "696",
"bin... |
import os
# try/except added for compatibility with python < 3.8
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER
except ImportError: # pragma: NO COVER
import mock
import math
from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template
fro... | {
"content_hash": "a4cb458edbdf3e4d6ffb220aa247d0b0",
"timestamp": "",
"source": "github",
"line_count": 9882,
"max_line_length": 160,
"avg_line_length": 35.35448289819875,
"alnum_prop": 0.641194368196741,
"repo_name": "googleapis/python-datacatalog",
"id": "dcec63959dc542724bb929c799eff5ea1e38534d",
... |
import copy
import inspect
import logging
from django.core import urlresolvers
from django import forms
from django.forms.forms import NON_FIELD_ERRORS # noqa
from django import template
from django.template.defaultfilters import linebreaks # noqa
from django.template.defaultfilters import safe # noqa
from django.t... | {
"content_hash": "891ecac63ad3a54f09b56313b974ebd9",
"timestamp": "",
"source": "github",
"line_count": 850,
"max_line_length": 79,
"avg_line_length": 38.451764705882354,
"alnum_prop": 0.5922775670052625,
"repo_name": "tanglei528/horizon",
"id": "45f4df80e9e268854bbf455702e96031f39d87b8",
"size": "... |
"""Definition of mali operator strategy."""
# pylint: disable=invalid-name,unused-argument,wildcard-import,unused-wildcard-import
import re
from tvm import topi
from .generic import *
from .. import op as _op
@conv2d_strategy.register("mali")
def conv2d_strategy_mali(attrs, inputs, out_type, target):
"""conv2d ma... | {
"content_hash": "bf3a1d1262e675a2dbcc2904354b9596",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 96,
"avg_line_length": 41.47222222222222,
"alnum_prop": 0.5912033936146461,
"repo_name": "sxjscience/tvm",
"id": "f6ea911a15bf598e599e8e073031b6255d93cca8",
"size": "5264"... |
"""
Write Prismatic (http://prism-em.com/) input files.
"""
class Prismatic:
"""
Class to write Prismatic (http://prism-em.com/) input files.
This is designed for STEM image simulation.
"""
def __init__(self, structure, comment="Generated by pymatgen"):
"""
Args:
stru... | {
"content_hash": "4b823f5b5225367f0fdfa17ae6c37fad",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 69,
"avg_line_length": 28.568181818181817,
"alnum_prop": 0.4701670644391408,
"repo_name": "gmatteo/pymatgen",
"id": "06d5eb7e649abb1650daafecb08ac1bd3577325f",
"size": "136... |
"""Tests for metrics."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import math
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
from tensorflow.python.framework import constant_op
from tensorflow.... | {
"content_hash": "2583bb281fc2d49f8b315da7732a3376",
"timestamp": "",
"source": "github",
"line_count": 3395,
"max_line_length": 80,
"avg_line_length": 37.9920471281296,
"alnum_prop": 0.6144608204181946,
"repo_name": "eerwitt/tensorflow",
"id": "91b3a88feb9d17725494525872f1d407b5983fa6",
"size": "1... |
import pyxb.binding.generate
import pyxb.utils.domutils
from xml.dom import Node
import os.path
schema_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../schemas/po1.xsd'))
code = pyxb.binding.generate.GeneratePython(schema_location=schema_path)
#file('code.py', 'w').write(code... | {
"content_hash": "919acf526bf392f33f5376056b08089f",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 269,
"avg_line_length": 46.739495798319325,
"alnum_prop": 0.6650485436893204,
"repo_name": "jonfoster/pyxb1",
"id": "bf3c9d2f0c5635eae42a36b08b6241bea6e6e94f",
"size": "55... |
#
# @package pricecalculator
# @file pricecalculator.py
# @brief Python application "Price Calculator",
# an "Elephant Carpaccio Exercise",
# according to the "Story Slicing" approach
# @author Rolf Hemmerling <hemmerling@gmx.net>
# @version 1.00
# @date 2015... | {
"content_hash": "2c84d407093b143c328c57d41e23e350",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 77,
"avg_line_length": 30.96153846153846,
"alnum_prop": 0.5925465838509317,
"repo_name": "hemmerling/codingdojo",
"id": "080ca6a8a90d6c3adb23a5234b3bc102067ffee9",
"size": ... |
from utils import perms
from discord import Embed, Color
import STATICS
description = "Stream announcing. (Only for zekro)"
DEVMODE = False
async def ex(message, client):
author = message.author
if not perms.check_if_zekro(author):
await client.send_message(author, embed=Embed(color=Color.red(), des... | {
"content_hash": "77d27395fc294af0e319b14c04629e73",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 139,
"avg_line_length": 30.3,
"alnum_prop": 0.6435643564356436,
"repo_name": "zekroTJA/regiusBot",
"id": "c8b8439abae14c9946409e2f499f85a79caea3e9",
"size": "909",
"binar... |
from abc import ABC
class Automation(ABC):
@classmethod
def load(Class, path_or_folder):
return Class()
def run(self):
pass
def serve(self):
pass
class Batch(ABC):
def get_data(self, variable_definition):
'''
Get the data of the variable in one of the ... | {
"content_hash": "20c727c53ddfa6a30d38581a64b74868",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 76,
"avg_line_length": 19.041666666666668,
"alnum_prop": 0.5568927789934355,
"repo_name": "crosscompute/crosscompute",
"id": "d691fc7ed827924dd9c64ad4c2aa854ef183d514",
"si... |
from setuptools import setup, find_packages
setup(
name='idalink',
description='An interface to the insides of IDA!',
long_description=open('README.md').read(),
version='0.12',
url='https://github.com/zardus/idalink',
license='GNU General Public License v3',
author='Zardus',
author_emai... | {
"content_hash": "96daccdae60a9d22c2a6651cc3b5d8b6",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 54,
"avg_line_length": 27.11111111111111,
"alnum_prop": 0.6516393442622951,
"repo_name": "zardus/idalink",
"id": "b59af1e1d3de070dd2cf7e63b6a597a1563aa0c7",
"size": "488",
... |
"""
Our CPU based backend interface and tensor data structure. Our implementation
wraps :mod:`numpy` ndarray and related operations
"""
import logging
import numpy as np
from neon.backends.backend import Backend, Tensor
from neon.util.compat import range
logger = logging.getLogger(__name__)
class CPUTensor(Tensor... | {
"content_hash": "299f0483863eb65284464f0b14c31653",
"timestamp": "",
"source": "github",
"line_count": 1717,
"max_line_length": 79,
"avg_line_length": 44.27897495631916,
"alnum_prop": 0.5516066660528497,
"repo_name": "ruguevara/neon",
"id": "0639055f90ae0d7714b47201727d1dc9bff2bf3f",
"size": "7676... |
from oslo_config import cfg
from oslo_log import log
from neutron.common import constants
from neutron.extensions import portbindings
from neutron.i18n import _LE, _LW
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2 import driver_api as api
from neutron.plugins.ml2.drivers.mech_sriov i... | {
"content_hash": "aca839531b37b6e58cd0abd69051946c",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 78,
"avg_line_length": 42.8876404494382,
"alnum_prop": 0.590123133350799,
"repo_name": "kongseokhwan/kulcloud-iitp-neutron",
"id": "d70edf22fd1cb7d09c99a3bdf0a12deffaf7b7b5"... |
from ....tests.helper import catch_warnings
from .. import converters
from .. import exceptions
from .. import tree
def test_reraise():
def fail():
raise RuntimeError("This failed")
try:
try:
fail()
except RuntimeError as e:
exceptions.vo_reraise(e, additional... | {
"content_hash": "841e617c411b304388030454a21bc57b",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 67,
"avg_line_length": 26.58695652173913,
"alnum_prop": 0.5437448896156991,
"repo_name": "piotroxp/scibibscan",
"id": "93f44495be0516475c7bbc506910cdb41c9204ef",
"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 'User'
db.create_table(u'july_user', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=T... | {
"content_hash": "9df41d366f4ccf2d44a9cba8a3eb5abb",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 187,
"avg_line_length": 67.90714285714286,
"alnum_prop": 0.5746292205743136,
"repo_name": "ChimeraCoder/GOctober",
"id": "32aa5878d51ef265c6c4b09da8da9647be0d398c",
"size"... |
"""Command line for Django."""
import os
import sys
from django.core.management import execute_from_command_line
def main():
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"{package}.settings".format(package=__package__))
execute_from_command_line(sys.argv)
if __name__ == "__main... | {
"content_hash": "c10c68587e0fcc88658275bdb93b466c",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 75,
"avg_line_length": 22.4,
"alnum_prop": 0.6339285714285714,
"repo_name": "novapost/django-ticketoffice",
"id": "3da68c86e577be2ed30ed0d72026bb8011be73aa",
"size": "382",... |
print unichr(42)
print unichr(43)
try:
print unichr("foo")
except TypeError, E:
print "Could not convert string:", E
print unichr(42).__class__ == unicode
print type(unichr(42)), unicode
| {
"content_hash": "98baa2666ef42711b924b1b83b9a92d4",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 40,
"avg_line_length": 24.375,
"alnum_prop": 0.6923076923076923,
"repo_name": "buchuki/pyjaco",
"id": "4dce2f7b85f5231171c4139966884e349f73bd13",
"size": "195",
"binary": ... |
AUTOMERGER_NAME = 'Chromium+Blink automerger'
AUTOMERGER_EMAIL = 'chrome-blink-automerger@chromium.org'
BLINK_REPO_URL = 'https://chromium.googlesource.com/chromium/blink.git'
CHROMIUM_REPO_URL = 'https://chromium.googlesource.com/chromium/src.git'
BRANCHES_TO_MERGE = [
# Chromium ref, Bli... | {
"content_hash": "458b8d5a1c8d1050dc7cd161fbe43f07",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 96,
"avg_line_length": 40.36,
"alnum_prop": 0.6392467789890981,
"repo_name": "primiano/chrome-blink-automerger",
"id": "574ffd719758da3c32902f81c45fd36f0fd319b1",
"size": "... |
"""Helper functions for running commands as subprocesses."""
import logging
import pathlib
import subprocess
from typing import Optional, Sequence, Union
def run_command(
command: Sequence[str],
*, # Ensures that the rest of the args are passed explicitly.
cwd: Optional[Union[str, pathlib.P... | {
"content_hash": "87b7fe7b09015cff554d9be7147994de",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 80,
"avg_line_length": 35.161764705882355,
"alnum_prop": 0.6587202007528231,
"repo_name": "chromium/chromium",
"id": "8efc59f978347aa32fd9f375ae281f7a86a75ec8",
"size": "25... |
import re
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.translation import ugettext_lazy, ugettext as _
from htmlentitydefs import name2codepoint
# Capitalizes the first letter of a string.
capfirst = lambda x: x and force_unicode(x)[0].upper() ... | {
"content_hash": "a0a8a2bd507698aa98a095b40a05c003",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 132,
"avg_line_length": 35.89824561403509,
"alnum_prop": 0.5488222070178869,
"repo_name": "rimbalinux/LMD3",
"id": "5315653bc3c690e5e099b6cf413c8a8cd98e8025",
"size": "102... |
from django.conf.urls.defaults import *
from diogenis.students.views import *
urlpatterns = patterns('',
url(r'^(?P<username>\w{0,50})/$', display_labs, name='students.index'),
url(r'^(?P<username>\w{0,50})/settings/$', settings, name='students.settings'),
url(r'^(?P<username>\w{0,50})/has_laptop/$', has... | {
"content_hash": "cce6bc6e1dea390220f60223a3f6c085",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 89,
"avg_line_length": 36.45454545454545,
"alnum_prop": 0.6433915211970075,
"repo_name": "gtsiokos/diogenis",
"id": "a1fff81d160fa5d0f93c59fc7d8e7fc0df1ff072",
"size": "401... |
import pytest
from common import SCHEMAS_PATH, list_schema_paths, list_latest_schema_paths
@pytest.mark.parametrize("path", list_schema_paths(SCHEMAS_PATH / "unit"))
def test_unit(path, assert_schema_correct):
assert_schema_correct(path)
@pytest.mark.parametrize("path", list_latest_schema_paths(SCHEMAS_PATH / ... | {
"content_hash": "8d339b3c8429d62bfa864238466c6562",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 81,
"avg_line_length": 32.76923076923077,
"alnum_prop": 0.7582159624413145,
"repo_name": "spacetelescope/asdf-standard",
"id": "a0be15fe5d533137da0a1e90276665d533418288",
"... |
"""Inplace operations.
"""
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import gen_array_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.util import deprecation
def _inplace_helpe... | {
"content_hash": "d543a2976a2afb6013ed28fb36f95a19",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 79,
"avg_line_length": 28.085470085470085,
"alnum_prop": 0.651095556908095,
"repo_name": "Intel-tensorflow/tensorflow",
"id": "aeaeae2ca9033458dba90bfc764311b49d4ca04c",
"... |
from __future__ import print_function
from unittest import TestCase
import numpy as np
from nose import SkipTest
from nose.tools import assert_raises
from numpy.testing import assert_array_equal, assert_array_almost_equal
from sklearn.datasets.samples_generator import make_spd_matrix
from sklearn import mixture
from ... | {
"content_hash": "911d0f7ade4dc47caa560f684f93a1b6",
"timestamp": "",
"source": "github",
"line_count": 501,
"max_line_length": 79,
"avg_line_length": 39.72055888223553,
"alnum_prop": 0.5890954773869347,
"repo_name": "dhuppenkothen/hmmlearn",
"id": "6170f8a9670647a568a341dad64cb6e986916dff",
"size"... |
DEPS = [
'env',
'flavor',
'recipe_engine/context',
'recipe_engine/file',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/raw_io',
'recipe_engine/step',
'run',
'vars',
]
def upload_dm_results(buildername):
skip_upload_bots = [... | {
"content_hash": "355604ca7d8599c6a23b5dd3206e7da3",
"timestamp": "",
"source": "github",
"line_count": 1249,
"max_line_length": 93,
"avg_line_length": 38.638911128903125,
"alnum_prop": 0.6076253626191462,
"repo_name": "HalCanary/skia-hc",
"id": "7ec0ddbb601931d2c1eb2ef59a4fa6ba52e421f9",
"size": "... |
from nltk.corpus import brown, stopwords
from nltk import ConditionalFreqDist
cfd = ConditionalFreqDist()
stopwords_list = stopwords.words('english')
def is_noun(tag):
return tag.lower() in ['nn','nns','nn$','nn-tl','nn+bez',
'nn+hvz', 'nns$','np','np$','np+bez',
... | {
"content_hash": "bcc2a368ee87ec41e40d5de9000d9ee2",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 78,
"avg_line_length": 35.166666666666664,
"alnum_prop": 0.5600315955766193,
"repo_name": "desilinguist/acm-crossroads-nltk",
"id": "2ec2026f418cb5265c1abae4f5c0d26698d3c8e7"... |
from zang.exceptions.zang_exception import ZangException
from zang.configuration.configuration import Configuration
from zang.connectors.connector_factory import ConnectorFactory
from zang.domain.enums.product import Product
from docs.examples.credetnials import sid, authToken
url = 'http://api.zang.io/v2'
configurat... | {
"content_hash": "d270b499755a25a6ec1c6285d4a8cdcb",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 65,
"avg_line_length": 27.514285714285716,
"alnum_prop": 0.726895119418484,
"repo_name": "jaymin-panchal/zang-python",
"id": "5222cd861c272b682035c88a6bd8c3434d72cc9a",
"si... |
"""
This script helps to set up a simple, local deployment of QFS.
You can write your own config file (start from ./sample_setup.cfg)
and run this script to install, uninstall or upgrade.
./sample_setup.py -c sample_setup.cfg -a install
-c: config file
-a: action (one of install, start, stop, uninstall)
-b... | {
"content_hash": "8df15f48cf4718e489c0923aea9b7595",
"timestamp": "",
"source": "github",
"line_count": 748,
"max_line_length": 339,
"avg_line_length": 42.018716577540104,
"alnum_prop": 0.5933821189945911,
"repo_name": "quantcast/qfs",
"id": "00b3e438502878e985b045ba46cdde3a7d6d9b1a",
"size": "3215... |
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource ... | {
"content_hash": "25d6f548e062a180f0f924738528e523",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 166,
"avg_line_length": 42.396907216494846,
"alnum_prop": 0.6674164133738602,
"repo_name": "twilio/twilio-python",
"id": "60c3c292cec77a277d8e5ce27db9dc70b3c8287e",
"size"... |
from pytest import fixture, mark, raises
from tornado import web, gen
from unittest.mock import Mock
from globus_sdk import ConfidentialAppAuthClient
from ..globus import GlobusOAuthenticator, GlobusLogoutHandler
from .mocks import setup_oauth_mock, no_code_test, mock_handler
def user_model(username):
"""Retur... | {
"content_hash": "fec6cff58ffc5cf920b4bfec2f3f28b9",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 81,
"avg_line_length": 31.97714285714286,
"alnum_prop": 0.6663688348820586,
"repo_name": "maltevogl/oauthenticator",
"id": "21e42b787ef3a4abc225fd542186d8d5d90260e4",
"siz... |
"""
Based on Premailer.
This is a hack of Premailer that uses BeautifulSoup and SoupSelect instead of lxml.
"""
# http://www.peterbe.com/plog/premailer.py
import re, os
import codecs
import urlparse, urllib
from BeautifulSoup import BeautifulSoup, Comment
import soupselect; soupselect.monkeypatch()
__version__ = '1.... | {
"content_hash": "7dc8db549996fe1ac01b68308099ac5d",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 95,
"avg_line_length": 35.593869731800766,
"alnum_prop": 0.4963401506996771,
"repo_name": "drawquest/drawquest-web",
"id": "e939081d5b9493e30f0434da6e5788b5fc341a6e",
"siz... |
import copy
from django.conf import settings
from django.contrib.admin import ModelAdmin
from django.contrib.admin.views.main import ChangeList
from django.contrib.contenttypes import generic
from django.forms import ModelForm
from django.contrib import admin
from django.db import models
from suit.widgets import Number... | {
"content_hash": "6455b0d78e8c42421aa168a490e835dd",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 78,
"avg_line_length": 32.21465968586387,
"alnum_prop": 0.6183975296603283,
"repo_name": "cubledesarrollo/cubledotes",
"id": "b34f82d399d58185a0f40e20c26a12b7b9b81ea9",
"s... |
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": "2b97147bed9e0bac92cd183783511a24",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 307,
"avg_line_length": 46.38255033557047,
"alnum_prop": 0.6537404138330198,
"repo_name": "Azure/azure-sdk-for-python",
"id": "e89eb243c02f6a8a5751aed490c141d0cce59b69",
"... |
import argparse
import os.path as osp
from multiprocessing import Pool
import mmcv
import numpy as np
from mmcv import Config, DictAction
from mmdet.core.evaluation import eval_map
from mmdet.core.visualization import imshow_gt_det_bboxes
from mmdet.datasets import build_dataset, get_loading_pipeline
from mmdet.datas... | {
"content_hash": "124ec272457fe4df66a586f1f73e1588",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 78,
"avg_line_length": 37.21195652173913,
"alnum_prop": 0.5660143128377392,
"repo_name": "open-mmlab/mmdetection",
"id": "4d8b60c96da3fee1d62db0617b1baab686fa5313",
"size"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('attachments', '0002_auto_20150916_0438'),
]
operations = [
migrations.AlterField(
model_name='attachment',
name='attachment_... | {
"content_hash": "1484ab46a1dab0f76bd7f628deb6cb23",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 169,
"avg_line_length": 28.894736842105264,
"alnum_prop": 0.6120218579234973,
"repo_name": "phani00/tovp",
"id": "3802054b59121945241db770f9d4703e584362d0",
"size": "573",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import registers.models
class Migration(migrations.Migration):
dependencies = [
('registers', '0002_auto_20160919_1303'),
]
operations = [
migrations.AlterModelOptions(
name='processitsystemrela... | {
"content_hash": "e415b95a90ebfdb83515fbbfab09059a",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 997,
"avg_line_length": 58.77235772357724,
"alnum_prop": 0.6331442799834002,
"repo_name": "rockychen-dpaw/oim-cms",
"id": "076cbe6e30ef3cd3117ac379df474c42b0e12f34",
"size... |
import os
from os import system as _sh
import os.path as osp
from os.path import join, basename
import sys
from time import sleep
import _mysql_exceptions
from glob import glob
from functools import partial
sys.path.append('/root/boinc/py')
import boinc_path_config
from Boinc import database, configxml
sh = partial(l... | {
"content_hash": "bf17b2a671ff7f1c6d221ab85a19a8e9",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 118,
"avg_line_length": 30.774193548387096,
"alnum_prop": 0.5718029350104822,
"repo_name": "grctest/project-rain-site",
"id": "5cdcbe1a35443820f7abbb77950f89318ab0394f",
"s... |
"""Reports binary size metrics for LaCrOS build artifacts.
More information at //docs/speed/binary_size/metrics.md.
"""
import argparse
import collections
import contextlib
import json
import logging
import os
import subprocess
import sys
import tempfile
SRC_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__... | {
"content_hash": "cd6bbc4afe713bb29f695e1c16808399",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 80,
"avg_line_length": 35.888324873096444,
"alnum_prop": 0.6515558698727015,
"repo_name": "chromium/chromium",
"id": "6004ae7f8832680dfbefd471579b2b07ccc08c3a",
"size": "1... |
"""
Talon.One API
Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage ap... | {
"content_hash": "b98d6979f8993e6df917f450d173a956",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 732,
"avg_line_length": 36.201117318435756,
"alnum_prop": 0.6128086419753086,
"repo_name": "talon-one/talon_one.py",
"id": "4fa25bb17b548ae3ddce0552b1c7b84cc809300c",
"siz... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ivrs', '0011_auto_20150716_2255'),
]
operations = [
migrations.AddField(
model_name='state',
name='is_processed',
... | {
"content_hash": "e80178860530f80e648c286c2dbb6626",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 53,
"avg_line_length": 21.894736842105264,
"alnum_prop": 0.5889423076923077,
"repo_name": "klpdotorg/dubdubdub",
"id": "45f4f63a99fbc47978f363014c2296e3b22e4901",
"size": "... |
""" colr_run.py
Run a subprocess, but don't let it output to stdout. Instead, capture it
and show an animation. Stdout output from the process goes straight to
/dev/null. Stderr too, if the -e option is given on the command line.
-Christopher Welborn 07-08-2019
"""
import os
import subprocess
import sy... | {
"content_hash": "78f366ef5c28a766218c4bfbb426f565",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 79,
"avg_line_length": 30.06477732793522,
"alnum_prop": 0.5741987611096149,
"repo_name": "welbornprod/colr",
"id": "17826c30705cd81fecf0d058bb9571f7eff2af99",
"size": "747... |
from django.contrib.auth.models import AnonymousUser
from .models import *
from django.test import TestCase
from django.db import transaction
import reversion
TEST_USER_NAME_CREATOR = 'test project creator'
TEST_USER_NAME_NOT_MEMBER = 'user is not a member'
TEST_PROJECT_PUBLIC_NAME = 'test project name public'
TEST... | {
"content_hash": "1168a3c039a178fe6298be9e1a0aa796",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 121,
"avg_line_length": 40.23041474654378,
"alnum_prop": 0.6624284077892325,
"repo_name": "postpdm/ich_bau",
"id": "6cb5a7244cfc5d99ee28d9cc3baddfe64de668d5",
"size": "873... |
"""Tests for imfusion.expression.test module."""
# pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import
from __future__ import absolute_import, division, print_function
from builtins import *
# pylint: enable=wildcard-import,redefined-builtin,unused-wildcard-import
import pytest
from imfusion.exp... | {
"content_hash": "3ac655d7734e45e06dcd11a620c595eb",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 78,
"avg_line_length": 31.13586956521739,
"alnum_prop": 0.6250654564496422,
"repo_name": "jrderuiter/im-fusion",
"id": "dc53f8cf492256197a4fca3b32284c11a690eead",
"size": ... |
if __name__ == '__main__':
import coverage
cov = coverage.Coverage()
cov.start()
# Import required modules after coverage starts
import sys
import pytest
# Call pytest and exit with the return code from pytest so that
# CI systems will fail if tests fail.
ret = pytest.main(sys.argv... | {
"content_hash": "5cf1babf1deee06096a656fb62877fc6",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 67,
"avg_line_length": 23.428571428571427,
"alnum_prop": 0.6321138211382114,
"repo_name": "MaxPoint/spylon",
"id": "db8f9aef05cfd2351710d51c390b1b4c7b07aa1d",
"size": "514"... |
import _plotly_utils.basevalidators
class TicksValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="ticks", parent_name="layout.scene.yaxis", **kwargs):
super(TicksValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "50c9105987d94018946d193aead9ad55",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 88,
"avg_line_length": 39.92307692307692,
"alnum_prop": 0.5973025048169557,
"repo_name": "plotly/python-api",
"id": "ab4cafbea5905bd2c5ea9d502555daa9fcb020c5",
"size": "519... |
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT, \
START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from genshi.output import NamespaceFlattener
import _base
from html5lib.constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
depth = 0
ign... | {
"content_hash": "55006566b06732102e6acbc65e32efb2",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 96,
"avg_line_length": 33.6865671641791,
"alnum_prop": 0.5104120513956579,
"repo_name": "dewitt/webfingerclient-dclinton",
"id": "fd02a6345489fe9ef4c9e3d395041ec2ef90457b",
... |
from __future__ import print_function, absolute_import
import warnings
from contextlib import contextmanager
from numba.tests.support import override_config, TestCase
from numba.cuda.testing import skip_on_cudasim
from numba import unittest_support as unittest
from numba import cuda, types
from numba.cuda.testing imp... | {
"content_hash": "c6758d9aaadfb7c9b5c296deafeb8208",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 65,
"avg_line_length": 31.65909090909091,
"alnum_prop": 0.6439339554917445,
"repo_name": "jriehl/numba",
"id": "f3888425020a6019dbc4523bc9c2ecb42292c4eb",
"size": "1393",
... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
# pandas display options
pd.options.display.max_rows = 100
pd.options.display.max_columns = 25
pd.options.display.width = 1000
one_day = 1
one_week = 5
one_month = 21
one_quarter = 63
learning_rate = 0.0001
training_e... | {
"content_hash": "632dbb1d2da5bdab10f0383b63a88f48",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 209,
"avg_line_length": 26.976958525345623,
"alnum_prop": 0.5978817902289033,
"repo_name": "timestocome/Test-stock-prediction-algorithms",
"id": "fdbf8f634f7233fbac8fa34c6f8... |
from sqlalchemy import bindparam
from sqlalchemy import Column
from sqlalchemy import delete
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import func
from sqlalchemy import insert
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import literal_column
from sql... | {
"content_hash": "10e459775011c3c98fd8c496d85d052c",
"timestamp": "",
"source": "github",
"line_count": 2606,
"max_line_length": 79,
"avg_line_length": 34.93860322333077,
"alnum_prop": 0.5690719384953322,
"repo_name": "sqlalchemy/sqlalchemy",
"id": "5c2f107f45ce8410023e744459796e97c1bd12fc",
"size"... |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, fmt_money
#from shopping_cart.templates.utils import get_transaction_context
no_cache = 1
no_sitemap = 1
@frappe.whitelist(allow_guest='True')
def get_products():
#frappe.errprint("in get products")
#res=frappe.... | {
"content_hash": "72ac2703ac5130776abdde1c2a222556",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 211,
"avg_line_length": 43.6875,
"alnum_prop": 0.7510729613733905,
"repo_name": "gangadhar-kadam/lgnlvefrape",
"id": "65e34493279b8385af8169335152c0b9ae357f15",
"size": "83... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.