text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Demo platform that has two fake switches.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
from homeassistant.components.switch import SwitchDevice
from homeassistant.const import DEVICE_DEFAULT_NAME
# pylint: disable=unused-argument
def setup... | {
"content_hash": "03d09fda4c451ef7accaec51a4dd3fb1",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 76,
"avg_line_length": 27.135135135135137,
"alnum_prop": 0.6145418326693227,
"repo_name": "JshWright/home-assistant",
"id": "83b8ae796bb0589b9bf56bea8371e67e7fe28bbb",
"siz... |
'''Enhances builder connections, provides object to access glade objects'''
from gi.repository import GObject, Gtk # pylint: disable=E0611
import inspect
import functools
import logging
logger = logging.getLogger('sms_quickly_lib')
from xml.etree.cElementTree import ElementTree
# this module is big so uses some con... | {
"content_hash": "61c7ec2c2af6712a3d7101780a748cc3",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 91,
"avg_line_length": 34.60912052117264,
"alnum_prop": 0.624,
"repo_name": "Deluxo/sms",
"id": "bd064801a7946f7cc3b01aa5cc2c5dd47cc3bcd4",
"size": "10802",
"binary": fa... |
from django.apps import AppConfig
class MailgunConfig(AppConfig):
name = 'mailgun'
| {
"content_hash": "6097e543bd60a7e73081561bbdf5d574",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 17.8,
"alnum_prop": 0.7528089887640449,
"repo_name": "KirovVerst/qproject",
"id": "0fa7417a8345dcc5184c666a32319fc72eb585d5",
"size": "89",
"binary"... |
from typing import Callable, Dict
import requests
from . import ClientTransport
class HttpPostClientTransport(ClientTransport):
"""HTTP POST based client transport.
Requires :py:mod:`requests`. Submits messages to a server using the body of
an ``HTTP`` ``POST`` request. Replies are taken from the respo... | {
"content_hash": "2135c9e6ebc7f4cb8bb57a3f921d59b0",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 88,
"avg_line_length": 37.69230769230769,
"alnum_prop": 0.6557823129251701,
"repo_name": "mbr/tinyrpc",
"id": "80b769e2e528d08d2b6f283bed30b4e939bc466d",
"size": "1516",
... |
import d1_common.types.dataoneTypes_v1_2
import d1_common.types.dataoneTypes_v2_0
import d1_test.d1_test_case
import d1_test.mock_api.util
class TestMockUtil(d1_test.d1_test_case.D1TestCase):
def test_1000(self):
"""parse_rest_url() 1."""
version_tag, endpoint_str, param_list, query_dict, client ... | {
"content_hash": "c3f11369610b6917aec062c790708046",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 105,
"avg_line_length": 37,
"alnum_prop": 0.5778635778635779,
"repo_name": "DataONEorg/d1_python",
"id": "e697185f5311c5931ed1a3947a3ca40e3352f0a1",
"size": "2343",
"bina... |
import tests.perf.test_ozone_ar_speed_many as gen
gen.run_test(750)
| {
"content_hash": "e9efd90b4e22019c3694dbd1cf7c7eec",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 49,
"avg_line_length": 17.5,
"alnum_prop": 0.7571428571428571,
"repo_name": "antoinecarme/pyaf",
"id": "a5c1e96cb9f77bdf0412794034d75bcd790024dc",
"size": "70",
"binary": ... |
import mock
from oslo.config import cfg
from neutron.common import constants as n_consts
from neutron.common import exceptions as n_exc
from neutron import context
from neutron.db import api as db
from neutron.plugins.vmware.api_client.exception import NsxApiException
from neutron.plugins.vmware.common import excepti... | {
"content_hash": "b356410be7265fd10726bd9d2b4fab51",
"timestamp": "",
"source": "github",
"line_count": 1388,
"max_line_length": 79,
"avg_line_length": 43.75864553314121,
"alnum_prop": 0.5721224294910845,
"repo_name": "vijayendrabvs/hap",
"id": "5b737bde90352ce437b2b8ada599fcfe216cfd3c",
"size": "6... |
"""
This is an example of a quasi-harmonic calculation for an hexagonal system using a quadratic polynomial.
"""
if __name__ == "__main__":
from pyqha import RY_KBAR
from pyqha import gen_TT, read_Etot, read_dos_geo, compute_thermo_geo, read_thermo, rearrange_thermo, fitFvib, write_celldmsT, write_alphaT
... | {
"content_hash": "1dfbad07cd9a1b17464ca7f2fc50fbc8",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 143,
"avg_line_length": 51.08571428571429,
"alnum_prop": 0.660234899328859,
"repo_name": "mauropalumbo75/pyqha",
"id": "d5057dc2485620fe547c28a4fbefd9aa8f303247",
"size": "... |
"""Git implementation of _version.py."""
import errno
import os
import re
import subprocess
import sys
def get_keywords():
"""Get the keywords needed to look up the version information."""
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable name... | {
"content_hash": "bb5bace3a24267a3b29492690c5e0980",
"timestamp": "",
"source": "github",
"line_count": 577,
"max_line_length": 81,
"avg_line_length": 34.22876949740035,
"alnum_prop": 0.564,
"repo_name": "lbdreyer/nc-time-axis",
"id": "d2eef2a8b31e9b15f5505f84e4ab0e2b142e1230",
"size": "20229",
"... |
import datetime
import hashlib
import json
from bson.objectid import ObjectId
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
from mongoengine.base import ValidationError
from crits.core.class_... | {
"content_hash": "a12e86d47b63e2ff5dd2bfa96dd8debe",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 124,
"avg_line_length": 36.185792349726775,
"alnum_prop": 0.5622923588039868,
"repo_name": "seanthegeek/crits",
"id": "79cb39f73972141d545e4f51503e5a63d20a8d0b",
"size": "... |
from __future__ import absolute_import, division, print_function
import six
import random
from ibeis_cnn.__LASAGNE__ import layers
from ibeis_cnn.__LASAGNE__ import nonlinearities
# from ibeis_cnn.__LASAGNE__ import init
from ibeis_cnn import custom_layers
from ibeis_cnn.models import abstract_models
import utool as ut... | {
"content_hash": "f153e7bed470d2cb9e6dbb81cc62d003",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 122,
"avg_line_length": 31.727642276422763,
"alnum_prop": 0.5386290839205637,
"repo_name": "bluemellophone/ibeis_cnn",
"id": "d3cf327977743b5c20067b5316690c942346fd9e",
"s... |
import sys
sys.path.insert(0, "../../python/")
import mxnet as mx
import numpy as np
import numpy.random as rnd
import time
import argparse
# parser
parser = argparse.ArgumentParser(description='kvstore test')
args = parser.parse_args()
def check_diff_to_scalar(A, x, rank=None):
""" assert A == x"""
assert(n... | {
"content_hash": "70428c1186396fcafa2c6e9dc5527b7a",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 86,
"avg_line_length": 27.081967213114755,
"alnum_prop": 0.6368038740920097,
"repo_name": "szha/mxnet",
"id": "3e2c2b98e270e7c3f5e14379af26221517e3119d",
"size": "2461",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import ehs_esports.users.models
class Migration(migrations.Migration):
dependencies = [
('communication', '0001_initial'),
('users', '0022_user_notifications'),
]
operations = [
migrations.RemoveFie... | {
"content_hash": "2a0a272f5161c09e9fbb673949f644be",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 140,
"avg_line_length": 29.413793103448278,
"alnum_prop": 0.608440797186401,
"repo_name": "ReilySiegel/ehs_esports",
"id": "0e5947ee44fc2b37baad1d27d7d6aaf6bf42598c",
"size... |
import json
from flask import request, Response, Blueprint
from rpaas import (auth, get_manager, storage, manager, tasks, consul_manager)
from rpaas.misc import (validate_name, require_plan, ValidationError)
router = Blueprint('router', __name__, url_prefix='/router')
supported_extra_features = ['tls', 'status', 'in... | {
"content_hash": "b8c24c69f1cd754d5fff40d923e3fe07",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 108,
"avg_line_length": 32.96350364963504,
"alnum_prop": 0.6391718334809566,
"repo_name": "tsuru/rpaas",
"id": "11ac8bebbad761f5dd4fa6cc3e688f2d2c8863cb",
"size": "9188",
... |
DOCUMENTATION = '''
---
module: merge_configs
short_description: Merge ini-style configs
description:
- ConfigParser is used to merge several ini-style configs into one
options:
dest:
description:
- The destination file name
required: True
type: str
sources:
description:
- A list of... | {
"content_hash": "b2c85971ca2bb3a874d6229cb718b946",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 71,
"avg_line_length": 20.571428571428573,
"alnum_prop": 0.6125,
"repo_name": "dardelean/kolla-ansible",
"id": "1a73e31018b01203eb7a6c9b0a8ebe28a976de40",
"size": "1317",
... |
from sqlalchemy.testing.requirements import SuiteRequirements
from sqlalchemy.testing import exclusions
class Requirements(SuiteRequirements):
# This class configures the sqlalchemy test suite. Oddly, it must
# be importable in the main codebase and not alongside the tests.
#
# The full list of suppo... | {
"content_hash": "837cae3631803547b99500f646116b10",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 93,
"avg_line_length": 43.24691358024691,
"alnum_prop": 0.7108192977447901,
"repo_name": "bdarnell/cockroach-python",
"id": "e009da5f9f1653871ff7a38fb31dc0abf150d82e",
"siz... |
import os
import sys
import string
import BoostBuild
xml = "--xml" in sys.argv
toolset = BoostBuild.get_toolset()
# Clear environment for testing.
#
for s in ('BOOST_ROOT', 'BOOST_BUILD_PATH', 'JAM_TOOLSET', 'BCCROOT', 'MSVCDir',
'MSVC', 'MSVCNT', 'MINGW', 'watcom' ):
try:
del os.environ[s]
excep... | {
"content_hash": "f4bb4cac718683ddf935aafbbb47a8f3",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 110,
"avg_line_length": 27.70689655172414,
"alnum_prop": 0.5294026135656503,
"repo_name": "basho-labs/riak-cxx-client",
"id": "59476bd7404a0634930205171c9eb215dfea4c23",
"... |
import time, sys, signal, atexit
import pyupm_my9221 as upmGroveCircularLED
# Exit handlers
def SIGINTHandler(signum, frame):
raise SystemExit
def exitHandler():
circle.setLevel(0, True)
print "Exiting"
sys.exit(0)
# This function lets you run code on exit
atexit.register(exitHandler)
# This function stops pytho... | {
"content_hash": "6fa858e88bbe3a890f3fa11abd5a7461",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 24.192307692307693,
"alnum_prop": 0.7472178060413355,
"repo_name": "kissbac/upm",
"id": "1c5a485d92f46b11658f197cea4dc3ac89c96139",
"size": "1790",
... |
class Solution:
# @param root, a tree node
# @return a boolean
def Height(self, root):
if root == None:
return 0
return max(self.Height(root.left), self.Height(root.right)) + 1
def isBalanced(self, root):
if root == None:
return True
if abs(self.H... | {
"content_hash": "610f48ca5770c1a75058999462d6c33a",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 77,
"avg_line_length": 32.46666666666667,
"alnum_prop": 0.5728952772073922,
"repo_name": "Chasego/codi",
"id": "2e7e70aba9d5e43002f8c725c40d796c206e25b2",
"size": "487",
... |
{
"name" : "pdf report support for your language",
"version" : "2.1.1",
"author" : "Shine IT",
"maintainer":"[email protected]",
"website": "http://www.openerp.cn",
"description": u"""
pdf report support for your language
=====================================
Fonts defined in the default report m... | {
"content_hash": "ed1dfe2d5a3fdcf91564ce66307c332e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 118,
"avg_line_length": 33.282051282051285,
"alnum_prop": 0.6741140215716487,
"repo_name": "chjw8016/GreenOdoo7-haibao",
"id": "f0e01ac7560ce4bca3d0849f15fed1bb5af61d76",
"... |
"""
Compare spawn to spawn_n, among other things.
This script will generate a number of "properties" files for the Hudson plot plugin
Profiling and graphs
====================
You can profile this program and obtain a call graph with `gprof2dot` and `graphviz`:
```
python -m cProfile -o output.pstats path/to/th... | {
"content_hash": "3e3e2a025f3a6fd85175d7348337e10a",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 114,
"avg_line_length": 24.425373134328357,
"alnum_prop": 0.5554537121906508,
"repo_name": "inercia/evy",
"id": "a1b097d8df9d484725d3f3192b6dce0bbfb68731",
"size": "3295",... |
import os
"""Handy utils for config"""
def contents(*names):
"""Return string contents from first matching named environment variable
or file.
Each name in names is checked first against an environment variable then
a file. An Exception is raised if nothing matches.
"""
for name in names:
... | {
"content_hash": "f06b71caa491c319795faa814885065b",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 28.545454545454547,
"alnum_prop": 0.60828025477707,
"repo_name": "gregelin/demo-allauth-bootstrap",
"id": "18c6717ff675131fba0a46d6915d2c4243b1652d",
... |
from django.test import SimpleTestCase
from corehq.apps.app_manager.exceptions import CaseXPathValidationError
from corehq.apps.app_manager.xpath import (
dot_interpolate,
UserCaseXPath,
interpolate_xpath,
)
class RegexTest(SimpleTestCase):
def test_regex(self):
replacement = "@case_id stuff"... | {
"content_hash": "f4419ae47063f2823b419fa923fa418b",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 114,
"avg_line_length": 40.51851851851852,
"alnum_prop": 0.5137111517367459,
"repo_name": "qedsoftware/commcare-hq",
"id": "2c56579973ec94b0c41057b556d1568815da7085",
"size... |
from collections import namedtuple
from undine.client.connector.base_connector import BaseConnector
from undine.database.mariadb import MariaDbConnector as MariaDB
class MariaDbConnector(BaseConnector):
__QUERY = {
'mission_mid': '''
SELECT mid FROM mission WHERE name = %(name)s
''',
... | {
"content_hash": "837257e685269c7e164b4d0ddd08ea55",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 80,
"avg_line_length": 34.6219512195122,
"alnum_prop": 0.5312903604555594,
"repo_name": "Sungup/Undine",
"id": "5bf82666f79fd24ce266b953da23527be05e1291",
"size": "8517",
... |
from msrest.serialization import Model
class SearchSort(Model):
"""The sort parameters for search.
:param name: The name of the field the search query is sorted on.
:type name: str
:param order: The sort order of the search. Possible values include:
'asc', 'desc'
:type order: str or :class:`... | {
"content_hash": "c31ffa57507df55b944b1dcc3547d655",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 72,
"avg_line_length": 28.40909090909091,
"alnum_prop": 0.608,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "15814e6e38a874e22146949dd84c0baef7196207",
"size": "1099"... |
import glob
import os
import shutil
import subprocess
import time
from threading import Thread
from config import config
from database import Database
from models import ComponentOptions, LayoutOptions
from models import ConvertRequest, ConversionStatus
FORMAT = {
'escher': 'Escher',
'sbml': 'SBML',
'sbgn... | {
"content_hash": "1b53aa15e96f375d6625a3b56a331e86",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 100,
"avg_line_length": 33.53061224489796,
"alnum_prop": 0.6062081558125381,
"repo_name": "SBRG/EscherConverter",
"id": "fcdc7c05c891eff08d34c813ce31bf3cdda4b168",
"size": ... |
__version__ = 'DEVELOPMENT'
| {
"content_hash": "654819b021dd103c127fe049d7080581",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 27,
"avg_line_length": 28,
"alnum_prop": 0.6428571428571429,
"repo_name": "knipknap/telemetric",
"id": "e6b3c12a3309b1d4e82c99050d417f90f8c10da3",
"size": "77",
"binary": ... |
import pytest
import nnabla as nn
import nnabla.parametric_functions as PF
import numpy as np
from nnabla.testing import assert_allclose
def ref_all_gather(x_data, n_devices):
results = []
for i in range(n_devices):
results.append(x_data * i)
return results
@pytest.mark.parametrize("seed", [313]... | {
"content_hash": "338cdd7d14e4f782995cf0e4fedda19b",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 100,
"avg_line_length": 27.347826086956523,
"alnum_prop": 0.6287758346581876,
"repo_name": "sony/nnabla",
"id": "fef653117adac920e5e55bdeb2a5fe6300e71bb7",
"size": "1855",
... |
from mio.utils import Null
def test_repr1(mio):
mio.eval("f = block(State clone())")
assert repr(mio.eval("f()")) == "NormalState()"
def test_repr2(mio):
mio.eval("f = block(State clone() setBreak())")
assert repr(mio.eval("f()")) == "BreakState()"
def test_repr3(mio):
mio.eval("f = block(Stat... | {
"content_hash": "c74625f502b0278fd06eab5ad71f1b9d",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 59,
"avg_line_length": 24.660714285714285,
"alnum_prop": 0.6198406951484432,
"repo_name": "prologic/mio",
"id": "bd4f2d625e988f34b172ef723e05e8e7023e7b06",
"size": "1381",
... |
import os
import re
import sys
from django.utils.crypto import get_random_string
def create_settings():
"""
Creates a new learningprogress_settings.py file in the base directory
if inexistent.
"""
base_dir = os.path.dirname(__file__)
if not os.path.exists(os.path.join(base_dir, 'learningprogr... | {
"content_hash": "dd3ff991deaf25cc4921ab868365e088",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 99,
"avg_line_length": 34.24242424242424,
"alnum_prop": 0.6371681415929203,
"repo_name": "normanjaeckel/LearningProgress",
"id": "7edeb1ec185e4b33d2dd47df2d1b568f0d7e5426",
... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
first_name = models.CharField(_('first name'), max_length=30)
last_name = models.CharField(_('last name')... | {
"content_hash": "4c09da44a1130cc793a7584862939dd6",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 65,
"avg_line_length": 32.13333333333333,
"alnum_prop": 0.7053941908713693,
"repo_name": "barszczmm/django-wpadmin",
"id": "1d4b3581539ac8680cff49bb6b940c584042650f",
"size... |
import pycurl
import StringIO
import urllib
import logging
from lib.msg.RawSerialize import RawSerialize
logger = logging.getLogger(__name__)
def authenticate(user, password, ip, port, realm=""):
c = pycurl.Curl()
content = StringIO.StringIO()
if "" == realm:
url = 'http://%s:%s/openam/json/authe... | {
"content_hash": "65a6a276606d4e93b39d508fe609d69e",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 153,
"avg_line_length": 31.4390243902439,
"alnum_prop": 0.6188259632790277,
"repo_name": "Svolcano/python_exercise",
"id": "ce2872076f863b2d2887f8af2e74b6977355e1df",
"siz... |
"""The request for analysis by a client. It contains analysis instances.
"""
import logging
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
from Products.ATExtensions.field import RecordsField
from plone.indexer import indexer
from Products.Archetypes import atapi
from Products.Archetypes.conf... | {
"content_hash": "945f913b75d1ffdcdb62d305a010013b",
"timestamp": "",
"source": "github",
"line_count": 2588,
"max_line_length": 117,
"avg_line_length": 43.710200927357036,
"alnum_prop": 0.5189441487951062,
"repo_name": "hocinebendou/bika.gsoc",
"id": "abf44f044cdf32cefa2c2f53722c74ccc2695927",
"si... |
import os
def getOutput(file):
lines = []
while 1:
line = file.readline()
if (contains(line, "Total tests run:")) :
lines.append(line)
if (contains(line, "[echo] * running test suite")) :
lines.append(line)
if not line:
break
return lin... | {
"content_hash": "166f263b8de441f78386f5aade4c3d0d",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 72,
"avg_line_length": 21.64406779661017,
"alnum_prop": 0.6115896632732968,
"repo_name": "fregaham/KiWi",
"id": "c493e65ccbae1d080968070f780de3885d19a091",
"size": "1586",
... |
import numpy as np
def linear(r):
return -r
def thin_plate_spline(r):
if r == 0:
return 0.0
else:
return r**2*np.log(r)
def cubic(r):
return r**3
def quintic(r):
return -r**5
def multiquadric(r):
return -np.sqrt(r**2 + 1)
def inverse_multiquadric(r):
return 1/np.s... | {
"content_hash": "91d34dcc2ec2c68d3dfcb6301675a465",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 77,
"avg_line_length": 28.61467889908257,
"alnum_prop": 0.5591535748637384,
"repo_name": "serge-sans-paille/pythran",
"id": "2c23a431fcc4f869f3a0cce148a894286ff5baa9",
"si... |
"""
Copyright 2020 Google LLC
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | {
"content_hash": "0998d030724fc4e01196474ce9d4973f",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 80,
"avg_line_length": 26.60759493670886,
"alnum_prop": 0.6379638439581351,
"repo_name": "google/report2bq",
"id": "f10532efa238483206508f4cdf866437694d3750",
"size": "2102... |
"""
Created on Tue Aug 9 00:24:17 2016
@author: ajaver
"""
import os
from functools import partial
import tables
def _isValidFlag(field, flag_value):
return (field._v_attrs['has_finished'] >= flag_value)
def _isValidProvenance(field, point_name):
return (point_name in field)
def _checkFlagsFun(fname, fie... | {
"content_hash": "78c4abe330f272e4b5fe8d76c5d85fcc",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 116,
"avg_line_length": 41.11,
"alnum_prop": 0.5923133057650207,
"repo_name": "ljschumacher/tierpsy-tracker",
"id": "e9cff4871923c644b7f7c9bfd75ad50215a7c166",
"size": "41... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nomi', '0080_auto_20170622_2036'),
]
operations = [
migrations.AddField(
model_name='nomination',
name='group_status',
... | {
"content_hash": "694bb81257efc648399518407b2dced5",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 124,
"avg_line_length": 25.38888888888889,
"alnum_prop": 0.5973741794310722,
"repo_name": "aniketp41/Gymkhana-Nominations",
"id": "8fe00b1aa71b263fb88a0e8119f670544ed56607",
... |
import telebot
import toml
import os
# get conf file:
telebot_config = os.getenv("TELEBOT_CONFIG")
if telebot_config:
config = toml.loads(telebot_config)
else:
telebot_conf_file = os.getenv("TELEBOT_CONFIG_FILE")
if not telebot_conf_file:
telebot_conf_file = "~/.telebot"
telebot_conf_file = o... | {
"content_hash": "8e6f5be478042875a40a862de4bfb2eb",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 79,
"avg_line_length": 26.89189189189189,
"alnum_prop": 0.6105527638190955,
"repo_name": "BorysDrozhak/ops-bot",
"id": "0fe13ea280b8692bc5b492543c49e665f77fe231",
"size": "... |
from element import Elem
from item import Item #@UnusedImport, suppress Eclipse warning, used dynamically in convert_to_item() eval
class OrganizemItemDataConversionException(Exception): pass
class BaseItemConverter(object):
@staticmethod
def convert_to_item(item):
pass
class YamlItemConverter(... | {
"content_hash": "f99c9bcce531678eb178a9e8dbed4517",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 138,
"avg_line_length": 45.25301204819277,
"alnum_prop": 0.582800851970181,
"repo_name": "marksweiss/organize-m",
"id": "f2cb7058f9e54ed26780497f6b6db7250d1c6c52",
"size": ... |
import _plotly_utils.basevalidators
class AutocolorscaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="autocolorscale", parent_name="sunburst.marker", **kwargs
):
super(AutocolorscaleValidator, self).__init__(
plotly_name=plotly_name,
... | {
"content_hash": "e17d6d00e9700ca5a2d384c0b12623a6",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 83,
"avg_line_length": 36.333333333333336,
"alnum_prop": 0.6073394495412844,
"repo_name": "plotly/python-api",
"id": "297a2cf0cf3ef2a5d66912e8ecfd035a077d1885",
"size": "54... |
"""
Utilities to compile denominator section and related helper functions.
"""
from typing import Any
from absl import app
from absl import flags
from common_util import *
FLAGS = flags.FLAGS
flags.DEFINE_string(
'denominator_config', None,
'Path of json file SHORT config for generating denominator section'... | {
"content_hash": "e96b08aea10d8abb1a895d6378cb323e",
"timestamp": "",
"source": "github",
"line_count": 758,
"max_line_length": 118,
"avg_line_length": 43.199208443271765,
"alnum_prop": 0.5211482669109788,
"repo_name": "datacommonsorg/data",
"id": "1cfeb020f242e7a840049859cd13308a3cfcb1be",
"size":... |
from string import Template
from datetime import date
bitcoinDir = "./";
inFile = bitcoinDir+"/share/qt/Info.plist"
outFile = "Credit-Qt.app/Contents/Info.plist"
version = "unknown";
fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro"
for line in open(fileForGrabbingVersion):
lineArr = line.replace(" ", ... | {
"content_hash": "cac1246f1d5a29fc837f097bb7cf3577",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 69,
"avg_line_length": 27.166666666666668,
"alnum_prop": 0.7085889570552147,
"repo_name": "credit-project/Credit",
"id": "518d66802a8b272bdfd74e4220ac1a8c6ea07fa5",
"size":... |
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions as lib_exc
from tempest.api.compute import base
from tempest import config
from tempest import test
CONF = config.CONF
class LiveBlockMigrationNegativeTestJSON(base.BaseV2ComputeAdminTest):
_host_key = 'OS-EXT-SRV-ATTR:host'
... | {
"content_hash": "4617acbabfb43824ea8ea3006797d5c3",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 71,
"avg_line_length": 37.627906976744185,
"alnum_prop": 0.6854140914709518,
"repo_name": "fengbeihong/tempest_automate_ironic",
"id": "b59e3343b0977ce0637a099b04aa64f6ae69e6... |
from bibliopixel.animation.strip import Strip
import math
# This one is best run in the region of 50 frames a second
class HalvesRainbow(Strip):
def __init__(self, layout, max_led=-1, centre_out=True, rainbow_inc=4,
**kwds):
super().__init__(layout, 0, -1, **kwds)
self._minLed =... | {
"content_hash": "f207aa17773ee669f3a629c7c0133d0c",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 111,
"avg_line_length": 34.21739130434783,
"alnum_prop": 0.5622617534942821,
"repo_name": "rec/BiblioPixelAnimations",
"id": "137c55c2baa9fdbb046f98e2d663b4ae32627921",
"si... |
"""
Bundle to check the loading order when instantiating with iPOPO
:author: Thomas Calmant
"""
# Pelix
from pelix.constants import BundleActivator
from pelix.framework import BundleContext, BundleEvent
# iPOPO
from pelix.ipopo.decorators import ComponentFactory, Validate, Invalidate, \
Instantiate
from pelix.ip... | {
"content_hash": "5579e2cb69efb5cd65d906374c8ef925",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 80,
"avg_line_length": 20.916666666666668,
"alnum_prop": 0.5630810092961488,
"repo_name": "ahmadshahwan/ipopo",
"id": "b8dfbdead6ad63e149bcc8c17c0fea23f0a350c6",
"size": "1... |
import pytz
import datetime
from django.test.utils import override_settings
from django.test import TestCase
from django.core.urlresolvers import reverse
from schedule.models.calendars import Calendar
from schedule.models.events import Event
from schedule.models.rules import Rule
from schedule.views import check_nex... | {
"content_hash": "85a85d6d453a8b5dcb47b0770947b2e5",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 117,
"avg_line_length": 43.736486486486484,
"alnum_prop": 0.5700602502703538,
"repo_name": "mbrondani/django-scheduler",
"id": "c4be1dde581485a61c4d6091afddfaee07218bbb",
... |
def main():
startApplication("sasview")
mouseClick(waitForObject(":groupBox_6.cbCategory_QComboBox_2"), 114, 12, 0, Qt.LeftButton)
mouseClick(waitForObjectItem(":groupBox_6.cbCategory_QComboBox_2", "Lamellae"), 103, 10, 0, Qt.LeftButton)
clickButton(waitForObject(":FittingWidgetUI.cmdPlot_QPushButton_2"... | {
"content_hash": "9d3206699bb80f8281ac0be6b530c5f9",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 143,
"avg_line_length": 85.95,
"alnum_prop": 0.7411285631180919,
"repo_name": "SasView/sasview",
"id": "5b4e56dfe9d0de71fbf9e5daec5499801a3bd3b0",
"size": "5182",
"binary... |
from clld.scripts.util import gbs
if __name__ == '__main__': # pragma: no cover
gbs()
| {
"content_hash": "ec6d5e584f47f426d65a07241be19140",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 46,
"avg_line_length": 18.6,
"alnum_prop": 0.5806451612903226,
"repo_name": "clld/nts",
"id": "67d05ba4d9f9da2ec6340a08d786a282ff833ce1",
"size": "93",
"binary": false,
... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "polyconf.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "ef3e69c423261d0df9449a52587d9732",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 72,
"avg_line_length": 25.444444444444443,
"alnum_prop": 0.7117903930131004,
"repo_name": "polyaxon/polyaxon",
"id": "a67562f1abd5d01fcdea721fa432c460fa0fe663",
"size": "834... |
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(BASE_DIR)
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings")
from django.core.management import execute_from_command_line
execute_from_command_lin... | {
"content_hash": "7327511d66e3d576ffacbb48f1205577",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 76,
"avg_line_length": 25.53846153846154,
"alnum_prop": 0.7108433734939759,
"repo_name": "mpachas/django-monthfield",
"id": "3687bd25aacf5db7567576cd6e740f450552a971",
"siz... |
from collections import namedtuple
from fileinput import input
Coord = namedtuple('Coord', 'y x')
Delta = namedtuple('Delta', 'y x')
Cell = namedtuple('Cell', 'y x value')
MOVE_LEFT = Delta(0, -1)
MOVE_RIGHT = Delta(0, 1)
MOVE_UP = Delta(-1, 0)
MOVE_DOWN = Delta(1, 0)
MOVE_DES = {
MOVE_DOWN: 'DOWN',
MOVE_LEF... | {
"content_hash": "cd40a926bceca4cd6bee9f5c569edef1",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 99,
"avg_line_length": 23.972789115646258,
"alnum_prop": 0.5683881952326901,
"repo_name": "bionikspoon/HackerRank-Challenges",
"id": "101303b009167ba74d42f119799c80cabeeb113... |
import six
class tsurf(object):
default_name = 'Undefined'
default_color = (0, 1, 1, 1.0)
def __init__(self, *args, **kwargs):
"""Accepts either a single filename or 4 arguments: x, y, z, triangles.
keyword arguments are: "color" and "name"
If a filename is given, the tsurf is read... | {
"content_hash": "65977d01bde35e6a80e7ebe2d604cc36",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 83,
"avg_line_length": 40.627450980392155,
"alnum_prop": 0.49758687258687256,
"repo_name": "joferkington/python-geoprobe",
"id": "b27c6b9ffe4fe5154b6c01af3755ebb20e1b1d07",
... |
import unittest
import numpy as np
from chaco.array_plot_data import ArrayPlotData
from chaco.plot import Plot
from chaco.tools.range_selection import RangeSelection
from enable.testing import EnableTestAssistant
class RangeSelectionTestCase(EnableTestAssistant, unittest.TestCase):
def test_selecting_mouse_lea... | {
"content_hash": "7348abf9d7d739d6bed3ceb437ebddc4",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 79,
"avg_line_length": 34.29824561403509,
"alnum_prop": 0.46342710997442454,
"repo_name": "tommy-u/chaco",
"id": "c94fb54affa733054fe2d6bae029cab9f7ce8492",
"size": "1955",... |
from __future__ import print_function
import unittest,os,csv
from rdkit import Chem,RDConfig
class TestCase(unittest.TestCase):
def setUp(self):
self.basePath=os.path.join(RDConfig.RDDataDir,'Pains')
self.painsFile = os.path.join(self.basePath,'wehi_pains.csv')
with open(self.painsFile,'r') as inf:
... | {
"content_hash": "126f0bfecb940da1133ddfbbd66cf140",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 83,
"avg_line_length": 34.36666666666667,
"alnum_prop": 0.6556741028128031,
"repo_name": "soerendip42/rdkit",
"id": "cd71671d1c3dfb9f0a7d9ec7371d1544cc19954b",
"size": "126... |
"""
Django settings for myapi project.
Generated by 'django-admin startproject' using Django 2.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
impo... | {
"content_hash": "52171c5439b0f30f4204c9eededae52d",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 91,
"avg_line_length": 27.652173913043477,
"alnum_prop": 0.6850853548966757,
"repo_name": "kentaiwami/FiNote",
"id": "9ddcf396f72fbd4d9ebcce8995f0ac7b52d0a3b5",
"size": "4... |
import sys
import zipfile
from io import BytesIO
from typing import Union
import warnings
import bs4
from bs4.builder import XMLParsedAsHTMLWarning
import pandas as pd
from .mappings import PSRTYPE_MAPPINGS, DOCSTATUS, BSNTYPE, Area
warnings.filterwarnings('ignore', category=XMLParsedAsHTMLWarning)
GENERATION_ELEMEN... | {
"content_hash": "a945750ed060d1bc4f444a41f41267b3",
"timestamp": "",
"source": "github",
"line_count": 981,
"max_line_length": 104,
"avg_line_length": 28.186544342507645,
"alnum_prop": 0.574373440381903,
"repo_name": "EnergieID/entsoe-py",
"id": "e765b6e0c285e3d56c424fc2f7ffb486fed0ba59",
"size": ... |
"""Serializers for the api views"""
from rest_framework import serializers
from photo_editor.models import Base, Folder, Image, ImageProcessorTool
class BaseSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Base
class ImageSerializer(BaseSerializer):
folder = serializers.Prim... | {
"content_hash": "575bf8cd3fb6d17151ca6262ebc3935b",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 71,
"avg_line_length": 28.86111111111111,
"alnum_prop": 0.6621751684311838,
"repo_name": "andela-cdike/django-photo-editor",
"id": "eb4f96111ab8210eb960510274a7ae8dc55fdc3d",... |
import argparse
import os
import pytest
import taichi as ti
FRAMES = 200
@pytest.mark.skipif(os.environ.get('TI_LITE_TEST') or '0', reason='Lite test')
def test_cornell_box():
from taichi.examples.rendering.cornell_box import render, tonemap
for i in range(FRAMES):
render()
interval = 10
... | {
"content_hash": "4eac5e28ab37641fe2402ca85f158b40",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 78,
"avg_line_length": 31.75,
"alnum_prop": 0.5767716535433071,
"repo_name": "yuanming-hu/taichi",
"id": "782b8783fee685b0d83d382b7dfa511c89fdc6dc",
"size": "1524",
"bina... |
from twisted.web.resource import Resource
from synapse.http.server import respond_with_json_bytes
from signedjson.sign import sign_json
from unpaddedbase64 import encode_base64
from canonicaljson import encode_canonical_json
from hashlib import sha256
from OpenSSL import crypto
import logging
logger = logging.getLogg... | {
"content_hash": "25bf220416c35896b007378c655209dd",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 81,
"avg_line_length": 34.81651376146789,
"alnum_prop": 0.5649538866930172,
"repo_name": "iot-factory/synapse",
"id": "ef7699d590cfa1dc8e5608225ee9368eb82324a1",
"size": "... |
try:
import idlelib.PyShell
except ImportError:
# IDLE is not installed, but maybe PyShell is on sys.path:
try:
import PyShell
except ImportError:
raise
else:
import os
idledir = os.path.dirname(os.path.abspath(PyShell.__file__))
if idledir != os.getcwd():
... | {
"content_hash": "23cd199329e75ed78708a2575285f142",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 78,
"avg_line_length": 31.61904761904762,
"alnum_prop": 0.5677710843373494,
"repo_name": "MalloyPower/parsing-python",
"id": "00a1fe3a00d121300c1e1150427ca629e2d54c5e",
"si... |
"""
@package ion.agents.instrument.port_agent_process
@file ion/agents.instrument/driver_launcher.py
@author Bill French
@brief Port agent process class that provides a factory for different launch mechanisms
USAGE:
config = {
device_host : 'localhost',
device_port : '4001'
type : PortAgentType.ETHERNET,... | {
"content_hash": "5347ef6f77d7a5e9908e2eea28aefc0f",
"timestamp": "",
"source": "github",
"line_count": 513,
"max_line_length": 118,
"avg_line_length": 34.53021442495127,
"alnum_prop": 0.6214858304166196,
"repo_name": "vipullakhani/mi-instrument",
"id": "62ee69900f415058f1aa1a796799ad5efcce1b05",
"... |
from dateparser import parse
from datetime import datetime
from pytz import utc
import urllib3
from CommonServerPython import * # noqa: E402 lgtm [py/polluting-import]
# Disable insecure warnings
urllib3.disable_warnings()
# CONSTANTS
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
DEFAULT_INCIDENT_TO_FETCH = 50
SEVERITY_OPTIO... | {
"content_hash": "f42d3b1dc0e692a3e300735f7bdb13e9",
"timestamp": "",
"source": "github",
"line_count": 1008,
"max_line_length": 126,
"avg_line_length": 38.67559523809524,
"alnum_prop": 0.6122354751827626,
"repo_name": "demisto/content",
"id": "308ff2e094e26e83cc7f74b97c7de73786787a66",
"size": "38... |
import tests.periodicities.period_test as per
per.buildModel((24 , 'T' , 200));
| {
"content_hash": "524f83efa0752b8231150524ef035d14",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 45,
"avg_line_length": 20.5,
"alnum_prop": 0.7073170731707317,
"repo_name": "antoinecarme/pyaf",
"id": "323687fd4a820a21aba35923187ca1cb7344bc04",
"size": "82",
"binary": ... |
class MatcherType(object):
"""
Interface for each Matcher functions. All matchers types must be implement get_ratio_match method between two
objects and return a ratio value.
"""
def get_ratio_match(self, object_a, object_b):
pass
| {
"content_hash": "d0d6fa26409b8f6eaaab74992940784b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 113,
"avg_line_length": 32.5,
"alnum_prop": 0.6884615384615385,
"repo_name": "Raul-diffindo/Django-Matcher",
"id": "1a31661d6e41d863898adefd18b3f0dc9e40c83b",
"size": "262",... |
import amsoil.core.pluginmanager as pm
import amsoil.core.log
logger=amsoil.core.log.getLogger('osliceauthorityrm')
import uuid
import pyrfc3339
import datetime
import pytz
class OSliceAuthorityResourceManager(object):
"""
Manage Slice Authority objects and resources.
Generates neccessary fields when cre... | {
"content_hash": "41958f7a2a531dcad33e170f3da40ca4",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 146,
"avg_line_length": 40.38528138528139,
"alnum_prop": 0.6427269803837496,
"repo_name": "motine/Ohouse",
"id": "8ad05674a9d6ea807d3ca1a0a1b28214dcc8fd3c",
"size": "9329"... |
'''
Copyright (c) 2013, UC Regents
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following... | {
"content_hash": "fbcb733aa540b49e434b3595fe5f9e01",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 80,
"avg_line_length": 47.26470588235294,
"alnum_prop": 0.8039825762289982,
"repo_name": "ooici/ooitk",
"id": "4fc8b4b065d3aca16b41b0583d6620c95808344a",
"size": "1629",
... |
"""
The :mod:`sklearn.model_selection._validation` module includes classes and
functions to validate the model.
"""
# Author: Alexandre Gramfort <[email protected]>
# Gael Varoquaux <[email protected]>
# Olivier Grisel <[email protected]>
# Raghav RV <rvraghav93@gma... | {
"content_hash": "19b4b2aade7ae3c90cf7a24a4ccfb43f",
"timestamp": "",
"source": "github",
"line_count": 1693,
"max_line_length": 79,
"avg_line_length": 40.337271116361485,
"alnum_prop": 0.6204477896062439,
"repo_name": "ryfeus/lambda-packs",
"id": "e54dade45512431964c42764f0e4a84f9f0834ee",
"size":... |
from django.conf import settings
from django.contrib import auth
from django.core.urlresolvers import reverse
from django import http
from django import test
from keystoneclient.auth.identity import v2 as auth_v2
from keystoneclient.auth.identity import v3 as auth_v3
from keystoneclient.auth import token_endpoint
from ... | {
"content_hash": "ed9d766b00169cb7fe84308e01090aee",
"timestamp": "",
"source": "github",
"line_count": 876,
"max_line_length": 79,
"avg_line_length": 36.05365296803653,
"alnum_prop": 0.6165342114428648,
"repo_name": "promptworks/django_openstack_auth",
"id": "7baa896cb1ad2a4e9fdfbbced234aeb9d375f265... |
"""A script to automatically convert an INI Pants config file to TOML. There will still likely be
some issues remaining which require manual fixes, but this script will automate most of the tedium.
Run `python3 migrate_to_toml_config.py --help`.
"""
import argparse
import logging
import re
from pathlib import Path
fr... | {
"content_hash": "084022382475a8ee823ae7c328c2b617",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 106,
"avg_line_length": 36.75423728813559,
"alnum_prop": 0.5937283836753516,
"repo_name": "jsirois/pants",
"id": "0a28b32b065ddb42986385f498f72f6236f078b1",
"size": "4492"... |
from __future__ import unicode_literals
from django.db import models, migrations
import uuid
class Migration(migrations.Migration):
dependencies = [
('users', '0011_auto_20151023_1228'),
]
operations = [
migrations.AlterField(
model_name='user',
name='first_name'... | {
"content_hash": "ec377a566954240cd4f1e06049315711",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 110,
"avg_line_length": 28.79310344827586,
"alnum_prop": 0.5844311377245509,
"repo_name": "qdqmedia/wiggum",
"id": "30b954730f7ac95593d9ca6ff9c634c5f5074e0f",
"size": "859"... |
from meter import *
from datapoints import *
from metergroup import *
from account import *
| {
"content_hash": "86d032f8db18c8cb959249b01d28649c",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 24,
"avg_line_length": 23,
"alnum_prop": 0.782608695652174,
"repo_name": "impactlab/jps-handoff",
"id": "c911f6590435bd8c72e3b68009d7780ad79a73a2",
"size": "92",
"binary":... |
from distutils.core import setup
setup(
name = 'django-test-addons',
packages = ['test_addons'],
version = '0.3.5',
description = 'Library to provide support for testing multiple database system like Mongo, Redis, Neo4j along with django.',
author = 'Hakampreet Singh Pandher',
author_email = '[email protected]... | {
"content_hash": "49dc606e330aef481e3026d3e2a8cf34",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 125,
"avg_line_length": 38.23529411764706,
"alnum_prop": 0.6207692307692307,
"repo_name": "arpitgoyaiitkgp/django-test-addons",
"id": "0874c0e1a5e8dfa67dd93b901b1d82b12cd69b9... |
dbuser = 'wpml'
# what is your database password?
dbpass = 'wpml'
# name of your project. you can specify here or pass as argument -n [name]
name = 'wordpress'
# what is your root dir for server (where you want to have wordpress installed)?
serverpath = '/var/www/html'
# what is base url to your server (without name)?... | {
"content_hash": "0175e595d072315cd2907ef2b2443211",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 80,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.7224025974025974,
"repo_name": "kkarpieszuk/setwp",
"id": "06d8a483da1b0d69393d372a406a69a0cccc84f0",
"size": "65... |
import re
import os
import shutil
import Prompt
class PromptClass(Prompt.ErrPrompt):
def CreateFileFail(self):
self.PrintErr ("Error: Fail to create file!")
def FileExist(self, File = "File"):
"""
return type: instance of basestring
return value:
c if user prefer cr... | {
"content_hash": "f3c1535fc2b3178893ab5164f92f54fc",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 127,
"avg_line_length": 33.08108108108108,
"alnum_prop": 0.5588235294117647,
"repo_name": "nday-dev/Spider-Framework",
"id": "d08f4fad6145256f8c69471ce86ed68a8fb4f371",
"s... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/community_crafting/component/shared_lightweight_turret_electronics.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS... | {
"content_hash": "7fd951a5013ce87db40f59142ad81a76",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 114,
"avg_line_length": 26.384615384615383,
"alnum_prop": 0.7201166180758017,
"repo_name": "anhstudios/swganh",
"id": "3158332578955e9a437964e07c3e3aa1bb04c157",
"size": "4... |
def arrayReplace(inputArray, elemToReplace, substitutionElem):
return [substitutionElem if e == elemToReplace else e for e in inputArray]
| {
"content_hash": "e7a29b24184a04a1d64adc1b2a3ab9ef",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 78,
"avg_line_length": 71,
"alnum_prop": 0.795774647887324,
"repo_name": "emirot/codefights",
"id": "176972e43daf5bb3e01dab3bdca2616c65989160",
"size": "142",
"binary": fa... |
from django.conf.urls import url
from events.forms import EventCreateForm
from events.views import EventCreateView, EventUpdateView, EventImageCreateView, EventImageUpdateView, EventDeleteView, \
EventImageDeleteView, EventDetailView
urlpatterns = [
url(r'^create/', EventCreateView.as_view(), name = "Event_ad... | {
"content_hash": "8361a54f8a639c84879466e581bf4481",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 121,
"avg_line_length": 50.64705882352941,
"alnum_prop": 0.6840882694541232,
"repo_name": "amfoss/fosswebsite",
"id": "7247693846f985c35d160bc1ec78972ebc80a834",
"size": "8... |
"""
Project management classes and functions
"""
import os
from ConfigParser import SafeConfigParser, NoSectionError, NoOptionError
import time
import datetime
from shutil import copy
try:
from PIL import Image
except:
import Image
import cvutils
import numpy as np
import subprocess
import uuid
from app_confi... | {
"content_hash": "3002b66b1e882c921a07d88ef5f2e530",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 123,
"avg_line_length": 39.05185185185185,
"alnum_prop": 0.6820940819423369,
"repo_name": "santosfamilyfoundation/TrafficCloud",
"id": "ebba2e82c34985ca5fad6c4c9b03ab4f88cec... |
"""docker-compose.yml generator.
It takes existing docker-compose.yml,
replaces "build:" instructions with the "image:" instructions,
preserves current binds - will read them from the running containers
Usage:
generate-compose.py [ --debug ] --file=file --jmaster-image=jm_image --jmaster-version=jm_version ... | {
"content_hash": "0770f03c7337fc095d670e4f241b9425",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 151,
"avg_line_length": 51.07446808510638,
"alnum_prop": 0.6877733805457197,
"repo_name": "Praqma/JenkinsAsCodeReference",
"id": "ced6389dad8fb20bcf845a41d760331e61c86c24",
... |
import time
time.sleep(0.25)
contents = clipboard.get_selection()
if len(contents) > 20:
title = contents[0:17] + "..."
else:
title = contents
folder = engine.get_folder("My Phrases")
engine.create_phrase(folder, title, contents) | {
"content_hash": "5d4bdbf4a894e4ddbe7b559a06dfab6e",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 45,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.70042194092827,
"repo_name": "andresgomezvidal/autokey_scripts",
"id": "80ccb95bcad807e64aac9ec2f7c04df4e263b8fd",
... |
from test.support import (TESTFN, run_unittest, import_module, unlink,
requires, _2G, _4G, gc_collect, cpython_only)
import unittest
import os
import re
import itertools
import socket
import sys
import weakref
# Skip test if we can't import mmap.
mmap = import_module('mmap')
PAGESIZE = mmap.... | {
"content_hash": "737507ec8ea6194b73114da2f36caa97",
"timestamp": "",
"source": "github",
"line_count": 777,
"max_line_length": 92,
"avg_line_length": 35.011583011583014,
"alnum_prop": 0.5217982649610351,
"repo_name": "chidea/GoPythonDLLWrapper",
"id": "ad93a59383421625ad76bf693174cba6708caaf7",
"s... |
"""From the paper Convolutional Sequence to Sequence Learning
http://arxiv.org/abs/1705.03122
"""
import tensorflow as tf
import numpy as np
from typeguard import check_argument_types
from neuralmonkey.encoders.attentive import Attentive
from neuralmonkey.model.model_part import ModelPart, FeedDict
from neuralmonkey... | {
"content_hash": "ff2bc382052441a389b3000e3e87ccb4",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 79,
"avg_line_length": 37.41428571428571,
"alnum_prop": 0.6065292096219931,
"repo_name": "bastings/neuralmonkey",
"id": "478a60e4284d922de36809be6cc77e69215eef77",
"size":... |
""" Crawling the geocode.
File: geocoder.py
Author: SpaceLis
Email: [email protected]
GitHub: http://github.com/spacelis
Description:
"""
from gevent import monkey
monkey.patch_all()
import sys
import re
import requests
from pyproj import Proj
from crawler.actors import Controller
from crawler.readers import CSVR... | {
"content_hash": "8b00b6fca2cc86959414a5f85b5f5981",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 77,
"avg_line_length": 26.880733944954127,
"alnum_prop": 0.5341296928327645,
"repo_name": "spacelis/crawler.kka",
"id": "f37a524ffee9ced2ae67f9b645a4cd3302d8e289",
"size":... |
from __future__ import print_function
import tensorflow as tf
import argparse
from antk.core import config
from antk.core import generic_model
from antk.core import loader
from antk.models import tree_mf_model
def return_parser():
parser = argparse.ArgumentParser(description="For testing")
parser.add_argument(... | {
"content_hash": "060c6bab24a6f0cd6fa16fd36568048f",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 107,
"avg_line_length": 57.35,
"alnum_prop": 0.6160999709386806,
"repo_name": "aarontuor/antk",
"id": "cb8753b4649b44be04f6f0480c06dea688858c3e",
"size": "3441",
"binary"... |
import antlr3
import testbase
import unittest
class t006lexer(testbase.ANTLRTest):
def setUp(self):
self.compileGrammar()
def lexerClass(self, base):
class TLexer(base):
def emitErrorMessage(self, msg):
# report errors to /dev/null
p... | {
"content_hash": "0ef64d5bb0817eb8deed9ab99e62eb40",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 58,
"avg_line_length": 27.918032786885245,
"alnum_prop": 0.5854374633000587,
"repo_name": "openstack/congress",
"id": "daa5d29dd30abbcb8e4f0018158b20c189f7aed3",
"size": "1... |
import logging
import asyncio
from hailtop.google_storage import GCS
from .spec_writer import SpecWriter
log = logging.getLogger('logstore')
class LogStore:
def __init__(self, batch_logs_bucket_name, worker_logs_bucket_name, instance_id, blocking_pool, *, project=None, credentials=None):
self.batch_log... | {
"content_hash": "d91d259cb8e81ef2d667b5b310c3042d",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 135,
"avg_line_length": 45.640449438202246,
"alnum_prop": 0.6602658788774003,
"repo_name": "cseed/hail",
"id": "9ed70cc9b6362b209d2ed37e22af14a5958ef299",
"size": "4062",
... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('productores', '0008_auto_20170919_0822'),
]
operations = [
migrations.AlterModelOptions(
name='sistemacacao',
options={'verbose_name... | {
"content_hash": "9466f88a0be32175c80789b62ad48b3c",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 100,
"avg_line_length": 23.764705882352942,
"alnum_prop": 0.6212871287128713,
"repo_name": "CARocha/plasystem",
"id": "1dfc8bf10d742cec2267db569cb27eb55a00fb72",
"size": "4... |
import _plotly_utils.basevalidators
class GridcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="gridcolor", parent_name="layout.smith.realaxis", **kwargs
):
super(GridcolorValidator, self).__init__(
plotly_name=plotly_name,
pa... | {
"content_hash": "8c26d83294633c426266abc3e8a9876b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 84,
"avg_line_length": 33.07692307692308,
"alnum_prop": 0.6139534883720931,
"repo_name": "plotly/plotly.py",
"id": "b1ad35ff0ebcf85a03f3b28926619a40bc77dde2",
"size": "430"... |
from dbt.logger import GLOBAL_LOGGER as logger # noqa
import dbt.exceptions
import google.cloud.bigquery
class Column(object):
TYPE_LABELS = {
'STRING': 'TEXT',
'TIMESTAMP': 'TIMESTAMP',
'FLOAT': 'FLOAT',
'INTEGER': 'INT'
}
def __init__(self, column, dtype, char_size=Non... | {
"content_hash": "bd3e87d3c895794b26764f23d023e26f",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 79,
"avg_line_length": 29.456521739130434,
"alnum_prop": 0.5592250922509225,
"repo_name": "nave91/dbt",
"id": "3a34903a867c14679b68b51841f6cb18eb72da32",
"size": "5420",
... |
"""Axis related components."""
import copy
import logging
import os
from math import floor
import h5py
import numpy as np
from crispy import resourceAbsolutePath
from crispy.config import Config
from crispy.items import BaseItem, ComboItem, DoubleItem, IntItem, Vector3DItem
from crispy.quanty import XDB
logger = lo... | {
"content_hash": "6776d7710518ebba607baba343f1351a",
"timestamp": "",
"source": "github",
"line_count": 505,
"max_line_length": 87,
"avg_line_length": 31.524752475247524,
"alnum_prop": 0.5912688442211055,
"repo_name": "mretegan/crispy",
"id": "7d2c8c942e774834e96d5c4dea67dfb4bd295e49",
"size": "164... |
from __future__ import absolute_import, division, print_function
from distutils.version import LooseVersion
import pandas as pd
import numpy as np
from ..core import DataFrame, Series
from ...base import tokenize
def getnanos(rule):
try:
return getattr(rule, 'nanos', None)
except ValueError:
... | {
"content_hash": "fc5aab2d5808b84b960c8f408e10203b",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 79,
"avg_line_length": 31.906832298136646,
"alnum_prop": 0.569398481604049,
"repo_name": "mikegraham/dask",
"id": "356348e0053eb0ea247c7dec942ec33c715aaeb6",
"size": "5137... |
from webmarks.storage import viewsets
from django.conf.urls import include
from django.conf.urls import url
from rest_framework import routers
apiRouter = routers.DefaultRouter()
# apiRouter.register(r'upload', viewsets.FileUploaderViewSet)
# apiRouter.register(r'crawler', viewsets.CrawlerViewSet, base_name='crawler')... | {
"content_hash": "a88a68d7d011fa920707d7a0acaf6410",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 36,
"alnum_prop": 0.7718253968253969,
"repo_name": "EricMuller/mynotes-backend",
"id": "24c107c519387b78fac96338611795bc84db40e5",
"size": "504",
"... |
from supermonkey import Monkey
class JanitorMonkey(Monkey):
def __init__(self, config_file, scheduler):
self.config_name = 'janitor'
super(JanitorMonkey, self).__init__(config_file, scheduler)
| {
"content_hash": "33a9a08d232f9e454c4a084326533bcd",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 67,
"avg_line_length": 30.714285714285715,
"alnum_prop": 0.6837209302325581,
"repo_name": "bogdanap/pySimians",
"id": "f241f9ddd886cde50a7f38461f076cfdaf5111b9",
"size": "21... |
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-easy-split',
version='0.2.0',
packages=['easy_split... | {
"content_hash": "28c6291a13f6706b1d2a0957598217a7",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 78,
"avg_line_length": 33.96969696969697,
"alnum_prop": 0.6297948260481713,
"repo_name": "Miserlou/django-easy-split",
"id": "6994c365852d8634320d468ace1ee67a5239a706",
"si... |
import numpy as np
from .base import LinearClassifierMixin, SparseCoefMixin
from ..feature_selection.selector_mixin import SelectorMixin
from ..svm.base import BaseLibLinear
class LogisticRegression(BaseLibLinear, LinearClassifierMixin, SelectorMixin,
SparseCoefMixin):
"""Logistic Regres... | {
"content_hash": "9d5cb59de9eecd3fbdd297a9ce3c5d91",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 78,
"avg_line_length": 37.652482269503544,
"alnum_prop": 0.6553023168204934,
"repo_name": "kmike/scikit-learn",
"id": "74abcf7c8a57ac38a909a235525958a25ab162d8",
"size": "... |
"""This is a simple HTTP server for manually testing exponential
back-off functionality in Chrome.
"""
import BaseHTTPServer
import sys
import urlparse
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
keep_running = True
def do_GET(self):
if self.path == '/quitquitquit':
... | {
"content_hash": "6404ea279f1bff80197d323c061b9e2a",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 75,
"avg_line_length": 26.425531914893618,
"alnum_prop": 0.6352657004830918,
"repo_name": "meego-tablet-ux/meego-app-browser",
"id": "4188cd103897b60c0e6fbb049af674aa46d15491... |
"""
Auto-generated class for Cat
"""
from six import string_types
from . import client_support
class Cat(object):
"""
auto-generated. don't touch.
"""
@staticmethod
def create(**kwargs):
"""
:type kind: string_types
:rtype: Cat
"""
return Cat(**kwargs)
... | {
"content_hash": "230ab8f68eae63516aa2d7ca7c00cb1e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 109,
"avg_line_length": 22.317073170731707,
"alnum_prop": 0.5792349726775956,
"repo_name": "Jumpscale/go-raml",
"id": "1340006bd93fd79f795064bb6affdea407a24abf",
"size": "9... |
import sys
import os
import sys
import subprocess
import tempfile
import time
import Qt
from Qt import QtCore, QtWidgets
import imath
import IECore
import Gaffer
import GafferScene
import GafferUI
import GafferSceneUI
# Delay for x seconds
def __delay( delay ) :
endtime = time.time() + delay
while time.time() < en... | {
"content_hash": "5dea10eaa8d613f16365b2ef5e4676ca",
"timestamp": "",
"source": "github",
"line_count": 635,
"max_line_length": 272,
"avg_line_length": 44.870866141732286,
"alnum_prop": 0.752219843470326,
"repo_name": "andrewkaufman/gaffer",
"id": "4c57e1d540d38c3a65552e31b1e5b71a40c5050a",
"size":... |
from django.contrib.admin.models import LogEntry, LogEntryManager
UNKNOWN = 0
ACCEPT_PREREG = 10
REJECT_PREREG = 11
COMMENT_PREREG = 12
CONFIRM_SPAM = 20
CONFIRM_HAM = 21
NODE_REMOVED = 30
NODE_RESTORED = 31
CONTRIBUTOR_REMOVED = 32
NODE_MADE_PRIVATE = 33
USER_REMOVED = 40
USER_RESTORED = 41
USER_2_FACTOR = 42
USER... | {
"content_hash": "1288fcfe488d4df410938c78c0a6f60c",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 84,
"avg_line_length": 20.837209302325583,
"alnum_prop": 0.6986607142857143,
"repo_name": "acshi/osf.io",
"id": "9f68dc295b929559fd81b0eb26d367182ea1ff42",
"size": "896",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.