text stringlengths 4 1.02M | meta dict |
|---|---|
'''
REST Server For DataBundle Libraries.
'''
from bottle import get, put, post, request, response #@UnresolvedImport
from bottle import HTTPResponse, static_file, install #@UnresolvedImport
from bottle import ServerAdapter, server_names #@UnresolvedImport
from decorator import decorator #@UnresolvedImport
import ... | {
"content_hash": "1f982fc48864da24eeb99b3637b1613d",
"timestamp": "",
"source": "github",
"line_count": 538,
"max_line_length": 111,
"avg_line_length": 29.449814126394052,
"alnum_prop": 0.619098712446352,
"repo_name": "treyhunner/databundles",
"id": "866bfc081cecfe3b4441e5a4479be17820c2decf",
"size... |
from django.conf.urls import patterns, include, url
# Import main view
from todo.views import Home
urlpatterns = patterns('',
# Main page
url( r'^$', Home.as_view() ),
# Include API URLs
url( r'^api/', include( 'api.urls' ) ),
)
| {
"content_hash": "21073e006ff7db4e5c3c2d4133d0fb53",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 51,
"avg_line_length": 18.923076923076923,
"alnum_prop": 0.6300813008130082,
"repo_name": "AxiaCore/todomvc-django",
"id": "44d2e60207c02fd4718bf1fffa63fd0830e34f7f",
"size... |
from django.db import models
from django.utils.encoding import force_bytes
from django.utils import timezone
# dependent on icalendar package - pip install icalendar
from icalendar import Calendar, Event, vDatetime, LocalTimezone
from datetime import datetime, timedelta
import urllib.request, urllib.error, urllib.pars... | {
"content_hash": "6e10ddb130ad6df2509362f43a0d9917",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 119,
"avg_line_length": 36.97037037037037,
"alnum_prop": 0.5834502103786816,
"repo_name": "zg/CSCWebsite",
"id": "15da3b807ec19c8a5445c081448e7d09396460cc",
"size": "4991"... |
from pythonforandroid.toolchain import Recipe, current_directory, shprint
import sh
import os.path
class LibpqRecipe(Recipe):
version = '9.5.3'
url = 'http://ftp.postgresql.org/pub/source/v{version}/postgresql-{version}.tar.bz2'
depends = []
def should_build(self, arch):
return not os.path.is... | {
"content_hash": "d5d2616bccb38606cc04537c93b8c332",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 88,
"avg_line_length": 33.46153846153846,
"alnum_prop": 0.6172413793103448,
"repo_name": "rnixx/python-for-android",
"id": "45c296a2a67aa7a23f9544509b22dbdffa9e00d7",
"size... |
import runStatus
import threading
import traceback
import sys
import os
import signal
def install_pystuck():
import pystuck
stuck_port = 6666
while 1:
try:
pystuck.run_server(port=stuck_port)
print("PyStuck installed to process, running on port %s" % stuck_port)
return
except OSError:
stuck_port +=... | {
"content_hash": "8aa8867db3ddf326dd37f5484dbf6d6f",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 73,
"avg_line_length": 21.545454545454547,
"alnum_prop": 0.7130801687763713,
"repo_name": "fake-name/ReadableWebProxy",
"id": "05e3e51f89625abee9acd19d13aa75134e72ccb5",
"s... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from builtins import range
from past.utils import old_div
from math import *
import proteus.MeshTools
from proteus import Domain
from proteus.default_n import *
from proteus import Context
'''
flow around a 2... | {
"content_hash": "6a90e70d4364396f7f3338d60f355365",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 110,
"avg_line_length": 26.270491803278688,
"alnum_prop": 0.6764430577223088,
"repo_name": "erdc/proteus",
"id": "fc3796217ca960c8a34fcc32db011891148f589c",
"size": "3205"... |
import argparse
import collections
import os
import sys
from spinnaker.run import check_run_and_monitor
from spinnaker.run import check_run_quick
from spinnaker.run import run_and_monitor
from spinnaker.run import run_quick
def get_repository_dir(name):
"""Determine the local directory that a given repository is i... | {
"content_hash": "4b7a01d1cb5c5cb1546d5b3d1a4c460f",
"timestamp": "",
"source": "github",
"line_count": 576,
"max_line_length": 80,
"avg_line_length": 40.802083333333336,
"alnum_prop": 0.6126287124500043,
"repo_name": "stitchfix/spinnaker",
"id": "8803371e19ae9606068eced1464c07e606671025",
"size": ... |
from builtins import object
import json
import sys
from datetime import datetime
from nose.plugins.skip import SkipTest
from nose.tools import assert_equal, assert_false, assert_true, assert_not_equal, assert_raises
from django.core import management
from django.db.utils import OperationalError
from beeswax.models im... | {
"content_hash": "22ff1b501e80a580a2403e5159ce7870",
"timestamp": "",
"source": "github",
"line_count": 1579,
"max_line_length": 139,
"avg_line_length": 40.671944268524385,
"alnum_prop": 0.6545211068030706,
"repo_name": "cloudera/hue",
"id": "00c797e17a8d4b0c218142729a163b3bfa94d77c",
"size": "6504... |
class IPStreetError(Exception):
pass
class ParamsInvalidError(IPStreetError):
pass
class APIConnectionError(IPStreetError):
pass
class SendError(IPStreetError):
pass
| {
"content_hash": "75b2dd41d3582b23fd31773ce41ae4bb",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 40,
"avg_line_length": 13.428571428571429,
"alnum_prop": 0.7553191489361702,
"repo_name": "IPStreet/PythonSDK",
"id": "e31e9515bb0bc029cb502984ef96936796648a0f",
"size": "1... |
"""Xception tests."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# Dependency imports
import numpy as np
from tensor2tensor.data_generators import problem_hparams
from tensor2tensor.models import xception
import tensorflow as tf
class XceptionTest... | {
"content_hash": "e3785646bda68822db8d90bfff2f08db",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 76,
"avg_line_length": 30.125,
"alnum_prop": 0.6655601659751037,
"repo_name": "waterblue13/tensor2tensor",
"id": "9114fb78157f45dcbca7d346d10e12d886d31a38",
"size": "1811",... |
import builtins
import unittest
import xml
import pytest
import astroid
from astroid import MANAGER, builder, exceptions, objects, test_utils, util
BUILTINS = MANAGER.astroid_cache[builtins.__name__]
class InstanceModelTest(unittest.TestCase):
def test_instance_special_model(self):
ast_nodes = builder.... | {
"content_hash": "b084224daedc9c88957fa87899123db0",
"timestamp": "",
"source": "github",
"line_count": 675,
"max_line_length": 85,
"avg_line_length": 31.17185185185185,
"alnum_prop": 0.5557720640653961,
"repo_name": "ruchee/vimrc",
"id": "5d438a65fbe3c404d15c602da086e6fcf3ab3045",
"size": "21688",... |
"""
SuperSocket.
"""
from __future__ import absolute_import
from select import select, error as select_error
import ctypes
import errno
import socket
import struct
import time
from scapy.config import conf
from scapy.consts import DARWIN, WINDOWS
from scapy.data import MTU, ETH_P_IP, SOL_PACKET, SO_TIMESTAMPNS
from s... | {
"content_hash": "c0bd36f6d25ccda7df1876defa446677",
"timestamp": "",
"source": "github",
"line_count": 538,
"max_line_length": 145,
"avg_line_length": 33.600371747211895,
"alnum_prop": 0.5221552248713835,
"repo_name": "4shadoww/hakkuframework",
"id": "4dff0ecf413ce25af3784e9d7ea0b03d391b02c3",
"si... |
from PIL import Image
import os
import math
import easygui
import webbrowser
import cloudinary
import cloudinary.uploader
import cloudinary.api
"""
QuickLogo v1.1 (Beta)
by William Wang
Takes in an image, strips it of most common-colored pixels,
then uploads it to a Cloudinary cloud of your choice.
T... | {
"content_hash": "1aadbcbfe0aab7adc2ddefbc8f3111d8",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 231,
"avg_line_length": 31.96875,
"alnum_prop": 0.6330400782013685,
"repo_name": "williamvwang/QuickLogo",
"id": "854e1dcdf474e902523893537631268104adbb6d",
"size": "5115"... |
import logging
import multiprocessing
import os
import time
import arrow
import OnePy as op
from OnePy.sys_module.metabase_env import OnePyEnvBase
from OnePy.utils.awesome_func import run_multiprocessing
from OnePy.utils.easy_func import get_day_ratio
class ForwardAnalysis(OnePyEnvBase):
def __init__(self):
... | {
"content_hash": "4a83099bcdba054d6f56ec6c509b7739",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 83,
"avg_line_length": 34.44,
"alnum_prop": 0.6085946573751452,
"repo_name": "Chandlercjy/OnePy",
"id": "c7706842e261a345a896ed07832c6e1d5b77b22d",
"size": "2641",
"binar... |
"""Tests for clause_search.inputs."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
import numpy as np
import tensorflow as tf
from deepmath.eprover import prover_clause_examples_pb2
from deepmath.guidance import inputs
FLAGS... | {
"content_hash": "179e884e04f4edcfad33703d7fa61ca7",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 80,
"avg_line_length": 39.21153846153846,
"alnum_prop": 0.574464606833415,
"repo_name": "tensorflow/deepmath",
"id": "a780cca46325e0a32c0f213bc332442231814c34",
"size": "1... |
"""
=====================
Classifier comparison
=====================
A comparison of a several classifiers in scikit-learn on synthetic datasets.
The point of this example is to illustrate the nature of decision boundaries
of different classifiers.
This should be taken with a grain of salt, as the intuition conveyed ... | {
"content_hash": "b92917f9766767a0a7bf6be1b157b03c",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 88,
"avg_line_length": 31.192307692307693,
"alnum_prop": 0.6491985203452528,
"repo_name": "TomDLT/scikit-learn",
"id": "b6fb666a4cd7176fd6cd5c0b514a4adc6d071f8b",
"size": ... |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
ex... | {
"content_hash": "283bd22ae9c73ad7df6a98cde8912a04",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 101,
"avg_line_length": 53.82706766917293,
"alnum_prop": 0.6435954742282441,
"repo_name": "MirkoPerrone/Scrips",
"id": "2ebb2c7481b677c46d95e2f785f099b680487589",
"size": ... |
import plotly.offline as offline
offline.init_notebook_mode(connected=True)
import plotly.graph_objects as go
fig = go.Figure(
data=[go.Bar(y=[2, 3, 1])],
layout=go.Layout(title="bar plot"))
fig.show()
fig.data[0].marker = dict(color='purple')
fig
| {
"content_hash": "ef433eda6dd3764a4ef1b6533cc4aff0",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 42,
"avg_line_length": 25.7,
"alnum_prop": 0.7042801556420234,
"repo_name": "mwouts/jupytext",
"id": "d3517da103887bf751335211e68c4375377f232a",
"size": "657",
"binary": ... |
from django.contrib.auth.decorators import login_required
from django.http import Http404
from django.http import HttpResponseRedirect
from django.shortcuts import render
from orchestra.bots.errors import StaffingResponseException
from orchestra.communication.staffing import get_available_requests
from orchestra.commu... | {
"content_hash": "239b5848e9d07dd7ca31268656048bb1",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 78,
"avg_line_length": 35.2,
"alnum_prop": 0.65650826446281,
"repo_name": "unlimitedlabs/orchestra",
"id": "f1f31ffd68156b961cf0deaac3e791c74657fed2",
"size": "1936",
"bi... |
import bokeh.server
from bokeh.plotting import line, circle, curdoc
from bokeh.widgetobjects import (VBoxModelForm, HBox,
BokehApplet, TextInput, PreText,
Select, Slider)
from bokeh.objects import Plot, ColumnDataSource
from bokeh.plot_object import Plo... | {
"content_hash": "c6e66afe88567e15003c291e2de0b8c9",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 83,
"avg_line_length": 34.316964285714285,
"alnum_prop": 0.5803304279953168,
"repo_name": "sahat/bokeh",
"id": "e185aa59bfc0add5380e07642855064de7e85814",
"size": "7687",
... |
import pytest
import tempfile
from vic import lib as vic_lib
@pytest.fixture()
def param_file(scope='function'):
p = 'GAUGE_HEIGHT 12.33\n'
temp = tempfile.NamedTemporaryFile(prefix='test_param', suffix='txt')
with open(temp.name, 'w') as f:
f.write(p)
return vic_lib.open_file(temp.name.encode... | {
"content_hash": "654012e0a1d5670102e7721e6e35d8bc",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 73,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.6943942133815552,
"repo_name": "UW-Hydro/VIC",
"id": "4767f9529e6bc04f295fee6898693becc5931e27",
"size": "553",
... |
from pyscf.prop.rotational_gtensor import rhf
from pyscf.prop.rotational_gtensor import uhf
#from pyscf.prop.magnetizability import dhf
RHF = rhf.RotationalGTensor
UHF = uhf.RotationalGTensor
#DHF = dhf.RotationalGTensor
try:
from pyscf.prop.rotational_gtensor import rks
from pyscf.prop.rotational_gtensor imp... | {
"content_hash": "b930e3628444ae9d7f9c5d986adeb3ca",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 49,
"avg_line_length": 28.066666666666666,
"alnum_prop": 0.7885985748218527,
"repo_name": "gkc1000/pyscf",
"id": "f45dca45ec13babdb8c0bc7d53079cd47c5018ec",
"size": "1103",... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name=... | {
"content_hash": "716d494734a0caa1cc9a5a785a6466ba",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 266,
"avg_line_length": 51.39041095890411,
"alnum_prop": 0.5371184859389577,
"repo_name": "openconnectome/open-connectome",
"id": "24cbde84e39ab6c5b85c5e3e3f4a62c7c81128cc",... |
import calendar
import itertools
import logging
from datetime import datetime, timedelta, time
from django import http
from django.db import models
from django.template.context import RequestContext
from django.shortcuts import get_object_or_404, render
from swingtime.models import Event, Occurrence
from swingtime im... | {
"content_hash": "5a4d6f7cc3f10d59b687462cd5be8223",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 104,
"avg_line_length": 29.952095808383234,
"alnum_prop": 0.5671731307477009,
"repo_name": "FortschrittApps/django-swingtime",
"id": "36419f19fbe6d51f2c3f0f87bc9053b04f39d20... |
from direct.actor.Actor import Actor
from panda3d.bullet import BulletBoxShape
from panda3d.bullet import BulletCharacterControllerNode
from panda3d.core import *
# My Game Classes
from Settings import *
# Members:
# controllerNode
# nodePath
# animator
# pose
class Character():
def __init__(self, world, r... | {
"content_hash": "ee9ccc87f07de8ff16e3ef22a0b258fa",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 77,
"avg_line_length": 31.92792792792793,
"alnum_prop": 0.5973476297968398,
"repo_name": "LIHAOLIN/Lego-Adventure",
"id": "d1fc43ce20a26fcd4420234a34f1486a7fa9a0c2",
"size... |
"""Support for Ubee router."""
import logging
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.const import (
CONF_HOST, CONF_PASSWORD, CONF_USERNAME)
import homeassistant.helpers.config_validation as cv
_LOGGER = loggin... | {
"content_hash": "57e88fe461c928304b238db66398a57b",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 75,
"avg_line_length": 28.87878787878788,
"alnum_prop": 0.6647429171038824,
"repo_name": "molobrakos/home-assistant",
"id": "8e610a4f51c8083e9393922416cfcf8ea46bf1b1",
"siz... |
from swgpy.object import *
from swgpy.command import BaseSwgCommand
from swgpy import ACTION
class PeaceCommand(BaseSwgCommand):
def getCommandName(self):
return 'peace'
def run(self):
actor = self.getActor()
target = self.getTarget()
if actor.hasState(ACTION.COMBAT):
... | {
"content_hash": "1d124af80979a68f39956bce34717111",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 92,
"avg_line_length": 33.28125,
"alnum_prop": 0.6065727699530516,
"repo_name": "anhstudios/swganh",
"id": "7b8630629f12911ace7221bc472160189426eed5",
"size": "1065",
"bi... |
"""
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
import sys
import warnings
from collections import OrderedDict, deque
from django.conf import settings
from django.core import exceptions
from django.db import (
DJANGO_VERSION_PICKLE_KEY, IntegrityError, connections, ... | {
"content_hash": "cde04ab2314f45ecf7772fec458c8aec",
"timestamp": "",
"source": "github",
"line_count": 1725,
"max_line_length": 115,
"avg_line_length": 39.893913043478264,
"alnum_prop": 0.589272999404217,
"repo_name": "benjaminjkraft/django",
"id": "b1bebcaca09d8654e6b641d0f25c4cfa6c0b9cd7",
"size... |
"""Utilities for handling different array flavors in PyTables.
Variables
=========
`__docformat`__
The format of documentation strings in this module.
`internal_flavor`
The flavor used internally by PyTables.
`all_flavors`
List of all flavors available to PyTables.
`alias_map`
Maps old flavor names to... | {
"content_hash": "352e25048980a944a22d83f42afe78f6",
"timestamp": "",
"source": "github",
"line_count": 428,
"max_line_length": 79,
"avg_line_length": 30.123831775700936,
"alnum_prop": 0.6573334367486233,
"repo_name": "PyTables/PyTables",
"id": "41bbbc8a3f6a65f5495a2d85405cc4cc5573c4c2",
"size": "1... |
from django import test
from ievv_opensource.ievv_sms import sms_registry
class TestAbstractSmsBackend(test.TestCase):
def test_get_sms_text_length(self):
self.assertEqual(sms_registry.AbstractSmsBackend.get_sms_text_length('Åge{^'), 7)
def test_get_max_length(self):
self.assertEqual(sms_reg... | {
"content_hash": "f56594ddabddd1cbff2131efb66bca74",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 89,
"avg_line_length": 37.9,
"alnum_prop": 0.7189973614775725,
"repo_name": "appressoas/ievv_opensource",
"id": "06bc8ed4820724d9e36b993321a4851a45082a8d",
"size": "759",
... |
import unittest2 as unittest
import tinctest
from tinctest import TINCTestCase
from test_tinc_sample import test_data_provider
@unittest.skip('mock test case for discovery tests')
class TINCTestCaseWithDataProvider(TINCTestCase):
"""
@maintainer balasr3
"""
def test_1_sample(self):
"""
... | {
"content_hash": "0c1575c50caeb3bbcbe0cb49c5ed152b",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 70,
"avg_line_length": 24.15,
"alnum_prop": 0.6666666666666666,
"repo_name": "Quikling/gpdb",
"id": "245b1b3a81aeeece4ed9451a64ee37567777400e",
"size": "483",
"binary": f... |
""" Command line interface.
"""
# Copyright © 2015 1&1 Group <btw-users@googlegroups.com>
#
# 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
#... | {
"content_hash": "f48269b96ea6c30bd77b54aa9f350398",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 110,
"avg_line_length": 37.50574712643678,
"alnum_prop": 0.6760649708856881,
"repo_name": "spodkowinski/bootils",
"id": "59b9ac192f00b63d3decaa8d0812468008030ffa",
"size": ... |
import datetime, re
from app import db
from app import login_manager
from app import bcrypt
def slugify(s):
return re.sub('[^\w]+', '-', s).lower()
entry_tags = db.Table('entry_tags',
db.Column('tag_id', db.Integer, db.ForeignKey('tag.id')),
db.Column('entry_id', db.Integer, db.ForeignKey('entry.id'))
)
... | {
"content_hash": "463d6de8715fd3603656557e4a3f83a1",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 77,
"avg_line_length": 29.113333333333333,
"alnum_prop": 0.6201053354705748,
"repo_name": "garwon/blog",
"id": "63ec2139706a292eaafd87ecbff8e003e099c53d",
"size": "4367",
... |
import json
import os
import re
import time
from datetime import datetime
import mwparserfromhell
os.environ['PYWIKIBOT_DIR'] = os.path.dirname(os.path.realpath(__file__))
import pywikibot
from config import config_page_name # pylint: disable=E0611,W0614
os.environ['TZ'] = 'UTC'
site = pywikibot.Site()
site.login()... | {
"content_hash": "34aafe030ff5a6191b531829f0e8b1d9",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 129,
"avg_line_length": 29.026666666666667,
"alnum_prop": 0.6587046394120349,
"repo_name": "Xi-Plus/Xiplus-Wikipedia-Bot",
"id": "ca6bd517f699e151fce206b63a20d88daca975a8",
... |
"""
@name: Modules/House/Family/__init__.py
@author: D. Brian Kimmel
@contact: D.BrianKimmel@gmail.com
@copyright: (c) 2013-2020 by D. Brian Kimmel
@note: Created on May 17, 2013
@license: MIT License
@summary:
To add a family named 'NewFamily', do the following:
* Add a package named 'New_Family'... | {
"content_hash": "bdea11be4db458d89f8d01078f50018b",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 66,
"avg_line_length": 23.09375,
"alnum_prop": 0.6001353179972937,
"repo_name": "DBrianKimmel/PyHouse",
"id": "b2927605b32e820515c5f4ac99db82bc80dbebdf",
"size": "1478",
... |
"""This example adds an ad extension override to a given campaign. To get
campaigns, run get_campaigns.py.
Tags: GeoLocationService.get, AdExtensionOverrideService.mutate
Api: AdWordsOnly
"""
__author__ = 'api.kwinter@gmail.com (Kevin Winter)'
import os
import sys
sys.path.insert(0, os.path.join('..', '..', '..', '.... | {
"content_hash": "1e0bf57e7fe7b918ff58fbe3f04ef8a6",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 80,
"avg_line_length": 32.51685393258427,
"alnum_prop": 0.5442294402211472,
"repo_name": "nearlyfreeapps/python-googleadwords",
"id": "1d7b48ab0fbe697f25b916c2ce4b974b2771bd5... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dnollkse', '0003_delete_document'),
]
operations = [
migrations.AlterField(
model_name='config',
name='favicon_url',
... | {
"content_hash": "38f034305a6b404ced2ef210bd72101b",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 58,
"avg_line_length": 30.264150943396228,
"alnum_prop": 0.5467581047381546,
"repo_name": "Jassob/DNollK.se",
"id": "009018fef05ad0e7d6d06defff2e116f2bcf4dfe",
"size": "167... |
"""Tests for distutils.command.sdist."""
import os
import tarfile
import unittest
import warnings
import zipfile
from os.path import join
from textwrap import dedent
from test.support import captured_stdout, check_warnings, run_unittest
try:
import zlib
ZLIB_SUPPORT = True
except ImportError:
ZLIB_SUPPORT ... | {
"content_hash": "3f2bfefe7c9829961156ec7148fff5d2",
"timestamp": "",
"source": "github",
"line_count": 484,
"max_line_length": 77,
"avg_line_length": 34.06404958677686,
"alnum_prop": 0.5763328683204949,
"repo_name": "mottosso/mindbender-setup",
"id": "5444b815a8b2349883ec5ade2583b63f2067fa5a",
"si... |
import riprova
# Store number of function calls for error simulation
calls = 0
# Max number of retries attempts
retries = 5
# Register retriable operation with custom evaluator
@riprova.retry(backoff=riprova.FibonacciBackoff(retries=retries))
def mul2(x):
global calls
if calls < 4:
calls += 1
... | {
"content_hash": "3a82f6c3cd691888c719bddeefcb6ad0",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 65,
"avg_line_length": 18.708333333333332,
"alnum_prop": 0.7015590200445434,
"repo_name": "h2non/riprova",
"id": "85a9bcae0ef702f7ca27a073904fe8d534196a58",
"size": "473",
... |
from __future__ import absolute_import
import os
import tempfile
# Find the best implementation available
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import mock
from nose.tools import assert_raises
import numpy as np
import PIL.Image
from . import errors
from . imp... | {
"content_hash": "6ef576febb8ddecb53bc2ef27f27b044",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 113,
"avg_line_length": 33.37948717948718,
"alnum_prop": 0.48486710708250114,
"repo_name": "gheinrich/DIGITS-GAN",
"id": "89a76510e846de5658bb3e4cf0067e2d3fd1770c",
"size"... |
"""Test cases for the API stream sensor."""
from homeassistant.bootstrap import async_setup_component
from .test_auth import test_auth_active_with_token
from tests.common import assert_setup_component
async def test_websocket_api(
hass, no_auth_websocket_client, hass_access_token, legacy_auth
):
"""Test AP... | {
"content_hash": "b65dcc77737cf5c289dc19ac9ee43628",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 88,
"avg_line_length": 29.70967741935484,
"alnum_prop": 0.6872964169381107,
"repo_name": "Teagan42/home-assistant",
"id": "2c7117378516c25a229166f96d9f734b5ef31316",
"size"... |
import unittest
from unittest.mock import patch
from airflow.providers.celery.sensors.celery_queue import CeleryQueueSensor
class TestCeleryQueueSensor(unittest.TestCase):
def setUp(self):
class TestCeleryqueueSensor(CeleryQueueSensor):
def _check_task_id(self, context):
retur... | {
"content_hash": "b3b84de4d6dec38f8ec30e955528aa6c",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 88,
"avg_line_length": 37.63636363636363,
"alnum_prop": 0.6594202898550725,
"repo_name": "danielvdende/incubator-airflow",
"id": "4b3820802fa180adde1938986b04906ec0ef6064",
... |
from django.contrib import admin
from .models import Table, Chair
from simple_history.admin import SimpleHistoryAdmin
class TableAdmin(admin.ModelAdmin):
list_display=(
"id",
"created",
"owner",
"name",
"weight"
)
#admin.site.register(Table,TableAdmin)
admin.site.register(Table, SimpleHistoryAdmin)
c... | {
"content_hash": "b00e9096394e38086761fbbe1094ae13",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 51,
"avg_line_length": 19.40909090909091,
"alnum_prop": 0.7353629976580797,
"repo_name": "wasit7/tutorials",
"id": "ebf6e0cf5ecc7cdc93d3ce4c6355c08cabe174f5",
"size": "427"... |
"""resource.py contains the base resource classes that user-created
resources depend on in steno3d
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from json import dumps
from pprint import pformat
from six import ... | {
"content_hash": "39e44333e7bd20a1afa88797f918d648",
"timestamp": "",
"source": "github",
"line_count": 566,
"max_line_length": 79,
"avg_line_length": 35.3922261484099,
"alnum_prop": 0.520367412140575,
"repo_name": "3ptscience/steno3dpy",
"id": "1f7cf29dde2a96a5537ce05fdf272e79303e0bd6",
"size": "2... |
import datetime
import json
import os
import time
from uuid import UUID, uuid4
from django import forms as django_forms, http
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.core.files.storage import default_storage as storage
from django.db import transaction
from dja... | {
"content_hash": "7e7d8d0f0158f4cbf11063a0772912d6",
"timestamp": "",
"source": "github",
"line_count": 1806,
"max_line_length": 79,
"avg_line_length": 38.27408637873754,
"alnum_prop": 0.6108965178016,
"repo_name": "lavish205/olympia",
"id": "b614cb4d572f0771caa7e717e9394afdbbc2d6c3",
"size": "6912... |
"""heatmap visualization."""
from django.conf import settings
from apps.managers.team_mgr.models import Group
def supply(request, page_name):
""" Handle the request for viz_heatmap widget."""
_ = page_name
_ = request
all_groups = Group.objects.order_by('name').all()
for group in all_groups:
... | {
"content_hash": "31273fb4fc908fe925145ad15d847a8d",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 93,
"avg_line_length": 29.142857142857142,
"alnum_prop": 0.634313725490196,
"repo_name": "csdl/makahiki",
"id": "94b20d57dbb316bddee16e5aa3972b9a434422a7",
"size": "1020",
... |
import psycopg2
def connect():
"""Connect to the PostgreSQL database. Returns a database connection."""
return psycopg2.connect("dbname=tournament")
def deleteMatches():
"""Remove all the match records from the database."""
db = connect()
db_cursor = db.cursor()
query = "DELETE FROM matches... | {
"content_hash": "cdccebbd316ba9a1dd23e80ffda2a180",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 140,
"avg_line_length": 29.4390243902439,
"alnum_prop": 0.6498204915769125,
"repo_name": "guillermogfer/tournament-results",
"id": "7adfb4c127bda3e01986809a2229e1821606e4e7"... |
"""Package for provider specific object_storage_service implementations."""
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
| {
"content_hash": "a2d784158d6a341b5c6ddc3c5ad408c5",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 75,
"avg_line_length": 70.5,
"alnum_prop": 0.6808510638297872,
"repo_name": "GoogleCloudPlatform/PerfKitBenchmarker",
"id": "f509ee3882bff959d2793b555d8c11a9ef48f93f",
"size... |
import collections
import errno
import logging
import math
import os
import re
import threading
import urllib
import urlparse
import json
import time
import Queue
import datetime
import dateutil.parser
try:
import ordereddict
except:
pass
import requests
import requests.utils
import gertty.version
from gertty... | {
"content_hash": "c1acfbd8a51b326763891d67d542c530",
"timestamp": "",
"source": "github",
"line_count": 1400,
"max_line_length": 172,
"avg_line_length": 42.11785714285714,
"alnum_prop": 0.5336385991689986,
"repo_name": "aspiers/gertty",
"id": "96a0fba31c340f2cf049bfbc57e2e3f59589f560",
"size": "596... |
from entities import *
class Account(Entity):
id = IntegerField(group=PRIMARY) # this field is in primary key group
iban = IntegerField(group=SECONDARY) # this is in secondary key group
balance = FloatField(default=0.0)
class Name(Entity):
first_name = StringField(group=SECONDARY)
last_name = ... | {
"content_hash": "6d1f2607683b0e25004b26d2e8c32766",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 75,
"avg_line_length": 28.020408163265305,
"alnum_prop": 0.705753823743627,
"repo_name": "eseraygun/python-entities",
"id": "8b9be07a4dc983c66a3b063730c2301d2dc377a6",
"siz... |
from typing import Type
from perfetto.trace_uri_resolver import util
from perfetto.trace_uri_resolver.resolver import TraceUriResolver
class PathUriResolver(TraceUriResolver):
PREFIX: str = None
def __init__(self, path: str):
self.path = path
def resolve(self) -> TraceUriResolver.Result:
return [
... | {
"content_hash": "479c8b46ea5e15710c1867514c95cb1f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 66,
"avg_line_length": 26.59090909090909,
"alnum_prop": 0.6871794871794872,
"repo_name": "google/perfetto",
"id": "ca5893af0ec7a88b99feebc29263ea59df90687f",
"size": "1186"... |
from supriya.tools.ugentools.PureUGen import PureUGen
class Impulse(PureUGen):
r'''A non-band-limited single-sample impulse generator unit generator.
::
>>> ugentools.Impulse.ar()
Impulse.ar()
'''
### CLASS VARIABLES ###
__documentation_section__ = 'Oscillator UGens'
__sl... | {
"content_hash": "ea54625c2e83c00d41a0b260fe6cbd87",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 76,
"avg_line_length": 22.223880597014926,
"alnum_prop": 0.48791134989926127,
"repo_name": "andrewyoung1991/supriya",
"id": "58db943bf2c0de1d80b34ba2ac374b9f4119c9a4",
"si... |
"""Support for monitoring an SABnzbd NZB client."""
from __future__ import annotations
from datetime import timedelta
import logging
from pysabnzbd import SabnzbdApi, SabnzbdApiException
import voluptuous as vol
from homeassistant.components.discovery import SERVICE_SABNZBD
from homeassistant.const import (
CONF... | {
"content_hash": "d87bc7feee53ecd929e4b706fb0a52e0",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 87,
"avg_line_length": 32.3003663003663,
"alnum_prop": 0.6358584713086868,
"repo_name": "sander76/home-assistant",
"id": "a420ca5381462e9e0bfdf9d4be2b1086ac9d8a8a",
"size"... |
import logging
from fusion_attention import AttentionMask, FusionAttention
from fusion_reshape import FusionReshape
from onnx import numpy_helper
from onnx_model import OnnxModel
from onnx_model_bert import BertOnnxModel
logger = logging.getLogger(__name__)
class FusionBartEncoderAttention(FusionAttention):
"""... | {
"content_hash": "d1547d40e71903630cca956544ea9bea",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 120,
"avg_line_length": 36.463022508038584,
"alnum_prop": 0.5428571428571428,
"repo_name": "microsoft/onnxruntime",
"id": "33db231c523324387a6afca7e59b5e3ed17ed119",
"size... |
"""
_setup.py_
Cloudant / CouchDB Client Library
"""
from io import open
from os import path
from setuptools import setup, find_packages
requirements_file = open('requirements.txt')
requirements = requirements_file.read().strip().split('\n')
requirements_file.close()
version_file = open('VERSION')
version = version... | {
"content_hash": "3da76e1839fd5109366fcc0c9b5f8ca2",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 73,
"avg_line_length": 30.6734693877551,
"alnum_prop": 0.6393878908848969,
"repo_name": "cloudant/python-cloudant",
"id": "a8ac4ef866638c24fde4f5762d309eeb52b43a0e",
"size"... |
import functools
import imath
import IECore
import Gaffer
import GafferUI
import GafferScene
import GafferSceneUI
import GafferDispatch
import GafferDispatchUI
##########################################################################
# Colour
#########################################################################... | {
"content_hash": "caade512bb140d7d534d453f979e95f6",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 131,
"avg_line_length": 54.098765432098766,
"alnum_prop": 0.7382473756275674,
"repo_name": "appleseedhq/gaffer",
"id": "7f6ac11e306f74710ab10442c51961cb528817e9",
"size": "... |
import collections
import re
import netaddr
from oslo_config import cfg
from oslo_log import log as logging
import six
from neutron.agent import firewall
from neutron.agent.linux import ip_conntrack
from neutron.agent.linux import ipset_manager
from neutron.agent.linux import iptables_comments as ic
from neutron.agen... | {
"content_hash": "06787856835d92a415ed62457ca90449",
"timestamp": "",
"source": "github",
"line_count": 904,
"max_line_length": 79,
"avg_line_length": 44.77654867256637,
"alnum_prop": 0.5695439497998913,
"repo_name": "adelina-t/neutron",
"id": "a695733e89aed77c5b6fa28549244ad7e294411f",
"size": "41... |
"""A setup module for the gRPC Python package."""
import os
import os.path
import shutil
import sys
from distutils import core as _core
from distutils import extension as _extension
import setuptools
from setuptools.command import egg_info
import grpc.tools.command
PY3 = sys.version_info.major == 3
# Ensure we're ... | {
"content_hash": "b0009cc985b667167460ca474db8f680",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 78,
"avg_line_length": 23.934065934065934,
"alnum_prop": 0.6786042240587695,
"repo_name": "a-veitch/grpc",
"id": "3524355cbfc62a752cab2cde98773bb037c04150",
"size": "3707",... |
"""
local path implementation.
"""
from __future__ import with_statement
from contextlib import contextmanager
import sys, os, atexit, io, uuid
import py
from py._path import common
from py._path.common import iswin32, fspath
from stat import S_ISLNK, S_ISDIR, S_ISREG
from os.path import abspath, normpath, isabs, exi... | {
"content_hash": "ad34032eb056fa51cec171b6ac0b1a80",
"timestamp": "",
"source": "github",
"line_count": 1027,
"max_line_length": 111,
"avg_line_length": 35.73222979552094,
"alnum_prop": 0.5169632395018666,
"repo_name": "lmregus/Portfolio",
"id": "0e856a66da06f0dacc92feb680c435b915e3b2da",
"size": "... |
"""
sdksolver_stress_unit_tests.py
"stress tests" sdk solver with 10's of thousand valid solved and unsolved puzzles
read from file
:created on: 20160616
__author__ = 'Frederic Dupont'
:License: GPL3
"""
# @TODO: Try to use ddt module --> data driven tests to simplify further
import random
import unittest
from sudok... | {
"content_hash": "e97796a5f8d5dc884b8858ad0b706c83",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 113,
"avg_line_length": 39.88235294117647,
"alnum_prop": 0.6622418879056047,
"repo_name": "ReblochonMasque/sudoku",
"id": "fa7caa46caf0190ca4478bf2dd84ffbb4ce8e2ec",
"size"... |
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
class vtkRectilinearSynchronizedTemplates(SimpleVTKClassModuleBase):
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
vtk.vtkRectilinearSynchronizedTemplates(), 'Pr... | {
"content_hash": "9916e191a14951e37c7b874955f69e82",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 69,
"avg_line_length": 42.81818181818182,
"alnum_prop": 0.692144373673036,
"repo_name": "chrisidefix/devide",
"id": "15efc3b9c82e2def766ef773a7fb04e508b5c193",
"size": "532... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/mission/quest_item/shared_brass_marshoo_q1_needed.iff"
result.attribute_template_id = -1
result.stfName("loot_nboo_n","brass_marshoo_q1_needed")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
... | {
"content_hash": "d09bade27eabbd62f4a070d1a2834869",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 90,
"avg_line_length": 25.846153846153847,
"alnum_prop": 0.7053571428571429,
"repo_name": "anhstudios/swganh",
"id": "5660c2c170766392bacc1e61c8bb89551ddf1818",
"size": "48... |
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 = "PolyTrend", cycle_length = 30, transform = "RelativeDifference", sigma = 0.0, exog_count = 20, ar_order = 0); | {
"content_hash": "dd704a6f207c643a4021803b87b9dd5a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 174,
"avg_line_length": 39.142857142857146,
"alnum_prop": 0.7153284671532847,
"repo_name": "antoinecarme/pyaf",
"id": "423181044ae6772d9476fb5c3c24aca97376543b",
"size": "27... |
"""
Django settings for scrum project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... | {
"content_hash": "3684e8679d26dfc72bcb7b432ba7ae6c",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 91,
"avg_line_length": 26.007874015748033,
"alnum_prop": 0.6784741144414169,
"repo_name": "mezklador/lightweight-django",
"id": "3a8b4aee66069a128c6618b88209f700ed6a1342",
... |
import os
from bunch import Bunch
import yaml
CWD = os.getcwd()
C = Bunch(solar_db="")
C.riak_ensemble = False
C.lock_bucket_type = None
C.counter_bucket_type = None
C.log_file = 'solar.log'
C.system_log_address = 'ipc:///tmp/solar_system_log'
C.tasks_address = 'ipc:///tmp/solar_tasks'
C.scheduler_address = 'ipc:/... | {
"content_hash": "4f59e96a4e34a9c4f5078154b9224982",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 64,
"avg_line_length": 23.582278481012658,
"alnum_prop": 0.5442834138486312,
"repo_name": "pigmej/solar",
"id": "9d8a06bb538c02857a5049bdc3b789e9c493806a",
"size": "2474",
... |
from os import listdir, sep
from os.path import isdir, join
def all_ok(functions, item):
return all(f(item) for f in functions)
def ls(path, d_ok=(), f_ok=(), base=None):
for item in listdir(path):
if isdir(item) and all_ok(d_ok, item):
for k in ls(item, ok, item):
yield ... | {
"content_hash": "17c2515ec04764995bc6f228e1593a23",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 53,
"avg_line_length": 24.863636363636363,
"alnum_prop": 0.5447897623400365,
"repo_name": "eugene-eeo/piggyback",
"id": "51ea107ea3ed2c2157f7fa964fe707d49a1d315f",
"size": ... |
import unittest
from unittest import mock
from parameterized import parameterized
from airflow import configuration
from airflow.providers.amazon.aws.hooks.glue import GlueJobHook
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
from airflow.providers.amazon.aws.operators.glue import GlueJobOperator
class T... | {
"content_hash": "b9bfe3840e55cef723c5defd1d57185e",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 101,
"avg_line_length": 39.89855072463768,
"alnum_prop": 0.6378496185978932,
"repo_name": "bolkedebruin/airflow",
"id": "be60057392a99cdca34aa7826ac62c19c526871b",
"size": ... |
from preprocessing import builder
from preprocessing.builder import Dataset
ds = Dataset("simple", 'data/simple/categories', 'data/simple/simple-20120104-titlecat.twr',
'data/simple/simple-20120104-catlinks.twr',
'data/simple/simple-20120104-pagetitle.twr',
... | {
"content_hash": "cabeeb3ce094431fcdf0ad5d12546b25",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 92,
"avg_line_length": 49.8125,
"alnum_prop": 0.562107904642409,
"repo_name": "Humblehound/WikiSpatialTree",
"id": "c0432c90d07bc74bb334917d3aad9cad8d19fdf8",
"size": "797"... |
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
The Imitater
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Functers.Functer"
DecorationModuleStr="ShareYourSystem.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugm... | {
"content_hash": "daf99ae250f75849cf837069b00c685f",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 124,
"avg_line_length": 23.113744075829384,
"alnum_prop": 0.7094525322944433,
"repo_name": "Ledoux/ShareYourSystem",
"id": "3f8b88c19c593c404707ef144e11ba3ed5d51987",
"siz... |
import pytest
from neotiles import (
MatrixSize, PixelColor, Tile, TileManager, TilePosition)
from neotiles.matrixes import NTNeoPixelMatrix, NTRGBMatrix
from .fixtures import manager_neopixel, manager_rgb
class TestTileManager:
@pytest.mark.parametrize('manager', [manager_neopixel(), manager_rgb()])
de... | {
"content_hash": "ac32b9355b9206a61af9a5f696671473",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 82,
"avg_line_length": 36.47435897435897,
"alnum_prop": 0.5454012888107791,
"repo_name": "mjoblin/neotiles",
"id": "df96b456f444a0d55408f85dff21bed795ce3c2c",
"size": "853... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import filecmp
import os
import numpy as np
import tensorflow as tf
from tensorflow_examples.lite.model_maker.core import test_util
from tensorflow_examples.lite.model_maker.core.data_util import object_dete... | {
"content_hash": "5dd60414e92ce5bc7571a9e75819d418",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 90,
"avg_line_length": 40.4051724137931,
"alnum_prop": 0.7136761254533817,
"repo_name": "tensorflow/examples",
"id": "3430feaf988fbc10941f026fc537568ac0cd5661",
"size": "5... |
"""SCons.Scanner.Fortran
This module implements the dependency scanner for Fortran code.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 Sof... | {
"content_hash": "af19d6147f4f14cdd35635edf62e63ee",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 125,
"avg_line_length": 45.32911392405063,
"alnum_prop": 0.599832449036582,
"repo_name": "EmanueleCannizzaro/scons",
"id": "179c8dbfd04616fb86ca84887acaf291a8222a7d",
"siz... |
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__) # @ReservedAssignment
| {
"content_hash": "3caeea89b14d474bb10ee7d1fe7fa62a",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 69,
"avg_line_length": 25.5,
"alnum_prop": 0.6715686274509803,
"repo_name": "pgbidkar/vsphere-automation-sdk-python",
"id": "59b403a2246a77aa245bcc52d60b8b6a72185c93",
"size... |
from collections import deque
import base64
import gzip as gzip_module
import hashlib
import os
import re
import time
import uuid
from html import escape
from io import BytesIO
def resolve_content(response):
return b"".join(item for item in response.iter_content(read_file=True))
class Pipeline(object):
pip... | {
"content_hash": "2238fb9b7586b031ac7dd0597784148a",
"timestamp": "",
"source": "github",
"line_count": 555,
"max_line_length": 106,
"avg_line_length": 33.5045045045045,
"alnum_prop": 0.5613874697499328,
"repo_name": "ric2b/Vivaldi-browser",
"id": "740a2268fdd98c0e08846b7fc2a36e36ff79d94d",
"size":... |
"""Automatically setup docs for a project
Call from command line:
bench setup-docs app path
"""
from __future__ import unicode_literals
import os, json, frappe, shutil, re
from frappe.website.context import get_context
from frappe.utils import markdown
class setup_docs(object):
def __init__(self, app):
"""Gene... | {
"content_hash": "474b5e61bd1c07339097f4ba24fbfed4",
"timestamp": "",
"source": "github",
"line_count": 459,
"max_line_length": 102,
"avg_line_length": 32.64052287581699,
"alnum_prop": 0.65812308103057,
"repo_name": "elba7r/frameworking",
"id": "d9de3897c1ccac62790a6ebdefa19b7cce2b81b4",
"size": "1... |
import threading
import weakref
from django.utils.inspect import func_accepts_kwargs
def _make_id(target):
if hasattr(target, '__func__'):
return (id(target.__self__), id(target.__func__))
return id(target)
NONE_ID = _make_id(None)
# A marker for caching
NO_RECEIVERS = object()
class Signal:
... | {
"content_hash": "3eaf4e8a726ed96b45f63011ec138957",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 94,
"avg_line_length": 36.45150501672241,
"alnum_prop": 0.5784016882282779,
"repo_name": "auready/django",
"id": "5599b9fdfcb7d84ddc88492ddc5cb34519cd4539",
"size": "10899... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('symposion_speakers', '0002_speaker_twitter_username'),
]
operations = [
migrations.AlterField(
model_name='... | {
"content_hash": "8888151c35c9e6dd00b3a3e34a31e7d5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 114,
"avg_line_length": 25.789473684210527,
"alnum_prop": 0.6510204081632653,
"repo_name": "pydata/symposion",
"id": "cf6dfcdbd214757c871169446744ac2499ca5f5c",
"size": "56... |
from django.contrib import admin
from windyer_comments.models import Comment
class CommentAdmin(admin.ModelAdmin):
search_fields = ('user__username', 'article__title', 'text')
list_filter = ('create_time',)
list_display = ('user', 'article', 'text', 'create_time')
fields = ('user', 'article', 'parent'... | {
"content_hash": "2564ce291c17f5bdd0942c4724260b3d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 64,
"avg_line_length": 34,
"alnum_prop": 0.6871657754010695,
"repo_name": "windyer/windyer_blog",
"id": "0ea28d5989a3f95f268fc79ff10d52e8a041cfd9",
"size": "398",
"binary... |
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/particle/shared_particle_test_31.iff"
result.attribute_template_id = -1
result.stfName("obj_n","unknown_object")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "181fcc41e88b25b1f01673882eb24b86",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 71,
"avg_line_length": 23.076923076923077,
"alnum_prop": 0.69,
"repo_name": "anhstudios/swganh",
"id": "eb21f06bc77d5603b27498aecd692932815cf1ae",
"size": "445",
"binary"... |
"""
WSGI config for blogproject project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_... | {
"content_hash": "0a994d2087bbd8e222e53709dae4e9e7",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 25,
"alnum_prop": 0.775,
"repo_name": "RebelBIrd/Blog",
"id": "27ee598dc0f7fea0723314286476a0c276bf1969",
"size": "400",
"binary": false,
"copies... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | {
"content_hash": "d69ec28a2ab0d0a581a82b23b360a662",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 115,
"avg_line_length": 38.9,
"alnum_prop": 0.7583547557840618,
"repo_name": "alexus37/AugmentedRealityChess",
"id": "8729a7243b35efcaadb2a3e41177e1c98d80f9ac",
"size": "77... |
import sys
from mox3 import mox
from neutronclient.neutron.v2_0.fw import firewallpolicy
from neutronclient import shell
from neutronclient.tests.unit import test_cli20
class CLITestV20FirewallPolicyJSON(test_cli20.CLITestV20Base):
def setUp(self):
super(CLITestV20FirewallPolicyJSON, self).setUp()
... | {
"content_hash": "fb1277d06a4f0f813b7e0c2fec89235c",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 79,
"avg_line_length": 43.92344497607655,
"alnum_prop": 0.5465141612200436,
"repo_name": "cernops/python-neutronclient",
"id": "a8786dbbca9e4ad2391a58b77097e08061a48a74",
... |
"""
Copyright (c) 2014 Alex Forencich
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 without limitation the rights
to use, copy, modify, merge, publish, distribute... | {
"content_hash": "93da109864cd9d496e1c6999c7920fce",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 78,
"avg_line_length": 33.46105919003115,
"alnum_prop": 0.48924681128386555,
"repo_name": "alexforencich/hdg2000",
"id": "39cc80003c66a7adf3a01542db0144ea700bf3c9",
"size"... |
"""Hold a local cache of the online Zotero library.
Provide overview of what has changed in the online Zotero library since last
sync.
Expose a simple API to query and refresh the cache.
"""
# Zotero API:
# http://programminghistorian.org/lessons/zotero-api/intro-to-the-zotero-api
# For syncing with finer granular... | {
"content_hash": "f51ffbb950e8f4550f8bea1de57dcc37",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 93,
"avg_line_length": 38.09055118110236,
"alnum_prop": 0.6059948320413436,
"repo_name": "DataONEorg/d1_python",
"id": "8aa7a51c395cbb26fa60c659d13145b443cfd820",
"size": ... |
import uuid
from contextlib import contextmanager
import shapely.geometry
import shapely.wkb
import psycopg2
PG_TYPES = {
'str': 'VARCHAR',
'float': 'DOUBLE PRECISION',
'int': 'INTEGER',
}
def json_schema_to_pg_columns(schema):
table_statements = []
for key, prop_type in schema['properties'].ite... | {
"content_hash": "1a081ddbe51a97ccc2f44553643e6171",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 105,
"avg_line_length": 33.890625,
"alnum_prop": 0.5506377747041648,
"repo_name": "omniscale/gbi-server",
"id": "703274934e4e60655a33b131195530302a2d117e",
"size": "7161",... |
"""
Module for models for a combined storage with a Salesforce and normal database.
usage purposes e.g.:
- Backup salesforce objects including its primary keys.
- Use the backup in queries, including ForeignKeys related correctly to the same database.
- Update the object in Salesfoce to the original values from ... | {
"content_hash": "e9e4d0681368e49037457a838e24358b",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 119,
"avg_line_length": 45.93333333333333,
"alnum_prop": 0.6782085838689612,
"repo_name": "django-salesforce/django-salesforce",
"id": "42cbfc32301eaabb03c29bbc173a9976845ac... |
import tkinter as tk
from pygubu.i18n import _
from pygubu.api.v1 import register_widget, register_custom_property
from pygubu.plugins.ttk.ttkstdwidgets import TTKFrame
from ttkwidgets.frames import ScrolledFrame, ToggledFrame
from ..ttkwidgets import _designer_tab_label, _plugin_uid
class ScrolledFrameBO(TTKFrame):
... | {
"content_hash": "f7068c308d9fb564ec38b77f889b236a",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 78,
"avg_line_length": 26.913669064748202,
"alnum_prop": 0.6426089280940925,
"repo_name": "alejandroautalan/pygubu",
"id": "f0ad79bb90a5b8452119f8bd2bca2c8ecaa22928",
"siz... |
""" Defines the Image component class.
"""
from __future__ import absolute_import
# Enthought library imports
from traits.api import Array, Bool, Enum, Instance, Property, cached_property
# Local imports
from enable.component import Component
from kiva.image import GraphicsContext
class Image(Component):
""" C... | {
"content_hash": "e72621ea32bc7537ec1384093a024fd9",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 81,
"avg_line_length": 32.12162162162162,
"alnum_prop": 0.6386201093815734,
"repo_name": "tommy-u/enable",
"id": "646bb6d02a1b59c5ce38f60c35f400a7d40ab6f8",
"size": "2377",... |
import os
import sys
import json
import fnmatch
TEST_DIR = "/webvtt/"
CATEGORIES_FILE = "../categories.json"
class Test:
def __init__(self, file, name, status, message):
self.file = file
self.name = name
self.status = status
self.message = message
self.passed = status == 'P... | {
"content_hash": "69c160903b899efefd907a237e619f38",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 100,
"avg_line_length": 28.759124087591243,
"alnum_prop": 0.5741116751269035,
"repo_name": "nwjs/chromium.src",
"id": "6cb18c3c2de2f5d637e3ca38efdf85bfb34c031e",
"size": "... |
import Cython.Compiler.Errors as Errors
from Cython.CodeWriter import CodeWriter
from Cython.Compiler.TreeFragment import TreeFragment, strip_common_indent
from Cython.Compiler.Visitor import TreeVisitor, VisitorTransform
from Cython.Compiler import TreePath
import unittest
import os, sys
import tempfile
class NodeT... | {
"content_hash": "d7c2eea7d37811d1891702766f4d0f2e",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 122,
"avg_line_length": 37.73529411764706,
"alnum_prop": 0.6023642504546636,
"repo_name": "bdh1011/wau",
"id": "08f870a1c02941997d77fadba3588611140207d6",
"size": "7698",
... |
from twitter import *
import simplejson
import serial
import datetime
import time
import threading
QUIT = 0
prevtweet = ""
def centerstring(string,width):
""" Pad a string to a specific width """
return " "*((width-len(string))/2)+string
def padstring(string,width):
"""pad a string to a maximum length"""
if... | {
"content_hash": "58a2c78c71a08a3323580f39b6e67df3",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 115,
"avg_line_length": 24.763779527559056,
"alnum_prop": 0.6146263910969794,
"repo_name": "tachijuan/python",
"id": "6978acb42cd2b9022046d187f3dcd003abefb5dd",
"size": "3... |
"""
Table object like a HTML-Table, buildup with DXF R12 entities.
Cells can contain Multiline-Text or DXF-BLOCKs, or you can create your own
cell-type by extending the CustomCell object.
Cells can span over columns and rows.
Text cells can contain text with an arbitrary rotation angle, or letters can be
stacked top-t... | {
"content_hash": "533b1520a764ec6d10e8768eec465970",
"timestamp": "",
"source": "github",
"line_count": 829,
"max_line_length": 92,
"avg_line_length": 37.583835946924005,
"alnum_prop": 0.575633084058157,
"repo_name": "sbarton272/AcousticBarcodes-Explorations",
"id": "54c696e2df1c8d1231e7b6e2a84bba183... |
"""
Script that loads random forest models trained on the sider and toxcast datasets, predicts on sweetlead,
creates covariance matrix
@Author Aneesh Pappu
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import sys
import numpy as np
import pa... | {
"content_hash": "6de38758d34ca3d227b8af0dfd2bc211",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 104,
"avg_line_length": 33.99270072992701,
"alnum_prop": 0.7199914107794717,
"repo_name": "joegomes/deepchem",
"id": "68aa503b7757d6a826a56a128dfdb540d5adb979",
"size": "4... |
from argparse import ArgumentParser
from typing import Any
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q
from zerver.models import Message, Realm, Recipient, Stream, Subscription, get_realm
class Command(BaseCommand):
help = "Generate statistics on the streams ... | {
"content_hash": "23b530c0457bf66f2ffe227395e47126",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 100,
"avg_line_length": 42.107142857142854,
"alnum_prop": 0.5262934690415606,
"repo_name": "showell/zulip",
"id": "940604c99dbffbccf0a19bfbf92b4389d02b2f6e",
"size": "2358"... |
from __future__ import division
import logging
import numpy as np
import itertools
from cvxopt import matrix, solvers
import matplotlib.pyplot as plt
from descartes.patch import PolygonPatch
from cops_and_robots.fusion.gaussian_mixture import GaussianMixture
from mpl_toolkits.axes_grid1 import make_axes_locatable
impo... | {
"content_hash": "aeb2b751ab3596cab479b9fab3f31867",
"timestamp": "",
"source": "github",
"line_count": 1119,
"max_line_length": 115,
"avg_line_length": 38.171581769437,
"alnum_prop": 0.5519735917966007,
"repo_name": "COHRINT/cops_and_robots",
"id": "1fda4f80479da7e09645ad4acd9265cca1729831",
"size... |
from ..args import ConversionConfigArg
from ..config import AudioStreamConfig
from ..conversion import Converter
from kao_command.args import Arg, FlagArg
class AddAudio:
""" Represents a command to create a Conversion Config file """
description = "Add a audio stream to a config file"
args = [Ar... | {
"content_hash": "3f3d7a4023203e5bd1e281be7f09766a",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 123,
"avg_line_length": 45.18181818181818,
"alnum_prop": 0.5808182427900738,
"repo_name": "cloew/Kaovert",
"id": "929e032c35af8dad8be339ad52af0f45ca2e613b",
"size": "1491",... |
import os
import pty
import threading
import argparse
import subprocess
import shutil
from litex.tools.litex_term import LiteXTerm
from rowhammer_tester.scripts.utils import RemoteClient, litex_server
def pty2crossover(m, stop):
while not stop.is_set():
r = os.read(m, 1)
wb.regs.uart_xover_rxtx.... | {
"content_hash": "e7c4b91ff52ed107dae61f6bd7eb9e92",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 99,
"avg_line_length": 29.511627906976745,
"alnum_prop": 0.6150512214342002,
"repo_name": "antmicro/litex-rowhammer-tester",
"id": "773a11b7312c3660e1872800cbfb53619cc03ed8",... |
from denorm.helpers import find_fks, find_m2ms
from django.db import models
from django.db.models.fields import related
from django.db import connections, connection
from denorm.models import DirtyInstance
from django.contrib.contenttypes.models import ContentType
from denorm.db import triggers
class DenormDependency... | {
"content_hash": "35799a349140ad1d05ac95f312c92a47",
"timestamp": "",
"source": "github",
"line_count": 423,
"max_line_length": 139,
"avg_line_length": 47.096926713947994,
"alnum_prop": 0.5630960746912961,
"repo_name": "incuna/django-denorm",
"id": "c7c321bdee7c4c9fc7c779e97c86914fe91e4720",
"size"... |
"""
Helper to find the path to the correct third_party directory
"""
from os import path
import sys
import platform
# Find the root path of the checkout.
# In the Chromium repository, this is the src/chromium directory.
# In the external repository, standalone build, this is the devtools-frontend directory.
# In the... | {
"content_hash": "38243232963dace710c9772e0f5344c4",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 129,
"avg_line_length": 30.254545454545454,
"alnum_prop": 0.6703725961538461,
"repo_name": "youtube/cobalt",
"id": "def3726fd5272bd7f973b8c3d9a2d0699b0c9ec9",
"size": "349... |
import subprocess
import shlex
subprocess.call(shlex.split('sudo PYTHONPATH="../LEDs/python/build/lib.linux-armv7l-2.7" python ../ledRV1_part2.py')) | {
"content_hash": "a7564de97d8abf173633e3e413757011",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 117,
"avg_line_length": 37.25,
"alnum_prop": 0.7718120805369127,
"repo_name": "ssaini4/RoboticLamp",
"id": "db60fb9b46121fd5c6a9218b82ed25a3a7120300",
"size": "149",
"bina... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.