text stringlengths 4 1.02M | meta dict |
|---|---|
import time
import random
class Sensor(object):
def __init__(self, name):
self.id = name
self.value = 0
def readvalue(self):
# We simulate a sensor by generating random values
self.value = random.randint(0,100)
self.timestamp = time.time()
return self.value
... | {
"content_hash": "d13a3f2b99058dc624fcbb35f431ea89",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 119,
"avg_line_length": 26.934782608695652,
"alnum_prop": 0.6351896690879741,
"repo_name": "gianpiero/dds-firststeps",
"id": "c3c94db5fd047df9bd9a7ae0c54547326cabde02",
"si... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Logging Test
url(r'^fail500/$', 'homepage.views.fail500', name='fail500'),
# Login
url(r'^signup/?$', 'users.views.signup', name='signup'),
url(r'^login/?$', 'users.views.user_login',... | {
"content_hash": "1410052dc7a9ce51eae7910c1cbbcba3",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 167,
"avg_line_length": 74.109375,
"alnum_prop": 0.6554923044486611,
"repo_name": "linuxmahara/blockcypher-explorer",
"id": "d357bc385e13f8031a1f41f9a655ee39e8137546",
"siz... |
__author__ = 'stachern'
from teamcity import underTeamcity as is_running_under_teamcity
from teamcity.unittestpy import TeamcityTestRunner
from django.test.simple import DjangoTestSuiteRunner
class TeamCityTestRunner(DjangoTestSuiteRunner):
def run_suite(self, suite, **kwargs):
if is_running_under_teamc... | {
"content_hash": "44cde86df807f3f53a8efb0eed4b3418",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 76,
"avg_line_length": 34.13333333333333,
"alnum_prop": 0.72265625,
"repo_name": "stachern/django_teamcity_test_runner",
"id": "dc7384cc2ae021f23c453ef700fd1e077877cd38",
"... |
from django.conf.urls import url
from . import views, list_views
urlpatterns = [
url(r'^article-column/$', views.article_column, name='article_column'),
url(r'^rename-column/$', views.rename_article_column, name='rename_article_column'),
url(r'^article-post/$', views.article_post, name='article_post'),
... | {
"content_hash": "f702558b0d652b26ed5765d4714bfeda",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 119,
"avg_line_length": 62.578947368421055,
"alnum_prop": 0.6593776282590412,
"repo_name": "glon/django_test",
"id": "4e70118430f83e616a97cb7f0cd3fd3736da8c83",
"size": "11... |
import json
import argparse
import boto3
from sys import getsizeof
### Read config file
def readConfigFile(filename):
parser = argparse.ArgumentParser()
parser.add_argument(filename)
args = parser.parse_args()
try:
with open(args.filename) as file:
return json.load(file)
except ... | {
"content_hash": "e2e2904794ac1b3921870bc80d2f0944",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 120,
"avg_line_length": 34.79775280898876,
"alnum_prop": 0.6283500161446561,
"repo_name": "thibeault/CloudFormation",
"id": "35ca4dd85c9e4568b9b2ac66693db232b0c403c5",
"siz... |
from .iq_unregister import UnregisterIqProtocolEntity
from .iq_status_set import SetStatusIqProtocolEntity
from .iq_picture_get import GetPictureIqProtocolEntity
from .iq_picture_get_result import ResultGetPictureIqProtocolEntity
from .iq_pictures_list import ListPicturesIqProtocolEntity
from .iq_picture_set import Set... | {
"content_hash": "47705cf391c0d6b88b1f7aa1e790b027",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 67,
"avg_line_length": 57.22222222222222,
"alnum_prop": 0.8776699029126214,
"repo_name": "ongair/yowsup",
"id": "427ef6b6cff2eabaa38efb15df1f4d656054ab91",
"size": "515",
... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='taskestimate',
name='is_na',
field=m... | {
"content_hash": "dc90126513c68d4993c0c49d3f744c79",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 53,
"avg_line_length": 21.42105263157895,
"alnum_prop": 0.5847665847665847,
"repo_name": "mfwarren/projector",
"id": "9728cbea50b42dab05f2fec366302a76cf0dadb0",
"size": "43... |
from docutils import nodes
from packaging.version import Version
from sphinx import __version__ as sphinx_version
from os import listdir
from os import environ
from os.path import basename
from os.path import dirname
from os.path import join as path_join
from sys import argv, stderr
import configparser
try:
impor... | {
"content_hash": "6cbddae45be7db7e484cacab7b8058fd",
"timestamp": "",
"source": "github",
"line_count": 439,
"max_line_length": 89,
"avg_line_length": 37.533029612756266,
"alnum_prop": 0.5554409176427748,
"repo_name": "john-mcnamara-intel/dpdk",
"id": "a55ce38800d59133a30ff09a5891f48165fc5368",
"si... |
""" Module for easy KMC from python. """
# Copyright (c) 2013 Mikael Leetmaa
#
# This file is part of the KMCLib project distributed under the terms of the
# GNU General Public License version 3, see <http://www.gnu.org/licenses/>.
#
from CoreComponents.KMCLocalConfiguration import KMCLocalConfiguration
from Core... | {
"content_hash": "0c2bca3f0d7eacf70afc586f010dbbf6",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 96,
"avg_line_length": 39.13461538461539,
"alnum_prop": 0.8176904176904177,
"repo_name": "txd283/FeCu-Irradiation-KMCLib",
"id": "5b69772f3a689307b822bab3c067d9c4f7fedd4a",
... |
'''
Created by auto_sdk on 2014-12-17 17:22:51
'''
from top.api.base import RestApi
class ItemImgDeleteRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.id = None
self.num_iid = None
def getapiname(self):
return 'taobao.item.img.delet... | {
"content_hash": "447800435c87a9c1cefd9ba73c07f4f4",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 55,
"avg_line_length": 27,
"alnum_prop": 0.6759259259259259,
"repo_name": "CooperLuan/devops.notes",
"id": "4d9ca40f51c306dca71398056742802a01352b98",
"size": "324",
"bin... |
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.behaviors import ButtonBehavior
from kivy.properties import ObjectProperty
from yahtr.ui.hex_widget import HexWidget
from yahtr.game import game_instance
from yahtr.data.actions import ActionType
from yahtr.core.hex_lib import Layout
from yahtr.utils im... | {
"content_hash": "8b54262e14b2d3c19175ed0705c61a08",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 108,
"avg_line_length": 39.07857142857143,
"alnum_prop": 0.5700968744288064,
"repo_name": "fp12/yahtr",
"id": "16f2125e29eedce2f85196baacfb46e4f58b9b12",
"size": "5471",
... |
import os
class Path:
def __init__(self, path, arg_names=None, defaults=None):
self._path = path
self._arg_names = tuple([] if arg_names is None else arg_names)
self._defaults = tuple([] if defaults is None else defaults)
@property
def path(self):
return self._path
@... | {
"content_hash": "7580b93e82257637048b9bddf692b1f3",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 34.35443037974684,
"alnum_prop": 0.5832719233603537,
"repo_name": "jbn/pathsjson",
"id": "693efe2e0af491d4cba63427f2d0702e335ac0e1",
"size": "2714",
... |
'''
Many people initially have difficulty formating their Python code so it
looks good in posts to the Pythonisa Forum. http://omz-forums.appspot.com
This script attempts to properly format your code with appropriate carrage
returns and backticks so that it is ready to post to the forum.
'''
import clipboard, console,... | {
"content_hash": "ef5c07e70b925df25f2bad33f5d4180b",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 74,
"avg_line_length": 34.607594936708864,
"alnum_prop": 0.5994879297732261,
"repo_name": "cclauss/Pythonista_ui",
"id": "6dba46318eb5320f9ce4314eac894aadc0951ea3",
"size":... |
import os
pdsDefaultLocation = "pds.linkedpersonaldata.org"
SERVER_UPLOAD_DIR = '/var/www/trustframework/'
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
# supported db backends are 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'o... | {
"content_hash": "63bcf84ec734243fb949c2e178e1eaeb",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 98,
"avg_line_length": 31.73404255319149,
"alnum_prop": 0.7184042909822327,
"repo_name": "HumanDynamics/openPDS-RegistryServer",
"id": "d8db5305f0a9fefb880e5661282e3a14f084c... |
"""
viewaction
"""
from __future__ import absolute_import, division, print_function
import logging
from PySide import QtGui, QtCore
from PySide.QtCore import Qt
from mceditlib.util.lazyprop import weakrefprop
from mcedit2.util.settings import Settings
log = logging.getLogger(__name__)
class ViewAction(QtCore.Q... | {
"content_hash": "6f3d3e8290ae614de5a175788f61d60f",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 125,
"avg_line_length": 31.041095890410958,
"alnum_prop": 0.59454986760812,
"repo_name": "vorburger/mcedit2",
"id": "a58161d79cde7482b00ba0c4db4b0b4e329001e6",
"size": "90... |
import os, sublime, sublime_plugin, subprocess
# Array of required Brew packages
packages = [
]
def conf_error(me):
sublime.error_message("No packages specified in config")
def brew_error(me):
import sys, webbrowser
if sublime.ok_cancel_dialog("Some package dependencies could not be installed automatic... | {
"content_hash": "2e88fc2c7f6ca33275c58ae45c314b91",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 232,
"avg_line_length": 32.06818181818182,
"alnum_prop": 0.6137491141034727,
"repo_name": "idleberg/sublime-developer-scripts",
"id": "00a4a868da4224f2e3bc2f2ec0edf105efc4ff2... |
import cython
@cython.profile(False)
def my_often_called_function():
pass
| {
"content_hash": "6f5e490950959e8cd44ca20bddb16b60",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 31,
"avg_line_length": 15.8,
"alnum_prop": 0.7341772151898734,
"repo_name": "cython/cython",
"id": "15197cb97210e38e1d523bacea8641139040ba0a",
"size": "79",
"binary": fals... |
"""
Record types for representing deployment models.
"""
from characteristic import attributes
@attributes(["repository", "tag"], defaults=dict(tag=u'latest'))
class DockerImage(object):
"""
An image that can be used to run an application using Docker.
:ivar unicode repository: eg ``u"hybridcluster/floc... | {
"content_hash": "9c98c0fa6c31d6a1e1d9f269cc6d1188",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 79,
"avg_line_length": 35.0609756097561,
"alnum_prop": 0.664,
"repo_name": "beni55/flocker",
"id": "0761745869928fa690ddbb3af6643562000ec034",
"size": "5867",
"binary": ... |
import threading
import Queue
import time
import logging
import sys
sys.path.insert(0, "../lib/Adafruit_MotorHAT_mod")
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor, Adafruit_StepperMotor
import Adafruit_PWM_Servo_Driver
def main():
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, fo... | {
"content_hash": "6982c54d35ce4a78d8d33a31c17c4d92",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 133,
"avg_line_length": 42.35197368421053,
"alnum_prop": 0.5087378640776699,
"repo_name": "Zimcoding/Raspy-Telescope",
"id": "7d0e65f1b30db3b9c862fe9a453364d5f25fc8df",
"s... |
import StringIO, os, sys
from zope.interface import implements
from zope.interface.verify import verifyObject
from twisted.trial.itrial import IReporter, ITestCase
from twisted.trial import unittest, runner, reporter, util
from twisted.python import failure, log, reflect, filepath
from twisted.scripts import trial
fro... | {
"content_hash": "49fee0046286648a7b262c3b9965804f",
"timestamp": "",
"source": "github",
"line_count": 934,
"max_line_length": 80,
"avg_line_length": 31.61884368308351,
"alnum_prop": 0.6016185832317487,
"repo_name": "GetSomeBlocks/ServerStatus",
"id": "3f36e956063a55bb43636d6c8b1ac719b8091f13",
"s... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 7, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 12); | {
"content_hash": "04c802d85ac7199aae1c8d3598fd54df",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 172,
"avg_line_length": 38.857142857142854,
"alnum_prop": 0.7132352941176471,
"repo_name": "antoinecarme/pyaf",
"id": "333c9d868d46976848a164e36fe0340cabcc06c7",
"size": "27... |
import numpy as np
import csv
from config import FLAGS
from sklearn.cross_validation import train_test_split
class DataSet(object):
def __init__(self, examples, labels=None):
if labels is not None:
assert len(examples) == len(labels), (
'examples.shape: ... | {
"content_hash": "2ffc1cafc0caeb9b78a6133f0693e750",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 137,
"avg_line_length": 33.36741214057508,
"alnum_prop": 0.6115472998851015,
"repo_name": "glrs/StackedDAE",
"id": "bb1db8863c5582f45e866b7731ebb360ad5ea4ee",
"size": "104... |
import socket
import re
import sys
from multiprocessing import Process
# 设置静态文件根目录
HTML_ROOT_DIR = "./html"
# 设置脚本文件根目录
WSGI_PYTHON_DIR = "./wsgipython"
class HTTPServer(object):
def __init__(self):
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.server_socket.setsock... | {
"content_hash": "d2e99ea00095b7e1c7bd053578b38321",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 93,
"avg_line_length": 31.194915254237287,
"alnum_prop": 0.5281173594132029,
"repo_name": "Ztiany/CodeRepository",
"id": "61e2fd64ec2615160df1a94d2ae1342ee639e336",
"size"... |
from __future__ import unicode_literals
from mock import patch
import sure # noqa
from moto.server import main, create_backend_app, DomainDispatcherApplication
def test_wrong_arguments():
try:
main(["name", "test1", "test2", "test3"])
assert False, ("main() when called with the incorrect number ... | {
"content_hash": "4eb171375ba5ae614f3cb92916264c47",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 78,
"avg_line_length": 32.744680851063826,
"alnum_prop": 0.6770630279402209,
"repo_name": "whummer/moto",
"id": "bd00b17c34d4b02d5b85d461c3a7ff316ae006ed",
"size": "1539",
... |
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import patch
import pytest
from pythonfmu.builder import FmuBuilder
from pythonfmu.deploy import deploy
PYTHON_SLAVE = Path(__file__).parent / "slaves/pythonslave.py"
@pytest.mark.parametrize("test_manager", [None, "pip", "conda"])
... | {
"content_hash": "8b20dc10d7572220a9f04cace463e8d1",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 104,
"avg_line_length": 37.104166666666664,
"alnum_prop": 0.6513194834362718,
"repo_name": "joshua-cogliati-inl/raven",
"id": "01f46a022a0ad79ec6a96c95688aa857f94ed3fe",
"s... |
"""
cloak.py - Simple file encryption/compression utility
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
import sys
import zlib
from optparse import OptionError
from optparse import OptionParser
def hideAscii(data):
retVal = ""
... | {
"content_hash": "ce1cf663c3aeb83ed9663d5d616f5cc3",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 104,
"avg_line_length": 25.927710843373493,
"alnum_prop": 0.595724907063197,
"repo_name": "michaelhidalgo/7WCSQ",
"id": "b93583711259471743f03d8ef1a0be3673beb974",
"size": ... |
"""
Pickling of python instances
"""
from concurrent.core.components.component import Component, implements
from concurrent.core.config.config import IntItem, ConfigItem
from concurrent.core.application.api import IPickler
from concurrent.core.util.cryptohelper import CryptoHelper
from concurrent.core.transport.pyjsonr... | {
"content_hash": "7f1073c6ee0e4f68ee58a3e877a8ac83",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 114,
"avg_line_length": 33.16814159292036,
"alnum_prop": 0.6424759871931697,
"repo_name": "moritz-wundke/Concurrent",
"id": "3f3492a41a88269612317c945779c86aff2294f8",
"si... |
"""
Demonstration of accessing wrapped functions for testing.
"""
from __future__ import print_function
from crochet import setup, run_in_reactor
setup()
@run_in_reactor
def add(x, y):
return x + y
if __name__ == '__main__':
print("add() returns EventualResult:")
print(" ", add(1, 2))
print("add... | {
"content_hash": "d3266767128bee2c08d34b7a75fc0660",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 74,
"avg_line_length": 22.473684210526315,
"alnum_prop": 0.6463700234192038,
"repo_name": "wrmsr/crochet",
"id": "cded7dce569864347514b9fe261569927931cb89",
"size": "445",
... |
import functools
import re
from nova import availability_zones
from nova import context
from nova import db
from nova import exception
from nova.network import model as network_model
from nova.openstack.common import log as logging
from nova.openstack.common import memorycache
from nova.openstack.common import timeuti... | {
"content_hash": "738b5e9a52322075adc36883bfb7bb4d",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 78,
"avg_line_length": 30.76439790575916,
"alnum_prop": 0.5999829816201497,
"repo_name": "zestrada/nova-cs498cc",
"id": "660c0e8d44970f614827c57620a45fda6077b2d6",
"size":... |
from __future__ import absolute_import, division, print_function
import types
# Dependency imports
import numpy as np
import tensorflow as tf
import tensorflow.compat.v1 as tf1
import tensorflow_probability as tfp
from odin.backend import parse_activation
from odin.backend.maths import softplus1
from odin.bay.distrib... | {
"content_hash": "c806866cd1291dd941ff1c49a1b8a4e0",
"timestamp": "",
"source": "github",
"line_count": 508,
"max_line_length": 89,
"avg_line_length": 40.15551181102362,
"alnum_prop": 0.6268444531594686,
"repo_name": "imito/odin",
"id": "29d6294755942d675d9647ec721f6048135a3f66",
"size": "20399",
... |
"""Extending the template engine variable namespace to always include certain values is quite easy.
There are two places you can extend:
* The 'web' variable can be extended by assigning to the request context.
* Adding additonal top-level variables is accomplished by assigning to the 'namespace' attribute of the con... | {
"content_hash": "713e14fcb1b2b12c0fe46ca906d612a7",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 114,
"avg_line_length": 36.725,
"alnum_prop": 0.6494213750850919,
"repo_name": "marrow/WebCore",
"id": "194501019b5ad703e09db462638581ed3470bb0d",
"size": "1488",
"binary... |
import re
import json
import sys
import os
movie_ratings_pattern = re.compile(r"""(?P<distribution>[\d\.\*]{10}?)\t # distribution of votes
(?P<votes>[\d]*?)\t # number of votes
(?P<rating>\d0?\.\d?)\t # rat... | {
"content_hash": "d77dff92f071ed479d6fc806a612c52a",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 111,
"avg_line_length": 34.29126213592233,
"alnum_prop": 0.5407701019252548,
"repo_name": "symat/spark-api-comparison",
"id": "a2ba1f8f712b5d411fb988ee21d425e634758b2e",
"... |
"""Module loader file for jobstamps tests."""
| {
"content_hash": "28b1d391d9f177718cd4170efe13c163",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 45,
"avg_line_length": 46,
"alnum_prop": 0.717391304347826,
"repo_name": "polysquare/jobstamps",
"id": "23f836df2c28955694e0265d4c14154fdf63404d",
"size": "156",
"binary":... |
"""Test the PackagesPlugin.
"""
import pytest
import enaml
from atom.api import Atom, Bool, Value, Str
from exopy.testing.util import handle_dialog
with enaml.imports():
from enaml.workbench.core.core_manifest import CoreManifest
from exopy.app.app_manifest import AppManifest
from exopy.app.errors.manife... | {
"content_hash": "d05a803fd09960f980b354e7dfd60835",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 79,
"avg_line_length": 31.79126213592233,
"alnum_prop": 0.6387234692319438,
"repo_name": "Ecpy/ecpy",
"id": "ede6ca5b3352cd8726bd3f306c71b795c4d43ebd",
"size": "6932",
"... |
from flask import Flask
from flask import render_template
from pymongo import MongoClient
import json
import os
app = Flask(__name__)
# connection settings
MONGO_URI = os.getenv('MONGODB_URI', 'mongodb://localhost:27017')
DBS_NAME = os.getenv('MONGO_DB_NAME', 'avengers')
COLLECTION_NAME = 'avengers'
#
@app.route('/... | {
"content_hash": "f7f3fb9e92887a3a7c400ec1b51c24f0",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 82,
"avg_line_length": 27.983333333333334,
"alnum_prop": 0.6569386539606908,
"repo_name": "GunnerJnr/_CodeInstitute",
"id": "60ec3765a6eeb83fb85452e71d4ea6db9db2c691",
"siz... |
# Base class for RPC testing
import logging
import optparse
import os
import sys
import shutil
import tempfile
import traceback
from .util import (
initialize_chain,
start_nodes,
connect_nodes_bi,
sync_blocks,
sync_mempools,
stop_nodes,
stop_node,
wait_bitcoinds,
... | {
"content_hash": "4260fed27f6541daf91e7e8573431a3e",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 142,
"avg_line_length": 36.56744186046512,
"alnum_prop": 0.5775883998982447,
"repo_name": "realzzt/BitCoin2013",
"id": "d5d26368439ae154713f4bb15f32b3513bbdc424",
"size": ... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/item/shared_item_space_station.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "81fe79f1c69ff8eb316f456b923895c7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 78,
"avg_line_length": 23.615384615384617,
"alnum_prop": 0.6938110749185668,
"repo_name": "anhstudios/swganh",
"id": "53304a24602532896ff757157095d7b0e4fd366e",
"size": "45... |
from collections import OrderedDict
from copy import deepcopy
from typing import Any, Dict, List, Tuple
import torch
import pytest
from allennlp.common import Lazy, Params
from allennlp.common.checks import ConfigurationError
from allennlp.common.testing import AllenNlpTestCase
from allennlp.data.data_loaders import ... | {
"content_hash": "ed97db207a5b191aa2f1686c1edc1c32",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 100,
"avg_line_length": 40.99657534246575,
"alnum_prop": 0.5130732603792498,
"repo_name": "allenai/allennlp",
"id": "5280970a34a9ca0eafc6982495e572b78d81f671",
"size": "11... |
"""Module containing classes related to GCE VM networking.
The Firewall class provides a way of opening VM ports. The Network class allows
VMs to communicate via internal ips and isolates PerfKitBenchmarker VMs from
others in the
same project. See https://developers.google.com/compute/docs/networking for
more informat... | {
"content_hash": "21eafe4b90340045b5c70a31fdee80ef",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 79,
"avg_line_length": 29.127118644067796,
"alnum_prop": 0.6342740762292697,
"repo_name": "lleszczu/PerfKitBenchmarker",
"id": "0c51e91ecd01a313833e3f87a57fa91b802f5a75",
... |
"""
This is part of shot detector.
Produced by w495 at 2017.05.04 04:18:27
"""
from __future__ import absolute_import, division, print_function
import logging
import time
import types
from functools import wraps, partial
import six
class LogMeta(type):
"""
Metaclass for logging every call
... | {
"content_hash": "db1763cfed8a73e8a7353fe6c3f47c27",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 65,
"avg_line_length": 26.042345276872965,
"alnum_prop": 0.4544090056285178,
"repo_name": "w495/python-video-shot-detector",
"id": "26c33ddc10f10289e1df32036bc2e91cfc3b96fb"... |
from .models import PollingLocation, PollingLocationManager
from .controllers import filter_polling_locations_structured_json_for_local_duplicates, \
import_and_save_all_polling_locations_data, polling_locations_import_from_structured_json
from admin_tools.views import redirect_to_sign_in_page
from ballot.models im... | {
"content_hash": "cc431f98db6ff774809518c2a6567278",
"timestamp": "",
"source": "github",
"line_count": 619,
"max_line_length": 117,
"avg_line_length": 45.41518578352181,
"alnum_prop": 0.6369877632327832,
"repo_name": "jainanisha90/WeVoteServer",
"id": "c99051b7895537c15cd9074821060a726ac87329",
"s... |
"""The tests for Alarm control panel device triggers."""
from datetime import timedelta
import pytest
from homeassistant.components.alarm_control_panel import DOMAIN
import homeassistant.components.automation as automation
from homeassistant.components.device_automation import DeviceAutomationType
from homeassistant.... | {
"content_hash": "0d3b540cbbefa8575d2732b28c122bf5",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 103,
"avg_line_length": 35.130982367758186,
"alnum_prop": 0.45701584570158454,
"repo_name": "home-assistant/home-assistant",
"id": "c8082e415e0ca85dad302523c3100b6609871e5d"... |
import logging
try:
from configparser import ConfigParser
except ImportError:
# Python 2 support
from ConfigParser import ConfigParser
logger = logging.getLogger("packges.knightos.org")
logger.setLevel(logging.DEBUG)
sh = logging.StreamHandler()
sh.setLevel(logging.DEBUG)
formatter = logging.Formatter("%... | {
"content_hash": "3e2a71932d340ce518a569cf6c32f9b5",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 85,
"avg_line_length": 22.925925925925927,
"alnum_prop": 0.7334410339256866,
"repo_name": "KnightOS/packages.knightos.org",
"id": "ac0a98a95fb282311e40e80cfdbfd6bd96d2e2f0",
... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class ExpressMailServiceRequest(Choreography):
def __init__(self, temboo_session):
"""
... | {
"content_hash": "f444ecce59849278d3eb3bfb255f8eac",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 216,
"avg_line_length": 45.08641975308642,
"alnum_prop": 0.7061883899233297,
"repo_name": "jordanemedlock/psychtruths",
"id": "07d5bdd720425f713c08dd319581467bf9f783da",
"s... |
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.fields import StreamField
from wagtail.wagtailsearch import index
from wagtail.wagtailadmin.edit_handlers import StreamFieldPanel
from ..fields import BodyStreamBlock
class StaticPage(Page):
body = StreamField(BodyStreamBlock())
search_fi... | {
"content_hash": "cd8b0d82e03ad0689e7a667a4caddf68",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 63,
"avg_line_length": 25.105263157894736,
"alnum_prop": 0.740041928721174,
"repo_name": "palazzem/wagtail-nesting-box",
"id": "d0415eb1102f995e062069752fdd8365d31506ec",
"... |
import requests
import urllib
import lxml.html
import time
class Web:
""" Test the functionality of a web application """
def __init__(self, web_url, ignore_validity=False):
"""
:param web_url: Full URL of website.
:return: n/a
"""
# Base will never be modified
... | {
"content_hash": "337897c8b45a44a5f0ba8b82ac56f8f2",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 105,
"avg_line_length": 32.774358974358975,
"alnum_prop": 0.5420122046628071,
"repo_name": "gmatoshp/jenkins-tomcat-nginx",
"id": "d2e9c60101d222ef9cd7d97c134f06d270cd7e98",... |
"""fontTools.ttLib -- a package for dealing with TrueType fonts.
This package offers translators to convert TrueType fonts to Python
objects and vice versa, and additionally from Python to TTX (an XML-based
text format) and vice versa.
Example interactive session:
Python 1.5.2c1 (#43, Mar 9 1999, 13:06:43) [CW PPC... | {
"content_hash": "0359afb57a99a0349683b75bd2ac5a28",
"timestamp": "",
"source": "github",
"line_count": 704,
"max_line_length": 118,
"avg_line_length": 43.07954545454545,
"alnum_prop": 0.46396069638617776,
"repo_name": "tommy-u/enable",
"id": "e2aa3e82cd4cf99a08c0164e4efba41485141dfd",
"size": "303... |
import sys
import os
import java.lang.System
import imp
from Screen import Screen
from org.sikuli.script import Env
from org.sikuli.script import Debug
import Sikuli
def _stripPackagePrefix(module_name):
pdot = module_name.rfind('.')
if pdot >= 0:
return module_name[pdot+1:]
return module_name
class Si... | {
"content_hash": "dd6e4b53a31f833da8b907f9134ce9cd",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 159,
"avg_line_length": 30.68,
"alnum_prop": 0.6114732724902217,
"repo_name": "bx5974/sikuli",
"id": "70a12aae51a81824bc6dce03443fc1abc657d957",
"size": "2369",
"binary":... |
import json
from .compat import six
def extra_as_internal(obj):
if not hasattr(obj, 'extra'):
return {}
if isinstance(obj.extra, six.string_types):
try:
obj.extra = json.loads(obj.extra)
except (TypeError, ValueError):
pass
return obj.extra
def get_extra(o... | {
"content_hash": "c2c2e04010e80db62f17f8c06360e0d4",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 70,
"avg_line_length": 27.166666666666668,
"alnum_prop": 0.6134969325153374,
"repo_name": "djaodjin/djaodjin-survey",
"id": "24835f5b066db68368697bb0fe4c3b146ce69e78",
"siz... |
from pyfaces import pyfaces
import sys,time
if __name__ == "__main__":
try:
start = time.time()
argsnum=len(sys.argv)
#print "args:",argsnum
if(argsnum<5):
print "usage:python pyfacesdemo imgname dirname numofeigenfaces threshold "
sys.exit(2) ... | {
"content_hash": "a838256ed00fb637167b0e5606cb840c",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 87,
"avg_line_length": 35,
"alnum_prop": 0.5782312925170068,
"repo_name": "anandmv/face-recognition",
"id": "8b17534ef4cf1009ffb23394ff9d58c5b3d989e4",
"size": "735",
"bi... |
"""
Author: Frederik Muller, xmulle20@stud.fit.vutbr.cz
Date: 04/2017
"""
import bcrypt
from flask import request
from bson import json_util, ObjectId
import pymongo
from slugify import slugify
from api import auth, db
from api.module import Module
from api.models.models import Product, ProductException, Review, Re... | {
"content_hash": "a3ecfbd2709ee9789da1afd70981ae43",
"timestamp": "",
"source": "github",
"line_count": 356,
"max_line_length": 173,
"avg_line_length": 30.691011235955056,
"alnum_prop": 0.7250594911220941,
"repo_name": "petrstehlik/pyngShop",
"id": "2ff33e19add1bcca83ef6825502425e52fe85205",
"size"... |
def none_to_zero(integer):
if integer is None:
return 0
else:
return integer
| {
"content_hash": "d43f2deef183846146cd9d1b306d2de0",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 26,
"avg_line_length": 20.2,
"alnum_prop": 0.5841584158415841,
"repo_name": "RedBulli/Django_SnookerStats",
"id": "f809f345328eb96a07cfc4282c9919dfecaebfe7",
"size": "101",
... |
import logging
import os
import re
import time
from datetime import datetime
from jinja2 import Environment, FileSystemLoader
import eitu.constants as constants
import eitu.formaters as formaters
import eitu.time_edit as timeEdit
from eitu.wifi import retrieve, write_database, read_database, stale_database
def fake... | {
"content_hash": "47d61a014118633aa9cab3e42ad9e320",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 100,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.6473429951690821,
"repo_name": "christianknu/eitu",
"id": "b2573bdbd24d7ff99e965ab484f69c1f8a204481",
"size": "2... |
import copy
from collections.abc import MutableMapping
from functools import partial
from typing import List
from flask import Response, render_template_string, request
from flask.views import View
from graphql import specified_rules
from graphql.error import GraphQLError
from graphql.type.schema import GraphQLSchema
... | {
"content_hash": "ba00631866843fdee98be529ff07e774",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 88,
"avg_line_length": 33.63586956521739,
"alnum_prop": 0.5845855550169656,
"repo_name": "graphql-python/graphql-server-core",
"id": "063a67a2271d1b6d60ecac3076e2feed4c00240... |
import StringIO
from PIL import Image
class Modifier(object):
def __init__(self, image, params):
self.image = image
self.params = params
def run(self):
return self
class SizeModifier(Modifier):
"""
Modifies the physical dimensions of an image. Will keep the image ratio if eith... | {
"content_hash": "1aae4d36936e886330f27c2fcb98f153",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 138,
"avg_line_length": 44.59615384615385,
"alnum_prop": 0.6304441569642087,
"repo_name": "jskopek/frame",
"id": "0411f29abdde5611790e5d5a9d1491dcd88a8e30",
"size": "4638"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(auto_create... | {
"content_hash": "a4bc5769478a18544caca77b6cc3a3af",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 114,
"avg_line_length": 31,
"alnum_prop": 0.5424133811230586,
"repo_name": "noah-dev/todo_django",
"id": "bb537f0d3c9f8b073701df692c35ef4c774f6a74",
"size": "910",
"binar... |
import xml.dom.minidom as dom
from math import *
class Element:
x = 0
y = 0
def __eq__(self,other):
if(isinstance(other,Element)):
if( self.x == other.x and self.y == other.y):
return True
else:
return False
return NotImplemented
def __ne__(self,other):
if(isinstance(other,Element)):
if(se... | {
"content_hash": "b5212f766816d2229410ced2551875c0",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 85,
"avg_line_length": 24.888157894736842,
"alnum_prop": 0.5971451229183188,
"repo_name": "ComputerArchitectureGroupPWr/Floorplan-Maker",
"id": "8a763993638f47899f4c14238f61... |
from oslo.config import cfg
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.orm import exc
from sqlalchemy.orm import joinedload
from neutron.common import constants
from neutron.common import utils
from neutron.db import agents_db
from neutron.db import model_base
from neutron.extensions import dhc... | {
"content_hash": "1c8c689a98d9cab6e053eefaf969d341",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 79,
"avg_line_length": 42.03414634146341,
"alnum_prop": 0.5909249158639898,
"repo_name": "subramani95/neutron",
"id": "aa8dfadb63bbc6228648e42cbdb79dc25e97f043",
"size": "... |
"""
Turns raw statistics about soccer matches into features we use
for prediction. Combines a number of games of history to compute
aggregates that can be used to predict the next game.
"""
from pandas.io import gbq
import match_stats
# Games that have stats available. Not all games in the match_games ta... | {
"content_hash": "5fdcf221cc8411a25136f05a3472a284",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 79,
"avg_line_length": 39.358108108108105,
"alnum_prop": 0.5842918454935623,
"repo_name": "Taketrung/ipython-soccer-predictions",
"id": "3429d923137a8b9ff3da96a4b6ebe350a2ca... |
"""
:codeauthor: Rahul Handay <rahulha@saltstack.com>
"""
import os
import pytest
import salt.modules.win_path as win_path
import salt.utils.stringutils
import salt.utils.win_reg as reg_util
from tests.support.mock import MagicMock, patch
pytestmark = [pytest.mark.windows_whitelisted, pytest.mark.skip_unless_on_wi... | {
"content_hash": "86a2273fc04231d0ded88e606f23d22e",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 85,
"avg_line_length": 36.41869918699187,
"alnum_prop": 0.6252930014510548,
"repo_name": "saltstack/salt",
"id": "7dad024a8783dda3f40683abbc15dfdf77cbdb34",
"size": "8959"... |
"""
This module contains implementations of IFilePath for zip files.
See the constructor for ZipArchive for use.
"""
__metaclass__ = type
import os
import time
import errno
# Python 2.6 includes support for incremental unzipping of zipfiles, and
# thus obviates the need for ChunkingZipFile.
import... | {
"content_hash": "4091d182ec65cf224108737c2e0df9e9",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 86,
"avg_line_length": 31.328301886792453,
"alnum_prop": 0.5944350758853288,
"repo_name": "hlzz/dotfiles",
"id": "b8f62c380ba1058237c48327524b21c139ac1335",
"size": "8447"... |
from werkzeug import check_password_hash, generate_password_hash
from app import app
from app.modules.auth.models import User
_default_comparison = generate_password_hash("", method=app.config['PW_HASH_SETTINGS'], salt_length=app.config['PW_SALT_LENGTH'])
def check(credentials):
user = User.query.filter_by(usern... | {
"content_hash": "2f33f7ff46533cf1f6432cad25abe228",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 129,
"avg_line_length": 42.416666666666664,
"alnum_prop": 0.756385068762279,
"repo_name": "awm/minventory",
"id": "c07b6848e4d45aa9c9a98bd844c8e36cd33365f1",
"size": "509",... |
from django import forms
from django.contrib import admin
from markedit.admin import MarkEditAdmin
from pycon.models import (PyConProposalCategory, PyConSponsorTutorialProposal,
PyConTalkProposal, PyConTutorialProposal,
PyConPosterProposal, PyConLightningTalkProposa... | {
"content_hash": "2ca6421818bfe4eb7c4e2cc47248edbf",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 97,
"avg_line_length": 27.304545454545455,
"alnum_prop": 0.6129515565173964,
"repo_name": "Diwahars/pycon",
"id": "299bf7af73862d995a9171e4ed47205fc45570d2",
"size": "6007... |
__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
__doc__ = """Module to define supported Windows chip architectures.
"""
import os
class ArchDefinition(object):
"""
A class for defining architecture-specific settings and logic.
"""
def _... | {
"content_hash": "9647ee7373d1f2f51774393fa6f52876",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 112,
"avg_line_length": 21.90909090909091,
"alnum_prop": 0.5985477178423236,
"repo_name": "pzajda/eloquence",
"id": "f7d28daf48d073e348fc8d3fa4668d2d0146ed0e",
"size": "207... |
__author__ = 'serginuez'
#msbee.py
#dependences: python-pcapy
from struct import *
import datetime
import argparse
import socket
import pcapy
import sys
import re
def main(argv):
try:
parser = argparse.ArgumentParser(description='mSbee')
parser.add_argument('-i','--interface', help='interface ... | {
"content_hash": "a54a1d2acdafe91cb7133658a6f50938",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 213,
"avg_line_length": 32.46666666666667,
"alnum_prop": 0.5369609856262834,
"repo_name": "serginuez/msbee",
"id": "891f3c1db22b1e00477868f0412ca44ebe937f19",
"size": "391... |
from multiprocessing import Pool
import numpy as np
from gtapps_mp.utils import pyfits
import tempfile
import os
import subprocess
import sys
from gt_apps import filter,expCube
def ltcube(times):
'''This is the atomic function that actually runs in the seperate
threads. It takes a list as input where the fi... | {
"content_hash": "7b5e9eb747415ddc9234ccda458770ba",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 133,
"avg_line_length": 39.52403846153846,
"alnum_prop": 0.6146454202651745,
"repo_name": "fermiPy/gtapps_mp",
"id": "29c5654e49d9736864daa3a4a5c0eb4c019dee24",
"size": "8... |
import logging
from flask import current_app, Flask, redirect, url_for
def create_app(config, debug=False, testing=False, config_overrides=None):
app = Flask(__name__)
app.config.from_object(config)
app.debug = debug
app.testing = testing
if config_overrides:
app.config.update(config_ov... | {
"content_hash": "5789b31da2f5d142c725e816850e81cf",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 78,
"avg_line_length": 27.317460317460316,
"alnum_prop": 0.6374201045903545,
"repo_name": "yafraorg/yafra-toroam",
"id": "419c524cb607ad2eb63cfc578edad15ed8e124e9",
"size":... |
from twisted.trial import unittest
from nagcat import plugin
class PluginTest(unittest.TestCase):
def testSearch(self):
plugins = plugin.search(plugin.INagcatPlugin)
self.assert_(plugins)
| {
"content_hash": "53a21624ed5a4d1367ac1a043f9d42f5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 53,
"avg_line_length": 26.25,
"alnum_prop": 0.7380952380952381,
"repo_name": "marineam/nagcat",
"id": "69ac65c8a6c8e1f5c03f857414e7d27f579f62d3",
"size": "793",
"binary": ... |
"""Fichier contenant la classe Commentaire, détaillée plus bas."""
from .instruction import Instruction
class Commentaire(Instruction):
"""Classe définissant un commentaire.
Un commentaire est une instruction commençant par un #,
non interprétée par Python.
"""
def __init__(sel... | {
"content_hash": "72fe4a3018f01852d233aa7f8514da66",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 78,
"avg_line_length": 27.651162790697676,
"alnum_prop": 0.5853658536585366,
"repo_name": "vlegoff/tsunami",
"id": "1643fdca055f049a1ef1ec0329b878759dc678f4",
"size": "2771... |
from .constants import *
from .geometry import *
from .pdbIO import *
from .graph import *
| {
"content_hash": "3ad396d29d15e20cd21d5d6689e817dd",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 24,
"avg_line_length": 18.4,
"alnum_prop": 0.7282608695652174,
"repo_name": "BIOS-IMASL/bomeba0",
"id": "7debb86746c05b9ea1d0690d63fc043ee6f9b4bc",
"size": "92",
"binary":... |
from recipe_engine.engine_types import ResourceCost
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
'step',
]
def RunSteps(api):
with api.step.nest('parent step'):
pass
api.step('null step', [])
api.step('zero step', ['echo', 'hi'], cost=None)
api.step('default step', ['echo', 'hi'])
api.step('max... | {
"content_hash": "0928bbb27bc524948ac0d7f0c9532a05",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 79,
"avg_line_length": 30.52,
"alnum_prop": 0.6055045871559633,
"repo_name": "luci/recipes-py",
"id": "14b2a3769814bb4778a921eada074c139102e9a3",
"size": "1700",
"binary"... |
"""
Class and functions for dealing with credentials in UNC connections on Windows.
"""
from win_unc.errors import InvalidUsernameError
from win_unc.cleaners import clean_username
from win_unc.validators import is_valid_username
class UncCredentials(object):
"""
Represents a set of credentials to be used wit... | {
"content_hash": "1a0236350cf82a2a703f38fdf161742f",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 103,
"avg_line_length": 40.598214285714285,
"alnum_prop": 0.6217286122718276,
"repo_name": "CovenantEyes/py_win_unc",
"id": "1e9bc578c8a386741ee7ea599ccf5201a7a31a12",
"si... |
import six
from .node import Node
from .utils import parse_date
@six.python_2_unicode_compatible
class News(Node):
"""Represents a News on CrunchBase"""
KNOWN_PROPERTIES = [
"title",
"author",
"posted_on",
"url",
"created_at",
"updated_at",
]
def _coe... | {
"content_hash": "bd1fb8f88b8bfc08a426e0d1ab32c5ad",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 68,
"avg_line_length": 22.242424242424242,
"alnum_prop": 0.5299727520435967,
"repo_name": "alabid/pycrunchbase",
"id": "67242ca520fe227c4dc5b1285fa4919f577e6495",
"size": "... |
from sms.tests.config import *
from django.test import TestCase
from unittest.mock import patch
import sms.routes.contact as routes
from contact.models import Contact
SAMPLE = 'sms.routes.contact.Contact.objects.sample'
INFORM_ALL = 'sms.routes.contact.Contact.objects.inform_all'
GET_TEMPLATER = 'sms.routes.contact.ge... | {
"content_hash": "96855297efc3017b4def11d8ff21f1cb",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 75,
"avg_line_length": 31.94214876033058,
"alnum_prop": 0.6507115135834411,
"repo_name": "hwayne/safehouse",
"id": "2d4ca28cacfea44a6de90fcefae71825346079e0",
"size": "386... |
__author__ = 'alisonbnt'
import os
import urllib
import ConfigParser
def setup():
print('-- GCM REPOSITORY SETUP --')
print('Checking setup')
already_installed_hook = False
git_hook_path = '.git/hooks/commit-msg'
cfg_file_path = '.git/hooks/gcm.cfg'
if os.path.isfile(git_hook_path):
a... | {
"content_hash": "b99fca0274eefce7a31be549b7daa4da",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 100,
"avg_line_length": 31.30841121495327,
"alnum_prop": 0.5585074626865671,
"repo_name": "alisonbnt/gcm-commit-msg-hook",
"id": "a0822f10c62c4079ab957478a740fa91366372db",
... |
import os, glob, datetime,sys,getopt
from GeoData.GeoData import GeoData
import matplotlib.pyplot as plt
import numpy as np
from GeoData.utilityfuncs import readIonofiles, readAllskyFITS,readSRI_h5
from PlottingClass import str2posix
from matplotlib.dates import YearLocator, MonthLocator, DateFormatter,MinuteLocator, H... | {
"content_hash": "9842b81b231542d1e1950acc5c2ae883",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 158,
"avg_line_length": 34.743169398907106,
"alnum_prop": 0.6005033029254483,
"repo_name": "jswoboda/MahaliPlotting",
"id": "a6da6392046d9e43f47e1502387947e37e4b4321",
"si... |
import os
import bdb
import types
from Tkinter import *
from WindowList import ListedToplevel
from ScrolledList import ScrolledList
import macosxSupport
class Idb(bdb.Bdb):
def __init__(self, gui):
self.gui = gui
bdb.Bdb.__init__(self)
def user_line(self, frame):
if s... | {
"content_hash": "b11df6b7f70868411302a3362c3be53c",
"timestamp": "",
"source": "github",
"line_count": 481,
"max_line_length": 79,
"avg_line_length": 33.82536382536382,
"alnum_prop": 0.5232944068838353,
"repo_name": "ericlink/adms-server",
"id": "c4af5b016764a93b3e53ad15d1989ce1699d4820",
"size": ... |
from .client import APIClient
from interage.api import managers
class InterageAPI(object):
def __init__(self, **args):
super(InterageAPI, self).__init__()
self.__client = APIClient(**args)
self.__init_managers()
def __init_managers(self):
self.__managers = {}
self.__man... | {
"content_hash": "6b70c2aaf565caba6a00531a8359d2b9",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 104,
"avg_line_length": 33.61538461538461,
"alnum_prop": 0.6521739130434783,
"repo_name": "IntMed/interage_python_sdk",
"id": "e045d297057d5fcefa1fa0717b48802004983637",
"s... |
try:
import unittest2 as unittest
except ImportError:
import unittest
import requests
import responses
from pkg_resources import resource_string
import json
import phabricator
phabricator.ARCRC = {} # overwrite any arcrc that might be read
RESPONSES = json.loads(
resource_string(
'phabricator.... | {
"content_hash": "e4357c99d2dd984d50e9e23e48f849b3",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 94,
"avg_line_length": 29.56896551724138,
"alnum_prop": 0.599028182701652,
"repo_name": "disqus/python-phabricator",
"id": "e12b2859b8f66030bd7ee7f96e782f73b838d7df",
"siz... |
"""
Services module forms
"""
from django import forms
from django.db.models import Q
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.utils.html import strip_tags
from maker.core.conf import settings
from maker.identities.models import Contact
from maker.c... | {
"content_hash": "45691da17c1cb1054e22e12b57be3462",
"timestamp": "",
"source": "github",
"line_count": 555,
"max_line_length": 128,
"avg_line_length": 44.983783783783785,
"alnum_prop": 0.5622847072017945,
"repo_name": "alejo8591/maker",
"id": "2dd115c0a8504fcae6e88ffb4d31222079ff75b2",
"size": "25... |
"""Get stats about your activity.
Example:
- my_activity.py for stats for the current week (last week on mondays).
- my_activity.py -Q for stats for last quarter.
- my_activity.py -Y for stats for this year.
- my_activity.py -b 4/24/19 for stats since April 24th 2019.
- my_activity.py -b 4/24/19 -e 6/16/... | {
"content_hash": "09bff1bfafa01d43f6bfe2be3a301e94",
"timestamp": "",
"source": "github",
"line_count": 1001,
"max_line_length": 80,
"avg_line_length": 34.33766233766234,
"alnum_prop": 0.6232398463865937,
"repo_name": "CoherentLabs/depot_tools",
"id": "7fb0f1cf62bc3297c08f823b7ecb282a030d833a",
"si... |
import contextlib
import threading
import time
import weakref
from dogpile.cache import api
from dogpile.cache import proxy
from dogpile.cache import region
from dogpile.cache import util as dogpile_util
from dogpile.core import nameregistry
from oslo_config import cfg
from oslo_log import log
from oslo_utils import i... | {
"content_hash": "bea1500ecc776ab55e17c4babac47be9",
"timestamp": "",
"source": "github",
"line_count": 436,
"max_line_length": 79,
"avg_line_length": 40.4954128440367,
"alnum_prop": 0.5975305845038514,
"repo_name": "klmitch/keystone",
"id": "064825f81361ffce56e9b38ee00d150f7d2c0595",
"size": "1823... |
"""Toolset to run multiple Swarming tasks in parallel."""
import getpass
import json
import os
import subprocess
import sys
import tempfile
import time
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.insert(0, ROOT_DIR)
import auth
import isolateserver
from utils ... | {
"content_hash": "e8e5044cc55197cb91048ec38666ae33",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 79,
"avg_line_length": 34.63101604278075,
"alnum_prop": 0.6641445336627548,
"repo_name": "guorendong/iridium-browser-ubuntu",
"id": "3ada588f4447e173ae5d99bb14c1fd9a3de94622... |
from Child import Child
from Node import Node # noqa: I201
GENERIC_NODES = [
# generic-where-clause -> 'where' requirement-list
Node('GenericWhereClause', kind='Syntax',
children=[
Child('WhereKeyword', kind='WhereToken'),
Child('RequirementList', kind='GenericRequirementLis... | {
"content_hash": "b514cf121d0300143eb0bd8d19163b5c",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 74,
"avg_line_length": 39.34939759036145,
"alnum_prop": 0.5447030006123699,
"repo_name": "harlanhaskins/swift",
"id": "57ab1c5e67c4ca1adfa523789058d67d3f5c29cf",
"size": "3... |
from __future__ import unicode_literals
from celery.schedules import crontab
from indico.core.celery import celery
from indico.core.db import db
from indico.modules.events.surveys.models.surveys import Survey
@celery.periodic_task(name='survey_start_notifications', run_every=crontab(minute='*/30'))
def send_start_n... | {
"content_hash": "8121b0fc7a2f8873a5215f48594c148b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 117,
"avg_line_length": 36.86666666666667,
"alnum_prop": 0.7721518987341772,
"repo_name": "mic4ael/indico",
"id": "47ed535a1e40e955a0bc7c499d24d67709994517",
"size": "767",... |
"""Checks WebKit style for text files."""
from blinkpy.style.checkers.common import TabChecker
class TextChecker(object):
"""Processes text lines for checking style."""
def __init__(self, file_path, handle_style_error):
self.file_path = file_path
self.handle_style_error = handle_style_error
... | {
"content_hash": "376b6843a0345faf9519392d4c1d40e7",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 69,
"avg_line_length": 30.476190476190474,
"alnum_prop": 0.696875,
"repo_name": "chromium/chromium",
"id": "bc995b9040c3115e185955bd0e32afb21cb15c7b",
"size": "2228",
"bi... |
from django.conf.urls import patterns, url
from django.views.generic import View
urlpatterns = patterns(
'',
url('', View.as_view()),
)
| {
"content_hash": "bbb979c3e1c32daba2c29ccb5e7107d3",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 42,
"avg_line_length": 20.714285714285715,
"alnum_prop": 0.6827586206896552,
"repo_name": "dheeraj1991/django-after-response",
"id": "bb248abe7d8da0b3de57447f9bf6da7190d81b4e"... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'urleater.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'api/data', 'app.views.data'),
url(r'^$', 'app.views.index... | {
"content_hash": "78f2334f5f2c7c89fe4a24b97ef9bfdd",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 69,
"avg_line_length": 34.25,
"alnum_prop": 0.6186131386861314,
"repo_name": "renanvicente/urleater-server",
"id": "97787ecc08ad807abe56e75ff3e8970f554bfc2f",
"size": "548"... |
'''
Database installation script.
It uses the configuration settings from $COG_CONFIG_DIR/cog_settings.cfg
'''
import os
import cog
from cog.constants import SECTION_EMAIL
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from cog.mode... | {
"content_hash": "fc49fbdeae8a54c0d9162fe51fd308f2",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 133,
"avg_line_length": 42.676923076923075,
"alnum_prop": 0.6092285508291276,
"repo_name": "EarthSystemCoG/COG",
"id": "0fef6e910008fabc266330d36b9e40f167dbb1f5",
"size": ... |
from setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = [
]
setup(
name='fashionmodel',
version='0.1',
author = 'Google',
author_email = 'training-feedback@cloud.google.com',
install_requires=REQUIRED_PACKAGES,
packages=find_packages(),
include_package_data=Tr... | {
"content_hash": "31cf8de258953983136e63a082e35b32",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 56,
"avg_line_length": 23.058823529411764,
"alnum_prop": 0.6964285714285714,
"repo_name": "turbomanage/training-data-analyst",
"id": "3cc5bb4e4157a27669ee248e6490977bcda43bc4... |
from typing import Callable
from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY
from azure.ai.ml.entities._builders import Command
from azure.ai.ml.entities._job.pipeline._component_translatable import ComponentTranslatableMixin
# pylint: disable=unused-argument
def to_component(*, job: ComponentTranslat... | {
"content_hash": "3806dad5dbacd33274814424d2e884c8",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 119,
"avg_line_length": 40.23076923076923,
"alnum_prop": 0.7055449330783938,
"repo_name": "Azure/azure-sdk-for-python",
"id": "b111ace632ef1537d88ccffca71fa190e69cfcef",
"s... |
__author__ = 'chengbin.wang'
from django.conf.urls import patterns, url
from .views import ProductList, ProductDetail
urlpatterns = patterns('',
url(r'^$', ProductList.as_view(), name="work"),
url(r'^detail/(?P<pk>\S+)/$', ProductDetail.as_view(), name="work_detail"),
)
| {
"content_hash": "69ccb1a4a3d92f0927a6410ba516e0e6",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 79,
"avg_line_length": 28.2,
"alnum_prop": 0.6631205673758865,
"repo_name": "bin112/GreenShoots-Studio",
"id": "b462458215b1eaf4560e110488792ec869c5917c",
"size": "421",
... |
from django.contrib import admin
from .models import Images, Document
admin.site.register(Images)
admin.site.register(Document) | {
"content_hash": "461848dd9e2a65d41f8688cb5374077c",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 36,
"avg_line_length": 21.5,
"alnum_prop": 0.8217054263565892,
"repo_name": "calmhandtitan/Smush-It",
"id": "ba0eba37f9e6b6a08ce40019d94d57ca6940e5d2",
"size": "129",
"bin... |
import os
import sys
import sphinx
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
on... | {
"content_hash": "429f35f71698618883c64e35d3c50ca0",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 111,
"avg_line_length": 27.194174757281555,
"alnum_prop": 0.6152564560276091,
"repo_name": "MSLNZ/msl-qt",
"id": "c057db676abe51317ab53dc5b68697bb56ca7278",
"size": "8403"... |
import os
import tempfile
import requirements
def format_toml(data):
"""Pretty-formats a given toml string."""
data = data.split('\n')
for i, line in enumerate(data):
if i > 0:
if line.startswith('['):
data[i] = '\n{0}'.format(line)
return '\n'.join(data)
def mu... | {
"content_hash": "be0120b819af143c02b4ca2d22617200",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 108,
"avg_line_length": 28.910344827586208,
"alnum_prop": 0.5593988549618321,
"repo_name": "adrianliaw/pipenv",
"id": "8c50a1077d6af33c93639609fc9e4cf27208d101",
"size": "... |
def main():
import os
import argparse
from qap.script_utils import csv_to_pandas_df, read_txt_file, \
qap_csv_correlations
parser = argparse.ArgumentParser()
parser.add_argument("old_csv", type=str, \
help="path to the QAP CSV output f... | {
"content_hash": "05557e48f550bf079e63512a64f0eeec",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 78,
"avg_line_length": 34.816326530612244,
"alnum_prop": 0.5216881594372802,
"repo_name": "preprocessed-connectomes-project/quality-assessment-protocol",
"id": "7e8f234e7f35b... |
from django.forms import ModelForm
from django.core.exceptions import ValidationError
from django import forms
from apps.titulos.models import TituloNacional, EstadoTituloNacional, NormativaNacional, EstadoNormativaNacional
class TituloNacionalForm(forms.ModelForm):
nombre = forms.CharField(max_length=255, required=... | {
"content_hash": "7c086149e538a3162de8a9cc3f3cc8dd",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 173,
"avg_line_length": 52.5625,
"alnum_prop": 0.8180737217598097,
"repo_name": "MERegistro/meregistro",
"id": "68992c5c438bb3189a7bb5265a7d8b84d121c242",
"size": "865",
... |
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "64edd0bdd0ecde05b84fede49bec7b75",
"timestamp": "",
"source": "github",
"line_count": 1436,
"max_line_length": 162,
"avg_line_length": 39.74442896935933,
"alnum_prop": 0.640145077357069,
"repo_name": "radicalbit/ambari",
"id": "faa9b81f3f7e94a0e840fda8c67304d0a6658b39",
"size": "5... |
"""
Module which groups all the aggregated precomputed information in order to
save computational power.
"""
import pandas as pd
from FirmsLocations.Preprocess.preprocess_cols import cp2str
def read_agg(filepath):
"Read file of aggregated info."
table = pd.read_csv(filepath, sep=';')
table = cp2str(table... | {
"content_hash": "710bfff4f543f87096a5dc286295bd4c",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 74,
"avg_line_length": 25.272727272727273,
"alnum_prop": 0.7194244604316546,
"repo_name": "tgquintela/Mscthesis",
"id": "c99fcbb55477fc82ff789938f0e3527d43e5571d",
"size": ... |
import sys
import time
import hashlib
import random
import base64
import urllib
import os
import binascii
from urlparse import urlparse, urlunparse
from urllib2 import HTTPError, URLError
from types import ListType, DictType
from traceback import print_exc
from xml.dom.minidom import parseString
from xml.dom import exp... | {
"content_hash": "f120f1eb474f0de0d2efceae45274470",
"timestamp": "",
"source": "github",
"line_count": 1250,
"max_line_length": 482,
"avg_line_length": 47.0256,
"alnum_prop": 0.5218264094450682,
"repo_name": "aplicatii-romanesti/allinclusive-kodi-pi",
"id": "cd8b2eb7a4a6843d7ccec60e70f0b14f758f18d3"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.