text
stringlengths
4
1.02M
meta
dict
from __future__ import print_function, absolute_import, unicode_literals import codecs import datetime import os try: from urlparse import urljoin, urlparse except ImportError: from urllib.parse import urljoin, urlparse # NOQA from nikola.plugin_categories import LateTask from nikola.utils import config_chang...
{ "content_hash": "f8b624e720e0e70ff17442fd4819aa2d", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 102, "avg_line_length": 36.166666666666664, "alnum_prop": 0.543778801843318, "repo_name": "servalproject/nikola", "id": "b9f2c7f36238762498c5c734e0ae3f9dae36d50a", "size":...
""" __graph_MT_pre__Pattern.py___________________________________________________________ Automatically generated graphical appearance ---> MODIFY DIRECTLY WITH CAUTION _____________________________________________________________________________ """ import tkFont from graphEntity import * from GraphicalForm im...
{ "content_hash": "6f26bbca59c303e008f1b80b27fc59a2", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 211, "avg_line_length": 41.42857142857143, "alnum_prop": 0.575095785440613, "repo_name": "levilucio/SyVOLT", "id": "c6d96f7619f97baffd512e5dde351c9048c6caf9", "size": "2610...
""" Performance PubsubIO streaming test for Write/Read operations. Caution: only test runners (e.g. TestDataflowRunner) support matchers Example for TestDataflowRunner: python -m apache_beam.io.gcp.pubsub_io_perf_test \ --test-pipeline-options=" --runner=TestDataflowRunner --sdk_location=.../dist/apache-...
{ "content_hash": "0929b7872d1c1e77ed36942f20f47860", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 78, "avg_line_length": 33.99014778325123, "alnum_prop": 0.6782608695652174, "repo_name": "iemejia/incubator-beam", "id": "a0457c0a4f257faf568ac9d54e3092403c3058e5", "size"...
from goldsberry.masterclass import NbaDataProvider from goldsberry.apiparams import * class daily_scoreboard(NbaDataProvider): def __init__(self, date, **kwargs): url_modifier = 'scoreboardV2' NbaDataProvider.__init__(self, url_modifier=url_modifier, default_params=p_league_sb, gameDate=date, **kw...
{ "content_hash": "af5ae2ac367d59b6f89cabaf9b7db2ee", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 118, "avg_line_length": 40.225352112676056, "alnum_prop": 0.6434407096171803, "repo_name": "bradleyfay/py-Goldsberry", "id": "c8ee19f79fa201f8b81089479cf72e4ccf7b1948", "s...
""" WSGI config for Webinterface 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.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Webinterface.settings") from dja...
{ "content_hash": "54ed27404ec4b426e42ae7ce5dfaf0a4", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 28.5, "alnum_prop": 0.7794486215538847, "repo_name": "elnappo/Baulicht", "id": "eb437cc28cc5407180bcd46b5ff2c60f879ab018", "size": "399", "binary":...
"""Support for exposing NX584 elements as sensors.""" from __future__ import annotations import logging import threading import time from nx584 import client as nx584_client import requests import voluptuous as vol from homeassistant.components.binary_sensor import ( DEVICE_CLASSES_SCHEMA as BINARY_SENSOR_DEVICE...
{ "content_hash": "e85d98acb3efde77bc2f860f932ab3d9", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 86, "avg_line_length": 30.264150943396228, "alnum_prop": 0.6319617622610141, "repo_name": "rohitranjan1991/home-assistant", "id": "cbd1796b768336c6c463f17a6b168ae00b03e4b9",...
import unittest from unittest import mock from google.api_core.exceptions import AlreadyExists from google.cloud.vision_v1.types import Product, ProductSet, ReferenceImage from airflow.providers.google.cloud.operators.vision import ( CloudVisionAddProductToProductSetOperator, CloudVisionCreateProductOperator,...
{ "content_hash": "005b0cd4203e890ea87fc094d7ff8a04", "timestamp": "", "source": "github", "line_count": 493, "max_line_length": 108, "avg_line_length": 39.302231237322516, "alnum_prop": 0.6381606110652354, "repo_name": "bolkedebruin/airflow", "id": "3c256febd6c9bedfa9e8cb9f8a853e77da81d936", "size"...
from __future__ import absolute_import from .base import * import dj_database_url ENV = 'HEROKU' DEBUG = True ALLOWED_HOSTS = [ 'neurobrush.com', 'www.neurobrush.com' ] # ALLOWED_HOSTS = ['*'] # DATABASES = { # 'default': dj_database_url.config() # } DATABASES = { 'default': { 'ENGINE': 'd...
{ "content_hash": "b13aff40e859e3dc60b14b8ea8262f6e", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 127, "avg_line_length": 26.1, "alnum_prop": 0.5699233716475096, "repo_name": "rootux/neurobrush", "id": "f89c283076729d7159bd26375b6bbcc924843715", "size": "1044", "binar...
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def DistributedVirtualSwitchManagerHostArrayFilter(vim, *args, **kwargs): '''Check host co...
{ "content_hash": "58b438e19fb11e836f92ec54021d275c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 124, "avg_line_length": 33.71875, "alnum_prop": 0.6181649675625579, "repo_name": "xuru/pyvisdk", "id": "32423dec7bf1ff95ea74a9578d60efe80bc328e9", "size": "1080", "binary...
import socket tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM) orig = ("127.0.0.1",5555) tcp.bind(orig) tcp.listen(1) while True: conn, cliente = tcp.accept() print 'Conectado por ', cliente while True: msg = conn.recv(1024) if not msg: break print cliente, msg conn....
{ "content_hash": "d424a84ab8c75221a5aa6c537403b2c5", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 55, "avg_line_length": 23.823529411764707, "alnum_prop": 0.6395061728395062, "repo_name": "ufgup/lab-redes-socket-python", "id": "313454224e1eb0decf8790e5419f52523c6bcd00", ...
from __future__ import unicode_literals # add to readme starting from: from django.core.urlresolvers import reverse from skd_smoke import SmokeTestCase class RedirectToSmokeTestCase(SmokeTestCase): TESTS_CONFIGURATION = ( ('is_authenticated', 302, 'GET', { 'redirect_to': '%s?next=%s' % (reve...
{ "content_hash": "56e4a655f91788486e0df9496081547a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 76, "avg_line_length": 31.375, "alnum_prop": 0.6075697211155379, "repo_name": "steelkiwi/django-skd-smoke", "id": "460d5900d3872a5853cda871d347affb99d0313b", "size": "526",...
from __future__ import unicode_literals import json import random import contextlib import shutil import pytest import tempfile from pathlib import Path from thinc.neural.optimizers import Adam from ...gold import GoldParse from ...pipeline import EntityRecognizer from ...lang.en import English try: unicode exce...
{ "content_hash": "b350c316d759de2ff6a68c1a260bf32e", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 94, "avg_line_length": 31.54368932038835, "alnum_prop": 0.5743305632502308, "repo_name": "ryfeus/lambda-packs", "id": "94a2562fd5ad60d37ecd1361b83381ea876b8ede", "size": "...
import unittest import signal import os import stackimpact from stackimpact.runtime import runtime_info, register_signal class RuntimeTestCase(unittest.TestCase): def test_register_signal(self): if runtime_info.OS_WIN: return result = {'handler': 0} def _handler(signum, fra...
{ "content_hash": "3b1d023d0a4ec4e662d9e2845d0bda5c", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 62, "avg_line_length": 21.617021276595743, "alnum_prop": 0.610236220472441, "repo_name": "stackimpact/stackimpact-python", "id": "e97ee1111cbf59e3e5688e6a95c844a5aa77073d", ...
import unittest import os from conans.client.conf.config_installer import tmp_config_install_folder from conans.test.utils.tools import TestClient class InstallFolderTests(unittest.TestCase): def test_unique_install_folder(self): """ Validate if tmp_config_install_folder is removing old folder before cr...
{ "content_hash": "c1e25c914167ea83133b040167f416d7", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 99, "avg_line_length": 39.04347826086956, "alnum_prop": 0.6837416481069042, "repo_name": "conan-io/conan", "id": "47a7fe319f5843f9db872cdb39c0f1462f49da98", "size": "914", ...
from __future__ import unicode_literals from future.builtins import filter, str try: from urllib.parse import urljoin except ImportError: # Python 2 from urlparse import urljoin from django.core.urlresolvers import resolve, reverse from django.db import models from django.utils.encoding import python_2_uni...
{ "content_hash": "1a437bc07bef9c35bdf9c674ac77862c", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 79, "avg_line_length": 35.945578231292515, "alnum_prop": 0.5879068887206662, "repo_name": "cccs-web/mezzanine", "id": "0b5a0d3a3c60260756991404ff1d8f35c0cde7e8", "size": "...
"""Test multiwallet. Verify that a bitcoind node can load multiple wallet files """ import os import shutil from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error class MultiWalletTest(BitcoinTestFramework): def set_test_params(self): ...
{ "content_hash": "c587450ad2a76da96264022d8952ad1d", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 145, "avg_line_length": 40.073170731707314, "alnum_prop": 0.6195982958003652, "repo_name": "brandonrobertz/namecoin-core", "id": "12d9e9f48d4b3bbf85c26cd79eef210d8a29ec3d", ...
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * OUT = ViewDetailLevel.Medium
{ "content_hash": "ddaa724fbebb52a3658cbf97f5f30960", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 31, "avg_line_length": 20.2, "alnum_prop": 0.801980198019802, "repo_name": "CAAD-RWTH/ClockworkForDynamo", "id": "e317e6763d622724e9c380e7062c19e378666b59", "size": "101", ...
class DummyMiddleware: def __init__(self, get_response): self.get_response = get_response def __call__(self, request): return self.get_response(request)
{ "content_hash": "3a5674f7268d2190ccc563022f509ea9", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 41, "avg_line_length": 25.571428571428573, "alnum_prop": 0.6368715083798883, "repo_name": "digitalocean/netbox", "id": "97592c3b21ce01b9f12739a7e2eb4be7ec875ba7", "size": "1...
import os import pytest from mock import Mock import pip.req.req_uninstall from pip.req.req_uninstall import UninstallPathSet, uninstallation_paths # Pretend all files are local, so UninstallPathSet accepts files in the tmpdir, # outside the virtualenv def mock_is_local(path): return True def test_uninstallat...
{ "content_hash": "b92c0a83b0739491c30f05e263927dca", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 79, "avg_line_length": 31, "alnum_prop": 0.5875352333228938, "repo_name": "atdaemon/pip", "id": "7097ded9d7841a85580568c7298f26a8d8a3555d", "size": "3193", "binary": fal...
import Queue import curses import logging import subprocess import textwrap import threading import traceback from curses import ascii logger = logging.getLogger('assertEquals.interactive.utils') class Bucket: """ """ class RefreshError(StandardError): """An error refreshing the summary. """ de...
{ "content_hash": "78eceb6830cf5d80093d3536e81d3fcc", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 79, "avg_line_length": 29.35377358490566, "alnum_prop": 0.504419090470834, "repo_name": "whit537/assertEquals", "id": "81e1e51666b10249f63a2c787bc05b553a42f07c", "size": "...
"""Save and restore variables.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import os.path import re import time import uuid import numpy as np import six from google.protobuf import text_format from tensorflow.core.protobuf impor...
{ "content_hash": "8f9761fb67a226f38455a884a23d3cba", "timestamp": "", "source": "github", "line_count": 2107, "max_line_length": 176, "avg_line_length": 40.16658756525866, "alnum_prop": 0.659356500573076, "repo_name": "allenlavoie/tensorflow", "id": "e40b8d22ed2ab0f4c9ff65e953f0f1cf681c8068", "size...
import os from django.test import TestCase from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.management import call_command from mapentity.registry import registry class AuthentFixturesMixin: fixtures = [os.path.join(settings.PROJECT_DIR, 'authent', 'fi...
{ "content_hash": "11d1b1e602b4749252011a25ae180608", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 90, "avg_line_length": 35.93877551020408, "alnum_prop": 0.673480976717774, "repo_name": "makinacorpus/Geotrek", "id": "9da9dbc442f4da306250db61b66dc2a457ec4d2a", "size": "1...
import sys, ptypes from ptypes import pstruct, parray, ptype, pbinary, pstr, dyn from ..headers import * from . import exports, imports, resources, exceptions, relocations, debug, loader, clr, tls, headers ## directory entry base types class AddressEntry(headers.IMAGE_DATA_DIRECTORY): addressing = staticmethod(virtua...
{ "content_hash": "59aa63723e8622bf51c0432624e09c24", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 191, "avg_line_length": 37.38157894736842, "alnum_prop": 0.627419922562478, "repo_name": "arizvisa/syringe", "id": "110819d8e85935d59bd4852a916051ae46b4a5e2", "size": "568...
import socket import ssl from ansible.module_utils.urls import generic_urlparse from ansible.module_utils.six.moves.urllib.parse import urlparse from ansible.module_utils.six.moves import http_client from ansible.module_utils._text import to_text # httplib/http.client connection using unix domain socket HTTPConnectio...
{ "content_hash": "2aec88984b0dbc1640b48d6617400987", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 120, "avg_line_length": 39.577586206896555, "alnum_prop": 0.6016118492703115, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "f9ec1fd4e299bf93268411cff52f83dc04...
import os import StringIO import unittest from telemetry import benchmark from telemetry import page as page_module from telemetry.page import page_set from telemetry.results import html_output_formatter from telemetry.results import page_test_results from telemetry.value import scalar def _MakePageSet(): ps = pag...
{ "content_hash": "02ffe1a990d44c4729852e1f870d839a", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 79, "avg_line_length": 31.168141592920353, "alnum_prop": 0.5276831345826235, "repo_name": "yury-s/v8-inspector", "id": "4fdf206d414512f32dd18104f8af84e5a03d3b7e", "size": ...
''' Vector space model bases ''' import os import cPickle as pickle import numpy as np from scipy.stats import spearmanr from .sim import cosine class Space(object): def __init__(self, descrs): self.reportMissing = True if isinstance(descrs, str): self.space = pickle.load(open(desc...
{ "content_hash": "39f8ec76b3429b5625341a23ba9b24cc", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 110, "avg_line_length": 35.83435582822086, "alnum_prop": 0.5386064030131826, "repo_name": "douwekiela/mmfeat", "id": "69eb2ebd32f71ad5e238c10f65bcac5f6a164ed5", "size": "5...
from PySide import QtCore, QtGui class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(418, 303) self.gridLayout = QtGui.QGridLayout(Dialog) self.gridLayout.setObjectName("gridLayout") self.configGroupBox = QtGui.QGroupBox(Dialog) ...
{ "content_hash": "978241454487a4b7723d63d7768cdf42", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 126, "avg_line_length": 56.86046511627907, "alnum_prop": 0.7239263803680982, "repo_name": "MusculoskeletalAtlasProject/mapclient-tests", "id": "b60e0965fb54d0c8c7529ebefadfa9...
""" Test that LLDB doesn't crash if the std module we load is empty. """ from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil import os class ImportStdModule(TestBase): mydir = TestBase.compute_mydir(__file__) # We only emulate a fake libc++ in th...
{ "content_hash": "738d0fe8772e21795bc725059333fe89", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 95, "avg_line_length": 41.07692307692308, "alnum_prop": 0.6697877652933832, "repo_name": "endlessm/chromium-browser", "id": "2b1cb100a3251366ee93f296b6fdf225c9e4ae6a", "siz...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 12, transform = "Quantization", sigma = 0.0, exog_count = 20, ar_order = 0);
{ "content_hash": "401b26766636bcd0083c7a0c7e8d0442", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 172, "avg_line_length": 38.857142857142854, "alnum_prop": 0.7132352941176471, "repo_name": "antoinecarme/pyaf", "id": "d83ad7e1c427d3f418ef134040b7d794a45740fe", "size": "27...
''' Provide 2013 Warsaw daylight hours from http://www.sunrisesunset.com ''' #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- from __future__ import absolute_import, division, print_function, uni...
{ "content_hash": "8847ecb5bef5ac6bab3f8952c27efce3", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 103, "avg_line_length": 31.95, "alnum_prop": 0.27856025039123633, "repo_name": "timsnyder/bokeh", "id": "f467f2d905c93b241eb06d1f12a143864ac3b34c", "size": "2248", "binar...
from __future__ import unicode_literals, absolute_import import json import unittest import responses from linebot import ( LineBotApi ) from linebot.models import ( LocationSendMessage ) class TestLineBotApi(unittest.TestCase): def setUp(self): self.tested = LineBotApi('channel_secret') ...
{ "content_hash": "40a6eea2736d7f6bdb841dc36261e34f", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 74, "avg_line_length": 27.31132075471698, "alnum_prop": 0.5512953367875648, "repo_name": "monhustla/line-bot-sdk-python", "id": "03fa5c993ec74de2b3f4c857eacd5bf100b35dfd", ...
from __future__ import (unicode_literals, absolute_import, division, print_function) import logging from django.core.management.base import BaseCommand from django.utils import timezone from snisi_malaria import (DOMAIN_SLUG, ROUTINE_REPORTING_END_DAY, ...
{ "content_hash": "7f034d16d1f024b174d8b876d5c01120", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 78, "avg_line_length": 41.108695652173914, "alnum_prop": 0.5818790763264586, "repo_name": "yeleman/snisi", "id": "f9652f4bd3426501eb920ac9d7a56830aadd8e2f", "size": "5752"...
"""Mice Protocols."""
{ "content_hash": "22d9659cde1259760a98004946944d94", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 21, "avg_line_length": 23, "alnum_prop": 0.5652173913043478, "repo_name": "hlzz/dotfiles", "id": "a76cb1a57eff9439e5f373d46e6465c611ab30f8", "size": "23", "binary": false,...
from datetime import date from django.test import TestCase, RequestFactory, Client from test_app.models import TestModel class ViewsTest(TestCase): def setUp(self): self.factory = RequestFactory() self.m = TestModel() self.m.date = date(2015, 2, 21) self.id = self.m.save() ...
{ "content_hash": "455a0f167dfeb27425792cb35e7d40ee", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 80, "avg_line_length": 34.72727272727273, "alnum_prop": 0.6132198952879581, "repo_name": "brmc/django-octopus", "id": "ba63f186ae470c31a50804ddbc8363cd0586cd2c", "size": "1...
from __future__ import unicode_literals import apps.submission.models from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('submission', '0004_auto_20171129_1346'), ] operations = [ migrations.AlterField( model_name='submissionpro...
{ "content_hash": "fcafc6151bfb3c2a8869470ecc875624", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 162, "avg_line_length": 28.157894736842106, "alnum_prop": 0.6691588785046729, "repo_name": "Candihub/pixel", "id": "d5a6882809c7cb7bd598394822a2897e52c6dc47", "size": "608"...
import logging import mongo_db import proj_constants as const log = logging.getLogger('app') def get_collection(): client = mongo_db.get_client() if not client: return return client[const.NEWS_DB][const.NEWS_COLLECTION] close = mongo_db.close
{ "content_hash": "7bd2c3178dadd3f8c5b3f4a718bf0ab6", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 55, "avg_line_length": 15.882352941176471, "alnum_prop": 0.6962962962962963, "repo_name": "andre487/news487", "id": "8d197d082524a05ee18553a558a764643c86cd5e", "size": "270...
import argparse import logging from math import ceil from multiprocessing import Pool import os import time import urlparse import boto from boto.s3.connection import OrdinaryCallingFormat parser = argparse.ArgumentParser(description="Download a file from S3 in parallel", prog="s3-mp-download") parser.add_arg...
{ "content_hash": "b9247d40c84bbdefbe6a5caa1665e669", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 119, "avg_line_length": 38.50887573964497, "alnum_prop": 0.6118623232944069, "repo_name": "mumrah/s3-multipart", "id": "9fae8d98b9efe6c404d5288980a804e7796227af", "size": ...
import hashlib from oslo_log import log as logging from oslo_utils import timeutils from nova.api.openstack import api_version_request from nova.api.openstack import common from nova.api.openstack.compute.views import addresses as views_addresses from nova.api.openstack.compute.views import flavors as views_flavors f...
{ "content_hash": "ffaf9660991e5006bbd53366dcd11679", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 79, "avg_line_length": 39.68456375838926, "alnum_prop": 0.5362760020294267, "repo_name": "nikesh-mahalka/nova", "id": "5eac17c0bb679b97d15ef98384f904b0a32afbf4", "size": "...
from __future__ import unicode_literals import django from django.db.models.aggregates import Sum from django.db.models.expressions import F from django.test import TestCase from .models import Company, Employee class ValuesExpressionsTests(TestCase): @classmethod def setUpTestData(cls): Company.obj...
{ "content_hash": "ffaa302ed61062ee254b7c031ef23f53", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 107, "avg_line_length": 42.29333333333334, "alnum_prop": 0.6097099621689785, "repo_name": "denisenkom/django-sqlserver", "id": "5975c2076f008b1dee4c9804b2c659938487526e", "...
import pygame from pygame.locals import * import sys SCREEN_SIZE = (1280, 720) #resolution of the game global HORIZ_MOV_INCR HORIZ_MOV_INCR = 10 #speed of movement global FPS global clock global time_spent def RelRect(actor, camera): return pygame.Rect(actor.rect.x-camera.rect.x, actor.rect.y-camera.rect.y, actor...
{ "content_hash": "0341ada1e3902f625437955fbc8b19b9", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 136, "avg_line_length": 34.155378486055774, "alnum_prop": 0.5518488277149189, "repo_name": "owattenmaker/PythonFighter", "id": "1eb654f9a937c63f289e292d30031ffc32d3cd95", ...
__author__ = 'Krishna Mudragada' from setuptools import setup setup(name='FeedTester', version='0.1', description='Test your Data feeds for validity', url='http://github.com/mudragada/Feeds', author='Krishna Mudragada', license='MIT', install_requires = ['logging', 're'])
{ "content_hash": "7c452c32040ad0e13cb2d7fe6a7a3310", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 54, "avg_line_length": 34.333333333333336, "alnum_prop": 0.6472491909385113, "repo_name": "mudragada/util-scripts", "id": "1e20e116b32e501eed5110109b248651e37e8f13", "size":...
import os # 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('.')) # -- Genera...
{ "content_hash": "27e68a49479ddd8ddf54477627016343", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 79, "avg_line_length": 31.93089430894309, "alnum_prop": 0.6934436664544876, "repo_name": "opendatatrentino/ckan-api-client", "id": "51190e0986a99c5e4db7df44f324d8af22492970"...
import copy import mock from oslo_config import cfg import oslo_messaging from neutron.common import config as base_config from neutron.common import constants as l3_constants from neutron.openstack.common import uuidutils from neutron.tests import base from networking_cisco.plugins.cisco.cfg_agent import cfg_agent f...
{ "content_hash": "97a39409426761df8d34d89fecaa72ea", "timestamp": "", "source": "github", "line_count": 634, "max_line_length": 79, "avg_line_length": 45.654574132492115, "alnum_prop": 0.5852133356365521, "repo_name": "cisco-openstack/networking-cisco", "id": "385faa489bbf82eb65964b990d392fe34885b53c...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('registration', '0003_player_slug'), ] operations = [ migrations.RemoveField( model_name='tournament', name='price', ...
{ "content_hash": "9d347b86a8294d29f5a866f9cdc453ec", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 45, "avg_line_length": 19.352941176470587, "alnum_prop": 0.5927051671732523, "repo_name": "eldruz/tournament_registration", "id": "22a9d7e0e1d823d2a67c4e22c18740b18e409610", ...
""" Functions for torque/pbs scheduler. """ from __future__ import division import re __author__ = "Ryo KOBAYASHI" __version__ = "170123" __email__ = "kobayashi.ryo@nitech.ac.jp" _fields = ( 'Job Id', 'Job_Name', 'Job_Owner', 'job_state', 'queue', 'server', 'Checkpoint', 'ctime', 'Error_Path', 'exec_h...
{ "content_hash": "6ed5c5c46429bb95eb17ef3058e5d026", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 84, "avg_line_length": 24.51824817518248, "alnum_prop": 0.5718963977374218, "repo_name": "ryokbys/nap", "id": "13af938a6e78fa80a406d2c4cb7d5f468850b7b6", "size": "3383", ...
from google.cloud import speech_v1 import io def sample_recognize(local_file_path): """ Transcribe a short audio file with multiple channels Args: local_file_path Path to local audio file, e.g. /path/audio.wav """ client = speech_v1.SpeechClient() # local_file_path = 'resources/multi....
{ "content_hash": "36bf19838d2a160ca812e788c78259f5", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 91, "avg_line_length": 29.47457627118644, "alnum_prop": 0.6728004600345026, "repo_name": "tswast/google-cloud-python", "id": "790835f22ff39732dc36c4e09154deb638a51290", "si...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0004_auto_20170721_1851'), ] operations = [ migrations.AddField( model_name='partida', name='rodada', fi...
{ "content_hash": "4afa43c5988af15897a65462971136f5", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 49, "avg_line_length": 21.526315789473685, "alnum_prop": 0.5843520782396088, "repo_name": "schiller/cartolafc", "id": "c673416b49817058866fd6437980bb10a96ff4d4", "size": "4...
from nose.tools import * from dateutil.parser import parse as time_parse import yawhois class TestWhoisIisSeSeStatusRegistered(object): def setUp(self): fixture_path = "spec/fixtures/responses/whois.iis.se/se/status_registered.txt" host = "whois.iis.se" part = yawhois.recor...
{ "content_hash": "37452ba5847e43bbc571d29b0d6be856", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 744, "avg_line_length": 51.951219512195124, "alnum_prop": 0.6650234741784038, "repo_name": "huyphan/pyyawhois", "id": "667f286d13ff9e2e9be0887d5035fe0eca4f519d", "size": "4...
"""Tests NODE_NETWORK_LIMITED. Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMITED correctly and that it responds to getdata requests for blocks correctly: - send a block within 288 + 2 of the tip - disconnect peers who request blocks older than that.""" from test_framework.messages impor...
{ "content_hash": "7002acdeb8f72b2d02178ba26707ab71", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 121, "avg_line_length": 40.43119266055046, "alnum_prop": 0.6643975493533015, "repo_name": "alecalve/bitcoin", "id": "b1a7ef6877f194eea44948b3180064a7de55bff8", "size": "46...
""" Copyright 2013 Jérémie BOUTOILLE This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope t...
{ "content_hash": "51790a185dc438a89f347c8f3c0873ea", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 69, "avg_line_length": 34.578947368421055, "alnum_prop": 0.6549974632166413, "repo_name": "jack51706/viper", "id": "65f03cf9892af11465d26a0de05d82b44c431575", "size": "1992...
from __future__ import absolute_import, division, print_function, unicode_literals import jubatus import jubatus.embedded from .base import GenericSchema, BaseDataset, BaseService, GenericConfig, Utils from .loader.array import ArrayLoader, ZipArrayLoader from .loader.sparse import SparseMatrixLoader from .loader.cha...
{ "content_hash": "e25cfe5cf90331185cf2f56ff20ebfce", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 99, "avg_line_length": 30.074626865671643, "alnum_prop": 0.63904052936311, "repo_name": "jubatus/jubakit", "id": "f01ac92cf74dd7146730a009099dac62608abd5f", "size": "6070"...
import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.paging i...
{ "content_hash": "e3e7d83cbe72b4879260eb9d03a97e72", "timestamp": "", "source": "github", "line_count": 972, "max_line_length": 245, "avg_line_length": 47.23868312757202, "alnum_prop": 0.6551746667828208, "repo_name": "Azure/azure-sdk-for-python", "id": "0a39d4f32ec63451479c9d3861ed884937abe9e7", "...
from __future__ import absolute_import import itertools from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated from sentry import status_checks from sentry.status_checks import sort_by_severity from sentry.api.base import Endpoint from sentry.auth.superuser import is_acti...
{ "content_hash": "690705ab571a79f81521db4407aa79a7", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 92, "avg_line_length": 32.567567567567565, "alnum_prop": 0.5842323651452282, "repo_name": "ifduyue/sentry", "id": "50c59a0d813a2d88093c3d8e9cc78648fbb44c0d", "size": "1205"...
import _plotly_utils.basevalidators class LineValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="line", parent_name="scatter3d.marker", **kwargs): super(LineValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "3587d05f3201000374b34452f9bb6451", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 85, "avg_line_length": 49.554455445544555, "alnum_prop": 0.5478521478521479, "repo_name": "plotly/python-api", "id": "2534fa8746374986a1acc6f71eeea5cd8298bc6e", "size": "5...
import numpy as np import pints class ForwardModel(object): """ Defines an interface for user-supplied forward models. Classes extending ``ForwardModel`` can implement the required methods directly in Python or interface with other languages (for example via Python wrappers around C code). "...
{ "content_hash": "9038ab63bfbc942e5fbb1f4ca4fd52bb", "timestamp": "", "source": "github", "line_count": 356, "max_line_length": 79, "avg_line_length": 33.18258426966292, "alnum_prop": 0.6023025480402946, "repo_name": "martinjrobins/hobo", "id": "adba9b54ab1e03573707b0e1aade9087dc65c767", "size": "1...
""" BMH Search ---------- Search that attempts to find a substring in a string. Uses a bad-character shift of the rightmost character of the window to compute shifts. Time: Complexity: O(m + n), where m is the substring to be found. Space: Complexity: O(m), where m is the substring to be found...
{ "content_hash": "e39057eb946d14b463e6e3d296182480", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 78, "avg_line_length": 31.958333333333332, "alnum_prop": 0.6134289439374185, "repo_name": "stphivos/algorithms", "id": "ca4371eb4f83b1ef2a63933ef1786a4f2a4527da", "size": "...
import os from eventlet import timeout as etimeout import mock from nova.compute import vm_states from nova import exception from nova.objects import fields from nova.objects import flavor as flavor_obj from nova.tests.unit.objects import test_flavor from nova.tests.unit.objects import test_virtual_interface from nova...
{ "content_hash": "ca73d843616bb047268c6539af3a99e9", "timestamp": "", "source": "github", "line_count": 2036, "max_line_length": 79, "avg_line_length": 47.65864440078585, "alnum_prop": 0.6059484917502294, "repo_name": "cloudbase/compute-hyperv", "id": "755ace88fe9691615636603e39b4feacf95dcf09", "si...
from entities import entity class ProgressBar(entity.Entity): def __init__(self, x, y, width, max, color): super().__init__(' ', position=(x, y)) self.max_value = max self.current_value = max self.width = width self.color = color self.x = x self.y = y ...
{ "content_hash": "c132deaa8a5b26e3e9294850edff6549", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 73, "avg_line_length": 25.714285714285715, "alnum_prop": 0.49333333333333335, "repo_name": "JoshuaSkelly/lunch-break-rl", "id": "4385cc322f35ee1a312daef89978ae2b4b267b03", ...
'''The app module, containing the app factory function.''' from flask import Flask, render_template from NewsReader.settings import ProdConfig from NewsReader.assets import assets from NewsReader.extensions import ( bcrypt, cache, db, login_manager, migrate, debug_toolbar, ) from NewsReader imp...
{ "content_hash": "4dd6c0a2d611532b9896e94c367560eb", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 73, "avg_line_length": 26.818181818181817, "alnum_prop": 0.6955932203389831, "repo_name": "jrotich/NewsReader", "id": "9f4a651d12dc0c709ded91776a6c362cee76eee1", "size": "1...
import sphinx_rtd_theme # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext...
{ "content_hash": "58ea83ea73804c16891a66553ce51bad", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 78, "avg_line_length": 30.276119402985074, "alnum_prop": 0.6600936652699039, "repo_name": "theyer/armada", "id": "e8d0e72ff0213a1a7e85a6cd93a543fd54f7cefe", "size": "4784"...
from django.test import TestCase, Client from django.shortcuts import resolve_url from imager_profile.tests.test_model import UserFactory from .test_photos import PhotoFactory, AlbumFactory from imager_images.models import PRIVATE, PUBLIC class LibraryImageTestCase(TestCase): def setUp(self): self.client...
{ "content_hash": "fdfebe4c8325be271505b8103d785178", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 93, "avg_line_length": 33.85, "alnum_prop": 0.6286927621861153, "repo_name": "qwergram/imgur_clone", "id": "e8e6c2b6a53f2bab0329f4377ac1a4f182222f79", "size": "5431", "b...
from symfit.api import * import pkg_resources try: __version__ = pkg_resources.get_distribution('symfit').version except pkg_resources.DistributionNotFound: __version__ = ''
{ "content_hash": "6bb23cb28184589541cb9bb0168dad6a", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 66, "avg_line_length": 26.142857142857142, "alnum_prop": 0.7213114754098361, "repo_name": "tBuLi/symfit", "id": "35f2d005682a5bcadaee815b9031e4489ada0934", "size": "267", ...
from m5.params import * from m5.proxy import * from Device import PioDevice from Platform import Platform class BaseGic(PioDevice): type = 'BaseGic' abstract = True cxx_header = "dev/arm/base_gic.hh" platform = Param.Platform(Parent.any, "Platform this device is part of.") class Pl390(BaseGic): ...
{ "content_hash": "a28695341be7a8222ba74faf82a20df2", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 84, "avg_line_length": 34.208333333333336, "alnum_prop": 0.6918392204628502, "repo_name": "prodromou87/gem5", "id": "0461758ed7183d48487f7cdfe54692e1707110e8", "size": "292...
import falcon class HelloResource: def on_get(self, req, resp): """Handles GET requests""" resp.status = falcon.HTTP_200 # This is the default status resp.body = ('\nHello Falcon!!\n') # falcon.API instances are callable WSGI apps app = falcon.API() # Resources are represented by long-l...
{ "content_hash": "c1c10a96f96e830a05616dbd2aee50f5", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 67, "avg_line_length": 28.647058823529413, "alnum_prop": 0.6776180698151951, "repo_name": "yosukesuzuki/falcon-gae-template", "id": "290426a1343f47e5ebce331df77e21d5c0f521fe"...
from fhirtordf.rdfsupport.namespaces import namespace_for from i2b2model.metadata.i2b2conceptdimension import ConceptDimension from rdflib import Graph, URIRef from rdflib.namespace import split_uri from i2fhirb2.fhir.fhirspecific import concept_path, concept_code class FHIRConceptDimension(ConceptDimension): gr...
{ "content_hash": "2a25f44c029f65a6af1ee0bb723100aa", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 106, "avg_line_length": 35.25925925925926, "alnum_prop": 0.6743697478991597, "repo_name": "BD2KOnFHIR/i2FHIRb2", "id": "a277aad991de077f45c60fc6a032fbfe73a6656f", "size": "...
"""Script for listing top buildbot crashes.""" from __future__ import print_function import collections import contextlib import datetime import multiprocessing import logging import optparse import os import re import sys from chromite.cbuildbot import cbuildbot_config from chromite.cbuildbot import constants from c...
{ "content_hash": "81bd47b8aa888245ffdb2aefacac3cff", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 79, "avg_line_length": 37.06201550387597, "alnum_prop": 0.6260196611587534, "repo_name": "chadversary/chromiumos.chromite", "id": "d1658e15580d3af2c68375415e8ad9219ee2c8d4",...
""" AVIPES={} AVSERVERS=['jsmart.web.id', 'jabber.ru', 'xmpp.ru', 'jabbers.ru', 'xmpps.ru', 'qip.ru', 'talkonaut.com', 'jabbus.org', 'jabber.org','gtalk.com','jabber.cz','jabberon.ru','server.dom','linuxoids.net','jabber.kiev.ua','jabber.ufanet.ru','jabber.corbina.ru'] def order_unban_v(groupchat, jid): iq = xmpp.Iq(...
{ "content_hash": "0400952c06a56540aa7990f737580eda", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 255, "avg_line_length": 38.926829268292686, "alnum_prop": 0.6527255639097744, "repo_name": "alosh55/STORM-BOT", "id": "025d38e17d09baa12e5f872dabd3d0cb4ad5fa60", "size": "...
"""Provide some default values/objects""" from pathlib import Path from typing import ClassVar from diot import Diot from simpleconf import Config import uvloop from xqute import logger as xqute_logger, JobErrorStrategy # turn xqute's logger off xqute_logger.setLevel(100) xqute_logger.removeHandler(xqute_logger.handle...
{ "content_hash": "eafee9f14bad83fc4ad94822fc04bded", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 78, "avg_line_length": 27.308823529411764, "alnum_prop": 0.6855142703284868, "repo_name": "pwwang/pyppl", "id": "6d7a5d1c7c4aa859c4e12f51b3d5f0cc7e82ba18", "size": "1857", ...
"""SCons.Tool.pdf Common PDF Builder definition for various other Tool modules that use it. Add an explicit action to run epstopdf to convert .eps files to .pdf """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation # # Permission is hereby granted, free of ...
{ "content_hash": "266e4193a897d71902fad6ca03207b82", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 107, "avg_line_length": 39.32051282051282, "alnum_prop": 0.6521030322791, "repo_name": "angad/libjingle-mac", "id": "beae6dd2a39186bcc6e5a48d375b9b6cdc352767", "size": "306...
from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class KeyHitTestCasesPage(page_module.Page): def __init__(self, url, page_set): super(KeyHitTestCasesPage, self).__init__( url=url, page_set=page_set, credentials_path = 'data/credentials.json') se...
{ "content_hash": "14b76ce50647a7b306f1f6b4097bb654", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 79, "avg_line_length": 31.980392156862745, "alnum_prop": 0.6860821581851625, "repo_name": "sgraham/nope", "id": "6f39d948e182a646149cca3a7b50d6fd381c453c", "size": "1794", ...
from unittest import mock from airflow.callbacks.callback_requests import CallbackRequest from airflow.configuration import conf from airflow.executors.local_executor import LocalExecutor from airflow.executors.local_kubernetes_executor import LocalKubernetesExecutor class TestLocalKubernetesExecutor: def test_q...
{ "content_hash": "3b371d1156bc3739069204c6106457ed", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 110, "avg_line_length": 43.921875, "alnum_prop": 0.7018854500177872, "repo_name": "danielvdende/incubator-airflow", "id": "48d09ad99e5edbe054a978a7781f3a7a0d56dfbf", "size"...
import datetime import random from will.plugin import WillPlugin from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings RESPONSES = [ "Pretty good, all things considered. You?", "Doing alright. How are you?", "Pretty solid for a %(day_name)s, thanks. ...
{ "content_hash": "bbed2a0bd5ac4d5ddeee71b70b5036ba", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 108, "avg_line_length": 33.096774193548384, "alnum_prop": 0.6354775828460039, "repo_name": "mike-love/will", "id": "014685576ab9bd85f6f94e5c15056ff2979f5083", "size": "1026...
from django.conf import settings from django.core.mail import EmailMessage from django.template.loader import render_to_string def on_submit_email(job): subject = "Thank you for posting your job!" body = render_to_string("email/jobsubmit.txt", {"job": job}) from_email = "bot@transparencyjobs.com" ...
{ "content_hash": "01b4dae459e7254509c215e880427397", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 82, "avg_line_length": 34.73529411764706, "alnum_prop": 0.6215071972904318, "repo_name": "sunlightlabs/transparencyjobs", "id": "8eac0b1a815995c576c3bcf77a6446dd3be3e190", ...
""" Track class """ from copy import deepcopy from os.path import basename from datetime import timedelta import gpxpy import numpy as np from rtree import index from .segment import Segment from .similarity import segment_similarity DEFAULT_FILE_NAME_FORMAT = "%Y-%m-%d" class Track(object): """Collection of se...
{ "content_hash": "601b7bb9343b334d7eec0dec733d677b", "timestamp": "", "source": "github", "line_count": 544, "max_line_length": 252, "avg_line_length": 30.683823529411764, "alnum_prop": 0.5222861250898634, "repo_name": "ruipgil/TrackToTrip", "id": "b6e66b9159d867bbaa12aeaa9f0c948e227395b9", "size":...
from status import * from views import * from permissions import *
{ "content_hash": "6c71c24fda32e4565a2315e8af10dde2", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 25, "avg_line_length": 22.333333333333332, "alnum_prop": 0.7761194029850746, "repo_name": "rvanlaar/easy-transifex", "id": "8e574ed268043a5d9c6b97c3c93f731b670a6a1e", "size"...
from sphinx import version_info as sphinx_version_info import os import git curr_path = os.path.abspath('.') # The try catch is need because of the subversion tool when it creates the master. try: repo = git.Repo(curr_path) current_branch = repo.active_branch.name except git.exc.InvalidGitRepositoryError: current...
{ "content_hash": "1be72dfed7a6eaeab77e64b8460cc601", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 82, "avg_line_length": 31.458333333333332, "alnum_prop": 0.6988079470198676, "repo_name": "ros-industrial/industrial_training", "id": "c6b2afe1bb8784c9e1281ea92a6ddeb651c52e...
from ambry.orm.database import BaseMigration class Migration(BaseMigration): def _migrate_sqlite(self, connection): # connection.execute('ALTER table ...') connection.execute('ALTER table columns ADD COLUMN c_valuetype VARCHAR') def _migrate_postgresql(self, connection): connection.e...
{ "content_hash": "6bdb73060dce622f7572c341659e6646", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 89, "avg_line_length": 35.45454545454545, "alnum_prop": 0.7307692307692307, "repo_name": "CivicKnowledge/ambry", "id": "12eceae304a5d357c9074fc3e9e622ec847d60a3", "size": "...
""" Deletes the loader's database. """ import sys from memsql_loader.util import cli_utils, servers from memsql_loader.util.command import Command from memsql_loader.loader_db.storage import LoaderStorage class ClearLoaderDb(Command): @staticmethod def configure(parser, subparsers): subparser = subp...
{ "content_hash": "eb0fed7244cccb67b56e522914338725", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 152, "avg_line_length": 42.758620689655174, "alnum_prop": 0.692741935483871, "repo_name": "memsql/memsql-loader", "id": "72b2a8e84c18d3a1c28b83e99a61cb1be1d4725d", "size": ...
import ray import pytest import sys from ray.experimental import shuffle def test_shuffle(): try: shuffle.run() finally: ray.shutdown() # https://github.com/ray-project/ray/pull/16408 @pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows.") def test_shuffle_hang(): try...
{ "content_hash": "3e42c4bbcb4315e9eb866e5b7b9b50d3", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 86, "avg_line_length": 24.526315789473685, "alnum_prop": 0.642346208869814, "repo_name": "ray-project/ray", "id": "51178ef37aca76b36f37d54e41d8bc984e63b4c2", "size": "1398"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dashboard', '0011_auto_20160619_1714'), ] operations = [ migrations.AddField( model_name='chapterevent', name='attendees', ...
{ "content_hash": "f9beec66aed73c4d3878eef1f7207b6e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 135, "avg_line_length": 28.17391304347826, "alnum_prop": 0.5817901234567902, "repo_name": "DLance96/ox-dashboard", "id": "52432c41b694db9e24b0cd38403dda69ce97d54e", "size":...
class InputHandler(object): ''' Interface for handling all user input. lnedentry: Columns from dataframe checks: Indicates presence absence of data values rbtns: Indicates presence absence of data values verify: Indicates whether input should be verified session: Indicates session creation ...
{ "content_hash": "005d116a53b07e8f1ff26eb3b80adbb4", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 70, "avg_line_length": 35.857142857142854, "alnum_prop": 0.6404382470119522, "repo_name": "bibsian/database-development", "id": "e156bd20ef1737810d89b4bfff40e3e4561b8172", ...
"""Tests for http/websocket.py""" import base64 import hashlib import os import pytest from aiohttp import websocket, multidict, protocol, errors from unittest import mock @pytest.fixture() def transport(): return mock.Mock() @pytest.fixture() def message(): headers = multidict.MultiDict() return prot...
{ "content_hash": "39a38dc81e06dab5c1dd1b3825d41705", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 74, "avg_line_length": 34.42465753424658, "alnum_prop": 0.6335057699960207, "repo_name": "elastic-coders/aiohttp", "id": "6a59767fd68c46b8f835e6ffb9e8925c08e89bec", "size"...
import time import numpy from nearpy import Engine from nearpy.hashes import RandomDiscretizedProjections, UniBucket from nearpy.filters import NearestFilter, UniqueFilter from nearpy.distances import EuclideanDistance from nearpy.experiments import DistanceRatioExperiment, RecallPrecisionExperiment # Set dimension a...
{ "content_hash": "b4b13ebfddc0e9491c2986f5dcd17179", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 81, "avg_line_length": 33.59090909090909, "alnum_prop": 0.7424447451511051, "repo_name": "imsparsh/NearPy", "id": "95458351d2cd53e2b8c951e89a4693363a316919", "size": "2217"...
""" WSGI config for myshop 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.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTI...
{ "content_hash": "fdd6f8217aa51f9eed705189c26a5f97", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.375, "alnum_prop": 0.7692307692307693, "repo_name": "EssaAlshammri/django-by-example", "id": "05ef28bdb3e251d8f7f022dad3c16c5a9a22e4e5", "size": "...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * import urllib.parse class AbandonConflictTest(BitcoinTestFramework): def __init__(self): super().__init__() self.num_nodes = 2 self.setup_clean_chain = False def setup_network(self): ...
{ "content_hash": "5dcec83c952653f78ec74ee95390c0dc", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 137, "avg_line_length": 49.05161290322581, "alnum_prop": 0.6435617519400236, "repo_name": "tdudz/elements", "id": "da0704d9cb6eee2b30b94bd0968e331587b0fc0a", "size": "7819...
import os import re import numpy as np from kitti.data import data_dir, get_drive_dir, get_inds def get_video_dir(drive, color=False, right=False, **kwargs): drive_dir = get_drive_dir(drive, **kwargs) image_dir = 'image_%02d' % (0 + (1 if right else 0) + (2 if color else 0)) return os.path.join(drive_di...
{ "content_hash": "88599cd7fabf38036bb496bdb8d47fd0", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 84, "avg_line_length": 31.126373626373628, "alnum_prop": 0.606531332744925, "repo_name": "hunse/kitti", "id": "7b73bb207cdbfddcb9004bc38a24ee0981f04751", "size": "5665", ...
from django.conf.urls import patterns, include, url from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^$', TemplateView.as_view(template_name='base.html')), url( r'^pa...
{ "content_hash": "2d3417a07d5f8210a9f5da3245a94400", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 75, "avg_line_length": 30.5, "alnum_prop": 0.6592505854800936, "repo_name": "gustavoatt/consultas", "id": "26f489aed7a45115fe3331692adddef1164dc15d", "size": "854", "bina...
"""Support for a ScreenLogic 'circuit' switch.""" import logging from screenlogicpy.const import DATA as SL_DATA, GENERIC_CIRCUIT_NAMES, ON_OFF from homeassistant.components.switch import SwitchEntity from . import ScreenlogicEntity from .const import DOMAIN _LOGGER = logging.getLogger(__name__) async def async_s...
{ "content_hash": "2bcb45a8f5e619e6255cbe25b2b23b7b", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 79, "avg_line_length": 33.015625, "alnum_prop": 0.6412683388547089, "repo_name": "sander76/home-assistant", "id": "ff73afebb575d9b9ac7e0f930ebbacec86c2d18a", "size": "2113"...
"""Support for Ubiquiti mFi switches.""" from __future__ import annotations import logging from mficlient.client import FailedToLogin, MFiClient import requests import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.const import ( CONF_HOST, CONF...
{ "content_hash": "2ac0234322d53e677ade29687e147771", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 84, "avg_line_length": 29.28, "alnum_prop": 0.6377049180327868, "repo_name": "rohitranjan1991/home-assistant", "id": "7564229d526f7f5f3b5e1f07f1e1be31ff149304", "size": "3...
"""Example Module for testing utils.monkey_patch().""" CALLED_FUNCTION = [] def example_decorator(name, function): """decorator for notify which is used from utils.monkey_patch(). :param name: name of the function :param function: - object of the function :returns: function -- decorated...
{ "content_hash": "375ef2fb68b3e21f99d9794e00d5bada", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 68, "avg_line_length": 28.058823529411764, "alnum_prop": 0.649895178197065, "repo_name": "tomasdubec/openstack-cinder", "id": "95f58e751179dbdc3392626ef736821187b13cda", "s...
# # Filename : make_run_val_simfit.py # Description : Generating scripts for command RunValGenFit # Author : Yi-Mu "Enoch" Chen [ ensc@hep1.phys.ntu.edu.tw ] # #******************************************************************************* import os,sys channellist=["MuonSignal","ElectronSignal"] massp...
{ "content_hash": "6c3aacdb6d71a416c7c5a7de5e266049", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 125, "avg_line_length": 33.43564356435643, "alnum_prop": 0.5493041160793604, "repo_name": "NTUHEP-Tstar/TstarAnalysis", "id": "a25767b3e86895b43d1320ac054b13c17c1a05c3", "...
''' Created on 29 sept. 2013 @author: Aristote Diasonama ''' """ Python Module handling daily notification sent to user about event taking place daily """ import logging from vendors.sendgrid import sender import memcache from market.handlers.base import BaseHandler, jinja_environment from market.handlers.main import...
{ "content_hash": "e496ccd06a3960790bde5cd46db9dfa3", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 128, "avg_line_length": 39.21678321678322, "alnum_prop": 0.557774607703281, "repo_name": "EventBuck/EventBuck", "id": "38bdf39c9ae3fa7d9e4470fa57dbfeeec944cbe3", "size": "...
"""Tests for metadata.py.""" __author__ = 'cimamoglu@google.com (Cihat Imamoglu)' import json import metadata import test_utils MAPROOT = { 'title': 't1', 'layers': [{'id': 12, 'type': 'KML', 'source': {'kml': {'url': 'http://x.com/a'}}}, {'id': 15, ...
{ "content_hash": "8a3777003a61495b25ae02eda989fe3a", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 79, "avg_line_length": 37.60215053763441, "alnum_prop": 0.6225336002287675, "repo_name": "klokan/googlecrisismap", "id": "26e272f29941627b061a89a03b9423375c37fa99", "size":...
"""A tf.learn implementation of tensor_forest (extremely random forests).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import six from tensorflow.contrib import framework as contrib_framework from tensorflow.contrib.framework import...
{ "content_hash": "9991b3604e329b20fe9c74c8c996f01b", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 79, "avg_line_length": 37.809701492537314, "alnum_prop": 0.672357643343531, "repo_name": "juharris/tensorflow", "id": "738103523947d20dbcffb558ddb27b349a9a33bc", "size": "...
import json import os import subprocess import sys from contextlib import ExitStack, suppress from datetime import datetime, timedelta import freezegun import pytest # We should set these before loading _any_ of the rest of airflow so that the # unit test mode config is set as early as possible. assert "airflow" not ...
{ "content_hash": "2c80c583f21b9433e46e76cd086edf60", "timestamp": "", "source": "github", "line_count": 744, "max_line_length": 110, "avg_line_length": 36.579301075268816, "alnum_prop": 0.6183722212015432, "repo_name": "apache/incubator-airflow", "id": "d3578997ad246eab1e53b2666e759b403c012c4a", "s...
import thread import time class Timer: def __init__(self, interval, function, length = None): self._ticks = self._remaining = length self._lock = thread.allocate_lock() self._interval = interval self._function = function self._running = False def start(self): se...
{ "content_hash": "23a48fc18f44604d86dfbc4ef07326e3", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 81, "avg_line_length": 26.885714285714286, "alnum_prop": 0.5483528161530287, "repo_name": "localstatic/steep", "id": "4c4fedc00c832135d146633c868cae5cccfe045f", "size": "98...
import io import logging import sys import traceback def getExceptionTrackeback(ex: Exception): traceback_str = "" if ex is not None: try: with io.StringIO() as f: # traceback.print_tb(sys.exc_info()[2], file=f) traceback.print_exception(etype=type( ...
{ "content_hash": "5518a2f34a863ccb39408a818b28e227", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 70, "avg_line_length": 29.557692307692307, "alnum_prop": 0.6193884189980482, "repo_name": "abrichards5/ABRUnixScripts", "id": "b1351c7551d229bc7e5ed04909988c906798af60", "s...
from shared.card import CARD_PLACEHOLDER_LENGTH import pygame import pygame.locals as pl from twisted.logger import Logger class View(object): log = Logger() def __init__(self, display): self.display = display self.first_call = False self.tab_order = [] self.tab_position = 0 if self.disp...
{ "content_hash": "ed039fa49211968ca6c367f8efbb558a", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 134, "avg_line_length": 27.88785046728972, "alnum_prop": 0.5958445040214477, "repo_name": "Timtam/cards-against-humanity", "id": "9c39c328ab46f4d443595b9086db0e4a2dc885d7", ...
from django import template from django.template.loader import render_to_string from django.contrib.contenttypes.models import ContentType as CT from django.core.urlresolvers import reverse from valuate.models import Valuation, ValuationType as VT from valuate.forms import ValuationForm register = template.Library() V...
{ "content_hash": "8cdefefd80e820d6137735cfac108065", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 170, "avg_line_length": 39.04390243902439, "alnum_prop": 0.584207896051974, "repo_name": "crodjer/django-valuate", "id": "585f6274b4ad9823a622818e5d1363bc318aa617", "size"...
from django.contrib import admin from event.models import Event, Product, Guest, Attending # Register your models here. admin.site.register(Event) admin.site.register(Product) admin.site.register(Guest) admin.site.register(Attending)
{ "content_hash": "1e93163cac52e6a803e1078b4a21bdd6", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 57, "avg_line_length": 29.375, "alnum_prop": 0.8127659574468085, "repo_name": "ayeletdn/SocialParty", "id": "adf5e2580e5f57852896604dccfe61d116f99f8b", "size": "235", "bin...