text
stringlengths
4
1.02M
meta
dict
import numpy as np # Example taken from : http://cs231n.github.io/python-numpy-tutorial/#numpy x = np.array([[1,2],[3,4]]) print np.sum(x) # Compute sum of all elements; prints "10" print np.sum(x, axis=0) # Compute sum of each column; prints "[4 6]" print np.sum(x, axis=1) # Compute sum of each row; prints "[3 7...
{ "content_hash": "9e263cc09b526fc312ff2496a3ff53ac", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 75, "avg_line_length": 35.888888888888886, "alnum_prop": 0.6687306501547987, "repo_name": "kmova/bootstrap", "id": "2bae1585270c95fac78cda000b47724f9bc0f8c9", "size": "323",...
""" Module contains in-memory rebalance tests. """ from ducktape.mark import defaults from ignitetest.services.ignite import IgniteService from ignitetest.services.utils.ignite_configuration.discovery import from_ignite_cluster from ignitetest.tests.rebalance.util import preload_data, start_ignite, get_result, Trigger...
{ "content_hash": "e85a7c87a32be04d45d969288029689a", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 116, "avg_line_length": 50.02150537634409, "alnum_prop": 0.6425193465176269, "repo_name": "NSAmelchev/ignite", "id": "2e10641afdd89a525c05704d3fb1df62c385c8bf", "size": "54...
import logging import re import uuid from smtplib import SMTPException from django.conf import settings from django.contrib import auth, messages from django.core.mail import send_mail from django.db import IntegrityError from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, redi...
{ "content_hash": "c2a31e5a9bf6e2420b810a7aa3790b8a", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 118, "avg_line_length": 40.353846153846156, "alnum_prop": 0.5702439954250857, "repo_name": "dotKom/onlineweb4", "id": "5cefa9ccadfb1f5eb871b23be625dc5903fb1462", "size": "...
from gluon import * from s3 import * from s3layouts import * try: from .layouts import * except ImportError: pass import s3menus as default # Below is an example which you can base your own template's menus.py on # - there are also other examples in the other templates folders # ==============================...
{ "content_hash": "87a1679121aa72c35834a47069b36dee", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 79, "avg_line_length": 37.29, "alnum_prop": 0.5089836417270046, "repo_name": "code-for-india/sahana_shelter_worldbank", "id": "4e2bf6cc5d19520f4dabcaa24d1d76d48c4af492", "...
from datetime import datetime from unittest import mock from murano.common import server from murano.services import states from murano.tests.unit import base from murano.tests.unit import utils as test_utils class ServerTest(base.MuranoTestCase): @classmethod def setUpClass(cls): super(ServerTest, ...
{ "content_hash": "21ec0dacec46e681d10f9c7e96abd5c6", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 77, "avg_line_length": 44.048442906574394, "alnum_prop": 0.558051846032993, "repo_name": "openstack/murano", "id": "b56f4cc6dd33fb564b5e8907649b5aadd6624b73", "size": "133...
from flask import Blueprint from flask import render_template, jsonify from flask.ext.login import login_required from app.service import webcomicsService mod = Blueprint('webcomics', __name__, ) @mod.route('/', methods=["GET"]) @login_required def index(): comics_meta = webcomicsService.get_comics_meta_info() ...
{ "content_hash": "d2b297f77b972382e99dff57b6fac96d", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 26.904761904761905, "alnum_prop": 0.7327433628318584, "repo_name": "arpitbbhayani/penny", "id": "e723937a6891e02669fcb9a1e4525886fc758e3b", "size": "...
"""Test suite that runs all NLTK tests. This module, `nltk.test.all`, is named as the NLTK ``test_suite`` in the project's ``setup-eggs.py`` file. Here, we create a test suite that runs all of our doctests, and return it for processing by the setuptools test harness. """ import doctest, unittest from glob i...
{ "content_hash": "1db4fe7bbade75d6848ec61a7dbd9bec", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 78, "avg_line_length": 35.869565217391305, "alnum_prop": 0.656969696969697, "repo_name": "enriquesanchezb/practica_utad_2016", "id": "c1ce9962bd26cd64d4d6f36ebbed370fd20633c8...
from django import forms from private_messages.models import ConversationLog class SendMessage(forms.Form): content = forms.CharField(widget=forms.Textarea) encrypted = forms.BooleanField(required=False) def __init__(self, *args, **kwargs): super(SendMessage, self).__init__(*args, **kwargs) self.fields['content...
{ "content_hash": "1b0e076ab3392c1bc255cdbc3d02b463", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 54, "avg_line_length": 36.11764705882353, "alnum_prop": 0.739413680781759, "repo_name": "jnayak1/cs3240-s16-team16", "id": "32dc55ef3c08ce03624f51b1ca5a1d4e0dd07642", "size...
from oslo_log import log from watcher._i18n import _ from watcher.common import exception from watcher.decision_engine.model import element from watcher.decision_engine.strategy.strategies import base LOG = log.getLogger(__name__) class HostMaintenance(base.HostMaintenanceBaseStrategy): """[PoC]Host Maintenance ...
{ "content_hash": "2c78d645edb120ebf274fe1abd360daa", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 79, "avg_line_length": 39.201438848920866, "alnum_prop": 0.6109377867498623, "repo_name": "openstack/watcher", "id": "a23ea07c8201cde708204bcfc3cdfac65a3939f1", "size": "1...
"""``dev_ixia.py`` `Ixia traffic generators specific functionality` """ from . import loggers from . import entry_template from .Ixia.IxiaHAL import IxiaHALMixin from .Ixia.IxiaHLT import IxiaHLTMixin from .Ixia.IxLoadHL import IxLoadHL from .packet_processor import PacketProcessor from .tg_helpers import TGHelperM...
{ "content_hash": "f9ea50b312bf103d2fcd1d18d5901e37", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 125, "avg_line_length": 28.31979695431472, "alnum_prop": 0.5875604947123141, "repo_name": "orestkreminskyi/taf", "id": "cc56734634bcfd28575df87aba0b87858c5ec59a", "size": ...
""" Contains miscellaneous helper functions. """ import cProfile import io import logging import os import pstats import re import shutil import socket import time import warnings import weakref from functools import wraps from subprocess import STDOUT, Popen, PIPE # Log level constant for additional VERBOSE level VE...
{ "content_hash": "80b90ccda23af06f249a80a9fd8a17e4", "timestamp": "", "source": "github", "line_count": 606, "max_line_length": 79, "avg_line_length": 27.353135313531354, "alnum_prop": 0.6607142857142857, "repo_name": "5GExchange/escape", "id": "09b823bcd13db50372e8d897f8c3e678ba12b8c2", "size": "1...
from __future__ import absolute_import, unicode_literals import datetime from decimal import Decimal from django import test from django import forms from django.core.exceptions import ValidationError from django.db import connection, models, IntegrityError from django.db.models.fields import ( AutoField, BigInte...
{ "content_hash": "cb03b16045db81c54967f6899c1267f3", "timestamp": "", "source": "github", "line_count": 607, "max_line_length": 105, "avg_line_length": 40.138385502471166, "alnum_prop": 0.6464455754391726, "repo_name": "atruberg/django-custom", "id": "704ae0b822e3f043c7f5abb1a4db32ff39789204", "siz...
"""Read the sequence data from a nexus file. This IO code only gives read access to the sequence data. Reference: 'NEXUS: An extensible file format for systematic information' Maddison, Swofford, Maddison. 1997. Syst. Biol. 46(4):590-621 """ from corebio.seq import Seq, SeqList, Alphabet from corebio.seq_io._nexus i...
{ "content_hash": "c9840c9bb39110243e32feb711840f85", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 61, "avg_line_length": 23.3265306122449, "alnum_prop": 0.6080489938757655, "repo_name": "JohnReid/bioinf-utilities", "id": "9d3321d91e43a19ff79b7f9163ce63e6c34ec2fc", "size...
from django.conf.urls import patterns, url from gestionchismes import views from django.conf import settings from django.conf.urls.static import static urlpatterns = patterns('', url(r'logueo/$', views.logueo, name='logueo'), url(r'logoff/$', views.logoff, name='logoff'), url(r'crear/$', views.create, name='crea...
{ "content_hash": "b464272ec2be7e007aa9c305c1ecf979", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 91, "avg_line_length": 49.2, "alnum_prop": 0.675609756097561, "repo_name": "leoraca/Social_libre", "id": "ddce84b61108ff12e19d7fa1b8f596562b13103a", "size": "1410", "bina...
""" Test class for baremetal IPMI power manager. """ import os import stat import tempfile from nova.openstack.common import cfg from nova import test from nova.tests.baremetal.db import utils as bm_db_utils from nova import utils from nova.virt.baremetal import baremetal_states from nova.virt.baremetal import ipmi f...
{ "content_hash": "df6c6525aa3c9b42aa498d4b46906663", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 73, "avg_line_length": 36.25365853658536, "alnum_prop": 0.6056243272335845, "repo_name": "houshengbo/nova_vmware_compute_driver", "id": "def6da66f0ee345c1c2fdbb27862f44a1976...
from nose.tools import * from dateutil.parser import parse as time_parse import yawhois class TestWhoisDnsPtStatusRegistered(object): def setUp(self): fixture_path = "spec/fixtures/responses/whois.dns.pt/status_registered.txt" host = "whois.dns.pt" part = yawhois.record.Par...
{ "content_hash": "952bf0ac0a8828e94090a0837052006a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 87, "avg_line_length": 41.72093023255814, "alnum_prop": 0.633221850613155, "repo_name": "huyphan/pyyawhois", "id": "e6e008451986cc06f8955e0dc64db21f2d65e7c1", "size": "2055...
from django import forms class DateTimeWidget(forms.MultiWidget): def decompress(self, value): if value: return [value.date(), value.time().replace(microsecond=0)] return [None, None]
{ "content_hash": "7db149805c097dc71c468f1ed31e4098", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 70, "avg_line_length": 30.857142857142858, "alnum_prop": 0.6574074074074074, "repo_name": "alexkyllo/django-calendar-events", "id": "6fea3a0e92a72fd86812583ce7cf1f4721555bd0",...
import time from mitmproxy.net import websockets from pathod import language from mitmproxy import exceptions class WebsocketsProtocol: def __init__(self, pathod_handler): self.pathod_handler = pathod_handler def handle_websocket(self, logger): while True: with logger.ctx() as l...
{ "content_hash": "63d6096cbd5676a3d7db78ee8bd29c20", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 79, "avg_line_length": 37.61818181818182, "alnum_prop": 0.4775253745770904, "repo_name": "zlorb/mitmproxy", "id": "63e6ee0ba86a0f320809384c988564ee412a82fd", "size": "2069"...
from flask import Blueprint routes = Blueprint('routes', __name__) from .RouteManager import *
{ "content_hash": "eb3cc49aa10c38056c69575f056d915e", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 38, "avg_line_length": 19.2, "alnum_prop": 0.7395833333333334, "repo_name": "I2MAX-LearningProject/Flask-server", "id": "246c520476d3554e254ac79364834255b5587ba6", "size": "...
from azure.identity import DefaultAzureCredential from azure.mgmt.apimanagement import ApiManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-apimanagement # USAGE python api_management_head_api_operation_policy.py Before run the sample, please set the values of the ...
{ "content_hash": "6af361979e44ac92989fb6d9d8cd6333", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 158, "avg_line_length": 34.388888888888886, "alnum_prop": 0.7302100161550888, "repo_name": "Azure/azure-sdk-for-python", "id": "c4080e717790bb83ee9900bfa0e22333f7766135", "...
from a10sdk.common.A10BaseClass import A10BaseClass class Ipv6Routes(A10BaseClass): """This class does not support CRUD Operations please use parent. :param Distance: {"type": "number", "format": "number"} :param Interface: {"type": "string", "format": "string"} :param Metric: {"type": "number",...
{ "content_hash": "65ad825aac90a1d6e8c27f0007999daf", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 826, "avg_line_length": 38.775510204081634, "alnum_prop": 0.5778947368421052, "repo_name": "amwelch/a10sdk-python", "id": "ce6d651091911aef895e2f52cf691e00da65c0f6", "size"...
r""" Nonlinear solvers ----------------- .. currentmodule:: scipy.optimize This is a collection of general-purpose nonlinear multidimensional solvers. These solvers find *x* for which *F(x) = 0*. Both *x* and *F* can be multidimensional. Routines ~~~~~~~~ Large-scale nonlinear solvers: .. autosummary:: newton...
{ "content_hash": "82831350d21c832d1c5e983c4fb4ead7", "timestamp": "", "source": "github", "line_count": 1660, "max_line_length": 104, "avg_line_length": 30.52530120481928, "alnum_prop": 0.5446400378907483, "repo_name": "ryfeus/lambda-packs", "id": "6b0fc3414cfa3e06887c34b6b1a31c7cad47e5e6", "size":...
__author__ = 'kotaimen' __date__ = '6/3/14' """ georest.geo.metadata ~~~~~~~~~~~~~~~~~~~~ Metadata of a geometry, aka geoindex helpers """ import collections import geohash import shapely.geometry import shapely.geometry.base class Metadata(collections.namedtuple('Metadata', ...
{ "content_hash": "db3831ad7bd7c73e7f1005753f72ae1e", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 80, "avg_line_length": 30.21212121212121, "alnum_prop": 0.6352390504847877, "repo_name": "Kotaimen/georest", "id": "c17f0cb4445676f04e241d8385a2ae3ed217f265", "size": "3018...
from __future__ import absolute_import from django.db.models.signals import post_save from sentry.adoption import manager from sentry.models import FeatureAdoption, GroupTombstone from sentry.plugins import IssueTrackingPlugin, IssueTrackingPlugin2 from sentry.plugins.bases.notify import NotificationPlugin from sentr...
{ "content_hash": "fc39b3801e0d497608a8437fcf2bb19b", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 101, "avg_line_length": 31.93951612903226, "alnum_prop": 0.7124100492362075, "repo_name": "ifduyue/sentry", "id": "0d31f2adad330ab44dd392bb1b932883c5efb3a1", "size": "7921...
import fnmatch import functools import os import re import sys import traceback from contextlib import contextmanager from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization as crypt_serialization from cryptography.hazmat.primitives.asymmetric import rsa from ...
{ "content_hash": "bc7808ecbe1a28dc472dfc1c72160576", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 79, "avg_line_length": 32.6448087431694, "alnum_prop": 0.6397723468362906, "repo_name": "gvlproject/libcloudbridge", "id": "589a00a8bfa78397bcea3b9398538aa483e985e2", "siz...
from __future__ import absolute_import __all__ = ['Mark', 'YAMLError', 'MarkedYAMLError'] from .compat import utf8 class Mark(object): def __init__(self, name, index, line, column, buffer, pointer): self.name = name self.index = index self.line = line self.column = column ...
{ "content_hash": "31988acd420b0bbedd12b66566b0e7df", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 73, "avg_line_length": 32.975, "alnum_prop": 0.5310841546626232, "repo_name": "flgiordano/netcash", "id": "2b7690430188cfc2b6cce953edc12fe67cb82643", "size": "2638", "bin...
''' Add alias fields to address points from the cloest road with the same name. ''' import arcpy, os, time from time import strftime class Fields (object): def __init__(self): self._fieldList = [] def getI(self, field): return self._fieldList.index(field) ...
{ "content_hash": "955f1cbd8cfce04dceb1464420a2899a", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 133, "avg_line_length": 48.01875, "alnum_prop": 0.58466744761161, "repo_name": "agrc/acs-alias-address-point", "id": "7757bba763e618601ec5c5f35201fbe14424dfcd", "size": "7...
FIGSHARE = 'FigShare' # MODEL MESSAGES :model.py BEFORE_PAGE_LOAD_PRIVATE_NODE_MIXED_FS = 'Warnings: This OSF {category} is private but ' + FIGSHARE + ' project {project_id} may contain some public files or filesets' BEFORE_PAGE_LOAD_PUBLIC_NODE_MIXED_FS = 'Warnings: This OSF {category} is public but ' + FIGSHARE + '...
{ "content_hash": "889af3fa43a49ab2f67162f6d6d5a664", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 233, "avg_line_length": 66.58, "alnum_prop": 0.7227395614298588, "repo_name": "AndrewSallans/osf.io", "id": "7d0615bb54da605be67fb52825731e901c43f257", "size": "3329", "b...
import errno import sys import unittest import time sys.path.append('./lib') sys.path.append('../python') sys.path.append('../api/generated/py') from warp17_ut import Warp17UnitTestCase from warp17_ut import Warp17NoTrafficTestCase from b2b_setup import * from warp17_common_pb2 import * from warp17_l3_pb2 ...
{ "content_hash": "77ec4a2269e673cac30e68b0964ffb86", "timestamp": "", "source": "github", "line_count": 776, "max_line_length": 97, "avg_line_length": 47.63015463917526, "alnum_prop": 0.46513893022374936, "repo_name": "jlijian3/warp17", "id": "4d2e4ef9782c62b920e4aa7bda7ea9a97b5c6eca", "size": "390...
''' Unpickle a small test knowledge base and do a little demo inference ------------------------------------------------------------------------------ SketchNet Iulius Curt @ 2013 ------------------------------------------------------------------------------ ''' from knowledge_repr import * from svghelpers import * ...
{ "content_hash": "302be20f1c3f2e8145e11d5ed13d1bf8", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 78, "avg_line_length": 24.057142857142857, "alnum_prop": 0.5380047505938242, "repo_name": "iuliux/SketchNet", "id": "240e182ec39d3b9ae683802b9cf0b554a631aef3", "size": "842...
from supybot.test import * import os import unittest import supybot.conf as conf import supybot.world as world import supybot.ircdb as ircdb import supybot.ircutils as ircutils class IrcdbTestCase(SupyTestCase): def setUp(self): world.testing = False SupyTestCase.setUp(self) def tearDown(sel...
{ "content_hash": "ea17e6c8b4d504bc291962e5596b5f36", "timestamp": "", "source": "github", "line_count": 538, "max_line_length": 80, "avg_line_length": 38.77695167286245, "alnum_prop": 0.6355095388745087, "repo_name": "ProgVal/Limnoria-test", "id": "0a505cd22eb1cdeb83ff9008284bf96c14ac4111", "size":...
import os,sys import math, re if len(sys.argv) < 4: print 'Use: splitProposalsFile.py bboxesFile parts output' sys.exit() bboxes = [x for x in open(sys.argv[1])] parts = int(sys.argv[2]) outFile = sys.argv[3] + '/part.' ################################## # Organize boxes by source image ########################...
{ "content_hash": "ca97bd4e37ad93c6b4a970d983c6d5f9", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 69, "avg_line_length": 24.88372093023256, "alnum_prop": 0.5710280373831775, "repo_name": "jccaicedo/localization-agent", "id": "ecc26989c694dffaf1e0b0867ecdba02e836eddf", "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('crowdcop_web', '0001_initial'), ] operations = [ migrations.AddField( model_name='campaign', name='num_tips', fi...
{ "content_hash": "3d145f8d30696022e4556b0be23abf22", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 49, "avg_line_length": 21.526315789473685, "alnum_prop": 0.5843520782396088, "repo_name": "bocaaust/CrowdCop", "id": "7ef4cefc8c785d7f67ebb1df13849c3f37ced61c", "size": "48...
"""Python wrapper for prefetching_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import warnings from tensorflow.contrib.data.python.ops import contrib_op_loader # pylint: disable=unused-import from tensorflow.contrib.data.python.ops import gen_da...
{ "content_hash": "cc91715f6c30d9dce839b595a3b93906", "timestamp": "", "source": "github", "line_count": 683, "max_line_length": 97, "avg_line_length": 36.92972181551976, "alnum_prop": 0.6630852793085675, "repo_name": "aselle/tensorflow", "id": "0edd7c9fe974784f199c272a649b302e72d8c218", "size": "25...
"""Support for OASA Telematics from telematics.oasa.gr.""" from __future__ import annotations from datetime import timedelta import logging from operator import itemgetter import oasatelematics import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, SensorDeviceClass, Sens...
{ "content_hash": "bd73fe7b84530a95d8453cbd2ebbe1b4", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 78, "avg_line_length": 31.86602870813397, "alnum_prop": 0.598048048048048, "repo_name": "nkgilley/home-assistant", "id": "3cb624190e77cdc8709fe5aee155a653c6498abb", "size"...
import os.path import djcelery djcelery.setup_loader() PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DEBUG = True TEMPLATE_DEBUG = DEBUG TESTING = False ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS # Hosts/domain names that are valid for this site; re...
{ "content_hash": "f84959d0862a025bbda7378d81df886c", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 79, "avg_line_length": 29.052380952380954, "alnum_prop": 0.6913620717915095, "repo_name": "dmrz/gitality", "id": "8e8df474090ad1dad68929b576cbc017ea5e1573", "size": "6141"...
"""Cloud Spanner API package.""" import pkg_resources __version__ = pkg_resources.get_distribution('google-cloud-spanner').version from google.cloud.spanner.client import Client from google.cloud.spanner.keyset import KeyRange from google.cloud.spanner.keyset import KeySet from google.cloud.spanner.pool import Ab...
{ "content_hash": "4fbcd6a5c18c39179256969a1892c7f1", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 76, "avg_line_length": 29.68421052631579, "alnum_prop": 0.7641843971631206, "repo_name": "ammarkhann/FinalSeniorCode", "id": "31913d8b1202fbe786c481502811c38bd5e7265c", "si...
""" Test for the SmartThings switch platform. The only mocking required is of the underlying SmartThings API object so real HTTP calls are not initiated during testing. """ from pysmartthings import Attribute, Capability from homeassistant.components.smartthings.const import DOMAIN, SIGNAL_SMARTTHINGS_UPDATE from hom...
{ "content_hash": "ab46efd9d9e4a6c579ec0ff29d94f8cb", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 88, "avg_line_length": 37.41747572815534, "alnum_prop": 0.703425012973534, "repo_name": "kennedyshead/home-assistant", "id": "7c202fad12ee6c352959c99c98224b089a07e7de", "s...
import unittest, StringIO, robotparser from test import test_support class RobotTestCase(unittest.TestCase): def __init__(self, index, parser, url, good, agent): unittest.TestCase.__init__(self) if good: self.str = "RobotTest(%d, good, %s)" % (index, url) else: self....
{ "content_hash": "3219aea4863dae94cc615b7f0c9f3ddd", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 88, "avg_line_length": 23.04255319148936, "alnum_prop": 0.6232686980609419, "repo_name": "fkolacek/FIT-VUT", "id": "405d517d2e04867e4f43cc918f00454aa5f6005f", "size": "541...
""" Testing signals emitted on changing m2m relations. """ from django.db import models from django.test import TestCase from .models import Car, Part, Person, SportsCar class ManyToManySignalsTest(TestCase): @classmethod def setUpTestData(cls): cls.vw = Car.objects.create(name='VW') cls.bmw...
{ "content_hash": "3b4896ab5844b00eff21a9c9ab7e27aa", "timestamp": "", "source": "github", "line_count": 465, "max_line_length": 87, "avg_line_length": 34.4494623655914, "alnum_prop": 0.5178225856795056, "repo_name": "fenginx/django", "id": "1e063e8a562ea5511016c8e380a94f299ca2f4f2", "size": "16019"...
class GroupsRequest(object): def __init__(self): self.groups = None self.request = None self.filename = None def getGroups(self): return self.groups def setGroups(self, groups): self.groups = groups def getRequest(self): return self.request def se...
{ "content_hash": "7ac66b41dd60cdbe2137edb4c6fcffef", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 36, "avg_line_length": 20.2, "alnum_prop": 0.6099009900990099, "repo_name": "mjames-upc/python-awips", "id": "f57e491bd67008ecd3be625728fb52193327b53b", "size": "582", "b...
from ceilometer.network.statistics import port_v2 from ceilometer import sample from ceilometer.tests.unit.network import statistics class TestPortPollsters(statistics._PollsterTestBase): def test_port_pollster(self): self._test_pollster( port_v2.PortPollster, 'port', ...
{ "content_hash": "ca6d6591aee678d970fec2e06c2237a8", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 54, "avg_line_length": 29.870967741935484, "alnum_prop": 0.5869330453563715, "repo_name": "openstack/ceilometer", "id": "684247113b012905282975c11055a0fbfb585896", "size": ...
import os import re import logging from ctypes import c_int32 from collections import defaultdict from devlib.utils.csvutil import create_writer, csvwriter from wa.utils.trace_cmd import TraceCmdParser, trace_has_marker, TRACE_MARKER_START, TRACE_MARKER_STOP logger = logging.getLogger('cpustates') INIT_CPU_FREQ_RE...
{ "content_hash": "46caf81fd8a84be863bd46a8e08a3f89", "timestamp": "", "source": "github", "line_count": 692, "max_line_length": 123, "avg_line_length": 37.660404624277454, "alnum_prop": 0.5893864395073097, "repo_name": "ARM-software/lisa", "id": "60a16fb2f38a3ae8c54e0e5f07f1b1b2dd6d4b7b", "size": "...
import bob.db.verification.filelist import bob.bio.base # babel_wav_directory = "[YOUR_HUNSPEECH_WAV_DIRECTORY]" database = bob.bio.base.database.DatabaseBob( database = bob.db.verification.filelist.Database( # TODO Later replace this first argument by # pkg_resources.resource_filename( # ...
{ "content_hash": "e58cd32000c1a64baa695277fd693937", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 85, "avg_line_length": 39.75, "alnum_prop": 0.6776729559748428, "repo_name": "juditacs/hunspeech", "id": "8a981a9e28ec8ec23e67f0c2c9febb2267134876", "size": "636", "binar...
import sst # Define SST core options sst.setProgramOption("timebase", "1ps") sst.setProgramOption("stopAtCycle", "0 ns") # Define the simulation components comp_cpu = sst.Component("cpu", "miranda.BaseCPU") comp_cpu.addParams({ "verbose" : 0, "generator" : "miranda.SingleStreamGenerator", "generatorParams.verbose"...
{ "content_hash": "704a9b02e4c95698f7f098ccbb5f90da", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 109, "avg_line_length": 32.013888888888886, "alnum_prop": 0.6433839479392625, "repo_name": "tactcomplabs/gc64-hmcsim", "id": "31d27f09a9e1bf9a88221bba1677d5696ea23842", "si...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ('profiles', '0001_initial'), ] operations = [ migrations.CreateModel( name='Default_Group', ...
{ "content_hash": "29fb21548b358c6baf0740e4916ac23f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 141, "avg_line_length": 25.043478260869566, "alnum_prop": 0.5434027777777778, "repo_name": "joelstanner/django-imager", "id": "182def9b97f650cf46f11ddda2e6ba5d4cab86ba", "s...
from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ("pokemon_v2", "0003_auto_20160530_1132"), ] operations = [ migrations.AlterField( model_name="language", name="iso639", field=models.CharField(max_length=...
{ "content_hash": "787a1371a15a1ad6d0c899ffb9d34310", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 50, "avg_line_length": 22.176470588235293, "alnum_prop": 0.5702917771883289, "repo_name": "PokeAPI/pokeapi", "id": "fa62bed381b76aed3df9d34a516cb3afd8a76b63", "size": "377"...
from msrest.serialization import Model class PacketCaptureResult(Model): """Information about packet capture session. Variables are only populated by the server, and will be ignored when sending a request. :ivar name: Name of the packet capture session. :vartype name: str :ivar id: ID of the...
{ "content_hash": "eaaec40c7a4372c72d7e49048361b069", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 265, "avg_line_length": 46.81944444444444, "alnum_prop": 0.6659744882824088, "repo_name": "SUSE/azure-sdk-for-python", "id": "78f6eb10241ebc5bab8b98d7945af9ba9ad35696", "si...
import csv,os import serial_reader #trydemo.myfn() import time while True: serial_reader.myfn() time.sleep(5)
{ "content_hash": "a6caa898fa041dc851bc635a833f1175", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 24, "avg_line_length": 17.142857142857142, "alnum_prop": 0.7083333333333334, "repo_name": "kartikpalani/Smart-Energy-Hackathon", "id": "a0cafa12e6d9cf6783334a4bfc81591172855ee...
import logging import os from helper import file_helper logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG) filename = '../config/firewall_config.pkl' path = os.path.join(os.path.dirname(os.path.abspath(__file__)), filename) def save(dict): return file_helper.save(path, dict) def loa...
{ "content_hash": "472a38ac24f2f94238b6a0eeac44452d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 76, "avg_line_length": 21.11764705882353, "alnum_prop": 0.7214484679665738, "repo_name": "vcpe-io/vcpe-hub", "id": "15e29e6edbc935cb93c83370aca7e203e7b46b39", "size": "359"...
from .interface import TorchModel, TorchSequenceModel from . import util, data, interface
{ "content_hash": "41417db20f5d39716a3a28a446ae1064", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 53, "avg_line_length": 45, "alnum_prop": 0.8222222222222222, "repo_name": "mattHawthorn/sk-torch", "id": "c06f150f99333597f39e4a1b65bd684f35d99746", "size": "105", "binary...
from django.conf.urls import url from data_ingestion import views urlpatterns = [ # ex: /data-ingestion-page/ url(r'^$', views.index, name='indexData'), # ex: /data-ingestion-page/5/ url(r'^(?P<collection_id>[0-9]+)/$', views.detail, name='detail'), # ex: /data-ingestion-page/5/edit url(r'^(?P<...
{ "content_hash": "d83a9a571bd6f11eac1cbb851d87ad2d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 83, "avg_line_length": 39, "alnum_prop": 0.6324786324786325, "repo_name": "SISTEMAsw/TAMP", "id": "068cb8d921714c3187647516788982c3a32ddb12", "size": "468", "binary": fal...
import random from googleimages import GoogleImagesSearch words = ["ability","able","aboard","about","above","accept","accident","according", "account","accurate","acres","across","act","action","active","activity", "actual","actually","add","addition","additional","adjective","adult","adventure", "advice","affect","a...
{ "content_hash": "10bf64995e3d3f87a62a29b395bc9d91", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 132, "avg_line_length": 82.2877358490566, "alnum_prop": 0.6415018629979937, "repo_name": "ugosan/passwordgen", "id": "f42e6bbb159647f403c75bf077f6d5ee507e99d9", "size": "1...
import urllib import twurl import json TWITTER_URL = 'https://api.twitter.com/1.1/friends/list.json' while True: print '' acct = raw_input('Enter Twitter Account:') if ( len(acct) < 1 ) : break url = twurl.augment(TWITTER_URL, {'screen_name': acct, 'count': '5'} ) print 'Retrieving', url ...
{ "content_hash": "b67b882a0a84b563762972e5218f5b67", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 61, "avg_line_length": 27.375, "alnum_prop": 0.604261796042618, "repo_name": "lastralab/Statistics", "id": "90743ccd6e9e08ed8e4eb17139ff1eaf675ed27d", "size": "657", "bin...
"""Common utility class to help SDK harness to execute an SDF. """ import logging import threading from typing import TYPE_CHECKING from typing import Any from typing import NamedTuple from typing import Optional from typing import Tuple from typing import Union from apache_beam.transforms.core import WatermarkEstima...
{ "content_hash": "48befd5f8a504a841fdc7e445190442c", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 81, "avg_line_length": 36.87336244541485, "alnum_prop": 0.7205116058739933, "repo_name": "apache/beam", "id": "bbb6b2de6e85b26fcb43d5aab86174be2472f4d6", "size": "9250", ...
"""Exercise 15: Reverse Word Order Write a program (using functions!) that asks the user for a long string containing multiple words. Print back to the user the same string, except with the words in backwards order. For example, say I type the string: My name is Michele Then I would see the string: Miche...
{ "content_hash": "5e67a1aac222d751995669fbe56ccd28", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 76, "avg_line_length": 26.857142857142858, "alnum_prop": 0.7021276595744681, "repo_name": "lcnodc/codes", "id": "8985efce71a4233ebda37ae03c835ba56f03fe85", "size": "611", ...
from datetime import datetime from django.utils import simplejson import logging from model.testfile import TestFile JSON_RESULTS_FILE = "results.json" JSON_RESULTS_FILE_SMALL = "results-small.json" JSON_RESULTS_PREFIX = "ADD_RESULTS(" JSON_RESULTS_SUFFIX = ");" JSON_RESULTS_VERSION_KEY = "version" JSON_RESULTS_BUILD...
{ "content_hash": "e15fffce2c08554533ee3beaa4838470", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 141, "avg_line_length": 36.83595505617978, "alnum_prop": 0.595473401659346, "repo_name": "Xperia-Nicki/android_platform_sony_nicki", "id": "d61a860564a2adc53f7d570c3aa0cc3b5...
""" Client side of the senlin engine RPC API. """ from oslo_config import cfg from senlin.common import consts from senlin.common import messaging from senlin.objects import base as object_base _CLIENT = None def get_engine_client(): global _CLIENT if not _CLIENT: _CLIENT = EngineClient() retur...
{ "content_hash": "005c30c788489dcde3b361e321f08f74", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 71, "avg_line_length": 28.016393442622952, "alnum_prop": 0.6026916325336454, "repo_name": "openstack/senlin", "id": "3b02d69e57fff4fab1a1541891ba08132760465d", "size": "225...
"""Utility functions for training.""" import six import tensorflow as tf from deeplab.core import preprocess_utils def _div_maybe_zero(total_loss, num_present): """Normalizes the total loss with the number of present pixels.""" return tf.to_float(num_present > 0) * tf.div(total_loss, ...
{ "content_hash": "d075ddfe49cea7032e81bc56e38a3688", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 80, "avg_line_length": 40.81494661921708, "alnum_prop": 0.6331851076815764, "repo_name": "derekjchow/models", "id": "477fdebc35a890f7410a5b3874e5ffcb4ed2cc19", "size": "12...
""" WSGI config for code_god project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "code_god.settings") from django.core...
{ "content_hash": "f773d2c09aa7adf34c738e94f224b473", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.928571428571427, "alnum_prop": 0.7698209718670077, "repo_name": "caihaoyu/code_god", "id": "f9ec53130ef9b6a98b80bc0f60068c6aa15dc826", "size": "39...
from django.apps import AppConfig class FollowersConfig(AppConfig): name = 'apps.followers'
{ "content_hash": "d3b0e1a368c6611a2e8b25d17fb40521", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 19.6, "alnum_prop": 0.7653061224489796, "repo_name": "kamilgregorczyk/instalike", "id": "67e8d2edefacdc905f9d8b1e5e49d3536b345bfc", "size": "98", "b...
from TwitterSearch import * from mapgeist.api import text_mind_map from mapgeist.visualization import visualize_tree_2D #Text phrase to be searched on Twitter search_text = 'artificial intelligence' #Number of nodes required in MindMap N = 50 #Filepath (png format) to store the MindMap to mappath = 'MindMap.png' t...
{ "content_hash": "7a55e8fe5a5b48d992afc1b5e6b2883e", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 54, "avg_line_length": 25.294117647058822, "alnum_prop": 0.5215116279069767, "repo_name": "sachinrjoglekar/MapGeist", "id": "80cb584151104f92fac0dccc81ab731578863f3d", "siz...
import os import shutil from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase from filebrowser.settings import DIRECTORY, VERSIONS_BASEDIR from filebrowser.base import FileObject from filebrowser.sites import site class FilebrowserTestCase(TestCase): @cla...
{ "content_hash": "d9f936f1b1a3abfe2c6316dc302f1447", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 140, "avg_line_length": 43.67307692307692, "alnum_prop": 0.6856010568031704, "repo_name": "michalwerner/django-filebrowser-tinymce4", "id": "3c4f0d27fe3521256bbe62fb8bd82f025...
from perfcomp import ansbile_playbook, pip_diff, rpm_diff from perfcomp.graphs import graph_ansible_playbook class JobDiff: def __init__(self, good, bad, ansible_playbooks_diff, rpm_diff_b, pip_diff_b): self.good, self.bad = good, bad self.ansible_diff = ansible_playbooks_diff ...
{ "content_hash": "a14fea521d7920bfe5ab917bbc4a0752", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 79, "avg_line_length": 39.04255319148936, "alnum_prop": 0.5989100817438692, "repo_name": "rdo-infra/ci-config", "id": "882c0927d56ca95093d1f5ed616e9cd7c4b293de", "size": "1...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0046_site_name_remove_null'), ('tests', '0051_tag_verbose_name'), ] operations = [ migrations.AlterModelOptions( name='customdocument', options={}, ...
{ "content_hash": "ee7b9194cbb9fe62f19220e42f28d8b6", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 54, "avg_line_length": 25.583333333333332, "alnum_prop": 0.5537459283387622, "repo_name": "torchbox/wagtail", "id": "7624bc6b6684570708f2429f6043c38a31267739", "size": "664...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) sys.path.append('/users/...
{ "content_hash": "a1791cb8e382634f42fe86ed1bf31ed9", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 188, "avg_line_length": 33.27947598253275, "alnum_prop": 0.7055504526964965, "repo_name": "mabelcalim/waipy", "id": "a2e97198035a63507c5293363dd2820dceacc1d7", "size": "80...
"""Sensitivity lists.""" from . import HDLObject from .signal import HDLSignal, HDLSignalSlice from .port import HDLModulePort class HDLSensitivityDescriptor(HDLObject): """Signal sensitivity descriptor.""" _sens_types = ["rise", "fall", "both", "any"] def __init__(self, sens_type, sig=None): "...
{ "content_hash": "5c70c8a76c5eb990c42b3e5a25347dcb", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 72, "avg_line_length": 30.083333333333332, "alnum_prop": 0.5678670360110804, "repo_name": "brunosmmm/hdltools", "id": "f81a64dc0ad10139bf76b994e0e2d8cdb3c59939", "size": "2...
"""Run the linting rules on the playbook with given args""" import multiprocessing from ansible.cli.playbook import PlaybookCLI # pylint: disable=E0611,F0401 from collections import defaultdict from interceptor import intercept from linter.utils import isLTS, suppressConsoleOut from linter.utils.composite_queue imp...
{ "content_hash": "9ace26c24f53674681086320f637b971", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 94, "avg_line_length": 38.20289855072464, "alnum_prop": 0.6073596358118362, "repo_name": "host-anshu/lint-playbook", "id": "25f20e8ec725c6828f448426192ce4c5ca5133ec", "size...
from nose.tools import assert_equal from kmodes.kmodes import get_max_value_key def test_mode_from_dict(): max_key = get_max_value_key({'a': 3, 'b': 10, 'c': -1, 'd': 9.9}) assert_equal('b', max_key)
{ "content_hash": "e7634f10692b1afb2c7a5df6b6b11988", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 69, "avg_line_length": 30, "alnum_prop": 0.6333333333333333, "repo_name": "nkhuyu/kmodes", "id": "7097143cc2845c53b21e2e3b291a3130a6b06d44", "size": "211", "binary": false...
import os import sys print("\nStripping input reference numbers from code cells...") # Find all files to work with. path_to_notebooks = '/srv/projects/intro_programming/intro_programming/notebooks/' filenames = [] for filename in os.listdir(path_to_notebooks): if '.html' in filename and filename != 'index.html': ...
{ "content_hash": "4f23c89f96fa7c0ad6a10f7b7528e5e1", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 82, "avg_line_length": 28.486486486486488, "alnum_prop": 0.6176470588235294, "repo_name": "BadWizard/intro_programming", "id": "2ab8878b1a362f079adf49a971ef71aa7677a4ea", "...
""" Sensor for Last.fm account status. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.lastfm/ """ import logging import re import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_...
{ "content_hash": "2b36f893eb8b15b5c886ff22ba09d2b4", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 79, "avg_line_length": 28.231404958677686, "alnum_prop": 0.6083138173302107, "repo_name": "tinloaf/home-assistant", "id": "d92fe8b53bfcd49b9444ea0d30d7a872c9d0fcec", "size...
from msrest.serialization import Model class MaintenanceRedeployStatus(Model): """Maintenance Operation Status. :param is_customer_initiated_maintenance_allowed: True, if customer is allowed to perform Maintenance. :type is_customer_initiated_maintenance_allowed: bool :param pre_maintenance_wind...
{ "content_hash": "e0fa15b127840186f5f42cc94ef8ca97", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 313, "avg_line_length": 60.51020408163265, "alnum_prop": 0.7274873524451939, "repo_name": "lmazuel/azure-sdk-for-python", "id": "1d3532edebdeed6a51f179c74b0927ccd6e9c777", ...
import unittest from opencensus.metrics import label_key from opencensus.metrics.export import metric_descriptor, value NAME = 'metric' DESCRIPTION = 'Metric description' UNIT = '0.738.[ft_i].[lbf_av]/s' LABEL_KEY1 = label_key.LabelKey('key1', 'key description one') LABEL_KEY2 = label_key.LabelKey('值', '测试用键') LABEL_...
{ "content_hash": "606e777bb80127045685e8564efff078", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 78, "avg_line_length": 38.464285714285715, "alnum_prop": 0.6504178272980501, "repo_name": "census-instrumentation/opencensus-python", "id": "ff79a3d3ceecc182a151f8491239ac8b3...
AUTH_FAILURE = "Your username and password were incorrect. Sorry" def NO_FIELD_SUPPLIED(field): return 'No %s supplied' % field PASSWORDS_DONT_MATCH = 'The passwords don\'t match' def FIELD_MUST_BE_LEN(field, the_len): return '%s must be at least %s characters long' % (field, the_len) USERNAME_TAKEN = 'Username...
{ "content_hash": "0804f5c6a65f523e28b252eb38f65254", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 70, "avg_line_length": 47.6, "alnum_prop": 0.7240896358543417, "repo_name": "whilefalse/Debt-Collector", "id": "2a9f2c0f37a6d2e2acc25df33682dce4b76b7629", "size": "726", ...
import pywatchman from watchman.integration.lib import WatchmanTestCase @WatchmanTestCase.expand_matrix class TestLog(WatchmanTestCase.WatchmanTestCase): def test_invalidNumArgsLogLevel(self) -> None: for params in [["log-level"], ["log-level", "debug", "extra"]]: with self.assertRaises(pywatc...
{ "content_hash": "d8223ff8830e900a622047e6fe1fd815", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 85, "avg_line_length": 40.74193548387097, "alnum_prop": 0.66270783847981, "repo_name": "facebook/watchman", "id": "bf84d3c29c879c3745ec6b7b6febb473e9f61ecc", "size": "1464"...
import numbers from telemetry import value as value_module from telemetry.value import list_of_scalar_values from telemetry.value import none_values from telemetry.value import summarizable class ScalarValue(summarizable.SummarizableValue): def __init__(self, page, name, units, value, important=True, ...
{ "content_hash": "82693f5826ae56b961ae2037417150aa", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 80, "avg_line_length": 33.601851851851855, "alnum_prop": 0.6632681179388261, "repo_name": "CapOM/ChromiumGStreamerBackend", "id": "bd533866eb6f25bb5d1f7a3eeae7efb04ba65d52",...
import time import json from wand.image import Image from wand.display import display start_time = time.time() img_file = '../images/orientation-examples/7-F.jpg' orientation = [ # 'undefined', # 'top_left', 'top_right', 'bottom_right', 'bottom_left', 'left_top', 'right_top', 'right_bot...
{ "content_hash": "9c058263663df760005459119ddc1e41", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 59, "avg_line_length": 30.84313725490196, "alnum_prop": 0.4551811824539097, "repo_name": "nbari/my-sandbox", "id": "8b652f8498ac54f1df5dba203d6f8c11b16d584b", "size": "1573...
import os from setuptools import setup, find_packages from pip.req import parse_requirements reqs_txt = os.path.join(os.path.dirname(__file__), 'requirements.txt') pip_reqs = [unicode(obj.req) for obj in parse_requirements(reqs_txt)] setup( name = 'baseball-projection-schematics', version = '0.2.0', des...
{ "content_hash": "a164b1d66ba7b394301217dacfc32ccc", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 76, "avg_line_length": 26.678571428571427, "alnum_prop": 0.6854082998661312, "repo_name": "mattdennewitz/baseball-projection-schematics", "id": "7bba9a6ac6f16be10f100fed080b2...
"""Benchmarks using custom training loop on MNIST dataset.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import timeit import numpy as np import tensorflow as tf from tensorflow.python.keras.benchmarks import benchmark_util from tensorflow.python.kera...
{ "content_hash": "149eebe8377241b0159afdb4090b054e", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 80, "avg_line_length": 39.590529247910865, "alnum_prop": 0.6062759445577992, "repo_name": "annarev/tensorflow", "id": "f1b431a35db5607966a44946ea38cc3c55efe6a2", "size": "...
from collections import Sequence # noqa from django.conf import settings from horizon import exceptions import six __all__ = ('APIResourceWrapper', 'APIDictWrapper', 'get_service_from_catalog', 'url_for',) class APIVersionManager(object): """Object to store and manage API versioning data and util...
{ "content_hash": "672e64aa80e4a4e9fdd4415838a781f6", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 79, "avg_line_length": 33.6865671641791, "alnum_prop": 0.5840496233938857, "repo_name": "gerrive/horizon", "id": "ea45eefbda94accc6a202e5031d1efa5cb270136", "size": "12049...
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on January, 24, 2013 @author: Sourabh Bajaj @contact: sourabhbajaj@gatech.edu @summary: Example tutorial code...
{ "content_hash": "e77594169202b2a6cad9904e6e911854", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 77, "avg_line_length": 32.757009345794394, "alnum_prop": 0.6690442225392297, "repo_name": "telefar/stockEye", "id": "38d410b1c3bdc73aaae59c531c336313c5cff676", "size": "35...
from __future__ import print_function import unittest from paddle.fluid.tests.unittests.test_cross_entropy_op import TestCrossEntropyOp, TestCrossEntropyOp2, TestCrossEntropyOp3, TestCrossEntropyOp4, TestCrossEntropyOp5, TestCrossEntropyOp6, TestCrossEntropyOp7 if __name__ == "__main__": unittest.main()
{ "content_hash": "fb753d75908f2082552d04837a308740", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 207, "avg_line_length": 44.42857142857143, "alnum_prop": 0.8038585209003215, "repo_name": "chengduoZH/Paddle", "id": "3057218a1d80deffe7eb3164c2350143fc38007d", "size": "924...
from . import AWSObject, AWSProperty, PropsDictType, Tags from .validators import boolean, double, integer class ConnectAttachmentOptions(AWSProperty): """ `ConnectAttachmentOptions <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-networkmanager-connectattachment-connectattachment...
{ "content_hash": "d2d811557de1a653704c4730bce3d085", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 174, "avg_line_length": 28.871698113207547, "alnum_prop": 0.6437067050058816, "repo_name": "cloudtools/troposphere", "id": "b98490b7c77337455073733f2fd5985c923fa279", "siz...
import os from os.path import join import sys import numpy as np from numpy.testing import (assert_equal, assert_allclose, assert_array_equal, assert_raises) import pytest from numpy.random import ( Generator, MT19937, PCG64, PCG64DXSM, Philox, RandomState, SeedSequence, SFC64, defa...
{ "content_hash": "f6251585b1207274b024afca9d8b710e", "timestamp": "", "source": "github", "line_count": 453, "max_line_length": 83, "avg_line_length": 34.15673289183223, "alnum_prop": 0.5971692625864409, "repo_name": "ryfeus/lambda-packs", "id": "29054b70b95a01227351dba02040aac7d82c2bb2", "size": "...
""" When training a model, it's often useful to decay the learning rate during training process, this is called learning_rate_decay. There are many strategies to do this, this module will provide some classical method. User can also implement their own learning_rate_decay strategy according to this module. """ import ...
{ "content_hash": "8844a22cda9d825fb7679854ca0338a1", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 102, "avg_line_length": 33.73529411764706, "alnum_prop": 0.5939718520363682, "repo_name": "Canpio/Paddle", "id": "716cc7824eff0c56cc55a055310fa8b1913ac5e6", "size": "8638"...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('projects', '0010_add_db_contraint'), ] operations = [ migrations.AlterField( ...
{ "content_hash": "008113ed1d12fdfa958b38c0323d901f", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 227, "avg_line_length": 48.423529411764704, "alnum_prop": 0.6209912536443148, "repo_name": "DMPwerkzeug/DMPwerkzeug", "id": "0a7ef9a7ca3b1b24613ed6b5d047fadae04c2934", "siz...
if __name__ == '__main__': if __package__ is None: import sys from os import path sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) ) #from Stream import * from ListOperators import many_to_many from PrintFunctions import print_streams_recent, print_stream_recent impor...
{ "content_hash": "67e37686e5620cb12770e1270e586db6", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 81, "avg_line_length": 24.86111111111111, "alnum_prop": 0.617877094972067, "repo_name": "zatricion/Streams", "id": "22a3989bee1de26352c7d4e8c634d2f64c8d4708", "size": "895"...
""" Git Branch Trail model """ from django.db import models class GitBranchTrailEntry(models.Model): """ Git Branch Trail """ project = models.ForeignKey('gitrepo.GitProjectEntry', related_name='git_trail_project') branch = models.ForeignKey('gitrepo.GitBranchEntry', related_name='git_trail_branch') c...
{ "content_hash": "faa4a05d62c786a535dd29eb2d2edfc5", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 92, "avg_line_length": 41.3, "alnum_prop": 0.6670702179176755, "repo_name": "imvu/bluesteel", "id": "37dd504f29a9520bb9aa92352b955692b09b57f8", "size": "826", "binary": f...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing M2M table for field sponsors_to_display on 'SpecificSponsorsPlugin' db.delete_table('sponsors_specificsponsorsplu...
{ "content_hash": "665cf47fd06dcaeca926429b8215fda4", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 189, "avg_line_length": 64.41891891891892, "alnum_prop": 0.6079295154185022, "repo_name": "frinat/fribourg-natation.ch", "id": "24e4441de0db0f76c5366162ff1de8cba0946f5a", "...
import logging import logging.config def init_logging(file=None, file_level=logging.DEBUG, stdout=True): config = { 'version': 1, 'formatters': { 'consoleFormatter': { 'format': '%(levelname)s %(message)s' }, 'fileFormatter': { 'f...
{ "content_hash": "3847cac7b492af565821249bec51fa34", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 91, "avg_line_length": 29.951219512195124, "alnum_prop": 0.4576547231270358, "repo_name": "thekot/cam_to_webm", "id": "1b4c88ffdff3c593349e2637a18ec78d6ccf2037", "size": "1...
from flask import Blueprint url_prefix = '/' main = Blueprint('main', __name__, url_prefix=url_prefix, template_folder='templates') from .views import *
{ "content_hash": "5b356438900cc902fdbce15756f8295f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 57, "avg_line_length": 24.285714285714285, "alnum_prop": 0.6470588235294118, "repo_name": "pjryan126/flask-docker", "id": "8a3245cd9745d5edeefd2af3a01111613acff9fb", "size":...
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('tournament', '0005_auto_20160717_2320'), ] operations = [ migrations.CreateModel( name='TeamPairing', fields=[ ('id'...
{ "content_hash": "0dc66018e8fb5607a56d143834fad38b", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 151, "avg_line_length": 39.52173913043478, "alnum_prop": 0.5764576457645765, "repo_name": "cyanfish/heltour", "id": "be54dec1d58da5e6f01ed4a78315f564ce97ebcd", "size": "189...
''' Parameters are one of the core concepts of Luigi. All Parameters sit on :class:`~luigi.task.Task` classes. See :ref:`Parameter` for more info on how to define parameters. ''' import abc import datetime import warnings import json from json import JSONEncoder from collections import OrderedDict, Mapping import oper...
{ "content_hash": "4fcb5dc7dfcd069ce4f1797603e0c35b", "timestamp": "", "source": "github", "line_count": 1107, "max_line_length": 150, "avg_line_length": 34.63414634146341, "alnum_prop": 0.5992175273865414, "repo_name": "Viktor-Evst/fixed-luigi", "id": "fb4d30a8e0e00c30606e3e4f825e770393d9884d", "si...
"""Abstraction of the underlying virtualization API.""" import sys from nova import flags from nova import log as logging from nova import utils from nova.virt import driver from nova.virt import fake from nova.virt import firewall from nova.virt import hyperv from nova.virt import vmwareapi_conn from nova.virt impor...
{ "content_hash": "a74fd0ceb7381ab7b9494a9115541fc0", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 78, "avg_line_length": 32.435483870967744, "alnum_prop": 0.6578816509199403, "repo_name": "salv-orlando/MyRepo", "id": "6875ccdd9ed584a6f2664c93a7223dfd32425c28", "size": "...
"""Module for example of listener.""" import sys import os import time from cyber_py import cyber from cyber.proto.unit_test_pb2 import ChatterBenchmark def test_client_class(): """ Client send request """ node = cyber.Node("client_node") client = node.create_client( "server_01", ChatterB...
{ "content_hash": "cbfb3a3b438540d8669ce51028a9fb82", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 56, "avg_line_length": 23.6875, "alnum_prop": 0.6068601583113457, "repo_name": "wanglei828/apollo", "id": "500b6684a04844da661672fd7026373456446e29", "size": "1540", "bin...
""" Django settings for mptt_424 project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # ...
{ "content_hash": "ac15c6022e7d8ea416b6f1f3d3f69b77", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 91, "avg_line_length": 26.071428571428573, "alnum_prop": 0.680365296803653, "repo_name": "Wtower/django-mptt-424", "id": "75acdb61a37a8e20896316ab96ca2f16c7883c8f", "size"...
from __future__ import absolute_import, print_function, unicode_literals import time class Clock(object): """ Logical timestamp generator. """ def __init__(self, timestamp=None): if timestamp: self.l = (timestamp >> 16) & 0xffffffffffff self.c = timestamp & 0xffff ...
{ "content_hash": "c2bdbb76e41f9c68cc533248bb809a73", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 74, "avg_line_length": 24.95098039215686, "alnum_prop": 0.48762278978388995, "repo_name": "nickchen-mitac/fork", "id": "18d07aefd374304bd598accb2c1013d2d6ed33d9", "size": ...
"""Exceptions that can be thrown from Wapi. Every one of them will generate a response matching the type of the exception.""" from django.http import HttpResponse class ApiError(RuntimeError): """Generic API Error""" default_msg = 'API Error' status_code = 400 def __init__(self, message=None): ...
{ "content_hash": "2aa029095a2e363ef4c306716f302a02", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 75, "avg_line_length": 31.328125, "alnum_prop": 0.6528678304239401, "repo_name": "fiam/wapi", "id": "2ef02507e5806914beca662a86677100c7c54bb6", "size": "3148", "binary": ...
from motor import Motor try: from gpio_manager import GPIOManager as GPIOManager DEBUG = 0 except: from gpio_simulation import GPIOSimulation as GPIOManager DEBUG = 1 sensor_radius = 0.1 num_magnets = 6 motor = Motor(sensor_radius, num_magnets) gpio_manager = None def main(): global gpio_manag...
{ "content_hash": "445c312b10cbebf1d463a63223c3f9e7", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 61, "avg_line_length": 15.692307692307692, "alnum_prop": 0.6507352941176471, "repo_name": "swm93/brushless-dc-motor", "id": "d71e0ffabbe591c7e898ed6f7c118294b4e3dee4", "siz...
import os from distutils.core import setup from setuptools import find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='django-twitsocket', version='0.1', author=u'Bruno Renie, Gautier Hayoun', author_email='bruno@renie.fr', packages=fin...
{ "content_hash": "acdeb7d5bf5b7454163d5f1cac4421c7", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 122, "avg_line_length": 29.857142857142858, "alnum_prop": 0.69377990430622, "repo_name": "apapillon/django-twitsocket", "id": "3282b58962ed60e3044e79fb737211292f780e68", "s...