text
stringlengths
4
1.02M
meta
dict
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, assert_raises_jsonrpc, start_nodes, ) class NamedArgumentTest(BitcoinTestFramework): """ Test named arguments on RPC calls. """ def __init__(self): super().__init__() ...
{ "content_hash": "01836b9821b8dd5e63ce7d5385ed50e6", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 92, "avg_line_length": 29.926829268292682, "alnum_prop": 0.6030969845150774, "repo_name": "Cocosoft/bitcoin", "id": "f9a40955c06c2b4411d34d23d001f58f703e5b76", "size": "143...
import os import subprocess import sys def data_path(path): return os.path.join(os.path.dirname(globals()["__file__"]), 'data', path) def fuzz_data_path(path): return os.path.join(os.path.dirname(globals()["__file__"]), 'fuzz_data', path) def run_command(args, verbose = False): """Runs the command and re...
{ "content_hash": "800f3746d27164e342cd8be7ce2bfe10", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 82, "avg_line_length": 31.5, "alnum_prop": 0.6536796536796536, "repo_name": "wooster/biplist", "id": "fbc22e7faab8dd333349bf03972d14cde7ca8c9f", "size": "718", "binary": ...
from __future__ import absolute_import import six from systrace.tracing_agents import atrace_agent from telemetry.core import exceptions from telemetry.internal.platform import tracing_agent from tracing.trace_data import trace_data from devil.android.sdk import version_codes class AtraceTracingAgent(tracing_agent....
{ "content_hash": "8156af31cc83cee24f565757296eb9c6", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 80, "avg_line_length": 38.25806451612903, "alnum_prop": 0.709106239460371, "repo_name": "catapult-project/catapult", "id": "1a2a0038d8a30ed8d7ea425989bf811c11422cbd", "size...
try: file = open('eeee', 'r+') except Exception as e: print('there is no file named as eeeee') response = input('do you want to create a new file') if response =='y': file = open('eeee','w') else: pass else: file.write('ssss') file.close()
{ "content_hash": "18bc90dc71aa5bfbbf0715967b582902", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 56, "avg_line_length": 20.142857142857142, "alnum_prop": 0.5673758865248227, "repo_name": "tencrance/cool-config", "id": "906630efea851929998132c79c870a5e9c3f0d77", "size":...
from __future__ import absolute_import, print_function from uwsgi import cache_update, cache_get, cache_del, mule_msg, mule_get_msg from . import offload from .base import BaseCache, SERIALIZERS dumps, loads = SERIALIZERS['pickle'] class UWSGICache(BaseCache): def __init__(self, name): self.name = name ...
{ "content_hash": "0d591702f412cc338521ce59baa45ff6", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 76, "avg_line_length": 24.069767441860463, "alnum_prop": 0.6328502415458938, "repo_name": "baverman/cachel", "id": "7d06c3dac12513fb326c8c13005059233f1d5b16", "size": "1035...
""" This file convert dataset from http://mmlab.ie.cuhk.edu.hk/archive/CNN_FacePoint.htm We convert data for LEVEL-3 training data. all data are formated as (patch, delta landmark), and delta landmark is ((x1, y1), (x2, y2)...) """ import os from os.path import join, exists import time from collections imp...
{ "content_hash": "7144c45a27aad593f9b4751f4f035778", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 99, "avg_line_length": 34.1125, "alnum_prop": 0.5932576035177721, "repo_name": "luoyetx/deep-landmark", "id": "4c767c8276ccdb89a8d4291c760b85fba7f9d92a", "size": "2770", ...
""" Tests for the API /portgroups/ methods. """ import datetime import mock from oslo_config import cfg from oslo_utils import timeutils from oslo_utils import uuidutils import six from six.moves import http_client from six.moves.urllib import parse as urlparse from testtools.matchers import HasLength from wsme impor...
{ "content_hash": "8dd097dbe5eae69d3e54e9a99f66608d", "timestamp": "", "source": "github", "line_count": 1264, "max_line_length": 79, "avg_line_length": 50.263449367088604, "alnum_prop": 0.5612358931578865, "repo_name": "jiazichenzhan/Server_Manage_Plugin", "id": "57f0b5284d0959783a9eb3b3d54059e05c928...
from Queue import Queue from threading import Thread class Worker(Thread): """Thread executing tasks from a given tasks queue""" def __init__(self, tasks): super(self.__class__, self).__init__() self.tasks = tasks self.daemon = True self.start() def run(self): whil...
{ "content_hash": "eb858ef753d910b2257aaa3e35bd5a58", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 74, "avg_line_length": 28.16923076923077, "alnum_prop": 0.5548880393227744, "repo_name": "goniz/buildscript", "id": "3c259eca5d2ca3e79597e9cf0e5233f07620bc8b", "size": "185...
import socket import sys import requests import string from scapy.all import * r = requests.get("http://4.ipquail.com/ip") if r.status_code == 200: ipv4 = r.content.translate(None, string.whitespace) else: ipv4 = 'err' message = "%s" % ipv4 server = '192.168.202.33' fakesrc = '1.1.1.1' srcport = RandNum(...
{ "content_hash": "d997f4215408c9f9d7c120489a057673", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 82, "avg_line_length": 23.542857142857144, "alnum_prop": 0.7026699029126213, "repo_name": "tbaschak/bcp38-tests", "id": "9b4c7a72e22c0832d2bac19b11d08cfd7d2c9429", "size": ...
import pandas as pd import numpy as np import pyaf.ForecastEngine as autof import pyaf.Bench.TS_datasets as tsds b1 = tsds.load_airline_passengers() df = b1.mPastData df.head() lEngine = autof.cForecastEngine() lEngine.mOptions.set_active_decomposition_types(['TSR']); lEngine H = b1.mHorizon; # # lEngine.mOptions...
{ "content_hash": "25e1a3b6c33c23b9f9c58f86ec157519", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 154, "avg_line_length": 27.914893617021278, "alnum_prop": 0.743140243902439, "repo_name": "antoinecarme/pyaf", "id": "5f9e8f7caa387fa7729393020a4f4f2cb28f0ee9", "size": "13...
from django.db import migrations import uuid def gen_uuid(apps, schema_editor): MyModel1 = apps.get_model('tourism', 'touristiccontent') MyModel2 = apps.get_model('tourism', 'touristicevent') for row in MyModel1.objects.all(): row.uuid = uuid.uuid4() row.save(update_fields=['uuid']) fo...
{ "content_hash": "7607663b92ac9ab8d9383dee62ef69e3", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 60, "avg_line_length": 25.375, "alnum_prop": 0.6338259441707718, "repo_name": "makinacorpus/Geotrek", "id": "a9871df2d21e4604660d5f2d612841586145e58b", "size": "659", "bi...
import axdebug, gateways from util import _wrap, _wrap_remove, RaiseNotImpl import cStringIO, traceback from pprint import pprint from win32com.server.exception import COMException import winerror import string import sys # Given an object, return a nice string def MakeNiceString(ob): stream = cStringIO.StringIO()...
{ "content_hash": "87155d50dd5245f8415a6c01e3e491f8", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 120, "avg_line_length": 39.794871794871796, "alnum_prop": 0.6531894329896907, "repo_name": "nzavagli/UnrealPy", "id": "6682ebfe5672b5c9aaf498bdf3d4a74dcd661346", "size": "...
import copy from future.utils import iteritems from pandaharvester.harvesterconfig import harvester_config from pandaharvester.harvestercore import core_utils from pandaharvester.harvestercore.db_proxy_pool import DBProxyPool as DBProxy from pandaharvester.harvestercore.plugin_factory import PluginFactory from pandaha...
{ "content_hash": "588c9d4ef2c53a7c33875669eeee5c5e", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 127, "avg_line_length": 57.51652892561984, "alnum_prop": 0.4984553488037934, "repo_name": "dougbenjamin/panda-harvester", "id": "22fd057e985145af0732d2a74c66d8b403a58622", ...
from django import forms from vendor.zebra.forms import StripePaymentForm from django.utils.safestring import mark_safe from django.contrib.auth import authenticate from django.contrib.auth.models import User from apps.profile.models import change_password, blank_authenticate from apps.social.models import MSocialProfi...
{ "content_hash": "a737b4333a000f15cd5619b0e34bad5e", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 124, "avg_line_length": 42.36666666666667, "alnum_prop": 0.565827432467873, "repo_name": "huihoo/reader", "id": "545670bd56a795d418b9186df22e82f6a0ffc480", "size": "7626",...
print('main.py was successfully called') import os print('imported os') print('this dir is', os.path.abspath(os.curdir)) print('contents of this dir', os.listdir('./')) import sys print('pythonpath is', sys.path) import kivy print('imported kivy') print('file is', kivy.__file__) from kivy.app import App from ki...
{ "content_hash": "b16244914823591ee7c096fdca51804e", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 113, "avg_line_length": 25.78828828828829, "alnum_prop": 0.5807860262008734, "repo_name": "wexi/python-for-android", "id": "a8083ab961f57e38d81e5a510658a70c17f821c0", "siz...
""" ============================ Faces dataset decompositions ============================ This example applies to :ref:`olivetti_faces_dataset` different unsupervised matrix decomposition (dimension reduction) methods from the module :py:mod:`sklearn.decomposition` (see the documentation chapter :ref:`decompositions`...
{ "content_hash": "4b5c30cfdb6ff6dc9c4b5d3f540888d4", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 79, "avg_line_length": 37.376288659793815, "alnum_prop": 0.532754102882361, "repo_name": "huzq/scikit-learn", "id": "84e6f923f0d3bf54915e9d0a67e0d05d39391857", "size": "72...
import logging from celery import uuid as celery_uuid from django.conf import settings from django.conf.urls import url from django.contrib import admin, messages from django.contrib.admin.options import IS_POPUP_VAR from django.contrib.admin.utils import unquote from django.contrib.auth import update_session_auth_has...
{ "content_hash": "6b7cfe18fc8aba2ae01ddb7126990246", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 126, "avg_line_length": 45.2787610619469, "alnum_prop": 0.6105736343203362, "repo_name": "jiivan/genoomy", "id": "db9f27448f690436b2ae6e4cd37ac47bebe7e4ed", "size": "10233...
import pbr.version __version__ = pbr.version.VersionInfo( 'zm').version_string()
{ "content_hash": "6fdcbccfb582d8bf6796586dd5c6a610", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 38, "avg_line_length": 17.2, "alnum_prop": 0.686046511627907, "repo_name": "orviz/zabbix-cli-ent", "id": "f8325059a7331dacd512c069840e0c88e224ccf2", "size": "657", "binary...
"""Unit tests for the with statement specified in PEP 343.""" __author__ = "Mike Bland" __email__ = "mbland at acm dot org" import sys import unittest from collections import deque from contextlib import GeneratorContextManager, contextmanager from test.support import run_unittest class MockContextManager(Generato...
{ "content_hash": "601568fe0e2aa2bd2242c5eeb4bfcfd3", "timestamp": "", "source": "github", "line_count": 742, "max_line_length": 111, "avg_line_length": 35.225067385444746, "alnum_prop": 0.6169032406167502, "repo_name": "MalloyPower/parsing-python", "id": "ae2fa4d7fe4da4790990d5404fe2446c94b65346", ...
""" Chemistry utilities :Author: Jonathan Karr <jonrkarr@gmail.com> :Date: 2018-02-07 :Copyright: 2018, Karr Lab :License: MIT """ import attrdict import mendeleev import re try: import openbabel except ModuleNotFoundError: # pragma: no cover pass # pragma: no cover class EmpiricalFormula(attrdict.AttrDe...
{ "content_hash": "99543be5d22c9f5220f3aabeef989410", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 123, "avg_line_length": 31.251908396946565, "alnum_prop": 0.5675378602833415, "repo_name": "KarrLab/wc_utils", "id": "a5d06154d7231aa1e3a95782d72a7cd647409e53", "size": "8...
import datetime import logging import time import pathlib from typing import Any, Dict, List, Optional, Union import requests import lxml.etree from .togetter import Togetter from .togetter_page import TogetterPage from .tweet import Tweet class TogetterPageParser(object): def __init__( self, ...
{ "content_hash": "4241ed15a2d26fa74943e2eab325cf49", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 79, "avg_line_length": 33.18181818181818, "alnum_prop": 0.5512328767123288, "repo_name": "085astatine/togetter", "id": "362841a10411fd5c559fc78b83f5735cf8d16277", "size": ...
"""Test the Pentair ScreenLogic config flow.""" from unittest.mock import patch from screenlogicpy import ScreenLogicError from screenlogicpy.const import ( SL_GATEWAY_IP, SL_GATEWAY_NAME, SL_GATEWAY_PORT, SL_GATEWAY_SUBTYPE, SL_GATEWAY_TYPE, ) from homeassistant import config_entries from homeass...
{ "content_hash": "6d5e811e143cf3255e7bd5bbee7640f1", "timestamp": "", "source": "github", "line_count": 348, "max_line_length": 84, "avg_line_length": 31.78735632183908, "alnum_prop": 0.6117338636774543, "repo_name": "aronsky/home-assistant", "id": "d1333cb751421b2c492ae39e82f470a61a9e88f3", "size"...
from django.contrib.gis import admin from survey.models import GravelSite, Pit, InputNode, Question, Context, QuestionCategory, BifSettings, PitScoreWeight, PitQuestionAnswer admin.site.register(GravelSite, admin.GeoModelAdmin) admin.site.register(Pit, admin.GeoModelAdmin) admin.site.register(InputNode, admin.ModelAdm...
{ "content_hash": "66a63b15cc4d4afcd982ece02181e8e8", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 137, "avg_line_length": 34.92307692307692, "alnum_prop": 0.6563876651982379, "repo_name": "Ecotrust/floodplain-restoration", "id": "049eae2e030b2ec025606e7738d8d7e84f679937",...
import unittest import httpretty from u2fval_client.client import ( Client, ) from u2fval_client.exc import ( BadAuthException, BadInputException, ServerUnreachableException, InvalidResponseException, U2fValClientException, ) @httpretty.activate class TestClient(unittest.TestCase): def s...
{ "content_hash": "91f6d677ea0b231db89f211e7777291a", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 80, "avg_line_length": 40.22826086956522, "alnum_prop": 0.6098351796811673, "repo_name": "Yubico/u2fval-client-python", "id": "0db0fb0a250adb6310b589d3fcf28ad11b7c28f3", "s...
import sys import pickle import os import shutil _current_dir = os.path.abspath(os.path.dirname(__file__)) import_path = os.path.join(_current_dir, '..') sys.path.append(import_path) from lib.common import list_file_paths from lib.pdf_genome import PdfGenome from lib.detector import query_classifier class ExtGenome:...
{ "content_hash": "0aec7ff3d56b2e086549722352d4b30f", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 175, "avg_line_length": 38.64705882352941, "alnum_prop": 0.6316590563165906, "repo_name": "uvasrg/EvadeML", "id": "a76c167686393a017ab0cd4ff33a6ef2cbc08579", "size": "3309"...
"""Creates an AndroidManifest.xml for an incremental APK. Given the manifest file for the real APK, generates an AndroidManifest.xml with the application class changed to IncrementalApplication. """ import argparse import os import sys from xml.etree import ElementTree sys.path.append(os.path.join(os.path.dirname(__...
{ "content_hash": "817b39a07221cd9418c41cca3fe250d9", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 80, "avg_line_length": 38.9, "alnum_prop": 0.6930591259640103, "repo_name": "nwjs/chromium.src", "id": "38da3dc0bb332fadc6c38b39e82b09d399ded5f9", "size": "4055", "binar...
from authkit.authenticate import middleware, sample_app def valid(environ, username, password): return username == password app = middleware( sample_app, setup_method='basic', basic_realm='Test Realm', basic_authenticate_function=valid ) if __name__ == '__main__': from paste.httpserver im...
{ "content_hash": "03e0c8dfc32df8ee3694e554af10fc5a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 56, "avg_line_length": 23.375, "alnum_prop": 0.6737967914438503, "repo_name": "nakato/AuthKit", "id": "42219c8eec98ed0d348969e3107556eb79c849b9", "size": "374", "binary":...
from django.core.urlresolvers import reverse from django.http import HttpResponse from django.test.client import Client from apps.canvas_auth.models import User, AnonymousUser from canvas.models import EmailUnsubscribe from canvas.tests.tests_helpers import CanvasTestCase, NotOkay, create_content, create_user, create_...
{ "content_hash": "f6782876b0e4c6e7c3b760a6cbab8d4d", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 122, "avg_line_length": 39.265017667844525, "alnum_prop": 0.6378689704823615, "repo_name": "drawquest/drawquest-web", "id": "4736fcd7cc4c8371b41f589c7377c4f5b6111ca2", "si...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('search_page', '0003_auto_20160810_1856'), ] operations = [ migrations.AddField( model_name='searchpage', name='boosted_searc...
{ "content_hash": "db8ebd58602a3c7d36c992c170d55436", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 209, "avg_line_length": 36.43478260869565, "alnum_prop": 0.6479713603818615, "repo_name": "ic-labs/django-icekit", "id": "da99191e8becd7e43ef54a0d9469a121c89b9cc2", "size":...
from pygame.math import Vector3 as V3 import pygame import thorpy from core3d import Object3D, Path3D from light import Light, Material from camera import Camera import primitivemeshes import parameters import drawing import vessel import random from scene import Scene import levelgen import gamelogic import garage im...
{ "content_hash": "1ea9cd5996d3a88ba828f4f78a19f8ab", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 106, "avg_line_length": 37.108626198083066, "alnum_prop": 0.5862247094274645, "repo_name": "YannThorimbert/ThePhantomRacer", "id": "bd084a7b7433d6abc0395f39525cdeb855c8b155"...
from suds import * from suds.sax import Namespace, splitPrefix def qualify(ref, resolvers, defns=Namespace.default): """ Get a reference that is I{qualified} by namespace. @param ref: A referenced schema type name. @type ref: str @param resolvers: A list of objects to be used to resolve types. ...
{ "content_hash": "b9907eb81d5d679f7e8cf779a8f8912b", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 87, "avg_line_length": 30.620689655172413, "alnum_prop": 0.5940315315315315, "repo_name": "c2theg/DDoS_Information_Sharing", "id": "c5d801543bcc04b24b908eb1e096bb351bae4458",...
""" Microservice module This module contains the microservice code for server models """ from flask import Flask # Create the Flask app app = Flask(__name__) app.config.from_object('config') import server import models
{ "content_hash": "6884e1ba6657c5a9a436041870887d5c", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 46, "avg_line_length": 15.266666666666667, "alnum_prop": 0.7336244541484717, "repo_name": "NYU-Foxtrot/inventory", "id": "b0503da16b533905d6dc3ef85d6c7c50bb0611a4", "size":...
import unittest from typing import cast from pyspark.sql.functions import array, explode, col, lit, udf, pandas_udf from pyspark.sql.types import DoubleType, StructType, StructField, Row from pyspark.sql.utils import IllegalArgumentException, PythonException from pyspark.testing.sqlutils import ( ReusedSQLTestCase...
{ "content_hash": "5adf8d431e93bd3b35a7bc16e30633aa", "timestamp": "", "source": "github", "line_count": 398, "max_line_length": 99, "avg_line_length": 33.7964824120603, "alnum_prop": 0.5339379971749312, "repo_name": "srowen/spark", "id": "b3f4c7331d162b4686c232ef3961a2b199c03603", "size": "14236", ...
import json from jsonapp.utils.json_util import JSONUtil class String(object): def __init__(self, string): self._string = string @property def string(self): """ :rtype: str """ return self._string def set(self, value): self._string = value def...
{ "content_hash": "5471de8b289feddc531b8cb597334617", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 87, "avg_line_length": 19.24137931034483, "alnum_prop": 0.5849462365591398, "repo_name": "eyalev/jsonapp", "id": "1e5c500928c8ef167eb490cdf6d3e76117aabe4f", "size": "2790"...
from __future__ import unicode_literals from mock import call, patch import pytest from boxsdk.config import API from boxsdk.object.group_membership import GroupMembership from boxsdk.util.shared_link import get_shared_link_header @pytest.fixture def shared_link(): return 'https://app.box.com/s/q2i1024dvguiads6mz...
{ "content_hash": "663b869a06098cc70bfb8dafb25c4b2d", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 111, "avg_line_length": 32.12676056338028, "alnum_prop": 0.637001315212626, "repo_name": "Tusky/box-python-sdk", "id": "5fe63335829bd8e6e8b370d5c70b44065d01c834", "size": ...
__author__ = 'hwang' import pandas as pd import numpy as np import random as rd from pyspark import SparkContext, SparkConf import time def tick_list(file): symbols = pd.read_csv(file,sep='\t', header=None) ls_symbols = symbols[0] ls_symbols = ls_symbols.tolist() return ls_symbols def baseRoutine1(ti...
{ "content_hash": "0b393e51094ae7ea5773e1dd712c644d", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 143, "avg_line_length": 36.89208633093525, "alnum_prop": 0.625780031201248, "repo_name": "Sapphirine/Real-time-Risk-Management-System", "id": "b69bbda3072b1fd4287e4de53a769d...
from django.conf import settings from django.template.defaultfilters import floatformat # noqa from django.utils import translation from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon.utils import csvbase from openstack_dashboard import api from openstack_dashboard imp...
{ "content_hash": "2f66f4e547a8ceb34578e7a6670c401a", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 114, "avg_line_length": 40.76984126984127, "alnum_prop": 0.5298812536499903, "repo_name": "wangxiangyu/horizon", "id": "07b0015e81766437ebf653029bdcbd2395e41252", "size": ...
from setuptools import setup from spanner import __version__ setup( name='spanner', version=__version__, description='An accumulation of utilities / convenience functions for python', author='Bryan Johnson', author_email='d.bryan.johnson@gmail.com', packages=['spanner'], url='...
{ "content_hash": "4832b38a65018439b3bb88809471b36f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 82, "avg_line_length": 31.5, "alnum_prop": 0.6567460317460317, "repo_name": "dbjohnson/spanner", "id": "7a7b9a65d01b23ba0b379382468b3e4967730ae8", "size": "527", "binary"...
"""Tests for tensorflow.contrib.graph_editor.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib import graph_editor as ge from tensorflow.python.framework import constant_op from tensorflow.python.framework import ops from tensorflow...
{ "content_hash": "4d5b5c62ad5857e88d63323b7b8a6e5c", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 71, "avg_line_length": 36.90277777777778, "alnum_prop": 0.6450884456153556, "repo_name": "krikru/tensorflow-opencl", "id": "e98cce0b026b13ceb176ddfcd411479211c1de98", "size...
""" Test scalar buffer interface adheres to PEP 3118 """ import numpy as np from numpy.core._rational_tests import rational from numpy.core._multiarray_tests import get_buffer_info import pytest from numpy.testing import assert_, assert_equal, assert_raises # PEP3118 format strings for native (standard alignment and ...
{ "content_hash": "e412c2d2e9087947622e75a272bd295d", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 80, "avg_line_length": 36.52287581699346, "alnum_prop": 0.594488188976378, "repo_name": "rgommers/numpy", "id": "0e6ab1015e15eedf077c3f8f9ccbdcb20d4d1d31", "size": "5588",...
''' My initial approach involved writing recursive formulas for elements on both diagonals, than converting them to iterative formulas which i next simplified by eliminating all summations. This worked, however was pretty cumbersome. Than i did some reading and it turns out that a simple paradigm shift...
{ "content_hash": "566d0a05e3313be0da8e191b00671d46", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 87, "avg_line_length": 28.27659574468085, "alnum_prop": 0.5425131677953349, "repo_name": "buyuk-dev/project-euler-solutions", "id": "6a9e369343f71312572296b2b475d5f77ae1ece7"...
"""``tornado.gen`` is a generator-based interface to make it easier to work in an asynchronous environment. Code using the ``gen`` module is technically asynchronous, but it is written as a single generator instead of a collection of separate functions. For example, the following asynchronous handler:: class Asy...
{ "content_hash": "82980478345342eb0e838086f80c3053", "timestamp": "", "source": "github", "line_count": 751, "max_line_length": 82, "avg_line_length": 36.529960053262315, "alnum_prop": 0.6053801851716848, "repo_name": "robotlinker/robotlinker_core", "id": "4bb82d422c7b48ab7c654e3556861ab6414398cb", ...
"""Deployment serializers for orchestrator""" from copy import deepcopy from itertools import groupby import sqlalchemy as sa from sqlalchemy.orm import joinedload import math import six from nailgun import consts from nailgun.db import db from nailgun.db.sqlalchemy.models import Node from nailgun.extensions.volume...
{ "content_hash": "47cc76151d671ef459983cc91cd7429d", "timestamp": "", "source": "github", "line_count": 527, "max_line_length": 79, "avg_line_length": 36.46869070208729, "alnum_prop": 0.6342681721213382, "repo_name": "prmtl/fuel-web", "id": "616efefd25279d4742bd5bdd1290c0eae496b983", "size": "19854...
from collections import defaultdict from django.apps import apps from django.utils.functional import cached_property def model_path(obj): return '%s.%s' % (obj._meta.app_label, obj._meta.object_name.lower()) class IdentifierManager(object): @cached_property def sites(self): from django.contrib.s...
{ "content_hash": "36e267429c5a558c4a8a87303949617f", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 97, "avg_line_length": 31.31896551724138, "alnum_prop": 0.6014313239746766, "repo_name": "fcurella/django-recommends", "id": "baa03e047709605d4c7a6bfc963d650956685904", "s...
from setuptools import setup, find_packages import sys name = 'scheduling' description = 'Scheduling web application' long_description = 'Allows for the generation and editing of a monthly schedule' version = '0.0.0' maintainer = '' maintainer_email = '' url = '' packages = find_packages() include_package_data = True ...
{ "content_hash": "ab7d7552bde484be90698d60f87b8643", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 80, "avg_line_length": 32.354838709677416, "alnum_prop": 0.6530408773678963, "repo_name": "schana/scheduling-python", "id": "9b49ff3ab651ce1566a807bcdb3cd57f5267ab9a", "siz...
import os.path DELETE_MARKER_MESSAGE = '''\ This file is placed here by pip to indicate the source was put here by pip. Once this package is successfully installed this source code will be deleted (unless you remove this file). ''' PIP_DELETE_MARKER_FILENAME = 'pip-delete-this-directory.txt' def has_delete_marker_f...
{ "content_hash": "2b7ba7f6b85470207a4a063f856b9cd8", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 78, "avg_line_length": 29.64, "alnum_prop": 0.708502024291498, "repo_name": "eammx/proyectosWeb", "id": "42ea81405085a0000c587ad563fee30c7f37a026", "size": "741", "binary...
from setuptools import setup, find_packages from codecs import open from os import path import sys if sys.version_info.major < 3: msg = "Sorry, Python 2 is not supported (yet)" print >> sys.stderr, msg sys.exit(1) here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encodi...
{ "content_hash": "b7c0087ace45dc71d14f69ba4cacdd95", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 64, "avg_line_length": 24.666666666666668, "alnum_prop": 0.6372141372141372, "repo_name": "taeguk/github-export", "id": "d757a7e2f266105a9629d6840d4053802c8f4cf3", "size": ...
import sys,os import fileinput import numpy STEP_NUM=100 REP_NUM=100 START=0 END=0.05 SINGLETON=1 REDUN_RATIO_CUTOFF=0.2 def main(): if len(sys.argv) != 6: mes = 'Usage: python {} <abundance.table> start end steps reps' print >> sys.stderr, mes.format(os.path.basename(sys.argv[0])) sys.exi...
{ "content_hash": "478417fc4b71e33bc07904d753a6ef8b", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 78, "avg_line_length": 33.26086956521739, "alnum_prop": 0.5120915032679738, "repo_name": "jiarong/seqdep", "id": "3e8d4262ba54c39743077c269af238b3598d51a0", "size": "3160",...
from __future__ import absolute_import, division, print_function, unicode_literals from . import tools_tags as tools from .azure_common import BaseTest from c7n_azure.actions.tagging import Tag from mock import patch, Mock from c7n.filters import FilterValidationError class ActionsTagTest(BaseTest): existing_t...
{ "content_hash": "3a6b103b8ceca85b4afd3f02629b010c", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 93, "avg_line_length": 32.25966850828729, "alnum_prop": 0.5149854427127933, "repo_name": "Sutto/cloud-custodian", "id": "9d52626be01d339633cb733d4c1e65b353ae44bb", "size":...
''' Copyright (C) 2014 Parrot SA Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following di...
{ "content_hash": "a61e1e57a22d09cdb25e7b39984e171b", "timestamp": "", "source": "github", "line_count": 393, "max_line_length": 131, "avg_line_length": 36.76590330788804, "alnum_prop": 0.5523565644681293, "repo_name": "cvramire/ARSDKBuildUtils", "id": "ab3b577938276b81c5514feb02e85c213b0ddba1", "si...
from SimpleCV import Camera from datetime import datetime from io import BytesIO DEFAULT_PICTURE_PATH = "/tmp/" try: web_camera = Camera() web_camera.getImage() print('webcam Init.') except: web_camera = None def take_picture_web(): file_stream = BytesIO() img_raw = web_camera.getImage().get...
{ "content_hash": "806e3c68184734110ec20c2458c11d58", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 76, "avg_line_length": 25.40740740740741, "alnum_prop": 0.6428571428571429, "repo_name": "farmy-maker/farmy-py", "id": "91e3741ffce6e2314b06476ac652122235b9c545", "size": "...
import datetime from django.template import Context from django.template import Template from django.test import TestCase from django.utils import timezone from content.models import Event from content.models import Message from content.models import Post from content.models import Venue class EventMethodTests(Test...
{ "content_hash": "4c5379567e86ae23a136758aeeb9e3a3", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 93, "avg_line_length": 32.02040816326531, "alnum_prop": 0.6301253452305078, "repo_name": "sfowl/fowllanguage", "id": "bda40fece718fa99f81151bf57054d3d8ffcfb6f", "size": "4...
{ 'name': 'Repairs Management', 'version': '1.0', 'category': 'Manufacturing', 'description': """ The aim is to have a complete module to manage all products repairs. ==================================================================== The following topics should be covered by this module: ------------...
{ "content_hash": "4c971ee4497bb477a09b8847a5a56dae", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 68, "avg_line_length": 35.27906976744186, "alnum_prop": 0.5589980224126566, "repo_name": "ntiufalara/openerp7", "id": "6f324c43f7a708ce0497952564215529a7debab9", "size": "2...
from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='UserGroup', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=...
{ "content_hash": "959e49aa452e0c0d3cea261193fca394", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 117, "avg_line_length": 34.111111111111114, "alnum_prop": 0.5472312703583062, "repo_name": "WebCampZg/conference-web", "id": "fd28436a2ba557cc04ff0898c2ac5c595cff46f0", "si...
from wdim.server.api.v1 import auth from wdim.server.api.v1 import document PREFIX = 'v1' HANDLERS = ( auth.AuthHandler.as_entry(), document.HistoryHandler.as_entry(), document.DocumentHandler.as_entry(), document.DocumentsHandler.as_entry(), )
{ "content_hash": "494ea3b6188e314ae6a57bc5de17a151", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 41, "avg_line_length": 26.2, "alnum_prop": 0.7251908396946565, "repo_name": "chrisseto/Still", "id": "cd922b97d70ec327d06cde0f2b9e410ff731f6e8", "size": "262", "binary": ...
from __future__ import absolute_import, print_function __author__ = 'katharine' import atexit import logging import math import os import sys import threading import time import requests from pebble_tool.version import __version__ from pebble_tool.sdk import sdk_manager from pebble_tool.util.config import config from...
{ "content_hash": "c8ab4e46ff91ca773d8362c5bf29a7d6", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 111, "avg_line_length": 36.796460176991154, "alnum_prop": 0.6168831168831169, "repo_name": "gregoiresage/pebble-tool", "id": "95fb19b5f9683a47ae2a924108d377dd91b499c9", "s...
''' Author: Description: ''' from core.broadcast import say, bang from core.config.settings import logger import sys class Reaction: """class Reaction""" response = '' request = '' def __str__(self): return 'My new reaction' @classmethod def __init__(self, *args, **kwargs): "...
{ "content_hash": "93d56eeb4861fc7a14c7e67ccac760b0", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 79, "avg_line_length": 26.25, "alnum_prop": 0.5545787545787546, "repo_name": "vsilent/smarty-bot", "id": "88add2920ef71d5d3f67452d2263b7a5b13c59eb", "size": "3954", "bina...
import unittest from typing import Any, Dict, List from unittest import mock from google.cloud.pubsub_v1.types import ReceivedMessage from airflow.providers.google.cloud.operators.pubsub import ( PubSubCreateSubscriptionOperator, PubSubCreateTopicOperator, PubSubDeleteSubscriptionOperator, PubSubDelet...
{ "content_hash": "b226dc74d4733b401015444a6e9a5669", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 108, "avg_line_length": 35.57337883959045, "alnum_prop": 0.6215101218459177, "repo_name": "apache/incubator-airflow", "id": "a8bc046ea918666e4994ea347b636aa2429eda7f", "si...
from __future__ import absolute_import, division, print_function, unicode_literals import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils import six from haystack.backends import BaseEngine, BaseSearchBackend, BaseSearchQuery, EmptyResults, log_quer...
{ "content_hash": "27f20eb6073e1be583aef18cfd4af431", "timestamp": "", "source": "github", "line_count": 716, "max_line_length": 184, "avg_line_length": 39.30307262569833, "alnum_prop": 0.5475640524501617, "repo_name": "vitalyvolkov/django-haystack", "id": "4f301c925d62ef6becbacd45dca0cf76e3965360", ...
""" Django settings for training project. Generated by 'django-admin startproject' using Django 1.11.6. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import o...
{ "content_hash": "ff8e14c5ad801e6c78f5a3e4934b177d", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 91, "avg_line_length": 25.975806451612904, "alnum_prop": 0.6827072337783298, "repo_name": "aberon10/training", "id": "abc1832ba96d48aaac95aaca499f7d4a31801fb2", "size": "3...
from google.appengine.ext import ndb from google.appengine.api import datastore_errors import logging import re def stringValidator(prop, value): cleanValue = value.strip() if prop._name == 'email' or prop._name == 'requester_email': cleanValue = cleanValue.lower() return cleanValue def phoneVal...
{ "content_hash": "f0f5519b91815f8291e33b491cf0d4d9", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 79, "avg_line_length": 37.83582089552239, "alnum_prop": 0.6848126232741617, "repo_name": "hackatbrown/2015.hackatbrown.org", "id": "c13e58f6f73f23d3fdd31aaab9c56fcf0fce807d",...
""" Provides classes for the analysis of dynamical systems and time series based on recurrence plots, including measures of recurrence quantification analysis (RQA) and recurrence network analysis. """ # array object and fast numerics import numpy as np from .. import Network from .joint_recurrence_plot import JointR...
{ "content_hash": "a3e94862173eadc27250d3074581ceab", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 79, "avg_line_length": 40.084070796460175, "alnum_prop": 0.6330720830113699, "repo_name": "wbarfuss/pyunicorn", "id": "0c55fa038c50091b42b80c1c048af5dfa8b72234", "size": "...
from django.conf import settings from django.conf.urls import url, include from django.conf.urls.i18n import i18n_patterns from django.views.generic import TemplateView, RedirectView from django.utils.module_loading import import_string import os.path import zerver.forms from zproject import dev_urls from zproject.lega...
{ "content_hash": "de66b8b47085587eba63e9cac70e072b", "timestamp": "", "source": "github", "line_count": 436, "max_line_length": 136, "avg_line_length": 50.403669724770644, "alnum_prop": 0.6827448125227521, "repo_name": "dattatreya303/zulip", "id": "23cb8dc6c8e104cfb71dd2f949c4d6d99a13e09c", "size":...
from rgfunc import * def printEmp(employees): n = 1 for name in employees: print n, ": ", name.fullname() n +=1 br() def new_emp(Employee,employees): br() print "Enter New Employees Details" employee = Employee(raw_input("Enter new employee's frist name: ")) employee.lastname = raw_input("Enter new emplo...
{ "content_hash": "56ae39934e03a0685b75d2711f8385a1", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 68, "avg_line_length": 20.24770642201835, "alnum_prop": 0.6452197553239691, "repo_name": "imughal/EmployeeScript", "id": "47426f243ec7bdb955538b91d60d71280b34a3de", "size"...
from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ from panda.models.base_upload import BaseUpload class Export(BaseUpload): """ A dataset exported to a file. """ from panda.models.dataset import Dataset dataset = models.ForeignKe...
{ "content_hash": "38b36b7950eb64ff09f837c4989491af", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 75, "avg_line_length": 27.375, "alnum_prop": 0.6621004566210046, "repo_name": "PalmBeachPost/panda", "id": "2d8f2788051d879b30b942e824f4d1eef909dc11", "size": "680", "bin...
''' Client.Item.* tests. Note that when using many of these methods in production, it would be necessary to handle error cases (e.g. ``INVALID_CREDENTIAL``). However, we don't do that here since any errors will automatically be marked as failures by the test runner. ''' import json from contextlib import contextmanag...
{ "content_hash": "ba3a9188740002dbbb6f5b97ff1a6bb1", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 106, "avg_line_length": 33.400862068965516, "alnum_prop": 0.7065427797135114, "repo_name": "plaid/plaid-python", "id": "3caabacc445e4260870b0804b3c0a3f831e332df", "size": ...
import doctest import unittest from mptt.tests import doctests from mptt.tests import testcases def suite(): s = unittest.TestSuite() s.addTest(doctest.DocTestSuite(doctests)) s.addTest(unittest.defaultTestLoader.loadTestsFromModule(testcases)) return s
{ "content_hash": "f8b75057c3053bf24f4d50a27b453f30", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 72, "avg_line_length": 24.727272727272727, "alnum_prop": 0.7757352941176471, "repo_name": "emiquelito/django-cms-2.0", "id": "b89a53b567f9bfe655281ad119b2e33c4e0161ed", "si...
def CreateDataLoader(datafolder,dataroot='./dataset',dataset_mode='2afc',load_size=64,batch_size=1,serial_batches=True,nThreads=4): from data.custom_dataset_data_loader import CustomDatasetDataLoader data_loader = CustomDatasetDataLoader() # print(data_loader.name()) data_loader.initialize(datafolder,da...
{ "content_hash": "3a7ea40dd87ea7d3e5a1a686bd2795bc", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 190, "avg_line_length": 82.33333333333333, "alnum_prop": 0.7854251012145749, "repo_name": "richzhang/PerceptualSimilarity", "id": "db989c18717e69af5d672a979721e2fe2b4ffba4", ...
from os.path import dirname, join BASE_DIR = dirname(dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or...
{ "content_hash": "438b361762700153e62af283661c74c3", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 127, "avg_line_length": 33.07954545454545, "alnum_prop": 0.6884232222603917, "repo_name": "glasslion/django-qiniu-storage", "id": "65a84e6b539f6f3b2bdc9f94aaa645b6c6a4ad02",...
import re from neutron.agent.linux import ip_lib from neutron.agent.linux import utils from neutron.openstack.common import jsonutils from neutron.openstack.common import log as logging from neutron.plugins.common import constants as p_const # TODO(JLH) Should we remove the explicit include of the ovs plugin here fro...
{ "content_hash": "f6e1e021ed32247b93901ebf014db052", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 79, "avg_line_length": 39.3696682464455, "alnum_prop": 0.5347297459973517, "repo_name": "ntt-sic/neutron", "id": "b6fcf9270142c3d272ca1e58ee6d8bb344ce0bd1", "size": "17481...
""" (C) Copyright 2011, 10gen This is a label on a mattress. Do not modify this file! """ # Python import socket, threading, time muninAgentVersion = "1.5.7" def containsStr( val, query ): """ Returns true if the value is contained in the string """ return val.find( query ) > -1 class MuninThread( threadin...
{ "content_hash": "f2b7daf834d56f532480271526e7cbe9", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 105, "avg_line_length": 27.923529411764704, "alnum_prop": 0.5072677480514008, "repo_name": "AlphaCluster/NewsBlur", "id": "1da32d34e13cc9a57a4cc73933e911b9f1f08c3d", "size...
import unittest import chainer import numpy import pytest import chainerx import chainerx.testing from chainerx_tests import array_utils from chainerx_tests import op_utils def _create_batch_norm_ndarray_args( xp, device, x_shape, gamma_shape, beta_shape, mean_shape, var_shape, float_dtype): x ...
{ "content_hash": "2a998868b7b990c98606aa005bfb2be9", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 79, "avg_line_length": 38.07236842105263, "alnum_prop": 0.6100743044755487, "repo_name": "chainer/chainer", "id": "67891b36ebd2348fff7bc0d2d8f33d49b1bd7071", "size": "1157...
import os import time from ds3 import ds3 client = ds3.createClientFromEnv() bucketName = "books" # make sure the bucket that we will be sending objects to exists client.put_bucket(ds3.PutBucketRequest(bucketName)) # create your list of objects that will be sent to DS3 # the key to the dictionary is the name the ...
{ "content_hash": "baf033d742224088b8eae43cfd49038f", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 177, "avg_line_length": 43.421052631578945, "alnum_prop": 0.6909090909090909, "repo_name": "SpectraLogic/ds3_python3_sdk", "id": "191de2c478282e16f7ed378424bb64a9c673cba3", ...
from office365.outlook.calendar.schedule_item import ScheduleItem from office365.outlook.calendar.working_hours import WorkingHours from office365.runtime.client_value import ClientValue from office365.runtime.client_value_collection import ClientValueCollection class ScheduleInformation(ClientValue): """Represen...
{ "content_hash": "bf651306c5ef740be6c4ee24a90f6a5c", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 117, "avg_line_length": 60.225806451612904, "alnum_prop": 0.7305838243170862, "repo_name": "vgrem/Office365-REST-Python-Client", "id": "52aac5bde2d94ba1e502964ba3131fe398de0d...
""" Module that contains many useful utilities for validating data or function arguments """ import warnings from pandas.core.dtypes.common import is_bool def _check_arg_length(fname, args, max_fname_arg_count, compat_args): """ Checks whether 'args' has length of at most 'compat_args'. Raises a TypeErro...
{ "content_hash": "bac108e42386386489838e949fb5c14c", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 78, "avg_line_length": 36.427374301675975, "alnum_prop": 0.617437313089487, "repo_name": "kdebrab/pandas", "id": "a96563051e7de87c66320535c9aec205ee0c3ded", "size": "13041...
from .ssl_ import create_urllib3_context, resolve_cert_reqs, resolve_ssl_version def connection_requires_http_tunnel( proxy_url=None, proxy_config=None, destination_scheme=None ): """ Returns True if the connection requires an HTTP CONNECT through the proxy. :param URL proxy_url: URL of the p...
{ "content_hash": "6823df66ec0cb4e27629cfa1cde0ebdc", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 80, "avg_line_length": 28.157894736842106, "alnum_prop": 0.6510903426791277, "repo_name": "sbidoul/pip", "id": "2199cc7b7f004009493d032720c36d6568f9d89e", "size": "1605", ...
from os import path try: import json # try stdlib (Python 2.6) except ImportError: try: import simplejson as json # try external module except: import gluon.contrib.simplejson as json # fallback to pure-Python module from gluon import current from gluon.html import * from gluon.storage imp...
{ "content_hash": "e86f918328eda5e7585953f4177d1937", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 114, "avg_line_length": 34.188976377952756, "alnum_prop": 0.4841087056655919, "repo_name": "sahana/Turkey", "id": "51b3d6abc8b6ad4b239d60a0d2499d5d242dc002", "size": "8709...
import copy import matplotlib.pyplot as plt import numpy as np import scipy as sp from scipy.spatial.distance import pdist, squareform from yass.evaluate.util import * def align_template(template, temp_len=40, mode='all'): window = np.arange(0, temp_len) - temp_len // 2 n_chan = template.shape[1] main_ch...
{ "content_hash": "f226978def671330984484e90ecbf2b9", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 151, "avg_line_length": 34.13768115942029, "alnum_prop": 0.5812990872426237, "repo_name": "paninski-lab/yass", "id": "7541c0b7525f175d144d71ccaa470b7db244a4af", "size": "9...
import codecs # Use regular expressions import re # Nice command line argument parsing import argparse # Module to check the properties of wave files import wave # Modules to check files and paths import os.path import sys # Module for working with Toolbox files # Create an command-line argument parser parser = a...
{ "content_hash": "2f990e31b9a6d1d1ee1568869e7e614a", "timestamp": "", "source": "github", "line_count": 1270, "max_line_length": 334, "avg_line_length": 42.18503937007874, "alnum_prop": 0.5780867942137191, "repo_name": "janstrunk/LangDocMAUS", "id": "64b18c2eff5f996c87f363a35de557df3c97c8f4", "size...
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType import copy as _copy class Domain(_BaseLayoutHierarchyType): # class properties # -------------------- _parent_path_str = "layout.ternary" _path_str = "layout.ternary.domain" _valid_props = {"column", "row", "x",...
{ "content_hash": "8fb04e311cbdd889699b04d25b43036c", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 84, "avg_line_length": 28.106280193236714, "alnum_prop": 0.5106565830182194, "repo_name": "plotly/python-api", "id": "e17b94fc5184e78215f7b463e0517affafba1173", "size": "5...
import cairocffi from . import base from os import statvfs import time __all__ = [ 'CPUGraph', 'MemoryGraph', 'SwapGraph', 'NetGraph', 'HDDGraph', 'HDDBusyGraph', ] class _Graph(base._Widget): fixed_upper_bound = False defaults = [ ("graph_color", "18BAEB", "Graph color"), ...
{ "content_hash": "6dba76c88de3aee8c73d220921c2a59c", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 82, "avg_line_length": 31.482233502538072, "alnum_prop": 0.5485327313769752, "repo_name": "farebord/qtile", "id": "d9c5d78a0fc21103b6d36b0d6d8e896291f4a88e", "size": "1395...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA from logging import getLogger import chainer from chainer i...
{ "content_hash": "3ab96cd0103b5e5aa3659fa54394366f", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 66, "avg_line_length": 30.21875, "alnum_prop": 0.6137538779731128, "repo_name": "toslunar/chainerrl", "id": "bca38d61cb22aeed03658602ca5bf1db814b2e2d", "size": "1934", "b...
"""Generate bibliography.rst The input file is of the following form. Blank lines are ignored. New lines are collapsed to a single space. Besides newlines, text for each entry is copied without filtering, and thus reST syntax can be used. Note that the key line must begin with '['. [M55] G. H. Mealy. `A Method for Sy...
{ "content_hash": "2c594507deccd47f325e7f0f85bf6538", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 75, "avg_line_length": 27.517241379310345, "alnum_prop": 0.5883458646616542, "repo_name": "necozay/tulip-control", "id": "c7924834f2797bf64217a23bd4ea2ba1009fb7d8", "size":...
import json from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults from airflow.hooks.slack_hook import SlackHook from airflow.exceptions import AirflowException class SlackAPIOperator(BaseOperator): """ Base Slack Operator The SlackAPIPostOperator is derived from thi...
{ "content_hash": "0b981ba41ec90a86ae1178b0b92655a5", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 124, "avg_line_length": 37.839285714285715, "alnum_prop": 0.6285983954695611, "repo_name": "yati-sagade/incubator-airflow", "id": "8398a7aea4433560eb5db36b10851caab0f0da28",...
""" WSGI config for a_z_challenge 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", "a_z_challenge.settings") from d...
{ "content_hash": "fb23d5e6f3f78a3acd2a2557f631b53f", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 28.642857142857142, "alnum_prop": 0.770573566084788, "repo_name": "GyrosOfWar/a-z-challenge-py", "id": "6c32dbbed8ee04a6ed51375bda8626a792e790ae", "s...
import argparse import os import sys import numpy as np from scipy import ndimage import gram from gram import JoinMode if __name__ == "__main__": parser = argparse.ArgumentParser(description="Synthesize image from texture", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--output...
{ "content_hash": "23690b36f439ff7f2a4b777e6d62a4a2", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 157, "avg_line_length": 48.679245283018865, "alnum_prop": 0.6391472868217054, "repo_name": "wxs/subjective-functions", "id": "9120aed6e217f2a190ce94b89ad124cca2bcea07", "s...
import numpy import pylab def signal_power_test(raw_validation_data_set, training_set, validation_set, pred_act, pred_val_act,display=False): signal_power=[] noise_power=[] normalized_noise_power=[] signal_power_variance=[] for i in xrange(0,len(raw_validation_data_set)): (sp,np,nnp,spv) = signal_a...
{ "content_hash": "ce2ba1c40efd1992d695001c3cbf0b4d", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 238, "avg_line_length": 47.032967032967036, "alnum_prop": 0.6976635514018692, "repo_name": "ioam/svn-history", "id": "c27fb6481b897b0629df4a76ac29c7aae8fe595d", "size": "42...
class OtherEndpointsMixin: """ Various endpoints dealing with the Showroom service and menus """ def avatar_server_settings(self): """ Some info about where avatars are stored, e.g.: { "version": 41, "path": "https://image.showroom-live.com/showro...
{ "content_hash": "00ce85d509684df13cfcb1e1bc6d50c5", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 105, "avg_line_length": 29.186046511627907, "alnum_prop": 0.5490039840637451, "repo_name": "wlerin/showroom", "id": "4f272dc9b96661ac5b6ab804eb3aef162addf092", "size": "251...
from __future__ import absolute_import from .value import Value, URI from ..exceptions import IllegalArgumentException from ..util import strings from ..vocabulary.xmlschema import XMLSchema import datetime from collections import defaultdict class Literal(Value): """ Lightweight implementation of the Litera...
{ "content_hash": "906704ecde0d42621684300fb6ec7447", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 109, "avg_line_length": 33.51968503937008, "alnum_prop": 0.5863284002818887, "repo_name": "mpetyx/pychatbot", "id": "05b09d05ebf6e7e08f057f027fd9893f4f8f4fed", "size": "93...
"""Unit tests for the pipeline options module.""" import logging import unittest import hamcrest as hc from apache_beam.options.pipeline_options import PipelineOptions from apache_beam.options.value_provider import RuntimeValueProvider from apache_beam.options.value_provider import StaticValueProvider from apache_be...
{ "content_hash": "e3ddaa9d63250d28fc2a0fff62910bb8", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 82, "avg_line_length": 40.68122270742358, "alnum_prop": 0.6215113782739373, "repo_name": "wangyum/beam", "id": "66c69bdfc70ea09bb9c6b19d42c6effd571b50ec", "size": "10101",...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Talk.auditorium' db.add_column(u'core_talk', 'auditorium', ...
{ "content_hash": "6ba023cbd46aa0388bc78f7b2a8a3fe2", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 195, "avg_line_length": 69.78899082568807, "alnum_prop": 0.5490995136058893, "repo_name": "eseca/congresoECC", "id": "5c6c577da96a7233784c87d75a8701792d5ff2d2", "size": "7...
""" Ferris event class """ import logging import bisect class Event(object): """ Provides a simple interface for slot/signal event system. Example: myevent = Event() myevent += some_handler_function myevent() """ def __init__(self, name=None): self.handlers = [] ...
{ "content_hash": "ee1a7dd9dc55c40996866516c524b507", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 90, "avg_line_length": 25.857142857142858, "alnum_prop": 0.5749802683504341, "repo_name": "yowmamasita/social-listener-exam", "id": "756ac3faa8a4df13c3445ff5a78e0d41e8274afe"...
from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.contrib.auth import login, authenticate from django.shortcuts import render, redirect from app.core.models import * from app.core.forms import * def get_current_user(request): user = request.user user.refr...
{ "content_hash": "ecc170f6597efd632555bcc3aba298d5", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 104, "avg_line_length": 35.467455621301774, "alnum_prop": 0.6885218551885218, "repo_name": "NatashaKrassevich/colocaciones", "id": "3223394b4bbe53262d63404caa472d46edb40cb0"...
import numpy import theano.tensor as T from pylearn2.models.model import Model from pylearn2.space import VectorSpace from pylearn2.utils import sharedX from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin class CNNCost(DefaultDataSpecsMixin, Cost): supervised = True def expr(self, model, data, **kwargs): ...
{ "content_hash": "8767385ff98da2057ca52a0b7318ab6e", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 62, "avg_line_length": 26.471698113207548, "alnum_prop": 0.6792587312900926, "repo_name": "SolessChong/kaggle-mnist", "id": "cc2c54fe814a723579488471ffcf9ee671acae6e", "siz...
import copy import sys import os import operator import shlex import warnings import heapq import bisect import random from subprocess import Popen, PIPE from threading import Thread from collections import defaultdict from itertools import chain from functools import reduce from math import sqrt, log, isinf, isnan, po...
{ "content_hash": "3e5fce909d7002d3e199b88271b1f875", "timestamp": "", "source": "github", "line_count": 3097, "max_line_length": 100, "avg_line_length": 35.00968679367129, "alnum_prop": 0.5672400276688956, "repo_name": "xuanyuanking/spark", "id": "97b87ea87e8348e6e5e7ca10c5111b8bdff3a73d", "size": ...
from geopy.geocoders import AzureMaps from test.geocoders.tomtom import BaseTestTomTom from test.geocoders.util import env class TestAzureMaps(BaseTestTomTom): @classmethod def make_geocoder(cls, **kwargs): return AzureMaps(env['AZURE_SUBSCRIPTION_KEY'], timeout=3, **kwargs)
{ "content_hash": "06f8646eee6ac7eb340cd0c8ca4820f2", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 66, "avg_line_length": 29.09090909090909, "alnum_prop": 0.703125, "repo_name": "geopy/geopy", "id": "5ea6931c26a5c836f330aa1a3f592844a3203b00", "size": "320", "binary": f...
import os import webob.static import ryu.base import ryu.app.wsgi class Application(ryu.base.app_manager.RyuApp): _CONTEXTS = { 'wsgi': ryu.app.wsgi.WSGIApplication, } def __init__(self, *args, **kwargs): super(Application, self).__init__(*args, **kwargs) kwargs['wsgi'].register...
{ "content_hash": "e569ebe66ebc408a5bc370002f3c2d78", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 67, "avg_line_length": 29.485714285714284, "alnum_prop": 0.6424418604651163, "repo_name": "atzm/oftgui", "id": "014c1f2473998ce7147f08d4bb401b28586cda5a", "size": "1057", ...
from robot import model, utils from keyword import Keyword class TestCase(model.TestCase): """Results of a single test case.""" __slots__ = ['status', 'message', 'starttime', 'endtime'] keyword_class = Keyword def __init__(self, name='', doc='', tags=None, timeout=None, status='FAIL', ...
{ "content_hash": "aaabff64f59c9bb75893b0be3789c352", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 79, "avg_line_length": 33.975, "alnum_prop": 0.5916114790286976, "repo_name": "ktan2020/legacy-automation", "id": "c84f125b8deffce124941bec616c4cb7c77508ab", "size": "1965"...
"""A utility class to write to and read from a non-blocking socket.""" from __future__ import unicode_literals import errno import socket import ssl from marrow.io import ioloop from marrow.util.compat import exception log = __import__('logging').getLogger(__name__) __all__ = ['IOStream', 'SSLIOStream'] class I...
{ "content_hash": "bd0a08dae0a168dd88a6e936438a7500", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 94, "avg_line_length": 34.245341614906835, "alnum_prop": 0.5458420241226082, "repo_name": "marrow/io", "id": "1747d89f3d13b69b2d63f942d2b89d7477742f6f", "size": "11676", ...
import os import random import numpy as np from collections import Counter def main(data_path): # randomly separate 5 files in each category for test labels = [name for name in os.listdir(data_path)] trainset = {} testset = {} dics = [] os.system('rm -r data/') os.system('mkdir data') ...
{ "content_hash": "c59c36063c5b6da920fed996f00b4e81", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 81, "avg_line_length": 28.272727272727273, "alnum_prop": 0.5956591639871383, "repo_name": "hkhpub/nbsvm-demo", "id": "ee96771adc670122cdc037461f2ed87c3023a147", "size": "12...