text stringlengths 4 1.02M | meta dict |
|---|---|
"""Bencode plugin related functions and classes for testing."""
from tests.parsers import test_lib
class BencodePluginTestCase(test_lib.ParserTestCase):
"""The unit test case for a bencode plugin."""
| {
"content_hash": "32efd2c4389e801cff7b0cba92ed7d94",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 63,
"avg_line_length": 29.285714285714285,
"alnum_prop": 0.7658536585365854,
"repo_name": "8u1a/plaso",
"id": "8f0c04febc0d171b530c7faa249016e02d166110",
"size": "229",
"b... |
import contextlib
import fixtures
import os
import time
import mock
from oslo.config import cfg
from nova import exception
from nova.openstack.common import processutils
from nova.storage import linuxscsi
from nova import test
from nova.tests.virt.libvirt import fake_libvirt_utils
from nova import utils
from nova.vir... | {
"content_hash": "d4f697ed64fff86f203c247ce1ca0e5a",
"timestamp": "",
"source": "github",
"line_count": 984,
"max_line_length": 79,
"avg_line_length": 45.76829268292683,
"alnum_prop": 0.5619282351896261,
"repo_name": "afrolov1/nova",
"id": "3ead953e19e09a1b3eaecef72b978aeeeb1c5c2e",
"size": "45692"... |
import eventlet
import eventlet.db_pool
import base64
import hashlib
import os
from psycopg2 import IntegrityError
import logging
class Auth(object):
def __init__(self,salt):
self.salt = salt
self.log = logging.getLogger('fairywren.auth')
self.log.info('Created')
def _saltPwhash(self,pwHash):
if l... | {
"content_hash": "3e2ea34b69cb0718c3448c187d1f5172",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 125,
"avg_line_length": 22.478991596638654,
"alnum_prop": 0.6631775700934579,
"repo_name": "hydrogen18/fairywren",
"id": "0ee04ceda05f040ee0e1b8af7546a1fb9e0c462b",
"size"... |
import argparse
import sys
import urllib2
from scripts.checkUtil import working_directory
from subprocess import call
from subprocess import check_output
import scripts.CheckList as cl
def main():
args = parse_parameters(sys.argv)
project = args.dir
config = args.config
tasks = ''
if args.tasks :
... | {
"content_hash": "3961a6375e59a04850e8da38344cc786",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 116,
"avg_line_length": 32.58108108108108,
"alnum_prop": 0.6009954375777685,
"repo_name": "wickedoto/ApkParser",
"id": "08737bd24f1fbbe52038103da3cd629e47430e17",
"size": "... |
"""Extend the basic Accessory and Bridge functions."""
from datetime import timedelta
from functools import partial, wraps
from inspect import getmodule
import logging
from pyhap.accessory import Accessory, Bridge
from pyhap.accessory_driver import AccessoryDriver
from pyhap.const import CATEGORY_OTHER
from homeassis... | {
"content_hash": "b70c32121297087806c657767a498cea",
"timestamp": "",
"source": "github",
"line_count": 563,
"max_line_length": 88,
"avg_line_length": 34.62344582593251,
"alnum_prop": 0.6064741189144821,
"repo_name": "titilambert/home-assistant",
"id": "68b61772ce84a2fa69cc33f5ced5f77d92b1d9df",
"s... |
import errno
import logging
import re
import time
from net import gorpc
from vtdb import tablet2
from vtdb import dbexceptions
# NOTE(msolomon) this sketchy import allows upstream code to mostly interpret
# our exceptions as if they came from MySQLdb. Good for a cutover, probably
# bad long-term.
import MySQLdb as My... | {
"content_hash": "4f7fa873f5912653a1df19cdf07a1844",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 90,
"avg_line_length": 36.7434554973822,
"alnum_prop": 0.6675691080079795,
"repo_name": "oopos/vitess",
"id": "c387498ec60bf5d2e3cc9dec825d36af511065e6",
"size": "8566",
... |
import asyncio
from hello import HelloRemote, HelloRequest
from venom.rpc.comms.grpc import Client
client = Client(HelloRemote, 'localhost', 50053)
async def request_say_hello(name):
response = await client.invoke(HelloRemote.say_hello, HelloRequest(name=name))
print('response:', response.message)
loop = as... | {
"content_hash": "7a62fea902ab28de6b5e369bdf29f71c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 82,
"avg_line_length": 30.307692307692307,
"alnum_prop": 0.7690355329949239,
"repo_name": "biosustain/venom",
"id": "dc62771f8ad7dae8b2c69e148e770a9561587cca",
"size": "394... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: cs_role
short_description: Manages user roles on Apache CloudStack based clouds.
description:
- Create, update, delete user roles.
version_added:... | {
"content_hash": "34b60c42904671659f128d0ce1a39fdd",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 98,
"avg_line_length": 25.301980198019802,
"alnum_prop": 0.5666210135002935,
"repo_name": "SergeyCherepanov/ansible",
"id": "001cdf924ffa992059f7ec4ce96faf56bf5efb96",
"si... |
from __future__ import absolute_import
import re
import os
import xml.etree.ElementTree as ET
import json
import copy
from svtplay_dl.utils.urllib import urlparse, parse_qs, quote_plus, Cookie
from svtplay_dl.service import Service, OpenGraphThumbMixin
from svtplay_dl.utils import get_http_data, is_py2_old, filenamify... | {
"content_hash": "9d243214e4120ddcef6b846f65739ea7",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 156,
"avg_line_length": 39.97872340425532,
"alnum_prop": 0.5119744544970729,
"repo_name": "OakNinja/svtplay-dl",
"id": "3e2d361d52aa2b64b3da006f14cc9eb8c4631e51",
"size": ... |
"""
Abstraction for different Python Qt bindings.
Supported Python Qt bindings are PyQt4 and PySide.
The Qt modules can be imported like this:
from DTL.qt.QtCore import QObject
from DTL.qt import QtGui, loadUi
The name of the selected binding is available in QT_BINDING.
The version of the selected binding is availab... | {
"content_hash": "a115919ba77bad8cc78994daaf385b36",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 117,
"avg_line_length": 36.46875,
"alnum_prop": 0.7532133676092545,
"repo_name": "rocktavious/DevToolsLib",
"id": "eace3df21edd3dc7be7df76c07239274b8ebe681",
"size": "2778"... |
import sys
import libsinan.jsax
class SimpleTaskHandler(object):
def __init__(self):
self.event_type = None
self.type = None
self.desc = None
self.task = None
self.fault = None
def set_event_type(self, value):
self.event_type = value
def set_type(self, valu... | {
"content_hash": "14de25dc3fa8cfa4a489d6152ac08e16",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 92,
"avg_line_length": 26.57377049180328,
"alnum_prop": 0.5363972856261567,
"repo_name": "asceth/sinan",
"id": "b08ace63698b09a9cecc4def6314bc6dede42cd0",
"size": "3242",
... |
import os
import numpy as np
from utils import env_paths
from parmesan.datasets import load_mnist_realval
from data_helper import create_semi_supervised, pad_targets
def _download():
"""
Download the MNIST dataset if it is not present.
:return: The train, test and validation set.
"""
data = load_m... | {
"content_hash": "de99f3137a12a21fec3fe54b2029c89c",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 112,
"avg_line_length": 38.68181818181818,
"alnum_prop": 0.6551116333725029,
"repo_name": "JohnReid/auxiliary-deep-generative-models",
"id": "e8087fa2b2053e5eb47aa3b1c371048e... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='StatusPoint',
fields=[
('id', models.AutoField(auto... | {
"content_hash": "afc27e178fb69fd9be1f108dee90f0da",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 114,
"avg_line_length": 30.59259259259259,
"alnum_prop": 0.5472154963680388,
"repo_name": "LuckyMagpie/Ubi",
"id": "d871fadf865a28d8295f113461bc085c7ae15212",
"size": "898"... |
import netaddr
import testscenarios
from neutron.agent.linux import ip_lib
from neutron.agent.linux import ovs_lib
from neutron.agent.linux import utils
from neutron.common import constants as n_const
from neutron.openstack.common import uuidutils
from neutron.tests.functional import base as functional_base
from neutr... | {
"content_hash": "d0bb05f4306c5e3881f8735fa2c73347",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 79,
"avg_line_length": 35.954802259887,
"alnum_prop": 0.6134506599622879,
"repo_name": "cloudbase/neutron-virtualbox",
"id": "e822e1362b9aa7889101bf6eaa175f21839b105c",
"s... |
"""Tests for the Chrome Preferences file parser."""
import unittest
from plaso.parsers import chrome_preferences
from tests.parsers import test_lib
class ChromePreferencesParserTest(test_lib.ParserTestCase):
"""Tests for the Google Chrome Preferences file parser."""
def testParseFile(self):
"""Tests parsi... | {
"content_hash": "5deffb476b44e8ae2b063cf57c0f9604",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 78,
"avg_line_length": 38.55,
"alnum_prop": 0.6987678339818417,
"repo_name": "joachimmetz/plaso",
"id": "47858fa2e9df49f35d8736fac6fdf40b69f2e3f7",
"size": "3131",
"binar... |
import json
from os import makedirs
from os.path import dirname, exists
class Config(object):
_keys = (
'homedir', 'hostname', 'password', 'username',
)
@classmethod
def load(cls, filename):
makedirs(dirname(filename), exist_ok=True)
if exists(filename):
with ope... | {
"content_hash": "40670a4fc779bcb7e20aa850f4a40460",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 58,
"avg_line_length": 26.181818181818183,
"alnum_prop": 0.5543981481481481,
"repo_name": "MarkusH/django-vault-client",
"id": "1244c44e43c3009070de751088402f039bd40cf4",
"... |
from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from six import text_type
from zerver.decorator import to_non_negative_int
from zerver.lib.actions import do_update_pointer
from zerver.lib.request import has_request_variables, ... | {
"content_hash": "a504d2eb844d821a199be6bc71adb80f",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 79,
"avg_line_length": 36.69444444444444,
"alnum_prop": 0.7093111279333838,
"repo_name": "joyhchen/zulip",
"id": "890efba89520a891847f4cebf226327e06fefc8e",
"size": "1321",... |
"""Copyright 2008 Orbitz WorldWide
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | {
"content_hash": "1636a4727e3f5b4f3c0559511dcf48ad",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 103,
"avg_line_length": 32.32367149758454,
"alnum_prop": 0.7387535495441638,
"repo_name": "crocodoc/graphite",
"id": "c684064d16576f50aef2e3147fa0e93ccbe43cf0",
"size": "6... |
from sklearn import datasets
iris = datasets.load_iris()
X = iris.data
y = iris.target
from sklearn.cross_validation import train_test_split
# 150 in iris dataset, 75 for training, 75 for testing
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=.5)
# # decision tree
# from sklearn import tree
# my... | {
"content_hash": "a537739fe6559a40b2d3cb19f85feee7",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 71,
"avg_line_length": 27.583333333333332,
"alnum_prop": 0.7764350453172205,
"repo_name": "jacky-ttt/CodingEveryday",
"id": "ec10b3f92c74d3be4260b705bf7e993f49e3eb7b",
"siz... |
from typing import Dict
from .base import GenericTensor, Pipeline
# Can't use @add_end_docstrings(PIPELINE_INIT_ARGS) here because this one does not accept `binary_output`
class FeatureExtractionPipeline(Pipeline):
"""
Feature extraction pipeline using no model head. This pipeline extracts the hidden states ... | {
"content_hash": "ff4393eee198b7ea0e21a96515acb061",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 119,
"avg_line_length": 44.65714285714286,
"alnum_prop": 0.6508850501172958,
"repo_name": "huggingface/transformers",
"id": "212ad0a121972a84657e750f9a0bef88e7b46ac7",
"si... |
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify mult... | {
"content_hash": "74f6f33de6313bac1b076d2e7bd0edcb",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 78,
"avg_line_length": 29.246153846153845,
"alnum_prop": 0.6601788532351394,
"repo_name": "the-virtual-brain/tvb-hpc",
"id": "d0727ea4bf8bc1e4018a62cbf61a28db51072897",
"s... |
from csc.nl.euro import StemmedEuroNL
class NL(StemmedEuroNL):
def __init__(self):
super(NL, self).__init__('it')
| {
"content_hash": "18c9e92d790c597637c961cb91fcc2b6",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 38,
"avg_line_length": 25.4,
"alnum_prop": 0.6299212598425197,
"repo_name": "pbarton666/buzz_bot",
"id": "2b559b66060eee35f0b7a8de28271e66a8d46db5",
"size": "127",
"binary... |
'''
EPOW (Emergency POWer off)
--------------------------
This module tests the EPOW feature incase of FSP systems.
1. EPOW3Random.
Simulate random EPOW3 temperature to check whether
OPAL notify EPOW notification to Host OS. Once Host
gets notified Host should do a graceful shutdown.
2. EPOW3LOW
Simual... | {
"content_hash": "e06adae400178b8bfccf54f4200c2eda",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 108,
"avg_line_length": 39.19771863117871,
"alnum_prop": 0.5925889999029974,
"repo_name": "open-power/op-test-framework",
"id": "3a217237a86881ecd12347387225985aae875057",
... |
class WindowAdapter(object) :
def __init__(self, *mth, **kw) :
object.__init__(self)
for i, j in kw.items() :
setattr(self, i, j)
def windowActivated(self, e) :
pass
def windowClosed(self, e) :
pass
def windowClosing(self, e) :
pass... | {
"content_hash": "dc178af588ad5073cf2d160c8562937b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 37,
"avg_line_length": 19.814814814814813,
"alnum_prop": 0.497196261682243,
"repo_name": "rrader/jpype",
"id": "0826ee0d90884e03e1b83bc516dd0151fc07dd41",
"size": "535",
... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/weapon/shared_base_vibro_unit_enhancement.iff"
result.attribute_template_id = -1
result.stfName("craft_weapon_ingredients_n","blade_vibro_unit_enhancement")
#### BEGIN MODIFICATIONS ####
#### EN... | {
"content_hash": "debc48cafde7c5afb656a8eb0e1a9a4d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 92,
"avg_line_length": 27.53846153846154,
"alnum_prop": 0.723463687150838,
"repo_name": "obi-two/Rebelion",
"id": "a191d343d8a617d057dbef771c6ce40dc302a525",
"size": "503",... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('participants', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', mode... | {
"content_hash": "4f2b8ba5096632e902f064c0275b5761",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 114,
"avg_line_length": 33.90243902439025,
"alnum_prop": 0.5424460431654676,
"repo_name": "kkujawinski/talktoyourapp",
"id": "d57361ebad097d909167f205ab843fc630f6bf49",
"si... |
from yafblog import app
app.run()
| {
"content_hash": "d3b112a4ba613d0b2426e8b95e2a631e",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 23,
"avg_line_length": 17,
"alnum_prop": 0.7647058823529411,
"repo_name": "suligap/yafblog",
"id": "427d7543222d31b16b0410f169eeb658f1e6de04",
"size": "34",
"binary": fals... |
"""Mapping for additional replays for battles
Revision ID: 533b503ed449
Revises: 5a5fa1c1dc8e
Create Date: 2014-03-27 20:41:56.503403
"""
# revision identifiers, used by Alembic.
revision = '533b503ed449'
down_revision = '5a5fa1c1dc8e'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_colum... | {
"content_hash": "fe1192f2e18690daf20149a57a41926a",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 91,
"avg_line_length": 25.166666666666668,
"alnum_prop": 0.7235099337748344,
"repo_name": "ceari/whyattend",
"id": "8c5be93f5f2862728583bdf750d97f01520a0af3",
"size": "604"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('bongo', '0003_auto_20141226_1717'),
]
operations = [
migrations.AlterField(
model_name='tip',
name='respond_to',
... | {
"content_hash": "9aa03bd99e570f7533387f8be001bb16",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 75,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.5970149253731343,
"repo_name": "BowdoinOrient/bongo",
"id": "8a62d3d6fffb63b275d23df333d0893edea64ce0",
"size": "... |
import utils
class plugin_inject:
def __init__(self, parent, content, position, arguments):
if len(arguments) == 1:
srvName = arguments[0]
if not srvName in parent.objects:
objectName = utils.genObjectName(srvName)
parent.objects[srvName] = objectNam... | {
"content_hash": "7317cae674680bfa7352737e59a6fba8",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 100,
"avg_line_length": 39,
"alnum_prop": 0.5571095571095571,
"repo_name": "OlegGS/acpp",
"id": "0e81c32e453d38f21a07860b4a0f88f8249d8af6",
"size": "858",
"binary": false... |
"""Broadcast operators"""
from __future__ import absolute_import as _abs
from . import cpp as _cpp
def broadcast_to(data, shape):
"""Broadcast the src to the target shape
We follows the numpy broadcasting rule.
See also https://docs.scipy.org/doc/numpy/user/basics.broadcasting.html
Parameters
--... | {
"content_hash": "8b78b31bd596b8075a41eca9a1156ac5",
"timestamp": "",
"source": "github",
"line_count": 512,
"max_line_length": 75,
"avg_line_length": 21.265625,
"alnum_prop": 0.5798126377663483,
"repo_name": "Laurawly/tvm-1",
"id": "2b350ff817d993c7649e2adf66ea79644df029ff",
"size": "11673",
"bi... |
import threading
import unittest
import os
import sys
try:
import pydevconsole
except:
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import pydevconsole
from pydev_imports import xmlrpclib, SimpleXMLRPCServer
from pydev_localhost import get_localhost
try:
raw_input
raw_input_name = '... | {
"content_hash": "96b0a40a1b1973d1ba6da3d1567abf5c",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 143,
"avg_line_length": 37.75968992248062,
"alnum_prop": 0.5269965099568877,
"repo_name": "liangazhou/django-rdp",
"id": "10a62260c84e6394925da9f4fd185669309ff1f3",
"size"... |
from rest_framework import serializers
from spiderhandler.models import QueryJob, QQInfo, WeiboInfo
class QueryRecordSerializer(serializers.ModelSerializer):
class Meta:
model = QueryJob
fields = ('createDate', 'username',
'forUserQQId', 'forUserWeiboId', 'forUserZhihuId',
... | {
"content_hash": "b3279d1ebdf3cf962a2efc2673b200f9",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 100,
"avg_line_length": 42.47727272727273,
"alnum_prop": 0.6655965757089353,
"repo_name": "zzhy1996/chase-or-not",
"id": "6e5daa024f01528b22cb010cf48f60d1858af4f6",
"size":... |
from __future__ import print_function
import pyrax
import os
import json
from docopt import docopt
USAGE = """Get some nodes from an application environment
Usage:
get-nodes.py APP_NAME ENVIRONMENT ROLE
get-nodes.py (-h | --help)
get-nodes.py --version
Arguments:
APP_NAME The application namesp... | {
"content_hash": "a3b1765f55ed44187fc25316a457e1a1",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 98,
"avg_line_length": 30.140625,
"alnum_prop": 0.656298600311042,
"repo_name": "iskandar/windows-automation-demo",
"id": "7c2beb23680b7ed22986a7352b2c7f928679a9e4",
"size"... |
"""Registrations for LinearOperator.matmul."""
from tensorflow.python.ops.linalg import linear_operator
from tensorflow.python.ops.linalg import linear_operator_algebra
from tensorflow.python.ops.linalg import linear_operator_block_diag
from tensorflow.python.ops.linalg import linear_operator_circulant
from tensorflow... | {
"content_hash": "8da99ea8b93e066f89a6da4e3c34c742",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 78,
"avg_line_length": 40.31277533039648,
"alnum_prop": 0.7378428587039668,
"repo_name": "tensorflow/tensorflow-experimental_link_static_libraries_once",
"id": "662a5b5e6f06... |
"""
clint.textui.prompt
~~~~~~~~~~~~~~~~~~~
Module for simple interactive prompts handling
"""
from __future__ import absolute_import, print_function
from re import match, I
from .core import puts
from .colored import yellow
from .validators import RegexValidator, OptionValidator
try:
raw_input
except NameErr... | {
"content_hash": "7766939be6e1c14db5f5a032902b1ef2",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 125,
"avg_line_length": 29.261111111111113,
"alnum_prop": 0.5657869755078793,
"repo_name": "dataworkshop/prerequisite",
"id": "7995e972f8152155068209b46e194a5dac74e420",
"... |
from openerp import fields, models
class MailMessageSubtype(models.Model):
""" Class holding subtype definition for messages. Subtypes allow to tune
the follower subscription, allowing only some subtypes to be pushed
on the Wall. """
_name = 'mail.message.subtype'
_description = 'Message s... | {
"content_hash": "03793dd7e26d09762821beb460064a52",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 120,
"avg_line_length": 57.12820512820513,
"alnum_prop": 0.6741472172351886,
"repo_name": "vileopratama/vitech",
"id": "0f2316a19b710262d2d0a6049b99e0c0d4794689",
"size": "... |
import logging
import sys
# Separated from util to allow test-config tool to run in under 2 seconds
def get_logger(name):
logger = logging.getLogger(name)
logger.setLevel(logging.INFO)
ch = logging.StreamHandler(sys.stderr)
ch.setLevel(logging.INFO)
formatter = logging.Formatter(fmt='%(asctime)s [... | {
"content_hash": "0919155ca2653ebf23fbb187d56aa213",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 73,
"avg_line_length": 32.88235294117647,
"alnum_prop": 0.6100178890876565,
"repo_name": "cloudify-cosmo/cloudify-system-tests",
"id": "0fa1d174eb9e4e266d31f23e81154721d1ac24... |
import sys
import os.path
if sys.version_info[0] == 2 and sys.version_info[1] == 6:
# py26 needs backport unittest2
import unittest2 as unittest
else:
import unittest
if sys.version_info[0] == 2 and sys.version_info[1] == 7:
# py27 and py31 assertRaisesRegexp was renamed in py32 to assertRaisesReg... | {
"content_hash": "f72a09dce26d768d56ce1c4c78c8d7d6",
"timestamp": "",
"source": "github",
"line_count": 398,
"max_line_length": 98,
"avg_line_length": 50.46733668341709,
"alnum_prop": 0.6519466294931793,
"repo_name": "savagecm/TestLink-API-Python-client",
"id": "4c030fba425bf057ebb71be46eb315ccd2e339... |
"""Implement Gerrit Code Review API"""
| {
"content_hash": "c1432d55ca7ced737f44ea4c8aff4bcc",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 38,
"avg_line_length": 39,
"alnum_prop": 0.717948717948718,
"repo_name": "JcDelay/pycr",
"id": "4ebeb8109abce34cc592f12fb3da146a8bcdd514",
"size": "39",
"binary": false,
... |
from django.conf import settings
from django.core.management import call_command
from django.db import connection
from django.test import TestCase
from tenant_schemas.utils import get_public_schema_name, get_tenant_model
ALLOWED_TEST_DOMAIN = '.test.com'
class TenantTestCase(TestCase):
@classmethod
def add_... | {
"content_hash": "11f876ea00dd2f97de11f9d690124937",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 112,
"avg_line_length": 33.01449275362319,
"alnum_prop": 0.6575943810359964,
"repo_name": "mcanaves/django-tenant-schemas",
"id": "d7a92f8e3238d5e9956a23cf7a6f9844347ac280",
... |
import sys
import os
import shutil
import glob
# This is Debian control file in a skeleton reusable block
control_skeleton='''
Maintainer: Albert Casals <skarbat@gmail.com>
Section: others
Package: {pkg_name}
Version: {pkg_version}
Conflicts: libqt5all-dev (<= 5.7-1)
Architecture: armhf
Depends: debconf (>= 0.5.00), ... | {
"content_hash": "50777742125a620e931cf4b00e11baf3",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 134,
"avg_line_length": 33.6013986013986,
"alnum_prop": 0.6297606659729449,
"repo_name": "pipaos/qt5-rpi",
"id": "f4a2bf901e9996a90d3ae025a36dbad28b684277",
"size": "4851"... |
import rospy
from map_labelling.srv import GoToLocation, GoToLocationResponse, MotionStatus,MotionStatusResponse
import random
locations = [ "grasp",
"charitys_office",
"vending_machines",
"levine_far_corner",
"towne_311",
"towne_321",
"to_skirkanich",
"empty_spot",
"bio_lab" ]
... | {
"content_hash": "136505bec8df725a77a4e10c5d4c1890",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 105,
"avg_line_length": 24.302083333333332,
"alnum_prop": 0.6318045435062152,
"repo_name": "GRASP-ML/ServiceRobots",
"id": "fe3cd442ab88bb56a247095c7954987063059e8b",
"size... |
""" Example TAL program
Copyright (c) 2009 Colin Stewart (http://www.owlfish.com/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above c... | {
"content_hash": "15f4ab92c0162fbd6a297df3cddd15e8",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 75,
"avg_line_length": 39.80952380952381,
"alnum_prop": 0.7599681020733652,
"repo_name": "g2p/SimpleTAL",
"id": "2563fd3458e6d5785ddfb743e1c917ba592230ab",
"size": "2526",
... |
from paver.easy import *
from paver import doctools
from paver.setuputils import setup
options(
sphinx=Bunch(builddir=".build"),
)
def sphinx_builddir(options):
return path("docs") / options.sphinx.builddir / "html"
@task
def clean_docs(options):
sphinx_builddir(options).rmtree()
@task
@needs("cle... | {
"content_hash": "13900d7da54dd50646140fc426df6c81",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 75,
"avg_line_length": 20.931972789115648,
"alnum_prop": 0.631459213519662,
"repo_name": "dbbhattacharya/kitsune",
"id": "1b7e4a6f2a1f786ca8faa9b0f1e3f503ef493063",
"size"... |
"""Philips Hue sensors platform tests."""
import asyncio
from unittest.mock import Mock
import aiohue
from homeassistant.components import hue
from homeassistant.components.hue.const import ATTR_HUE_EVENT
from homeassistant.components.hue.v1 import sensor_base
from homeassistant.helpers.entity import EntityCategory
f... | {
"content_hash": "9a71e8491dc1eb341cc81faf66c02497",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 86,
"avg_line_length": 35.34761120263592,
"alnum_prop": 0.613627889634601,
"repo_name": "w1ll1am23/home-assistant",
"id": "acefbdd07fec974b62d7f6b130a534fa2e41ac89",
"size... |
from ztag.annotation import Annotation
from ztag.annotation import Manufacturer
from ztag import protocols
import ztag.test
import re
class FtpNetApp(Annotation):
name = "NetApp FTP Server"
protocol = protocols.FTP
subprotocol = protocols.FTP.BANNER
port = None
manufact_re = re.compile(
"... | {
"content_hash": "35d5a11542ca041ad048bf15f5556452",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 78,
"avg_line_length": 25.520833333333332,
"alnum_prop": 0.5551020408163265,
"repo_name": "zmap/ztag",
"id": "0bbdfe4c511220fa530b873fe59c2a70a3f19a84",
"size": "1225",
"... |
"""Module for outputting test record to JSON-formatted files."""
import base64
from json import JSONEncoder
from openhtf.output import callbacks
from openhtf.util import data
class OutputToJSON(callbacks.OutputToFile):
"""Return an output callback that writes JSON Test Records.
Example filename_patterns might ... | {
"content_hash": "148dc39d2a6a4725eabf5137a55e5e84",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 79,
"avg_line_length": 41.0625,
"alnum_prop": 0.6996448503297819,
"repo_name": "fahhem/openhtf",
"id": "41f5e4e3b504cdb9cdd5fb7d8b128952372b42fb",
"size": "1971",
"binary... |
"""
Script to format python requests responses as
HTTP text.
"""
import six
import benchline.args
def format_response(protocol, status_code, reason, headers_dict, body):
"""Formats the response items as an HTTP response
>>> format_response("HTTP/1.1", "200", "OK", {"Content-type": "text/plain"}, "this is the... | {
"content_hash": "33dc23f04e06a774c47c4a1d250b968c",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 113,
"avg_line_length": 34.21951219512195,
"alnum_prop": 0.6557377049180327,
"repo_name": "pauldeden/benchline",
"id": "e0f900d1d0f95f9d20e7b9ca64d9f6520d446d5a",
"size": "... |
from urllib.parse import unquote
from azure.core.paging import PageIterator, ItemPaged
from azure.core.exceptions import HttpResponseError
from ._deserialize import (
get_blob_properties_from_generated_code,
load_many_xml_nodes,
load_xml_int,
load_xml_string,
parse_tags,
)
from ._generated.models ... | {
"content_hash": "e1ce5398239326e324e48b13a6ba5713",
"timestamp": "",
"source": "github",
"line_count": 327,
"max_line_length": 100,
"avg_line_length": 44.027522935779814,
"alnum_prop": 0.6675696325623394,
"repo_name": "Azure/azure-sdk-for-python",
"id": "6bbaa71c404f80ea571b283184b522c2eab0afb6",
... |
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8... | {
"content_hash": "fa74b6f7956672ee0cf89ea99e540450",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 86,
"avg_line_length": 32.50704225352113,
"alnum_prop": 0.6451473136915078,
"repo_name": "sorreltree/multienum",
"id": "7408d3f2b90b40919ccac60215b57cc84b84cf9e",
"size": "... |
from tempest.api.identity import base
from tempest import test
class ExtensionTestJSON(base.BaseIdentityV2AdminTest):
_interface = 'json'
@test.attr(type='gate')
def test_list_extensions(self):
# List all the extensions
resp, body = self.non_admin_client.list_extensions()
self.ass... | {
"content_hash": "fd72e2e23b855c1d0f313824e7b36a2b",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 60,
"avg_line_length": 29.272727272727273,
"alnum_prop": 0.6319875776397516,
"repo_name": "vedujoshi/os_tempest",
"id": "67f20f43ee4031ad3725fd2436cd27f3cdc91fdf",
"size": ... |
from __future__ import absolute_import
from datetime import datetime
from django.core.urlresolvers import reverse
from sentry.models import Release, ReleaseCommit, ReleaseProject
from sentry.testutils import APITestCase
class ProjectReleaseListTest(APITestCase):
def test_simple(self):
self.login_as(user... | {
"content_hash": "7d955a39b0709537e103422f9bb594a1",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 98,
"avg_line_length": 30.783382789317507,
"alnum_prop": 0.5380759591285907,
"repo_name": "gencer/sentry",
"id": "c4dc74eb0c500d07fd342336f1abf2b3b71372ad",
"size": "10374... |
"""SCons.Tool.mslink
Tool-specific initialization for the Microsoft linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ... | {
"content_hash": "1a178b250beb35dad71183e8f936d652",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 149,
"avg_line_length": 42.30503144654088,
"alnum_prop": 0.6708540845907975,
"repo_name": "Dwii/Master-Thesis",
"id": "ac533c8dcae6d87507c1d985913133221987b4e2",
"size": "... |
import sqlite3
con = sqlite3.connect(":memory:")
con.execute("create table person (id integer primary key, firstname varchar unique)")
# Successful, con.commit() is called automatically afterwards
with con:
con.execute("insert into person(firstname) values (?)", ("Joe",))
# con.rollback() is called after the wit... | {
"content_hash": "7f6c49f511c1c8cd72b7cb4bdca98ddb",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 85,
"avg_line_length": 35.375,
"alnum_prop": 0.7208480565371025,
"repo_name": "mollstam/UnrealPy",
"id": "d6f27e6b2282adaf1909925ea8043a79ffa8f793",
"size": "566",
"binar... |
import os
import pytest
from pymt import models
MODELS = [models.__dict__[name] for name in models.__all__]
MODELS.sort(key=lambda item: item.__name__)
@pytest.mark.parametrize("cls", MODELS)
def test_model_setup(cls):
model = cls()
args = model.setup()
assert os.path.isfile(os.path.join(args[1], args... | {
"content_hash": "4530b06586e4f4f6f820a620995d9772",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 59,
"avg_line_length": 21.53488372093023,
"alnum_prop": 0.6684665226781857,
"repo_name": "csdms/coupling",
"id": "eb4d9551632711e1a96e7ae7e71acfe096ce0c02",
"size": "949",
... |
import os
import sys
from django.utils.importlib import import_module
def setup_environ(dunder_file=None, project_path=None, relative_project_path=None, settings_path=None):
assert not (dunder_file and project_path), ("You must not specify both "
"__file__ and project_path")
if dunder_file is no... | {
"content_hash": "5f122c23b23d3149dc3012a14449fb02",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 103,
"avg_line_length": 37.97222222222222,
"alnum_prop": 0.6708119970738844,
"repo_name": "espenak/pinax-oldversion-backup",
"id": "89841027a30a9bd0de47d673fef8948d6a506ef1",... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipes', '0002_recipecollection_title'),
]
operations = [
migrations.CreateModel(
name='Tag',
fields=[
('id'... | {
"content_hash": "50759aa2b0d7cebab0d25a72bbfeaa0b",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 114,
"avg_line_length": 28.428571428571427,
"alnum_prop": 0.5402010050251256,
"repo_name": "agnethesoraa/recipemaster",
"id": "1bbbd969c967d9d32547d814938484f498aacb8b",
"s... |
from django.contrib.auth.password_validation import validate_password
from django.core.exceptions import ValidationError
from django.http import Http404
from rest_framework import serializers
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_re... | {
"content_hash": "265d4ac7dd65e32ca7d55220d5d4df38",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 106,
"avg_line_length": 37.24031007751938,
"alnum_prop": 0.7214820982514571,
"repo_name": "szopu/django-rest-registration",
"id": "6fe46a9312cab4ae6edd430682a44ba6025e4ae7",... |
from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
from unicore.webhooks import models
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# ... | {
"content_hash": "63d8d78203f7dc28ad5123023b891103",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 69,
"avg_line_length": 28.757142857142856,
"alnum_prop": 0.7098857426726279,
"repo_name": "universalcore/unicore.distribute",
"id": "cc8d634e0c14cac6907f1fe9949678609c88a972"... |
from django.test import TestCase
from utils import get_random_entry
from models import ExampleModel
class ExampleAppTest(TestCase):
def test_get_random_entry_test(self):
entry = get_random_entry()
self.assertEquals(type(entry), ExampleModel)
self.assertGreater(len(entry.name), 0)
self.assertGreater(len(entry.... | {
"content_hash": "ca3da1625fe92ce64d22215c750ee452",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 47,
"avg_line_length": 29.307692307692307,
"alnum_prop": 0.7690288713910761,
"repo_name": "tnajdek/django-kendoui-backend",
"id": "67c56f37681e46e0ba6a864a47800bb8dc1d912c",
... |
import base64
import copy
import datetime
import functools
import iso8601
import os
import string
import tempfile
import fixtures
import mock
from oslo.config import cfg
from nova.api.ec2 import cloud
from nova.api.ec2 import ec2utils
from nova.api.ec2 import inst_state
from nova.api.metadata import password
from nov... | {
"content_hash": "93cd05e4505b1b0e96fe81c0871cfcce",
"timestamp": "",
"source": "github",
"line_count": 3138,
"max_line_length": 79,
"avg_line_length": 44.80752071383046,
"alnum_prop": 0.5221256560886449,
"repo_name": "CiscoSystems/nova",
"id": "f94d9b351ec1510e9f78bd8403181cdc1bd913de",
"size": "1... |
from django.shortcuts import render,redirect
from django.http import HttpResponse
from PIL import Image
from StringIO import StringIO
import ImageFilter
import random, math
'''
def is_point_inside(p, im):
return p[0] >= 0 and p[1] >= 0 and p[0] < im.size[0] and p[1] < im.size[1]
def getgray(rgb):
return (rgb[0] + r... | {
"content_hash": "efa7426974f99a7715d7635138565e8e",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 28.556962025316455,
"alnum_prop": 0.6591312056737588,
"repo_name": "Socialsquare/WhiteboardCamera",
"id": "22f9bd27dcf9cd329e25676cb0cc5af30d233e49",
... |
class RecursionError( OverflowError, ValueError ):
'''Unable to calculate result because of recursive structure'''
def sort(nodes, routes, noRecursion=1):
'''Passed a list of node IDs and a list of source,dest ID routes
attempt to create a list of stages where each sub list
is one stage in a process.
... | {
"content_hash": "13779d4cf654d096cce48d2bd8d5507e",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 82,
"avg_line_length": 33.21825396825397,
"alnum_prop": 0.5203679369250985,
"repo_name": "flavour/eden",
"id": "7ce233717ce16f5db6be9106e6dabba67e602c9e",
"size": "8622",
... |
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
fro... | {
"content_hash": "c6fc3a75ad4e7f335df713ef0359ddff",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 79,
"avg_line_length": 32.98461538461538,
"alnum_prop": 0.6884328358208955,
"repo_name": "feinheit/zipfelchappe",
"id": "a54ef3ffde41757f2c572375451a5278afe1eb38",
"size": ... |
from django.views.generic import DetailView, ListView
from core.mixins import ConveneTimeMixin
from explainers.models import Explainer
class ExplainerListDetail(ConveneTimeMixin, ListView):
queryset = Explainer.objects.all().published()
template_name = 'pages/explainer-landing.html'
class ExplainerDetail(... | {
"content_hash": "8544950c82a90fc8671e1bd38904c59e",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 54,
"avg_line_length": 27.733333333333334,
"alnum_prop": 0.7884615384615384,
"repo_name": "texastribune/txlege84",
"id": "f875a1032717bccc89a931342b24bbea137e81f5",
"size":... |
from django.db.models import Q
from .models import UserProfile
class TestUserBackend(object):
"""Authentication backend to easily log in a user while testing."""
def authenticate(self, request=None, username=None, email=None,
password=None):
# This needs to explicitly throw when... | {
"content_hash": "c73f5b99c94740a731c0f615f8e6fcad",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 78,
"avg_line_length": 30.692307692307693,
"alnum_prop": 0.6349206349206349,
"repo_name": "psiinon/addons-server",
"id": "8c74798a9d1f442c38c089c16500b21c4343de67",
"size":... |
from juriscraper.opinions.united_states.state import tex
class Site(tex.Site):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.court_id = self.__module__
self.court_name = "capp_5"
| {
"content_hash": "8e5dad56299ecc90f8c16b83ba86e101",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 56,
"avg_line_length": 29.875,
"alnum_prop": 0.602510460251046,
"repo_name": "freelawproject/juriscraper",
"id": "c1a9d27619eebca920c2912dadc41dd7f2e95ffc",
"size": "384",
... |
import logging
import time
from typing import Any, Dict
from datetime import timedelta
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import transaction
from django.utils.timezone import now as timezone_now
from zerver.lib.context_managers import lockfile
from zerv... | {
"content_hash": "225b6e1b95b52181ab62acf855015a3d",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 101,
"avg_line_length": 44.1578947368421,
"alnum_prop": 0.6769964243146603,
"repo_name": "dhcrzf/zulip",
"id": "9c04e8526c4494f50cd4123372fa3e992da061cb",
"size": "3356",
... |
from __future__ import absolute_import, unicode_literals
import unittest
import mock
import pykka
from mopidy import backend, core
from mopidy.internal import deprecation
from mopidy.models import Track
from tests import dummy_audio
class TestPlaybackProvider(backend.PlaybackProvider):
def __init__(self, au... | {
"content_hash": "6fbafea088360044f0e5906d6f16196c",
"timestamp": "",
"source": "github",
"line_count": 1233,
"max_line_length": 79,
"avg_line_length": 32.96918085969181,
"alnum_prop": 0.617057390962092,
"repo_name": "vrs01/mopidy",
"id": "34c9d367600a791155b13c741b46c45e82004336",
"size": "40651",... |
"""Test helper functions"""
import pathlib
import tempfile
import warnings
import zipfile
import numpy as np
from scipy.ndimage import rotate
def create_test_sino_2d(A=9, N=22, max_phase=5.0,
ampl_range=(1.0, 1.0)):
"""
Creates 2D test sinogram for optical diffraction tomography.
... | {
"content_hash": "6508ecb0048d0e907d4d008c385c39ce",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 76,
"avg_line_length": 32.173010380622834,
"alnum_prop": 0.5672187567218757,
"repo_name": "RI-imaging/ODTbrain",
"id": "94f326964f2cda1da4d2b6abb2dffca3ccc6d134",
"size": ... |
"""
Gaussian Mixture Models.
This implementation corresponds to frequentist (non-Bayesian) formulation
of Gaussian Mixture Models.
"""
# Author: Ron Weiss <ronweiss@gmail.com>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Bertrand Thirion <bertrand.thirion@inria.fr>
import numpy as np
from scipy i... | {
"content_hash": "49c50ad90c39a31b906eb7fd8f6754cd",
"timestamp": "",
"source": "github",
"line_count": 715,
"max_line_length": 79,
"avg_line_length": 37.62937062937063,
"alnum_prop": 0.5661401226537818,
"repo_name": "bigdataelephants/scikit-learn",
"id": "c9f252dc7ffe9e6557bc3777b79273e1bb98b800",
... |
import hashlib
import os
import tempfile
from attic.hashindex import NSIndex, ChunkIndex
from attic.testsuite import AtticTestCase
class HashIndexTestCase(AtticTestCase):
def _generic_test(self, cls, make_value, sha):
idx = cls()
self.assert_equal(len(idx), 0)
# Test set
for x in ... | {
"content_hash": "3a1499b98b122f98faa23a8770907a0d",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 127,
"avg_line_length": 38.42857142857143,
"alnum_prop": 0.5809395065900642,
"repo_name": "pombredanne/attic",
"id": "1f6aa22aa8a09c0817aea494ecb1a0feac1e017a",
"size": "29... |
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import ConfigParser, os, platform, subprocess, sys, json
from copy_reg import add_extension
# globals
prefs = {}
main_wnd = None
# register module path
mod_path = os.path.normpath(os.path.dirname(os.path.abspath(__file__)) + '/../pymodules')
sys.path.append(mod_pa... | {
"content_hash": "be625f2a7c3760e276845e263de12a00",
"timestamp": "",
"source": "github",
"line_count": 956,
"max_line_length": 100,
"avg_line_length": 40.65481171548117,
"alnum_prop": 0.5885092368651264,
"repo_name": "UPO33/darkhammer",
"id": "57c44200994f6301180438ae597d2428a0a3b0d9",
"size": "38... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
---
module: bigip_command
short_description: Run TMSH and BASH ... | {
"content_hash": "eb8ac32062b43bbd351c8bc7cad84a2d",
"timestamp": "",
"source": "github",
"line_count": 714,
"max_line_length": 104,
"avg_line_length": 32.76890756302521,
"alnum_prop": 0.593623114074454,
"repo_name": "SergeyCherepanov/ansible",
"id": "e312eabf504b4ce8029a2dba6b73373f0c30a4e1",
"siz... |
""" S3 Framework Tables
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including w... | {
"content_hash": "5d67925edc0c41f5ab736396e496a62b",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 83,
"avg_line_length": 36.484848484848484,
"alnum_prop": 0.5348837209302325,
"repo_name": "flavour/Turkey",
"id": "09e4042fad51bb4844d5e91dcab0fb8ee1ebeaf8",
"size": "2433"... |
from calendar import month_name
from collections import defaultdict
from django.http import Http404
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.contrib import messages
from django.shortcuts import get_object_or_404
from django.core.urlresolvers imp... | {
"content_hash": "241703dd1ecfbb5c486a64d81162f659",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 133,
"avg_line_length": 41.214765100671144,
"alnum_prop": 0.621885686370298,
"repo_name": "dfalk/mezzanine-wiki",
"id": "83006cf982fbf1c93dd606c06d3f8ae23b251db2",
"size":... |
"""Implementation of Transformer networks.
Size glossary:
* Batch size (B).
* Sequence length (N).
* Memory size (M). The size of the optional memory, passed in via `state`.
* Number of heads (H): the number of attention heads.
* Value size (V): the size of each value embedding per head.
* Key size (K): th... | {
"content_hash": "27aeb116b4ef448818ac9a33a331c21b",
"timestamp": "",
"source": "github",
"line_count": 651,
"max_line_length": 82,
"avg_line_length": 38.93855606758832,
"alnum_prop": 0.6366326087814115,
"repo_name": "deepmind/deepmind-research",
"id": "c1b547420df635b8415f7a1a216f1ec1f7e4d027",
"s... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notifications', '0008_vacuum_content'),
]
operations = [
migrations.AddField(
model_name='statusupdate',
name='previous_stat... | {
"content_hash": "decb8cc5352434883452e8a54d004512",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 257,
"avg_line_length": 38.73913043478261,
"alnum_prop": 0.5589225589225589,
"repo_name": "CDE-UNIBE/qcat",
"id": "7e41466ac5b46c2223e130438554ed7f0809ee67",
"size": "965",... |
"""
Kubeflow Pipelines API
This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition.
Contact: kubeflow-pipelines@google.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import d... | {
"content_hash": "3bb2f0c2fc5c85969cce38230e59ed31",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 124,
"avg_line_length": 33.225806451612904,
"alnum_prop": 0.5839805825242719,
"repo_name": "kubeflow/pipelines",
"id": "fceb87dc323cfbebcae8f8c3ab6908fc368776a0",
"size": "... |
from apps.account import views as account_views
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from rest_framework import routers
router = routers.DefaultRouter(trailing_slash=False)
urlpatterns = [
# account
... | {
"content_hash": "28b4402c57f658f1930da197f4e19244",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 80,
"avg_line_length": 32.541666666666664,
"alnum_prop": 0.7323943661971831,
"repo_name": "RonquilloAeon/django-golden-image",
"id": "825407408df741b1d4f236fbe53aa5f836bc406a... |
import ddt
import mock
from nova import exception
from nova.network import model
from os_win import constants as os_win_const
import compute_hyperv.nova.conf
from compute_hyperv.nova import vif
from compute_hyperv.tests.unit import test_base
CONF = compute_hyperv.nova.conf.CONF
class HyperVNovaNetworkVIFPluginTest... | {
"content_hash": "77a2fa3f30df8e17126d7ff65d364219",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 77,
"avg_line_length": 39.15384615384615,
"alnum_prop": 0.6467226290409002,
"repo_name": "stackforge/compute-hyperv",
"id": "385161c405eec26c2d4a2b72825374d09d31e797",
"si... |
"""This component provides basic support for Foscam IP cameras."""
from __future__ import annotations
import asyncio
from libpyfoscam import FoscamCamera
import voluptuous as vol
from homeassistant.components.camera import SUPPORT_STREAM, Camera
from homeassistant.config_entries import ConfigEntry
from homeassistant... | {
"content_hash": "89e4606021e477d028f0c9c21eef16df",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 128,
"avg_line_length": 31.161943319838056,
"alnum_prop": 0.5799662206054307,
"repo_name": "GenericStudent/home-assistant",
"id": "eee1e136af060445b2650a63d7c2c4f08c79b0fb",... |
from __future__ import absolute_import
import rules
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import reverse
from django.utils.encoding import force_str
from rest_framework.test import APITestCase
from testapp.models import Book
from testa... | {
"content_hash": "c7fd24e6284e5818ce20b60b79fe9895",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 81,
"avg_line_length": 42.979166666666664,
"alnum_prop": 0.6970431410567135,
"repo_name": "escodebar/django-rest-framework-rules",
"id": "907a5636d25698e226e6a64bea51212836d0... |
from __future__ import unicode_literals
import unittest
from guardian.conf import settings as guardian_settings
from django.conf import settings
from django.conf import UserSettingsHolder
from django.utils.functional import wraps
def skipUnlessTestApp(obj):
app = 'guardian.testapp'
return unittest.skipUnless(... | {
"content_hash": "7431ba814e4a645548ce4f0014984ae1",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 86,
"avg_line_length": 35.52564102564103,
"alnum_prop": 0.6261277517141826,
"repo_name": "rmgorman/django-guardian",
"id": "3d17951dcc8dc6f4021b8e4b5efa4614e0232619",
"size... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bustime.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "aff72bd99b22ffea8c63430593777077",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 71,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.7105263157894737,
"repo_name": "norn/bustime",
"id": "23a757828be3a9393976eb4870e56bf0e1e3738e",
"size": "250",
... |
from typing import List
from RULEngine.Game.OurPlayer import OurPlayer
from RULEngine.Util.Pose import Pose
from RULEngine.Util.Position import Position
from RULEngine.Util.geometry import get_distance, conv_position_2_list, remove_duplicates
from ai.Algorithm.IntelligentModule import Pathfinder
from ai.states.world_s... | {
"content_hash": "0f27cb4e198446e79f71ffdfe3753e48",
"timestamp": "",
"source": "github",
"line_count": 465,
"max_line_length": 124,
"avg_line_length": 46.1247311827957,
"alnum_prop": 0.5413558373741142,
"repo_name": "MaximeGLegault/StrategyIA",
"id": "d1452358fc4949f7b552cfdbdcfb85b6a430ee50",
"si... |
import unittest
from test import test_support
import string
import StringIO
mimetools = test_support.import_module("mimetools", deprecated=True)
msgtext1 = mimetools.Message(StringIO.StringIO(
"""Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Foo!
"""))
c... | {
"content_hash": "35ee3f8090cf15c3fc631ddf5d99bbda",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 81,
"avg_line_length": 34.58490566037736,
"alnum_prop": 0.5984724495362793,
"repo_name": "babyliynfg/cross",
"id": "f754b78b35458e3b36c142e7d8fd6d42b2ba75e3",
"size": "1833... |
import os
import pprint
from mediafire import MediaFireApi
APP_ID = '42511'
MEDIAFIRE_EMAIL = os.environ["MEDIAFIRE_EMAIL"]
MEDIAFIRE_PASSWORD = os.environ["MEDIAFIRE_PASSWORD"]
pp = pprint.PrettyPrinter(indent=2)
api = MediaFireApi()
session = api.user_get_session_token(
app_id=APP_ID, email=MEDIAFIRE_EMAIL, ... | {
"content_hash": "f0f5757c088a8d195b9e835d8f916272",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 70,
"avg_line_length": 23.9,
"alnum_prop": 0.7433751743375174,
"repo_name": "roman-yepishev/mediafire-python-open-sdk",
"id": "1faef46e62a23a9df16a86a44d4720aa89610102",
"s... |
"""Tests of features related to GDAL RFC 49
See https://trac.osgeo.org/gdal/wiki/rfc49_curve_geometries.
"""
import fiona
from .conftest import requires_gdal2
@requires_gdal2
def test_line_curve_conversion(path_curves_line_csv):
"""Convert curved geometries to linear approximations"""
with fiona.open(path_... | {
"content_hash": "aff196a705a8deb6150f0979c7c0ba0b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 60,
"avg_line_length": 27,
"alnum_prop": 0.7015250544662309,
"repo_name": "rbuffat/Fiona",
"id": "50e6634a905b5b79b71ca34338743b6e3086a5ab",
"size": "459",
"binary": fals... |
"""
Django settings for cheeseshop project.
Generated by 'django-admin startproject' using Django 1.8.14.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build ... | {
"content_hash": "6144cf96a4091ffa4c432d8b4bd899aa",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 77,
"avg_line_length": 26.66887417218543,
"alnum_prop": 0.6471318599453688,
"repo_name": "jezdez/django-constance",
"id": "76308e6dd2433b2eacfc734cd1f1cc8bf7ca2a21",
"size... |
from __future__ import unicode_literals
import time
import gym
# default dummy environment execution over 20 episodes
# load the environment
env = gym.make('CartPole-v0')
for i_episode in range(20):
# reset the enviroment at the beginning of each episode
observation = env.reset()
# up to a 100 steps
... | {
"content_hash": "1a422f27a993c3b48dbc8f08d85dd797",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 75,
"avg_line_length": 33.7037037037037,
"alnum_prop": 0.6648351648351648,
"repo_name": "Hiestaa/RLViz",
"id": "1e1fb49edd8c50ae697e2ba6fd1fbb33013a6c38",
"size": "953",
... |
import sys
is_3 = sys.version_info >= (3, 0)
if is_3:
import io
else:
import StringIO
try:
import cStringIO
except ImportError:
cStringIO = None
__all__ = ['jsmin', 'JavascriptMinify']
__version__ = '2.0.9'
def jsmin(js):
"""
returns a minified version of the javascript strin... | {
"content_hash": "49823084b026bc8c45152260abe9e457",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 109,
"avg_line_length": 33.45893719806763,
"alnum_prop": 0.42030031764366155,
"repo_name": "diderson/couchapp",
"id": "9ba31aaac56e4d0951cca1500234fcdf0230c800",
"size": "... |
from ycm import vimsupport
from ycmd.responses import UnknownExtraConf
from ycm.client.base_request import ( BaseRequest, BuildRequestData,
JsonFromFuture )
class EventNotification( BaseRequest ):
def __init__( self, event_name, extra_data = None ):
super( EventNotification,... | {
"content_hash": "c2adc60c59cb3d4359a199c60dee63f8",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 79,
"avg_line_length": 31.75,
"alnum_prop": 0.6251968503937008,
"repo_name": "korbenzhang/vim-ycm-win",
"id": "a5978ad0529703cc5b5b3de018e62fcefac05d2b",
"size": "2643",
... |
import typing
from urllib.parse import ParseResult, urlparse
from jinja2 import Undefined, contextfunction, escape
from starlette.templating import Jinja2Templates
def render_ql_nickname(nickname):
nickname = str(escape(nickname))
for i in range(8):
nickname = nickname.replace(
"^" + str(... | {
"content_hash": "4385b7e05ee006e705b789c121eaa188",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 82,
"avg_line_length": 33.97727272727273,
"alnum_prop": 0.6006688963210702,
"repo_name": "em92/pickup-rating",
"id": "1faee861c99bd7b77746d1cd225749693e680538",
"size": "14... |
'''Web-based file differ.
For usage, see README.md.
'''
from __future__ import print_function
from binaryornot.check import is_binary
import logging
import mimetypes
import os
import platform
import requests
import socket
import sys
from threading import Timer
import time
import webbrowser
from flask import (Flask, ... | {
"content_hash": "17b66866f591310425d7c89fb573a091",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 89,
"avg_line_length": 27.86092715231788,
"alnum_prop": 0.620513429997623,
"repo_name": "daytonb/webdiff",
"id": "2bf0f44ea27c4722a01da8b02b13f52546f5c402",
"size": "8436"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0002_initial_data'),
]
operations = [
migrations.CreateModel(
name='Redirect',
fields=[
('id'... | {
"content_hash": "0e2893fbcbdd31d4dd585fca1191f991",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 118,
"avg_line_length": 39.52777777777778,
"alnum_prop": 0.5397048489107519,
"repo_name": "inonit/wagtail",
"id": "d3ab5d3d2cb722c561c80102cacf928961cbe57b",
"size": "1447"... |
from collections import namedtuple
from .common import get_debian_package_name
MaintainerDescriptor = namedtuple('Maintainer', 'name email')
class RosPackage(object):
__slots__ = [
'name',
'debian_name',
'version',
'url',
'repository_name',
'repository_url',
... | {
"content_hash": "e652ceae2b44d55335243a6f2088b6e2",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 79,
"avg_line_length": 33.95454545454545,
"alnum_prop": 0.5642570281124498,
"repo_name": "130s/ros_buildfarm",
"id": "10e3d10e6ae93d460189ca8e260d43a454104c11",
"size": "29... |
import django_filters
from django.contrib.auth.models import User, Group
from rest_framework import viewsets, mixins
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from api.pagination import LargeResultsSetPagination
from api... | {
"content_hash": "29e73ad8b804c9d53ad18cd84e0e75c9",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 153,
"avg_line_length": 39.08,
"alnum_prop": 0.7758444216990789,
"repo_name": "Oinweb/py-fly",
"id": "2f0c64dc86a7f4f74d4f66c8d55730fbae7ac25d",
"size": "977",
"binary": ... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'certified'}
DOCUMENTATION = '''
module: ec2_vpc_nacl
short_description: create and delete Netwo... | {
"content_hash": "9f208893dd30551103d6dd87cf1d15de",
"timestamp": "",
"source": "github",
"line_count": 570,
"max_line_length": 126,
"avg_line_length": 34.598245614035086,
"alnum_prop": 0.6263881141929922,
"repo_name": "e-gob/plataforma-kioscos-autoatencion",
"id": "0f26aac7f9767b46534967889f07a39674... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.