text
stringlengths
4
1.02M
meta
dict
"""The volumes extension.""" from oslo_utils import strutils from webob import exc from nova.api.openstack import common from nova.api.openstack.compute.schemas.v3 import volumes as volumes_schema from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api import validation from nova i...
{ "content_hash": "f5c795208149d9e696779895d790e377", "timestamp": "", "source": "github", "line_count": 554, "max_line_length": 79, "avg_line_length": 35.33754512635379, "alnum_prop": 0.5916636869796189, "repo_name": "cloudbase/nova-virtualbox", "id": "5cd88a2c4f74760a5e7991dd3a1863a33a180be7", "si...
""" PyCOMPSs Testbench ======================== """ # Imports import unittest from pycompss.api.api import compss_barrier from pycompss.api.api import compss_wait_on from pycompss.api.task import task from pycompss.api.parameter import * from pycompss.api.binary import binary from pycompss.api.compss import compss f...
{ "content_hash": "d1b2945eb88d852ec81c2fc0a594111f", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 139, "avg_line_length": 27.93984962406015, "alnum_prop": 0.6940258342303552, "repo_name": "mF2C/COMPSs", "id": "de78be35c82da78b7c7692dc535ff1317fb7f50d", "size": "3760", ...
import sys, os, getopt, sniper_lib, sniper_stats def usage(): print 'Usage:', sys.argv[0], '[-h (help)] [-l|--list | -t|--topology | -m|--markers | -e|--events] [--partial <section-start>:<section-end> (default: roi-begin:roi-end)] [--through-time|tt <statname>] [-d <resultsdir (default: .)>]' jobid = 0 resultsdi...
{ "content_hash": "de7d8e1529f8c66e0d8a63da7c354d27", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 235, "avg_line_length": 33.14545454545455, "alnum_prop": 0.6182117388919364, "repo_name": "yonggang985/Sniper", "id": "7d5aea50d421e6ad27246c8174446dc83a45f0b3", "size": "...
import logging import numpy as np from numpy import ma from .qctests import QCCheckVar module_logger = logging.getLogger(__name__) class StuckValue(QCCheckVar): def test(self): self.flags = {} x = ma.compressed(self.data[self.varname]) flag = np.zeros(self.data[self.varname].shape, dty...
{ "content_hash": "b900e705e1d6bc0f7975f542fdd917df", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 69, "avg_line_length": 26.636363636363637, "alnum_prop": 0.6040955631399317, "repo_name": "castelao/CoTeDe", "id": "89a4d9c1a94fa6bd09df3420c6c9a525772da50f", "size": "676"...
from south.v2 import DataMigration import desktop.management.commands.convert_documents class Migration(DataMigration): def forwards(self, orm): # Earlier we did the document conversions from Doc1 to Doc2 upon loading # the home page of a user. That approach had certain flaws like shared ...
{ "content_hash": "e5aad78924ee65d6a04506cc24d769e3", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 195, "avg_line_length": 70.12222222222222, "alnum_prop": 0.5736016479163366, "repo_name": "cloudera/hue", "id": "e4afa035596f5b92ffaf397a755808931408b86f", "size": "6336", ...
"""Utilities for IODINE.""" # pylint: disable=g-doc-bad-indent, g-doc-return-or-yield, g-doc-args # pylint: disable=missing-docstring import importlib import math from absl import logging from matplotlib.colors import hsv_to_rgb import numpy as np import shapeguard import sonnet as snt import tensorflow.compat.v1 as tf...
{ "content_hash": "80e6d8befc9ce4428ad0a2b1e86f516c", "timestamp": "", "source": "github", "line_count": 488, "max_line_length": 80, "avg_line_length": 34.38319672131148, "alnum_prop": 0.6289409380773586, "repo_name": "deepmind/deepmind-research", "id": "b8f8cf27cefe3769fea94afc3c5cdfade73e2e0b", "s...
from Queue import Queue from warnings import warn import functools import json import os import re import struct import subprocess import sys import threading import traceback import weakref from sgactions.dispatch import dispatch as _dispatch def log(*args): sys.stderr.write('[SGActions] %s\n' % ' '.join(str(x...
{ "content_hash": "ba87e08ca3a47e2c4d48233c66a2076d", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 99, "avg_line_length": 25.926470588235293, "alnum_prop": 0.6010588012856872, "repo_name": "vfxetc/sgactions", "id": "0344e04b1c7c5525281f29e7ebba2eec15b75c94", "size": "53...
""" Tests For Multi Scheduler """ from nova.scheduler import driver from nova.scheduler import multi from nova.tests.scheduler import test_scheduler class FakeComputeScheduler(driver.Scheduler): is_fake_compute = True def __init__(self): super(FakeComputeScheduler, self).__init__() self.is_u...
{ "content_hash": "fcb0f9b411112b8c453d3dc5a19d57d7", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 74, "avg_line_length": 33.59322033898305, "alnum_prop": 0.6634712411705348, "repo_name": "jessicalucci/NovaOrc", "id": "fb25ae9da4e9b33bba9185a6b77c511a56a9a5f9", "size": "...
from piliko import * # this example shows the plotting of red and green circles with # negative radial quadrances. c1=circle((0,0),4) c2=circle((0,0),-4) plot_red_circles([c1,c2]) plot_blue_circles(c1) plot_green_circles(c1,c2) plotshow()
{ "content_hash": "190e19e868cb26ae629eef1831632151", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 63, "avg_line_length": 21.90909090909091, "alnum_prop": 0.7302904564315352, "repo_name": "donbright/piliko", "id": "c6449e36478c1587070db3c9bec327f7baefb861", "size": "241"...
from __future__ import print_function, division import imghdr import urllib2 as urllib import io from PIL import Image validated_images = {} class AtomIncompatibleImageType(Exception): """ Exception raised when the Atom image is not PNG """ pass class AtomIncompatibleImageSize(Exception): """ ...
{ "content_hash": "97aaf646b8285632416ddd9dd55022d9", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 100, "avg_line_length": 23.226190476190474, "alnum_prop": 0.6396719630958483, "repo_name": "seperman/atomgen", "id": "818046d4a6db7ee29250ed4a739b6f4bdaf5c765", "size": "19...
""" Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re from lib.core.settings import WAF_ATTACK_VECTORS __product__ = "AppWall (Radware)" def detect(get_page): retval = False for vector in WAF_ATTACK_VECTORS: page, headers,...
{ "content_hash": "a3978c7ec0a006530b80a192cd7753ff", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 115, "avg_line_length": 24.80952380952381, "alnum_prop": 0.6641074856046065, "repo_name": "JeyZeta/Dangerous", "id": "951769b4ff276c0afe9a0a33de409c5db1d14e4e", "size": "54...
""" Test lldb data formatter subsystem. """ import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class DataFormatterBoolRefPtr(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin def test_boolrefptr_with_run_co...
{ "content_hash": "e41d232bc46818b43ae8ac9f62d9ebfc", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 104, "avg_line_length": 35.96103896103896, "alnum_prop": 0.5987721198988805, "repo_name": "endlessm/chromium-browser", "id": "25ecdef5948c4b9840e24ddec0172bf5ce3c953c", "si...
"""Decrypts the ciphertext stored in GCS to get MySQL password""" from google.cloud import kms_v1 from hive_to_bigquery import client_info def decrypt_symmetric(project_id, location_id, key_ring_id, crypto_key_id, ciphertext): """Decrypts input ciphertext using the provided symmetric Crypt...
{ "content_hash": "a8d2d6831825398c7c5429f1479d016e", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 38, "alnum_prop": 0.6741854636591479, "repo_name": "CloudVLab/professional-services", "id": "fe11065f4a216561da30566762b54e76d851d135", "size": "1373...
import pygame class Animation(object): loadedImagePaths = [] loadedImages = [] def __init__(self, imgPath, width, height, updateRate, frameLimit): if imgPath not in Animation.loadedImagePaths: self.img = pygame.image.load(imgPath).convert_alpha() Animation.loadedImagePaths.append(imgPath) Animation.load...
{ "content_hash": "0309f4772c7b6513513f4021bf85cab7", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 103, "avg_line_length": 27.327868852459016, "alnum_prop": 0.7060587882423516, "repo_name": "pedro-b/layer-switcher", "id": "df40de677e673da9697b26e290dcbfeba72f2358", "size...
"""API serving config collection service implementation. Contains the implementation for BackendService as defined in api_backend.py. """ # pylint: disable=g-statement-before-imports,g-import-not-at-top try: import json except ImportError: import simplejson as json import logging import api_backend import api_e...
{ "content_hash": "dca2701786ab800ef7fcd09752384279", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 80, "avg_line_length": 32.72941176470588, "alnum_prop": 0.6843997124370956, "repo_name": "catapult-project/catapult", "id": "ca7670a52c00f2306cd86958098d25897a667759", "si...
import warnings from sphinx_astropy.conf import * warnings.warn("Note that astropy_helpers.sphinx.conf is deprecated - use sphinx_astropy.conf instead")
{ "content_hash": "d09466aeb53a29f648982eacb0b2bd01", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 102, "avg_line_length": 31.2, "alnum_prop": 0.7948717948717948, "repo_name": "dpshelio/astropy-helpers", "id": "97c7afdf5682224976b5c1bee73f85af4dcda6c1", "size": "156", "...
import wx import wx.xrc import wx.combo ########################################################################### ## Class TestFrame ########################################################################### class TestFrame ( wx.Frame ): def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx....
{ "content_hash": "1ba15bcb825535ce126bfcbd4d8c901e", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 179, "avg_line_length": 35.19512195121951, "alnum_prop": 0.6406791406791407, "repo_name": "JorgeDeLosSantos/curso-wxpython", "id": "3466ca2b9a107ec6d09cba02e1ccadebfb78a4ab",...
import json with open('samples.json', 'r') as f: samples = json.loads(f.read()) with open('comment.txt', 'r') as f: data = f.read().replace('\n', '') samples['comments'].append(data) with open('samples.json', 'w') as f: f.write(json.dumps(samples))
{ "content_hash": "b18377fa6f68b1e63624f2c6cc4e35ef", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 37, "avg_line_length": 19.071428571428573, "alnum_prop": 0.6104868913857678, "repo_name": "CatalystOfNostalgia/hoot", "id": "39786b5053ff1f1d15ef2ba40911f977a07e5cf0", "siz...
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'DjFacilito.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^home/$', 'TodoList.views.home', ...
{ "content_hash": "8f3e33e614d43a85d3f8ac33ac84f9bd", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 89, "avg_line_length": 42.17391304347826, "alnum_prop": 0.6164948453608248, "repo_name": "0sw4l/Cuke", "id": "3454c5c99dc74acdd68eca67868bba8275dc58da", "size": "970", "b...
from django.conf.urls.defaults import patterns, include, url from django.views.generic.simple import direct_to_template from django.contrib import admin admin.autodiscover() import settings urlpatterns = patterns('', # home url(r'^$', direct_to_template, { "template": "home.html", }, name="home"), # pack...
{ "content_hash": "b453feddb284804af0f42d943015039c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 78, "avg_line_length": 28, "alnum_prop": 0.6136363636363636, "repo_name": "jonathanchu/pickleback", "id": "fcd9561261c8fb106a2c230815a8acdcdd106c65", "size": "924", "bina...
"""Test the fundrawtransaction RPC.""" from decimal import Decimal from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, assert_fee_amount, assert_greater_than, assert_greater_than_or_equal, assert_raises_rpc_error, connect_nodes_bi, ...
{ "content_hash": "97769981a3e697ab0108595f4e997c24", "timestamp": "", "source": "github", "line_count": 749, "max_line_length": 223, "avg_line_length": 45.19492656875835, "alnum_prop": 0.5628194144929248, "repo_name": "Bushstar/UFO-Project", "id": "a806de43b4146e8afe9d4dfeb73f0e51ed6ae386", "size":...
""" High-level interface to the Player client libraries. The Player client libraries allow Python code to communicate with hardware devices such as robots, cameras, and range sensors. This is a temporary home for this file until it finds a permanent home (maybe in the PlayerStage project or in PLASTK?) """ import t...
{ "content_hash": "69374b0c1abbbf017d53c8158f253b55", "timestamp": "", "source": "github", "line_count": 416, "max_line_length": 92, "avg_line_length": 31.596153846153847, "alnum_prop": 0.6426506390748631, "repo_name": "mjabri/topographica", "id": "90bb9dd10ba35d9e340d3e0e56f38d030ec69982", "size": ...
import time import random r2.DomeLightsRelay.Enable() r2.DomeMotorRelay.Enable() if not "-mute" in args: r2.SoundRelay.Enable() r2.BodyServosRelay.Enable() time.sleep(1) r2.Head.Enable() r2.Head.SetPosition(0) r2.LeftUtilityArm.SetTarget(0) r2.RightUtilityArm.SetTarget(0) nextHeadMove = time.time() + 10 nextSo...
{ "content_hash": "6ce4aceb9888fdc7d436ba0f51135312", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 58, "avg_line_length": 23.720588235294116, "alnum_prop": 0.6491010539367638, "repo_name": "curtisblack/R2D2", "id": "df57b7a838e65ab25b2b5bc4a2e987149cf4be40", "size": "161...
import time from importlib import import_module from django.conf import settings from django.contrib.sessions.backends.base import UpdateError from django.core.exceptions import SuspiciousOperation from django.utils.cache import patch_vary_headers from django.utils.deprecation import MiddlewareMixin from django.utils....
{ "content_hash": "0a0ecf42bd96eff994ea94d0c09f89cf", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 79, "avg_line_length": 45.75675675675676, "alnum_prop": 0.5841701122268163, "repo_name": "schinckel/django", "id": "d36be4eca8bd2a6c2a6d6ee83afd3830406bfeed", "size": "3386...
''' @license: Apache License, Version 2.0 @copyright: 2007-2013 Marc-Antoine Gouillart @author: Marc-Antoine Gouillart ''' ## Python imports ## Django imports from django.contrib.auth.models import Group, User, Permission ## MAGE imports import scm.models from ref.models.parameters import setOrCreatePara...
{ "content_hash": "c7893962e50fdda06eba7a47cf8a4864", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 200, "avg_line_length": 42.644444444444446, "alnum_prop": 0.6221990620114644, "repo_name": "marcanpilami/MAGE", "id": "c77eb9221c35c7fe1bc6034291f281cdbf59fdec", "size": "1...
from tempfile import NamedTemporaryFile from dune.xt import guarded_import from dune.xt.common.vtk.plot import plot for mod_name in ( # order should not matter! '_discretefunction_discretefunction', '_discretefunction_dof_vector', '_functionals_interfaces_common', '_functionals_int...
{ "content_hash": "ccee57cf27b0d01e99e0f8beb4184b50", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 107, "avg_line_length": 44.31521739130435, "alnum_prop": 0.6735344616139318, "repo_name": "pymor/dune-gdt", "id": "3f19fff046cb3a9d3b480def26cf9e2eeed6a6bc", "size": "4581"...
"""Sum square difference The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)^2 = 55^2 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square o...
{ "content_hash": "cd8049ab52163c24dd2c95f9f5c9d3ef", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 76, "avg_line_length": 21.727272727272727, "alnum_prop": 0.6262203626220363, "repo_name": "yhlam/project-euler", "id": "327cb5ba0426a6144956df44fdc95ffadc05dcd1", "size": "...
"""Track the accumulation of Path/Value pairs found.""" import collections from citest.base import JsonSnapshotableEntity # Denotes the seperator used when specifying paths to JSON attributes # in an object hierarchy. PATH_SEP = '/' def build_path(*parts): return PATH_SEP.join(parts) class PathValue(collections...
{ "content_hash": "0ba01c3f26dfb6f3eb508ee7f4c1f4dc", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 77, "avg_line_length": 32.935483870967744, "alnum_prop": 0.683643486777669, "repo_name": "google/citest", "id": "ca9f5c05888ff4a1b5b1ad5dad5ebec8af679e0f", "size": "1619", ...
""" mbed SDK Copyright (c) 2011-2020 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
{ "content_hash": "e384f1c5d26607ba33c75f886e468f99", "timestamp": "", "source": "github", "line_count": 808, "max_line_length": 125, "avg_line_length": 37.54579207920792, "alnum_prop": 0.5743811187658635, "repo_name": "kjbracey-arm/mbed", "id": "2ef5d6d40b0bdd1013d99e32294340df7d754098", "size": "3...
"""Test APIFlask class for input parameters causing TypeErrors. """ import apikit import pytest def test_lsstflask_type_errors(): """Test APIFlask for input parameters causing TypeErrors. """ # No arguments at all. # Obviously the linter is correct here... with pytest.raises(TypeError): # ...
{ "content_hash": "eafe820b7afbdffa78f929d2ac367811", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 70, "avg_line_length": 41.0625, "alnum_prop": 0.5809233891425672, "repo_name": "lsst-sqre/sqre-apikit", "id": "135af3694ea8668f9654418c874906c79dc37b6a", "size": "1993", ...
import argparse import numpy as np import matplotlib.pyplot as plt from nitime.viz import winspect argParser = argparse.ArgumentParser() argParser.add_argument('datafile') args = argParser.parse_args() time,signal = [],[] fin = open(args.datafile, 'r') for line in fin: words = line.split(',') time.append(floa...
{ "content_hash": "520d42c342d5946e5b042301db655fba", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 45, "avg_line_length": 22.952380952380953, "alnum_prop": 0.7178423236514523, "repo_name": "NeuralProsthesisLab/unlock", "id": "2a2c286b0045c390255af00e875027381482572b", "s...
"""Support for watching multiple cryptocurrencies.""" # pylint: disable=import-error from __future__ import annotations from datetime import timedelta from pysochain import ChainSo import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ATTR_...
{ "content_hash": "2b042d87d2bf5069ac73ec6e56f495c1", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 77, "avg_line_length": 29.943181818181817, "alnum_prop": 0.6944971537001897, "repo_name": "toddeye/home-assistant", "id": "157d94b87062c7c21fc75b52c451ecf330085566", "size"...
import chainer from chainer import backend from chainer.backends import cuda from chainer import configuration from chainer import function_node from chainer.utils import type_check if cuda.cudnn_enabled: cudnn = cuda.cudnn libcudnn = cuda.cuda.cudnn class GroupNormalization(function_node.FunctionNode): ...
{ "content_hash": "f1260c6b24e2c8d2dc9d8f2bffe3b91c", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 78, "avg_line_length": 34.12176165803109, "alnum_prop": 0.5418722951939868, "repo_name": "tkerola/chainer", "id": "82a57b9aad4bdd9e52914e4f42a9b8b5049a6d25", "size": "1317...
import sublime # type: ignore from os import path from unittest import TestCase from typing import List, Tuple, Optional try: from lib import entities except ImportError: # If we're running these tests in UnitTesting, then we need to use # The package name - Tab Filter - so let's grab import lib ...
{ "content_hash": "a47f982d610c25439294ddfb276b6c41", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 78, "avg_line_length": 33.91228070175438, "alnum_prop": 0.588334195550957, "repo_name": "robinmalburn/sublime-tabfilter", "id": "23eaf278174f460b9c81a9dc5a7ace5228300425", ...
import os import re import numpy as np import pyproj import rasterio as rio from sklearn.neighbors import KernelDensity from l8 import BANDS, SCENE_ID_PATTERN, get_date, spectrum from l8 import timeseries # Empirically found for demo. log_probability_threshold = -3000000 def is_scene_directory(srcpath): sid =...
{ "content_hash": "0c6503a762f0122eec8a24c28ba25c79", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 89, "avg_line_length": 32.15094339622642, "alnum_prop": 0.5475352112676056, "repo_name": "kapadia/l8", "id": "d3cb1b28cc42f3d2344ca1b230f261c6c0385675", "size": "3597", ...
import numpy as np from collections import namedtuple optimise = None # expensive, from scipy RadialFitResult = namedtuple('RadialFitResult', ['centre', 'radius']) def radial_fit(p): """ Find the least squares radial fitting a set of ND points. Parameters ---------- p : ``(N, D)`` `ndarray` ...
{ "content_hash": "7680d33bb7725aacb520f0c874d508cb", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 69, "avg_line_length": 24.930232558139537, "alnum_prop": 0.5802238805970149, "repo_name": "nontas/menpo3d", "id": "a718cffdd5d69ace31ab1a421c7b9a2731648a17", "size": "1072"...
import pytest from etapi.public.forms import LoginForm from etapi.user.forms import RegisterForm from .factories import UserFactory class TestRegisterForm: def test_validate_user_already_registered(self, user): # Enters username that is already registered form = RegisterForm(username=user.usernam...
{ "content_hash": "1bfa693fdd9bf08f8998abc1cb17d2c7", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 74, "avg_line_length": 36.81666666666667, "alnum_prop": 0.6731552738795835, "repo_name": "hypebeast/etapi", "id": "6d5afbd189c1d1573006d84030e3809788cc6e46", "size": "2233"...
import sys import pylibvw class SearchTask(): def __init__(self, vw, sch, num_actions): self.vw = vw self.sch = sch self.blank_line = self.vw.example("") self.blank_line.finish() self.bogus_example = self.vw.example("1 | x") def __del__(self): self.bogus_example...
{ "content_hash": "71e692f9ab7b3de52d642a0654357829", "timestamp": "", "source": "github", "line_count": 599, "max_line_length": 238, "avg_line_length": 43.18530884808013, "alnum_prop": 0.583771455079635, "repo_name": "zzzbit/vowpal_wabbit", "id": "dd2d0677c1d52146e927daec263a80cc754ea0c4", "size": ...
""" Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distri...
{ "content_hash": "d83fd61c704cd660c27f9e13afb6b47f", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 102, "avg_line_length": 39.06060606060606, "alnum_prop": 0.7152831652443755, "repo_name": "rstens/gwells", "id": "790ab2edb90fd0066f6d5b94210ace24210702f9", "size": "1289",...
import numpy as np from scipy.spatial import cKDTree from .bary import RbfInterpolator class KDTreeInterpolator(object): """ KDTreeInterpolator(points, values) Nearest-neighbours (barycentric) interpolation in N dimensions. This interpolator uses a KDTree to find the closest neighbours of a ND point...
{ "content_hash": "a06fd94e44c3547d050b5dec1ce1adfb", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 107, "avg_line_length": 30.340425531914892, "alnum_prop": 0.5634642356241234, "repo_name": "mfouesneau/faststats", "id": "83fe47c576c2eeaab1d8262addf8e812d037bece", "size":...
import os SCRIPT_PATH = os.path.dirname(__file__) class Lua: def __init__(self, redis): self.redis = redis scripts = filter(lambda s: s.endswith('.lua'), os.listdir(SCRIPT_PATH)) for scriptname in scripts: with open(os.path.join(SCRIPT_PATH, scriptname)) as script: ...
{ "content_hash": "be12b946ea19ea93f2b6f0b8b038fb98", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 93, "avg_line_length": 30.11764705882353, "alnum_prop": 0.626953125, "repo_name": "getfleety/coralillo", "id": "463f67f31af1f9df6135c7d3bf11b86df1f9de3d", "size": "512", ...
from setuptools import find_packages, setup import retask.release as rl setup(name='retask', version=rl.VERSION, description=rl.DESCRIPTION, long_description=rl.LONG_DESCRIPTION, author=rl.AUTHOR, author_email=rl.EMAIL, maintainer='Kushal Das', maintainer_email='kushaldas@gmai...
{ "content_hash": "f213b8c4e5f9922286e4f9ed53978ffc", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 55, "avg_line_length": 27.771428571428572, "alnum_prop": 0.5576131687242798, "repo_name": "rtnpro/retask", "id": "b3c051eeb3673fab909b318f9b44da4636681154", "size": "1020",...
from time import sleep from datetime import datetime from threading import Thread, Event import logging from ftp.db import FtpDb class Monitor(Thread): DEFAULT_INTERVAL = 60*60 db = None checker = None interval = None force_update = False logger = None _stop_event = None def __init...
{ "content_hash": "19cf9b0c3b770a7d11469bd967ced958", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 105, "avg_line_length": 32.6, "alnum_prop": 0.565439672801636, "repo_name": "grazor/ftwatch", "id": "3efb3db550747e8671874475e0deca8ba5bbe61f", "size": "1956", "binary": ...
"""The gcloud app regions group.""" from googlecloudsdk.calliope import base @base.ReleaseTracks(base.ReleaseTrack.BETA, base.ReleaseTrack.GA) class Regions(base.Group): """View regional availability of App Engine runtime environments. This command can be used to view availability of App Engine standard and fl...
{ "content_hash": "25a1c9678a5c0a02efd0ba2eb703fea2", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 80, "avg_line_length": 29.45, "alnum_prop": 0.6977928692699491, "repo_name": "KaranToor/MA450", "id": "c017720e421eb09761e96bafcf046a082bde1259", "size": "1185", "binary"...
from girder.exceptions import ValidationException from girder.utility import setting_utilities class PluginSettings: LICENSES = 'item_licenses.licenses' @setting_utilities.default(PluginSettings.LICENSES) def _defaultLicenses(): return [ { # Selected open source licenses from: ...
{ "content_hash": "72395b68f89b5d6597b0bb2043b3e69f", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 91, "avg_line_length": 36.112, "alnum_prop": 0.4237926451041205, "repo_name": "girder/girder", "id": "5fd0474bbcceefb677305bff4cb97dd72e4ac573", "size": "4514", "binary"...
import os, time, re, io import json import mimetypes, hashlib import traceback, logging from collections import OrderedDict import requests from .. import config, utils from ..returnvalues import ReturnValue from ..storage import templates from .contact import update_local_uin logger = logging.getLogger('itchat') d...
{ "content_hash": "ffb498e0d9d28341a3da8d4da9559993", "timestamp": "", "source": "github", "line_count": 508, "max_line_length": 128, "avg_line_length": 42.16338582677165, "alnum_prop": 0.5279424809748354, "repo_name": "ArmsZhou/Raspberry-Pi-Python-scripts", "id": "8f00bab12381106aeea7130dcf2073ab6867...
from .convunet import unet from .dilatedunet import dilated_unet from .dilateddensenet import dilated_densenet, dilated_densenet2, dilated_densenet3
{ "content_hash": "58b34a22a2ce4bafd8fce9fc4aef6d07", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 83, "avg_line_length": 49.666666666666664, "alnum_prop": 0.8456375838926175, "repo_name": "chuckyee/cardiac-segmentation", "id": "b056e6ab28b8f7a1042649663dd9b9a4ba23021b", ...
"""django_nice_stats URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')...
{ "content_hash": "280852191e6a2cf8bf3d849ae25ef202", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 36.30769230769231, "alnum_prop": 0.7033898305084746, "repo_name": "spapas/django-nice-stats", "id": "12998e3bc5d399561bdca51d010f61f7503ed14c", "size...
import os from pyramid.authentication import AuthTktAuthenticationPolicy from pyramid.authorization import ACLAuthorizationPolicy from pyramid.security import Allow, Authenticated from pyramid.session import SignedCookieSessionFactory from passlib.apps import custom_app_context as pwd_context class NewRoot(object): ...
{ "content_hash": "f1c354e41f8e58b536ac32fdfa63b0ee", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 68, "avg_line_length": 34.225, "alnum_prop": 0.7341124908692477, "repo_name": "PyListener/CF401-Project-1---PyListener", "id": "2203e82cba2787be8bdaee9bba876f1c99246808", "...
import copy import netaddr from oslo_config import cfg from oslo_log import log as logging from oslo_policy import policy as oslo_policy from oslo_utils import excutils import six import webob.exc from neutron.api import api_common from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api from neutron.api.v2 impo...
{ "content_hash": "a83d64c1b4aaf39cb90981af8c4ff19d", "timestamp": "", "source": "github", "line_count": 688, "max_line_length": 79, "avg_line_length": 46.78343023255814, "alnum_prop": 0.5419579333271196, "repo_name": "NeCTAR-RC/neutron", "id": "8237905d26bfc101b768a552c50f00d91b81c57e", "size": "32...
import sys from config import redisdb if __name__ == '__main__': name = sys.argv[1] channel = sys.argv[2] print 'Welcome to {channel}'.format(**locals()) while True: message = raw_input('Enter a message: ') if message.lower() == 'exit': break message = '{...
{ "content_hash": "f529176f79671b6c77911754d55e85ab", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 61, "avg_line_length": 22.5, "alnum_prop": 0.5530864197530864, "repo_name": "hugoxia/Python", "id": "4e36b3068696b5ef58288bafcc3067075a9219fc", "size": "405", "binary": f...
from security_monkey.views import AuthenticatedService from security_monkey.views import __check_auth__ from security_monkey.views import ITEM_FIELDS from security_monkey.views import ITEM_COMMENT_FIELDS from security_monkey.views import AUDIT_FIELDS from security_monkey.views import REVISION_FIELDS from security_monke...
{ "content_hash": "3dbef9091f49e3a0c9aaf9fb4cc174ab", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 102, "avg_line_length": 37.364285714285714, "alnum_prop": 0.5019116803670426, "repo_name": "pradeep-aradhya/security_monkey", "id": "f78817dc1e75ed1b55b7d399e5a09d6acb9a72eb...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class Extension...
{ "content_hash": "a8dd7d37e0cc2cde00802ecd24273b33", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 105, "avg_line_length": 30.333333333333332, "alnum_prop": 0.5805064500716675, "repo_name": "skuda/client-python", "id": "6b4ac38b8c2d750863ef84578c1081b7774ea6d9", "size":...
import base try: from django.utils import simplejson as json except ImportError: import json from test_utils.testmaker.serializers import REQUEST_UNIQUE_STRING, RESPONSE_UNIQUE_STRING class Serializer(base.Serializer): def __init__(self, name='pickle'): super(Serializer, self).__init__(name) ...
{ "content_hash": "d438249a61749931d94b911d13a272b9", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 90, "avg_line_length": 33.84375, "alnum_prop": 0.6454293628808865, "repo_name": "ericholscher/django-test-utils", "id": "d5a9b48a6209e51cf44f5a959da47b2cab56f876", "size": ...
""" Handles updating the database with allowed minutes and override allowed minutes for the gradeable timer """ from sqlalchemy import create_engine, MetaData, text, exc import datetime import os import sys import json try: CONFIG_PATH = os.path.join( os.path.dirname(os.path.realpath(__file__)), '..', 'co...
{ "content_hash": "bbfc9ec7763bd365d33f94c81d4c7b13", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 105, "avg_line_length": 35.46, "alnum_prop": 0.6080090242526791, "repo_name": "Submitty/Submitty", "id": "c04638fb5e09b9b652607158e5bc066dd4c09da2", "size": "3570", "bin...
import traceback class MSSQLEXEC: def __init__(self, connection): self.mssql_conn = connection self.outputBuffer = '' def execute(self, command, output=False): try: self.enable_xp_cmdshell() self.mssql_conn.sql_query("exec master..xp_cmdshell '{}'".format(comma...
{ "content_hash": "4110d1cc947ebbd3f9a67d853e0f6dc5", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 162, "avg_line_length": 38.15625, "alnum_prop": 0.6134316134316135, "repo_name": "Waffle-Wrath/CrackMapExec", "id": "cda4a09d46369933251ed773a92b7336e7a0d244", "size": "122...
import itertools from typing import Optional import openfermion from openfermion.utils._testing_utils import random_interaction_operator def random_interaction_operator_term( order: int, real: bool = True, seed: Optional[int] = None, ) -> openfermion.InteractionOperator: """Genera...
{ "content_hash": "0c4616bcb7855ddff0984f1d40177601", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 80, "avg_line_length": 32.25, "alnum_prop": 0.6844961240310078, "repo_name": "quantumlib/OpenFermion-Cirq", "id": "8080d4427a64e6842f368f6525aaa3219c136b42", "size": "1853"...
import pretend import pytest from pyramid.httpexceptions import HTTPBadRequest, HTTPMovedPermanently from warehouse import redirects class TestRedirectView: def test_redirect_view(self): target = "/{wat}/{_request.method}" view = redirects.redirect_view_factory(target) request = pretend...
{ "content_hash": "91ffe122595c5393bc67c41770b41933", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 85, "avg_line_length": 32.953125, "alnum_prop": 0.6614509246088194, "repo_name": "pypa/warehouse", "id": "6070d62d50c9daace087690440a18be43804ba24", "size": "2650", "bina...
__authors__ = [ '"Leo (Chong Liu)" <HiddenPython@gmail.com>', ] import datetime import httplib from google.appengine.api import users from google.appengine.ext import db from soc.logic.models.host import logic as host_logic from soc.logic.models.sponsor import logic as sponsor_logic from soc.logic.models.user i...
{ "content_hash": "3eb83298c2133c0ee019d04a4da19d32", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 80, "avg_line_length": 40.52785145888594, "alnum_prop": 0.6745205838078409, "repo_name": "SRabbelier/Melange", "id": "b153d1f9a7a65351911fe8246f7467299c51547f", "size": "1...
from django.shortcuts import render, get_object_or_404 from rags.models import Rag, Category def Home(request): rags = Rag.objects.all() context={"title": "SomeTitle", "rags": rags} return render(request, 'rags/home.pug', context=context) def RagDetail(request, pk): rag = get_object_or_404(Rag, pk=p...
{ "content_hash": "7e8a0ca2c38ac4c0cff4b185b7ebacdf", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 120, "avg_line_length": 30.071428571428573, "alnum_prop": 0.6543942992874109, "repo_name": "Intey/rags", "id": "a4a83f7b5d28457647b11a3634eb1a3256b07f15", "size": "866", ...
default_app_config = 'dartcms.apps.filemanager.apps.FileManagerConfig'
{ "content_hash": "77cd8084d9c3833d6f9ceffa884438fa", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 70, "avg_line_length": 72, "alnum_prop": 0.8194444444444444, "repo_name": "astrikov-d/dartcms", "id": "6002859d78b6f88c90cb15d74e7292d362ea05bf", "size": "72", "binary": f...
""" DBSCAN: Density-Based Spatial Clustering of Applications with Noise """ # Author: Robert Layton <robertlayton@gmail.com> # Joel Nothman <joel.nothman@gmail.com> # Lars Buitinck # # License: BSD 3 clause import numpy as np from scipy import sparse from ..base import BaseEstimator, ClusterMixin fro...
{ "content_hash": "3348a82fc2945c335e5000e573647682", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 79, "avg_line_length": 41.00970873786408, "alnum_prop": 0.6414141414141414, "repo_name": "ldirer/scikit-learn", "id": "6c7bba5af9f8c9385370413bc4872c1d481cd727", "size": "...
from __future__ import absolute_import import errno import itertools import logging import os.path import tempfile from pip._internal.utils.misc import rmtree from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import Optional logger = logging.getLogger(__name__) clas...
{ "content_hash": "1a6ae36f1fcfbcb9ab576bd3d123230a", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 79, "avg_line_length": 32.02958579881657, "alnum_prop": 0.5896914834657306, "repo_name": "rouge8/pip", "id": "77d40be6da34417ee4710b7ded6933ff16c15b59", "size": "5521", ...
from django.db import migrations class Migration(migrations.Migration): dependencies = [("members", "0041_auto_20190513_1803")] operations = [ migrations.RenameField( model_name="enquiry", old_name="creator", new_name="created_by" ) ]
{ "content_hash": "e9802d2deeed2d2ece4a05ddbb78baf9", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 75, "avg_line_length": 23.25, "alnum_prop": 0.6344086021505376, "repo_name": "ianastewart/cwltc-admin", "id": "9f3d34e3775c4c3bfa11965f0aef4fd59fd853f5", "size": "328", "...
from datetime import datetime from django.db import models from django.contrib.contenttypes.models import ContentType from django.utils.translation import ugettext_lazy as _ from django.db.models.fields import FieldDoesNotExist from django.core.exceptions import ImproperlyConfigured from model_utils.managers import I...
{ "content_hash": "50b5e109dffc95e6f2f51135c41ee090", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 77, "avg_line_length": 32.825, "alnum_prop": 0.6430566133536431, "repo_name": "gregmuellegger/django-model-utils", "id": "ad265b65943e31b277f12a657a226364b2a25ed5", "size"...
import os import sys import stat import string import textwrap import argparse import shutil import getpass import subprocess from collections import OrderedDict import yaml from wlauto import ExtensionLoader, Command, settings from wlauto.exceptions import CommandError, ConfigError from wlauto.utils.cli import init_...
{ "content_hash": "70e10235ee9f1094c5534e4625b9953e", "timestamp": "", "source": "github", "line_count": 384, "max_line_length": 143, "avg_line_length": 44.4296875, "alnum_prop": 0.5772229060430221, "repo_name": "chase-qi/workload-automation", "id": "9d5e7b48f5cf2d7aa676fef20d1ffcbe7832fe74", "size"...
""" Tests for django test runner """ from __future__ import absolute_import from optparse import make_option from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command from django import db from django.test import simple, TransactionTestCase, skipUnlessDBFeature from djang...
{ "content_hash": "967ba2a5af8f1022597045ae012a7602", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 152, "avg_line_length": 36.79496402877698, "alnum_prop": 0.6023071659008701, "repo_name": "rebost/django", "id": "8c6dabf771487c84cde7e53f851d22f21541ba54", "size": "10229...
import recognizer import os #============= Matching each images in test folder with the known faces =============== # Get path to all the test images # Filtering on .jpg extension - so this will only work with JPEG images ending with .jpg def match_faces(): test_filenames = filter(lambda x: x.endswith('.jpg'), ...
{ "content_hash": "1e50605aa1e59028494c9320873a4807", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 99, "avg_line_length": 39.9, "alnum_prop": 0.62531328320802, "repo_name": "gereziherw/DeepFaceRecognizer", "id": "7485751ba6768866907aee161dc433c0fc3c3340", "size": "1596",...
import re from flask_admin.babel import gettext from flask_admin.model import filters from .tools import parse_like_term class BasePyMongoFilter(filters.BaseFilter): """ Base pymongo filter. """ def __init__(self, column, name, options=None, data_type=None): """ Constructor. ...
{ "content_hash": "a62172f926376c297de8c869c7573faa", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 73, "avg_line_length": 24.298076923076923, "alnum_prop": 0.6062524732884844, "repo_name": "dxmo/flask-admin", "id": "179866c019894b95697b3fb7aa0675295c37a59c", "size": "25...
""" Simple example how to a run WsgiDAV in a 3rd-party WSGI server. """ from tempfile import gettempdir from avax.webdav.wsgidav.fs_dav_provider import FilesystemProvider from avax.webdav.wsgidav.version import __version__ from avax.webdav.wsgidav.wsgidav_app import DEFAULT_CONFIG, WsgiDAVApp __docformat__ = "...
{ "content_hash": "ff74f771a209bc064744308707220683", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 95, "avg_line_length": 36.13157894736842, "alnum_prop": 0.6576839038601602, "repo_name": "eavatar/avax.webdav", "id": "90e0b5a38472e27a2b3908b613c182e60a0ee93e", "size": "1...
import uuid import fixtures import mock from oslo_config import fixture as config_fixture from oslo_log import log from pycadf import cadftaxonomy from pycadf import cadftype from pycadf import eventfactory from pycadf import resource as cadfresource import keystone.conf from keystone import notifications from keysto...
{ "content_hash": "b2f1be256825920d875845fa7b73f38a", "timestamp": "", "source": "github", "line_count": 1273, "max_line_length": 79, "avg_line_length": 43.45797329143755, "alnum_prop": 0.5654893170890424, "repo_name": "cernops/keystone", "id": "674bef05e839b645690074b3a1f74e7cf7350519", "size": "55...
extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information ...
{ "content_hash": "3c8b8d1d47042c3f5e855f94f360e226", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 79, "avg_line_length": 31.37719298245614, "alnum_prop": 0.7078557450377411, "repo_name": "jthelin/rainbowstream", "id": "8831a8af5f1044996144f6ccb2b2d92b0a2f39d4", "size":...
from datetime import datetime class BaseUser(object): """ Base user class for extending. Used by skills for at least logging but can be used for more. """ def log_error(self, user_id, message): raise NotImplementedError("Not Implemented.") def get_error(self, user_id): ra...
{ "content_hash": "af6a03dc3586a56a5a84567418a417c2", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 76, "avg_line_length": 26.490909090909092, "alnum_prop": 0.5634866163349348, "repo_name": "TheLampshady/all_voice", "id": "ca57d615b87264b35b08c66ed584af4afe0d3479", "size"...
from lazy import lazy from ploy.common import BaseMaster, BaseInstance, import_paramiko, yesno import getpass import logging import os import socket import subprocess import sys log = logging.getLogger('ploy') def get_key_fingerprint(key): key_fingerprint = key.get_fingerprint() if isinstance(key_fingerprin...
{ "content_hash": "ce1710fc0b9fff8b464a1271dfe512e9", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 141, "avg_line_length": 37.72357723577236, "alnum_prop": 0.5535560344827586, "repo_name": "fschulze/ploy", "id": "cce6ac761a68d70a976df424dd80d13e36ff6a98", "size": "9280"...
from pyoauth2 import Client, AccessToken from everydo.api import OCEverydoApi, WOEverydoApi from everydo.api.base import check_execption class EverydoApiClient: def __init__(self, key, secret, api_host, redirect=''): self.key = key self.secret = secret self.api_host = api_host se...
{ "content_hash": "04372e8f7e20b48a51212474f1c39a83", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 140, "avg_line_length": 32.20454545454545, "alnum_prop": 0.612796988943778, "repo_name": "audoe/EverydoApi", "id": "eb332caf45bfd06caa3bad942f206e17d29df8cd", "size": "433...
import cgi import cgitb # Abilita gli errori al server web/http cgitb.enable() # Le mie librerie mjl (Json, Files), mhl (Html), flt (T w/ Redis) import mjl, mhl, flt import redis # Parametri generali TestoPagina="Aggiunge un gruppo di allarmi (chiave Redis)" DirBase="/var/www" ConfigFile=DirBase+"/conf/config.json"...
{ "content_hash": "784f930fe39b5f40c5478f8c36f603d6", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 142, "avg_line_length": 25.35981308411215, "alnum_prop": 0.6285240464344942, "repo_name": "raspibo/Livello1", "id": "0e7506a41c55844439a76e994415f6c3101e748f", "size": "55...
'''Status line at the bottom is working good here. ''' ##################### from tkinter import * from tkinter.filedialog import * from tkinter import ttk from tkinter.scrolledtext import * import os from sanHarvardKyoto import * from engVirgin import * TITLE = "संयुक्ता" class IndicEditor(Text, object): de...
{ "content_hash": "05b175f69da7b46affb40f4178a7bc21", "timestamp": "", "source": "github", "line_count": 444, "max_line_length": 114, "avg_line_length": 32.30855855855856, "alnum_prop": 0.5696061345416521, "repo_name": "sammohan/dyukSI", "id": "98893f94b6d6a5af9485eeedc1c9eb07126e77f2", "size": "146...
"""Generic utilities for all python scripts.""" import atexit import httplib import os import platform import signal import stat import subprocess import sys import tempfile import urlparse import zipfile def GetPlatformName(): """Return a string to be used in paths for the platform.""" if IsWindows(): retur...
{ "content_hash": "a533e51c507435dc8281599335c27696", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 79, "avg_line_length": 23.995049504950494, "alnum_prop": 0.6771198679595626, "repo_name": "wuhengzhi/chromium-crosswalk", "id": "35ac49964ccb1ec9ddfe81792c72cd11419b661f", ...
import pytest import json import time import msgpack from api import create_app @pytest.fixture def taxcalc_inputs(): return [{ 'user_mods': { "policy": { 2017: {"_FICA_ss_trt": [0.1]}}, "consumption": {}, "behavior": {}, "growdiff_baseline"...
{ "content_hash": "9c262e2b2c962b20e7ad5c5106f22224", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 75, "avg_line_length": 24.96385542168675, "alnum_prop": 0.5603281853281853, "repo_name": "OpenSourcePolicyCenter/webapp-public", "id": "ce1cc51e3ea868219702b0262c979e9eab6b7c...
"""Zwave discovery schemas.""" from . import const DEFAULT_VALUES_SCHEMA = { 'power': { const.DISC_SCHEMAS: [ {const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SENSOR_MULTILEVEL], const.DISC_INDEX: [const.INDEX_SENSOR_MULTILEVEL_POWER]}, {const.DISC_COMMAND_CLASS: [const....
{ "content_hash": "ecb0ea723838592c6a479e6620ea5bdc", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 79, "avg_line_length": 42.936974789915965, "alnum_prop": 0.5985908601624426, "repo_name": "persandstrom/home-assistant", "id": "2a4e42ab92c21dfff11cd2380b42e6ea75693c21", ...
import time from raiden.mtree import Merkletree from raiden.utils import keccak def do_test_speed(rounds=100, num_hashes=1000): values = [ keccak(str(i)) for i in range(num_hashes) ] start_time = time.time() for __ in range(rounds): Merkletree(values).merkleroot elapsed ...
{ "content_hash": "490576410f72daefe33b208eb9ad9068", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 69, "avg_line_length": 20.304347826086957, "alnum_prop": 0.6209850107066381, "repo_name": "charles-cooper/raiden", "id": "88fd63ef7dfb1607e3a59b21e5bfb8ed8c3cf806", "size":...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Event.slug' db.alter_column('operations_event', 'slug', self.gf('django.db.models.fields.SlugField')(max_length=2...
{ "content_hash": "790e85a3291a751fcdae869bb719dc01", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 208, "avg_line_length": 86.13065326633166, "alnum_prop": 0.5469661610268378, "repo_name": "ngageoint/geoevents", "id": "a4589813bc32c6a40e261396eb70060c2cabdce1", "size": ...
""" pygments.formatters.svg ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for SVG output. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.token import Comment from pygments.util import get_bo...
{ "content_hash": "0cd9d9f1e71361b95eadf0de37a013d1", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 90, "avg_line_length": 38.82446808510638, "alnum_prop": 0.5581586518701191, "repo_name": "tmm1/pygments.rb", "id": "547a7bbcdd86d91fb2b5c78bf4f435288a903bf5", "size": "729...
def test(): assert True
{ "content_hash": "6ddaf06c079421734c6a99a8e48c91d9", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 15, "avg_line_length": 14, "alnum_prop": 0.6071428571428571, "repo_name": "hiidef/django-quickbooks", "id": "8ec8593d85d122cfb2046203d844abaf441a60f3", "size": "70", "bina...
from __future__ import unicode_literals __version__ = "5.0.29"
{ "content_hash": "d611c4257c2568a28917fce690b30018", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 39, "avg_line_length": 31.5, "alnum_prop": 0.6666666666666666, "repo_name": "indictranstech/tele-frappe", "id": "902d2412b994ce54a8a80cde7ed1273ee7f0301b", "size": "63", "...
"""Event notifications.""" from happening.notifications import Notification class EmailNotification(Notification): """An email has been sent.""" required_data = ["subject", "content"] send_notification = False
{ "content_hash": "4089b2ed865bd6122dcba62cc2bda36a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 48, "avg_line_length": 20.636363636363637, "alnum_prop": 0.7092511013215859, "repo_name": "jscott1989/happening", "id": "4c6e10b82da210ae8b761c7d9f019b7493ab1029", "size": ...
import sys import os import socket import zmq from PyQt4 import QtGui, QtNetwork, QtCore from struct import * from time import sleep # Receive port where the CFS TO_Lab app sends the telemetry packets udpRecvPort = 1235 # # Receive telemetry packets, apply the appropiate header # and publish the message with zeroMQ ...
{ "content_hash": "e17bec6de5b2403ecd6a476aa813430f", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 87, "avg_line_length": 33.294736842105266, "alnum_prop": 0.5991147644641164, "repo_name": "CACTUS-Mission/TRAPSat", "id": "9ce4ae0cd253602716be5c1b5f5a0313bff58aa5", "size"...
import random import unittest from data_structures import bst, stack class TestDataStructures(unittest.TestCase): def test_BST(self): tree = bst.BST() values = (5, 3, 7, 2, 8, 4, 6) # Insertion for value in values: tree.insert(value) visit_func =...
{ "content_hash": "97cd0eacbdac4c2eca89decc5585f4c0", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 65, "avg_line_length": 33.57142857142857, "alnum_prop": 0.6085106382978723, "repo_name": "pauljxtan/pystuff", "id": "dc9acfde1ad1e45ecd677e43f040a06719489014", "size": "258...
''' Install software from the FreeBSD ``ports(7)`` system .. versionadded:: 2014.1.0 This module allows you to install ports using ``BATCH=yes`` to bypass configuration prompts. It is recommended to use the :mod:`ports state <salt.states.freebsdports>` to install ports, but it it also possible to use this module excl...
{ "content_hash": "c1e38ba29456fc432d3e781a625ba705", "timestamp": "", "source": "github", "line_count": 478, "max_line_length": 79, "avg_line_length": 27.784518828451883, "alnum_prop": 0.5839168737293878, "repo_name": "smallyear/linuxLearn", "id": "d3ace225d4c2db97dba435d501ad00c10d4bb8db", "size":...
from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys import pytest def testShouldFireKeyPressEvents(driver, pages): pages.load("javascriptPage.html") keyReporter = driver.find_element(by=By.ID, value="keyReporter") keyReporter.send_keys("a") result = driver.find...
{ "content_hash": "e0ef926b8a4170b0e155a096a40b4b35", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 118, "avg_line_length": 38.80503144654088, "alnum_prop": 0.7069692058346839, "repo_name": "asashour/selenium", "id": "71230f3709eae1923d1a9778881071e0e128176d", "size": "1...
from __future__ import print_function, division from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer from lasagne.nonlinearities import sigmoid from lasagne.objectives import crossentropy from lasagne.init import Uniform, Normal from lasagne.layers import LSTMLayer, DenseLayer, C...
{ "content_hash": "827719fb5e9f3523f3ef3ec8af534724", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 92, "avg_line_length": 27.055555555555557, "alnum_prop": 0.62217659137577, "repo_name": "JackKelly/neuralnilm_prototype", "id": "628c23f86cbb8a5fd085df153112a1f4e274a702", ...
from __future__ import print_function import json import sys import fieldtrial_to_struct def _hex(ch): hv = hex(ord(ch)).replace('0x', '') hv.zfill(2) return hv.upper() # URL escapes the delimiter characters from the output. urllib.quote is not # used because it cannot escape '.'. def _escape(str): result =...
{ "content_hash": "c70ccd82931d1cb51f8cd32d2e3843c4", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 80, "avg_line_length": 37.36150234741784, "alnum_prop": 0.6727821060567982, "repo_name": "endlessm/chromium-browser", "id": "d03307cdea9719470fde56e0ed10300ece1a1d3a", "si...
""" Django settings for api project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ import os from url...
{ "content_hash": "02f94cd27a92db9c292d8bc99ca29087", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 113, "avg_line_length": 30.458620689655174, "alnum_prop": 0.681535152269897, "repo_name": "caneruguz/osf.io", "id": "9dc59328a948441f83169690395d1b451c2b37ec", "size": "88...
from sympy.core.basic import Basic import combinatorial import elementary import special from special.polynomials import legendre, hermite, chebyshevt, chebyshevu, \ chebyshevu_root, chebyshevt_root # see #391 from combinatorial.factorials import factorial, rf, ff, binomial from combinatorial.factorials impo...
{ "content_hash": "9c1db0c447c72f8eea86f418d16eb951", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 91, "avg_line_length": 37.89655172413793, "alnum_prop": 0.7898089171974523, "repo_name": "certik/sympy-oldcore", "id": "bf6d0ebdad14b6bbd9492e9f780c4724cf93de7e", "size": "...
import scrapy class ItuneApp(scrapy.Item): guid = scrapy.Field() updatedAt = scrapy.Field() name = scrapy.Field() url = scrapy.Field() thumbnail = scrapy.Field() appLastUpdated = scrapy.Field() developer = scrapy.Field() website = scrapy.Field() ofReviews = scrapy.Field() ...
{ "content_hash": "497349ad41385cfa084c132196aba945", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 37, "avg_line_length": 18.615384615384617, "alnum_prop": 0.640495867768595, "repo_name": "trujunzhang/djzhang-targets", "id": "b494a37a633ef0b911c9193e5112685636610d94", "s...
""" Written by Lucas Sinclair. MIT Licensed. Contact at www.sinclair.bio """ # Built-in modules # # Internal modules # from fasta import FASTA from plumbing.databases import convert_to_sql from plumbing.databases.sqlite_database import SQLiteDatabase from plumbing.common import GenWithLength # Third party modules # ...
{ "content_hash": "c1a9e12c831e570dabeae91c9000d8d7", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 96, "avg_line_length": 30.19148936170213, "alnum_prop": 0.5828047921071177, "repo_name": "xapple/fasta", "id": "030bc6ec0414f88c47c5a0743b481f1dec46afc2", "size": "1467", ...
from paintApparatus import * from abb import * import json from color import Color class Control(object): def __init__(self, serial_connection, apparatus): self.last_brush = 0 self.last_color = Color() self.serial_connection = serial_connection self.apparatus = apparatus sel...
{ "content_hash": "73183f6c4e9493b3d59725a6c50b2610", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 97, "avg_line_length": 35.80373831775701, "alnum_prop": 0.6256851996867658, "repo_name": "Roboartitsts/PiPaintingServer", "id": "945e69009311fbe6cf3d4cdd758f2b6e7a470bf1", ...
import json from server.models import database, DoctorModel, LoginModel from server.hmsexceptions import UserNotExistException from server.utils import logger def register_doctor(post_data): """ Register a doctor in the system. The post data is a dict. :param post_data: dict :returns: a status, a st...
{ "content_hash": "4022aa81b29e871a75c6eb7559c7f083", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 78, "avg_line_length": 34.83125, "alnum_prop": 0.5998564507446618, "repo_name": "pa2515-group2/server", "id": "bb9c5fb18b0a5a58437ce2a397b89dded319c5b0", "size": "5573", ...
from typing import Any, Dict, Optional import os from collections import OrderedDict from ConfigSpace import Configuration from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import CategoricalHyperparameter from sklearn.base import BaseEstimator from autosklearn.askl_typi...
{ "content_hash": "b4ec5d217aac390fbccd27f01618c85e", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 86, "avg_line_length": 35.265625, "alnum_prop": 0.6366858661940629, "repo_name": "automl/auto-sklearn", "id": "f858781997c2761067d4cef76d8f3ba576c75eaf", "size": "4514", ...
from tastypie.api import Api as BaseApi from whippedcream.api import Api from .resources import (NamesResourceDefault, NamesResource, DateTimeResource, FileResource) v1_api = BaseApi(api_name='v1') v1_api.register(NamesResourceDefault()) v1_api.register(NamesResource()) v1_api.register(DateTi...
{ "content_hash": "c580cf0474b8b8e4f17a46ab3ae60488", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 60, "avg_line_length": 27.529411764705884, "alnum_prop": 0.7564102564102564, "repo_name": "paulcwatts/django-whippedcream", "id": "396167938e241afe10d6754c60bc80aa8024d97e", ...