text
stringlengths
4
1.02M
meta
dict
from electrum_ltc.plugin import hook from electrum_ltc.util import print_msg, raw_input, print_stderr from electrum_ltc.logging import get_logger from ..hw_wallet.cmdline import CmdLineHandler from .coldcard import ColdcardPlugin _logger = get_logger(__name__) class ColdcardCmdLineHandler(CmdLineHandler): de...
{ "content_hash": "4a4fe67dfea436aec3e98779954eff5d", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 64, "avg_line_length": 22.489795918367346, "alnum_prop": 0.6715063520871143, "repo_name": "vialectrum/vialectrum", "id": "ff14ac4047c8dc671f38ea5404d6c9bed7e6f110", "size":...
""" Miscelanius utilities which are helpful sometime. """ import logging try: from urlparse import urlsplit except ImportError: from urllib.parse import urlsplit from hashlib import sha1 import os import shutil def unique_file(path): """ Drop non-unique lines in the file. Return number of unique li...
{ "content_hash": "1c5f5ccef6c2563beaad50eb6a401e20", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 86, "avg_line_length": 27.254901960784313, "alnum_prop": 0.5651079136690648, "repo_name": "subeax/grab", "id": "7a59fe36d345045fdb2423697861b3a2f2aff5f1", "size": "2780", ...
from rest_framework.serializers import ModelSerializer, HyperlinkedIdentityField, SerializerMethodField from posts.models import Post from comments.api.serializers import CommentSerializer from comments.models import Comment class PostCreateUpdateSerializer(ModelSerializer): class Meta: model = Post ...
{ "content_hash": "896032b417a7b8f335d004d04b280062", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 103, "avg_line_length": 23.440677966101696, "alnum_prop": 0.5704989154013015, "repo_name": "videetssinghai/Blog-Rest-Api", "id": "76617d5c23dbf27556a0135a53aff60a69381f9c", ...
"""Implements a source for reading Avro files.""" import cStringIO import os import zlib import avro from avro import datafile from avro import io as avroio from avro import schema import apache_beam as beam from apache_beam.io import filebasedsource from apache_beam.io import filebasedsink from apache_beam.io impor...
{ "content_hash": "c01eedba4da9194985e9a472139d339a", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 80, "avg_line_length": 37.332402234636874, "alnum_prop": 0.6551440329218107, "repo_name": "dhalperi/incubator-beam", "id": "e02e1f7e893fc4b79fac2bf5099eb975973e8f91", "siz...
''' Execute a command and read the output as JSON. The JSON data is then directly overlaid onto the minion's Pillar data. ''' from __future__ import absolute_import # Don't "fix" the above docstring to put it on two lines, as the sphinx # autosummary pulls only the first line for its description. # Import python libs...
{ "content_hash": "e03c8d12068aa9498d1313368e23abf4", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 117, "avg_line_length": 28.566666666666666, "alnum_prop": 0.6312718786464411, "repo_name": "stephane-martin/salt-debian-packaging", "id": "1a75d819bea30b5fa97aea0e44439567ea0...
""" Authentication backend classes for Desktop. These classes should implement the interface described at: http://docs.djangoproject.com/en/1.0/topics/auth/#writing-an-authentication-backend In addition, the User classes they return must support: - get_groups() (returns a list of strings) - get_home_directory() (...
{ "content_hash": "bef86d2794d0dabafad953129b657e6e", "timestamp": "", "source": "github", "line_count": 534, "max_line_length": 106, "avg_line_length": 31.44569288389513, "alnum_prop": 0.6887803716055264, "repo_name": "yongshengwang/hue", "id": "c65839d97e869fc8afc44c28be0e18eeef1b65eb", "size": "1...
contestants, problems = [int(x) for x in input().split()] for i in range(contestants): input() print(problems)
{ "content_hash": "7474718c0cca82e4a8b9af62bef841f2", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 57, "avg_line_length": 19.5, "alnum_prop": 0.6752136752136753, "repo_name": "CajetanP/coding-exercises", "id": "5131eaff1b23fa65b0441d30ef8d540329a75c74", "size": "141", "...
""" Implementation of optimized einsum. """ from __future__ import division, absolute_import, print_function from numpy.core.multiarray import c_einsum from numpy.core.numeric import asarray, asanyarray, result_type __all__ = ['einsum', 'einsum_path'] einsum_symbols = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST...
{ "content_hash": "3d1612d9b9a7123429d3188177781768", "timestamp": "", "source": "github", "line_count": 990, "max_line_length": 86, "avg_line_length": 35.81515151515151, "alnum_prop": 0.5624841357136814, "repo_name": "dwillmer/numpy", "id": "97eb7924faade2c0e8373a9dad63f3a4e8698763", "size": "35457...
import cPickle as pickle import logging import numpy as np from os.path import join as path_join import sys import keras.backend as K from keras.models import Sequential, Graph from keras.layers.containers import Graph as SubGraph from keras.layers.containers import Sequential as Stack from keras.layers.core import *...
{ "content_hash": "a2e79d8848862f0dfa8bdff16f665d41", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 140, "avg_line_length": 32.12562814070352, "alnum_prop": 0.672454246832473, "repo_name": "textclf/fancy-cnn", "id": "13db8f496d0749bc8eac83acbef5d4cb34e2efc1", "size": "63...
from flask_wtf import FlaskForm from wtforms import validators, PasswordField, BooleanField, SubmitField class PasswordsForm(FlaskForm): password = PasswordField('New Password', [ validators.DataRequired(), validators.EqualTo('confirm', message='Passwords must match') ]) confirm = PasswordF...
{ "content_hash": "82ecf408d376430cd855866f9376a7ff", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 75, "avg_line_length": 45.92307692307692, "alnum_prop": 0.7370184254606366, "repo_name": "t4skforce/PenTestingUnit", "id": "6a12bc99d7afb8a329adf6895e63a9cd80086dcb", "size...
from django.urls import re_path from .views import WizardCreateView urlpatterns = [ re_path(r"^create/$", WizardCreateView.as_view(), name="cms_wizard_create"), ]
{ "content_hash": "853879ffce976dfe9619e13b0310a115", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 66, "avg_line_length": 22.625, "alnum_prop": 0.6740331491712708, "repo_name": "rsalmaso/django-cms", "id": "e24a37e4b081789c3baeec8c8919f52a5589c3ee", "size": "181", "bina...
class GwinnettPipeline(object): def process_item(self, item, spider): return item
{ "content_hash": "389da0d76cd58e13ba5fee015271dafc", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 41, "avg_line_length": 31.333333333333332, "alnum_prop": 0.6914893617021277, "repo_name": "lahoffm/aclu-bail-reform", "id": "61c0798f145a14ec7104cee4607fb915529fa01b", "size...
from __future__ import print_function, absolute_import, division import warnings import numpy as np import scipy.sparse as sp import os.path import sys import contextlib import json from datetime import datetime from sklearn.pipeline import Pipeline from six import StringIO from .eval_scopes import import_all_estimat...
{ "content_hash": "a0bb412952829496ecc9359e457162a4", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 79, "avg_line_length": 33.244505494505496, "alnum_prop": 0.588298487728287, "repo_name": "pandegroup/osprey", "id": "b4dee9cd80f241251bc65602a2484a714266f1b2", "size": "12...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('event', '0002_auto_20180131_1828'), ] operations = [ migrations.AlterField( model_name='dancefloorevent', name='completed', field=models.NullBooleanField...
{ "content_hash": "02f01c19706f047fe0d1c10c9d88d01c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 56, "avg_line_length": 22.0625, "alnum_prop": 0.5920679886685553, "repo_name": "bruecksen/notifhain", "id": "c1d349dfeebf01c630da0d180dbb68b8a3483d4d", "size": "402", "bi...
import mock import testtools import heatclient.v1.shell as shell class TestHooks(testtools.TestCase): def setUp(self): super(TestHooks, self).setUp() self.client = mock.Mock() nested_stack = mock.Mock() self.client.resources.get = mock.Mock(name='thingy', ...
{ "content_hash": "af4832c4e1086d4352d091c72819a2ff", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 78, "avg_line_length": 38.921052631578945, "alnum_prop": 0.5196078431372549, "repo_name": "rdo-management/python-heatclient", "id": "b797136acbb767ca87173eb239d45780d17cfbfa...
""" # Name: meas/wsgi.py # Description: # Created by: Auto # Date Created: Oct 07 2016 # Last Modified: Oct 10 2016 # Modified by: Phuc Le-Sanh """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "meas_development.settings") application =...
{ "content_hash": "98b764e51df301317a2fd5a453f8d5e6", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 76, "avg_line_length": 24.571428571428573, "alnum_prop": 0.6976744186046512, "repo_name": "deka108/meas_deka", "id": "0e89ada24d0d77e00ad9dc97e393fb251ce84c02", "size": "34...
"""Backport of the new select module with epoll and kqueue interface The select_backport extension is a backport of the new API functions of Python 2.7/SVN for Python 2.3 to 2.6. It contains object oriented wrappers for epoll (Linux 2.6) and kqueue/kevent (BSD). >>> try: ... import select_backport as select ... e...
{ "content_hash": "fd1b12a5398b1292856d6b0d97884e69", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 78, "avg_line_length": 31.195121951219512, "alnum_prop": 0.63408913213448, "repo_name": "gorakhargosh/select_backport", "id": "0c40d88e248aedefb4a38cd468066a3d89efa331", "s...
from django.conf.urls import include, url from rest_framework.authtoken.views import obtain_auth_token from blog.urls import router urlpatterns = [ url(r'^api/token/', obtain_auth_token, name='api-token'), url(r'^api/', include(router.urls)), ]
{ "content_hash": "59d2c79a66bd753f5eb46683c78c5932", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 61, "avg_line_length": 28.333333333333332, "alnum_prop": 0.7215686274509804, "repo_name": "chatcaos-org/django_rest_framework", "id": "5cb94df8e10aa22488a8e5004ce55e8f796583a8...
from copy import deepcopy from unittest import TestCase from django.test import TransactionTestCase from django.core.files.storage import default_storage from django.test import override_settings from botocore.exceptions import NoCredentialsError import datetime from dateutil.parser import parse from djconnectwise i...
{ "content_hash": "562c2e1593b28c5631654d7cea8b9723", "timestamp": "", "source": "github", "line_count": 2238, "max_line_length": 79, "avg_line_length": 37.23547810545129, "alnum_prop": 0.6457825831303325, "repo_name": "KerkhoffTechnologies/django-connectwise", "id": "8ab81a6c3bd613e18f720b5644c5d06ac...
"""PhysicsRoller is for wheels, soccer balls, billiard balls, and other things that roll."""
{ "content_hash": "86bb2e4a92bb7d4941514c52a734f86e", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 92, "avg_line_length": 47, "alnum_prop": 0.7446808510638298, "repo_name": "tobspr/panda3d", "id": "c0510dfc69879e370fa22877ae6c0798060eef87", "size": "94", "binary": false...
from importlib import import_module from django.conf import settings from orchestra.core.errors import InvalidSlugValue from orchestra.core.errors import SlugUniquenessError class Workflow(): """ Workflows represent execution graphs of human and machine steps. Attributes: slug (str): ...
{ "content_hash": "fc6a5d062612850bd2cbad51f6f2c183", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 79, "avg_line_length": 29.067857142857143, "alnum_prop": 0.5666543801449809, "repo_name": "Sonblind/orchestra", "id": "f233d8ad02a67af81312753cdaf905a85f5a3971", "size": "...
import pytz from datetime import datetime def empty_str(in_str): """ Simple helper to return True if the passed string reference is None or '' or all whitespace """ if in_str is not None and not isinstance(in_str, basestring): raise TypeError('Arg must be None or a string type') retu...
{ "content_hash": "e33670012c30c69b6605f58ccabe75ce", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 65, "avg_line_length": 23.272727272727273, "alnum_prop": 0.6590401785714286, "repo_name": "eHealthAfrica/rapidsms", "id": "38fea37365eb6c6638090e6a326a0b0debb603e3", "size"...
""" __init__.py :copyright: (c) 2015 by Fulfil.IO Inc. :license: see LICENSE for details. """ from trytond.pool import Pool from party import Address, PaymentProfile, Party from transaction import PaymentGatewayStripe, PaymentTransactionStripe, \ AddPaymentProfile def register(): Pool.register( ...
{ "content_hash": "0a3819f54593bce56084cf51a11fdc02", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 73, "avg_line_length": 24.32, "alnum_prop": 0.6595394736842105, "repo_name": "prakashpp/trytond-payment-gateway-stripe", "id": "582652e8e6df9b45e64130bc55586689dfc3650b", "...
import mock from neutron.agent.common import base_polling from neutron.agent.linux import polling from neutron.tests import base class TestGetPollingManager(base.BaseTestCase): def test_return_always_poll_by_default(self): with polling.get_polling_manager() as pm: self.assertEqual(pm.__class...
{ "content_hash": "f992d0f02031c50f44d5bb5a5cc407c8", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 78, "avg_line_length": 38.35294117647059, "alnum_prop": 0.647239263803681, "repo_name": "igor-toga/local-snat", "id": "8ae677e20541ce56b96f4c3a37e78378aa59e562", "size": "2...
""" Multiple SNMP engines +++++++++++++++++++++ Send multiple SNMP GET requests to multiple peers using multiple independent SNMP engines. Deal with peers asynchronously. SNMP options are: * with SNMPv1, community 'public' and with SNMPv2c, community 'public' and with SNMPv3, user 'usr-md5-des', MD5 auth and DE...
{ "content_hash": "abf3c5feabe156fdc493b6291974490c", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 106, "avg_line_length": 35.25242718446602, "alnum_prop": 0.7135775268521068, "repo_name": "etingof/pysnmp", "id": "fc2143d488c5172628a06452a4627928ed2dd33e", "size": "3631...
from functools import total_ordering import itertools import re all_modules = [] @total_ordering class Module(object): """ A module is the basic abstraction in our test runner script. Each module consists of a set of source files, a set of test commands, and a set of dependencies on other modules. We use...
{ "content_hash": "7fdbcef951d791d861a61cdc6158b692", "timestamp": "", "source": "github", "line_count": 492, "max_line_length": 100, "avg_line_length": 25.107723577235774, "alnum_prop": 0.6060066380636283, "repo_name": "sachintyagi22/spark", "id": "10ad1fe3aa2c67610ac6ad743584703c70720d8b", "size":...
import logging from distutils.util import strtobool from configobj import ConfigObj from fastapp.models import Base, Setting, Apy from fastapp.utils import Connection from StringIO import StringIO logger = logging.getLogger(__name__) def _read_config(app_config): # read app.config #app_config_file = StringI...
{ "content_hash": "56daef90a3daba14608ee5498eb4ced2", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 88, "avg_line_length": 30.46315789473684, "alnum_prop": 0.6285418106427091, "repo_name": "sahlinet/fastapp", "id": "dc4f4ea9c8104c794ac554c4b5bf139847fc7c1b", "size": "2894...
import os import numpy as np from ..models import model_from_config, save_json from ..hyperopt import Node, CMAES from ..model_selection import CV from .fit import fit def obj_fn(s, x, y): try: model = model_from_config(config=s) result = CV(method='split', test_size=0.2).run( model=m...
{ "content_hash": "e542be0cf5a8026aa5e4a93248f755f1", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 98, "avg_line_length": 27.792079207920793, "alnum_prop": 0.571072319201995, "repo_name": "rafaeltg/pydl", "id": "c0dda605f90df7e3c6bf5b950c759c856beb1a03", "size": "2807",...
import RPi.GPIO as GPIO, feedparser, time DEBUG = 1 USERNAME = "tachijuan" # just the part before the @ sign, add yours here PASSWORD = "" NEWMAIL_OFFSET = 1 # my unread messages never goes to zero, yours might MAIL_CHECK_FREQ = 60 # check mail every 60 seconds GPIO.setmode(GPIO.BOARD) GREEN_LE...
{ "content_hash": "197facf3a9b1981ccc35e1b8d85dd6c1", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 137, "avg_line_length": 28.967741935483872, "alnum_prop": 0.6035634743875279, "repo_name": "tachijuan/python", "id": "35b6f317e2e3176dd60929563c440f8ee7fedb03", "size": "92...
import py, os, cffi, re import _cffi_backend def getlines(): try: f = open(os.path.join(os.path.dirname(cffi.__file__), '..', 'c', 'commontypes.c')) except IOError: py.test.skip("cannot find ../c/commontypes.c") lines = [line for line in f.readlines(...
{ "content_hash": "1c88ff65ce7d34450b0d3a0ea9d630c0", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 78, "avg_line_length": 28, "alnum_prop": 0.5157563025210085, "repo_name": "hipnusleo/laserjet", "id": "923568d4daf2ea6e7dbc24bb2cfba1afcb1e2567", "size": "952", "binary":...
from fabric.api import run, settings, env from cloudferrylib.base.action import action from cloudferrylib.utils import forward_agent from cloudferrylib.utils import utils as utl INSTANCES = 'instances' class ConvertFile(action.Action): def run(self, info=None, **kwargs): cfg = self.cloud.cloud_config.clo...
{ "content_hash": "d2ab2c7237e14596a4d2529314b1c60c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 75, "avg_line_length": 44.09090909090909, "alnum_prop": 0.6109965635738832, "repo_name": "japaniel/CloudFerry", "id": "f86582dd81b004c774f3dd8deb3a4a7a4f8853d1", "size": "1...
""" mistune ~~~~~~~ The fastest markdown parser in pure Python with renderer feature. :copyright: (c) 2014 - 2017 by Hsiaoming Yang. """ import re import inspect __version__ = '0.7.4' __author__ = 'Hsiaoming Yang <[email protected]>' __all__ = [ 'BlockGrammar', 'BlockLexer', 'InlineGrammar', 'I...
{ "content_hash": "39aec537b34808e5d5e7a4316542d2d5", "timestamp": "", "source": "github", "line_count": 1157, "max_line_length": 82, "avg_line_length": 30.60933448573898, "alnum_prop": 0.4996470422137512, "repo_name": "ammarkhann/FinalSeniorCode", "id": "ee09aff1774db8a4d82a1e9ff6d830c4b40d954a", "...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1beta1Ro...
{ "content_hash": "bd79355c51dad7decb089b9d6a45e7fb", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 272, "avg_line_length": 30.96875, "alnum_prop": 0.5797174571140262, "repo_name": "skuda/client-python", "id": "e294646514d7073ed90916e363962c69e0891c3e", "size": "5963", ...
from swgpy.object import * def create(kernel): result = Weapon() result.template = "object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_s11_gen1.iff" result.attribute_template_id = 10 result.stfName("weapon_name","sword_lightsaber_type11") #### BEGIN MODIFICATIONS #### #### END MODI...
{ "content_hash": "31f885dcd4c5fa2e01193dba4a912b20", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 108, "avg_line_length": 27.076923076923077, "alnum_prop": 0.71875, "repo_name": "anhstudios/swganh", "id": "cbf5d9ac799d5afb016e8066bcd5d946655cbcba", "size": "497", "bin...
from test_helper import failed, passed, get_file_output, test_is_not_empty def test_output(): output = get_file_output() answers = ["('a', 'apple')", "('b', 'banana')", "('c', 'cherry')", "('d', 'durian')", "('g', 'guava')", "('m', 'melon')"] if all(kv in output for kv in answers): ...
{ "content_hash": "6edff676eb5468965eda8e937c6efa78", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 74, "avg_line_length": 27.263157894736842, "alnum_prop": 0.5212355212355212, "repo_name": "iemejia/incubator-beam", "id": "7b37e800894f55bc1ffee1c3c73b15173f89025e", "size"...
from __future__ import unicode_literals from django.db import models from catalog.models import Product class CartItem(models.Model): """ Corresponds to one type of item in the Cart """ date_added = models.DateTimeField(auto_now_add=True) quantity = models.IntegerField(default=1) product = mod...
{ "content_hash": "75cfcd8fd8e25ec543cf28e61795d313", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 65, "avg_line_length": 32.84375, "alnum_prop": 0.6460513796384396, "repo_name": "meiordac/ecommerce", "id": "5ad7fb954ca13a90129836bb3df6f5d467c29511", "size": "1051", "b...
from abc import ABCMeta, abstractmethod class Preprocess: __metaclass__ = ABCMeta def __init__(self, parent_preprocess=None): self._parent_preprocess = parent_preprocess def __call__(self, dset): return self.apply_preprocess(dset) def apply_preprocess(self, dset): try: ...
{ "content_hash": "8397e5b6c59b9dd4425222d05050b55c", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 99, "avg_line_length": 34.674418604651166, "alnum_prop": 0.6586183769282361, "repo_name": "ASalvail/smartlearner", "id": "812d9b048b2e120af79500b6bcfb7280778838e4", "size":...
"""Tests for `strategy.reduce`.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized from tensorflow.python.distribute import combinations from tensorflow.python.distribute import reduce_util from tensorflow.python.dist...
{ "content_hash": "4eddb6f9bcde8516f3e8db60b0000d40", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 79, "avg_line_length": 31.157894736842106, "alnum_prop": 0.7331081081081081, "repo_name": "davidzchen/tensorflow", "id": "a87cce2f0b8f10ec03bccaee5a01f3885f641135", "size":...
"""main module for the interface""" import tkinter as tk import os from model.Request import Request from gui.GUIApplication import GUIApplication if __name__ == "__main__": app = GUIApplication(master=tk.Tk()) app.mainloop()
{ "content_hash": "49a9e3dd1aa3dc2fecf717c0836f72c8", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 45, "avg_line_length": 21.454545454545453, "alnum_prop": 0.711864406779661, "repo_name": "rmulton/lawen", "id": "2099bbc2758beecbcd35aec226636da66be9d67b", "size": "236", ...
from . import ExplorationTechnique import logging l = logging.getLogger("angr.exploration_techniques.explorer") class Explorer(ExplorationTechnique): """ Search for up to "num_find" paths that satisfy condition "find", avoiding condition "avoid". Stashes found paths into "find_stash' and avoided paths into "a...
{ "content_hash": "87c5255386bfa4106033128d494f87c2", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 193, "avg_line_length": 44.1953125, "alnum_prop": 0.5663779388368393, "repo_name": "Ruide/angr-dev", "id": "23420e838c9d774aba86dc69755ef5699212d6e2", "size": "5657", "b...
import unittest import re import xss RE_DOMXSS_SOURCES = re.compile(r'(location\s*[\[.])|([.\[]\s*["\']?\s*(arguments|dialogArguments|innerHTML|write(ln)?|open(Dialog)?|showModalDialog|cookie|URL|documentURI|baseURI|referrer|name|opener|parent|top|content|self|frames)\W)|(localStorage|sessionStorage|Database)') RE_DOM...
{ "content_hash": "65843176d40e3ecf800c551bee4cf8af", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 275, "avg_line_length": 51.5, "alnum_prop": 0.5589459084604715, "repo_name": "leapalazzolo/XSS", "id": "cec1c1c4231031ab883c7cf615b041a9480cd2e2", "size": "3649", "binary...
from RGT.XML.SVG.baseContainerNode import BaseContainerNode from types import StringType class BaseGlyph(BaseContainerNode): ATTRIBUTE_D = 'd' ATTRIBUTE_HORIZ_ADV_X = 'horiz-adv-x' ATTRIBUTE_VERT_ORIGIN_X = 'vert-origin-x' ATTRIBUTE_VERT_ORIGIN_Y = 'vert-origin-y' ATTRIBUTE_VERT_ADV_Y = '...
{ "content_hash": "773e25cd053e6866f9d6dd9867bcfd71", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 118, "avg_line_length": 38.917647058823526, "alnum_prop": 0.597037484885127, "repo_name": "danrg/RGT-tool", "id": "6f4ff2e0b6a557f9095593e93cef315e8e0c13e0", "size": "3308"...
import pymongo from sklearn.cluster import DBSCAN import matplotlib.pyplot as plt import numpy as np import os import urllib import matplotlib.cbook as cbook from sklearn.datasets.samples_generator import make_blobs from matplotlib.patches import Ellipse from copy import deepcopy __author__ = 'greghines' client = pymo...
{ "content_hash": "3fe44854b2fe351f30b76882c86e0704", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 153, "avg_line_length": 27.88888888888889, "alnum_prop": 0.650996015936255, "repo_name": "zooniverse/aggregation", "id": "d739c308c239093776a133e5acce0479ea96994f", "size":...
from __future__ import absolute_import import unittest from zope.interface._compat import PYTHON2 as PY2 from zope.interface.common import builtins from . import VerifyClassMixin from . import VerifyObjectMixin from . import add_verify_tests class TestVerifyClass(VerifyClassMixin, unittest.Te...
{ "content_hash": "a157bd705ff84354d9bd7c9a6edd092d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 49, "avg_line_length": 24.441176470588236, "alnum_prop": 0.6582430806257521, "repo_name": "kimjinyong/i2nsf-framework", "id": "1f0d33833e0df7f18c9d979ae1c5b12e6983375c", "s...
""" Machine arithmetics - determine the parameters of the floating-point arithmetic system Author: Pearu Peterson, September 2003 """ from __future__ import division, absolute_import, print_function __all__ = ['MachAr'] from numpy.core.fromnumeric import any from numpy.core.numeric import errstate # Need to speed...
{ "content_hash": "1adeb9ae80ce58956d9beb34c59bee9a", "timestamp": "", "source": "github", "line_count": 343, "max_line_length": 89, "avg_line_length": 31.580174927113703, "alnum_prop": 0.4943685376661743, "repo_name": "DailyActie/Surrogate-Model", "id": "96a210fe07a594f66c25ed2ca14387162c161434", "...
from translations.models import Translation def merge_dups(): done = [] count = 0 def get_dups(t): return Translation.objects.filter(de__iexact=t.de, en__iexact=t.en).exclude(id=t.id) def get_next(): qs = Translation.objects.exclude(id__in=done).order_by('created') if qs: ...
{ "content_hash": "9af0e8d160b8303a6dd23d02f04ca82f", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 92, "avg_line_length": 23.214285714285715, "alnum_prop": 0.5584615384615385, "repo_name": "placeB/translation-service", "id": "4d1a5b89f03659eea515a89be38974230b4ac83b", "s...
from typing import Any, Optional from cleo.styles import OutputStyle from sdoc.sdoc2 import in_scope, node_store, out_scope from sdoc.sdoc2.node.Node import Node class Formatter: """ Abstract parent class for all formatters for generating the output of nodes in a requested format. """ # -----------...
{ "content_hash": "eca2d914cf1d58a40f318ff42aadc78b", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 120, "avg_line_length": 33.96629213483146, "alnum_prop": 0.4608005292755541, "repo_name": "SDoc/py-sdoc", "id": "0d31640b37d0f64887d1d77cb26ab9459a635e18", "size": "3023", ...
import multiprocessing import Queue import signal import os import time from beaver.config import BeaverConfig from beaver.queue import run_queue from beaver.ssh_tunnel import create_ssh_tunnel from beaver.utils import setup_custom_logger, REOPEN_FILES from beaver.worker.worker import Worker def run(args=None): l...
{ "content_hash": "3ecd9cb7d139a7fe17d2a19400a3b480", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 120, "avg_line_length": 33.53846153846154, "alnum_prop": 0.5963302752293578, "repo_name": "moniker-dns/debian-beaver", "id": "93f76fb9e6ef30b74341e2c329d757566151403e", "si...
from optparse import OptionParser import os import sys import glob import numpy as np from collections import defaultdict from core.external import parse_tree from core.util import dirs from core.util import file_handling as fh from core.feature_extractors.vocabulary_with_counts import VocabWithCounts pronoun_list...
{ "content_hash": "783bb6ad0a84b82507a8867337d2c799", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 237, "avg_line_length": 41.301886792452834, "alnum_prop": 0.6299109182275011, "repo_name": "dallascard/guac", "id": "b118f462b8a8b5b296decbca2b04da75823938b7", "size": "17...
import pytest import uuid from mock import MagicMock, mock from polyaxon import settings from polyaxon.client import RunClient from polyaxon.lifecycle import V1Statuses from polyaxon.utils.test_utils import BaseTestCase @pytest.mark.client_mark class TestStatuses(BaseTestCase): @mock.patch("polyaxon_sdk.RunsV1A...
{ "content_hash": "39d6b8517ef986ff69d1a167e71e36b5", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 87, "avg_line_length": 38.464285714285715, "alnum_prop": 0.7019498607242339, "repo_name": "polyaxon/polyaxon", "id": "4506bb16bb52d9aceb6db074a274c83c332d94a1", "size": "16...
from dataclasses import dataclass, field from dataclasses_json import LetterCase, dataclass_json, config @dataclass_json @dataclass class CamelCasePerson: given_name: str = field( metadata={'dataclasses_json': { 'letter_case': LetterCase.CAMEL }} ) @dataclass_json @dataclass cla...
{ "content_hash": "8623ab068f611f699a054339b24589b0", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 78, "avg_line_length": 28.26605504587156, "alnum_prop": 0.6270691333982473, "repo_name": "lidatong/dataclasses-json", "id": "ccc1d45cbf34fd6cfcef67c32e1484f89b67f8f6", "si...
""" Enable wxPython to be used interacive by setting PyOS_InputHook. Authors: Robin Dunn, Brian Granger, Ondrej Certik """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The ...
{ "content_hash": "e0f1a391fb2c9c34051004ea34667e3b", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 81, "avg_line_length": 36.122699386503065, "alnum_prop": 0.5441576086956522, "repo_name": "sodafree/backend", "id": "1eff4cee77f98ee5ee6bbda16e85b186405cf7d0", "size": "59...
from django.contrib.auth import get_user_model from django.http import JsonResponse from django.shortcuts import get_object_or_404 from django.utils import timezone from oauth2_provider.contrib.rest_framework.authentication import OAuth2Authentication from oauth2_provider.contrib.rest_framework.permissions import Token...
{ "content_hash": "1adf7a8e177c3925889c1ff09551a990", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 120, "avg_line_length": 38.504950495049506, "alnum_prop": 0.7068655181280535, "repo_name": "davidjrichardson/uwcs-zarya", "id": "27cb2c7372e61bf0ffe385a833e0cac5093a71de", ...
import os import logging import argparse from math import log, floor from argparse import RawDescriptionHelpFormatter import matplotlib matplotlib.use('Agg') import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from secimtools.dataManager import l...
{ "content_hash": "6a8a1ea440125781a4246efb0f2f5def", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 98, "avg_line_length": 40.413919413919416, "alnum_prop": 0.6317411402157165, "repo_name": "secimTools/SECIMTools", "id": "639ee9e33dffbcfd1ffb12f4b6eab7ae89934e75", "size"...
from __future__ import unicode_literals import datetime import json import logging from urllib import urlencode from django.core.urlresolvers import reverse from django.http.response import JsonResponse, Http404 from django.shortcuts import render, redirect from django.template import loader from django.utils import ...
{ "content_hash": "939c34377b424f58c5336cccb7379afb", "timestamp": "", "source": "github", "line_count": 623, "max_line_length": 108, "avg_line_length": 37.45104333868379, "alnum_prop": 0.6299074232813303, "repo_name": "TomasTomecek/trello-reporter", "id": "d128179e988907f6581ee933717fd8b63f70b5f2", ...
"""Helpers to traverse the Dataset dependency structure.""" from six.moves import queue as Queue # pylint: disable=redefined-builtin from tensorflow.python.framework import dtypes OP_TYPES_ALLOWLIST = ["DummyIterationCounter"] # We allowlist all ops that produce variant tensors as output. This is a bit # of overkil...
{ "content_hash": "969c867cdd9579cecf8b3b50c8d1b81c", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 77, "avg_line_length": 31.388059701492537, "alnum_prop": 0.7213504517356157, "repo_name": "Intel-Corporation/tensorflow", "id": "41987bd2e348f480cfaeaa2167c037c98468d2fb", ...
import h5py import numpy as np import torch from collections import defaultdict, namedtuple, Mapping from glob import glob from torch.utils.data import Dataset import os class Invertible: def inv(self, y): raise NotImplemented('Subclasses of Invertible must implement an inv method') class DataTransform: ...
{ "content_hash": "e6b9e16f0ffdf545d59352f6ddb79a7a", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 107, "avg_line_length": 31.6968085106383, "alnum_prop": 0.5563013928511495, "repo_name": "atlab/attorch", "id": "74b36936ed45d2e5ff045c441ba427fa8139a051", "size": "5959",...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class GetConnectApp(Choreography): def __init__(self, temboo_session): """ Create a...
{ "content_hash": "68c6409fed96c2acb9e1cb095929bd3f", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 176, "avg_line_length": 41.67605633802817, "alnum_prop": 0.6998986143967557, "repo_name": "jordanemedlock/psychtruths", "id": "818418d8bd22e779fba9d492486f42e17a0cadec", "s...
__author__ = 'nlw' import argparse import logging import unittest import re from scigraph.api.SciGraph import SciGraph from scigraph.renderers.TabRenderer import * from scigraph.renderers.RawRenderer import * from scigraph.renderers.EntityAnnotationTabRenderer import * import wikipedia renderer = EntityAnnotationTab...
{ "content_hash": "c6f145de14b7cec175c06d618a3d1933", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 130, "avg_line_length": 28.955882352941178, "alnum_prop": 0.542915185373286, "repo_name": "SciGraph/py-SciGraph", "id": "af6e745fa3e8cae9f8a88825eba478617cb683c0", "size": ...
import re import imp import os.path import sys from datetime import datetime from datetime import timedelta from httplib import BadStatusLine from HTMLParser import HTMLParseError import logging import urllib2 from django.conf import settings from django.utils.importlib import import_module from django.contrib.conten...
{ "content_hash": "74f3d983c7c3759a5d00cae94d0e252c", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 137, "avg_line_length": 39.19602272727273, "alnum_prop": 0.5554105965064869, "repo_name": "glarrain/django-linkcheck", "id": "e50555a65ef8330806b48ba50e50367aff89e0fd", "s...
import json from decimal import Decimal from unittest.mock import Mock, patch import pytest from django.core.exceptions import ValidationError from django.utils import timezone from stripe.stripe_object import StripeObject from .....checkout.complete_checkout import complete_checkout from .....order.actions import or...
{ "content_hash": "a51e60a8ff69cc14f529594a8735b173", "timestamp": "", "source": "github", "line_count": 1469, "max_line_length": 88, "avg_line_length": 31.733151803948264, "alnum_prop": 0.6985369830101252, "repo_name": "mociepka/saleor", "id": "f06f5964650c27cb4eaef7cfa95b2b41309d2948", "size": "46...
from pprint import pprint import cgum.statement import cgum.program import bughunter.pool as pl prog = cgum.program.Program.from_source_file("replace-while-loop-body/after.c") pool = pl.DonorPool(prog, pl.StatementCriterion()) pprint(pool.contents())
{ "content_hash": "c84023ef53cc98823c5c9aec28870e16", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 79, "avg_line_length": 28.11111111111111, "alnum_prop": 0.7905138339920948, "repo_name": "ChrisTimperley/BugCollector", "id": "39f1a82c406c64552dfc77ca62e2f1aa100feb43", "si...
from baseframe import __ from baseframe.forms import Form, ValidName from baseframe.forms.sqlalchemy import AvailableName import wtforms import wtforms.fields.html5 __all__ = ['UserGroupForm'] class UserGroupForm(Form): name = wtforms.TextField(__("URL name"), validators=[wtforms.validators.Required(), ValidName...
{ "content_hash": "3a9c20ef26db7b935c4069bc434d3519", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 118, "avg_line_length": 42.142857142857146, "alnum_prop": 0.735593220338983, "repo_name": "jace/failconfunnel", "id": "d70f7d4425d381019e6e64a3212ed51c7b1393c9", "size": "6...
from __future__ import division, unicode_literals """ Created on Mar 8, 2012 """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "[email protected]" __date__ = "Mar 8, 2012" import unittest import os from nose.ex...
{ "content_hash": "acadbe28b14ff86fa5b53aa66e8d2d92", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 74, "avg_line_length": 29.037735849056602, "alnum_prop": 0.6270305393112411, "repo_name": "rousseab/pymatgen", "id": "ce7adcbf68157d230750d02a20534d4d7030647e", "size": "15...
"""Declarative container example.""" from dependency_injector import containers, providers class Container(containers.DeclarativeContainer): factory1 = providers.Factory(object) factory2 = providers.Factory(object) if __name__ == "__main__": container = Container() object1 = container.factory1()...
{ "content_hash": "722b33ecfc425eefb8ac7834e5ac5b87", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 66, "avg_line_length": 23.391304347826086, "alnum_prop": 0.671003717472119, "repo_name": "ets-labs/dependency_injector", "id": "21a43174441e58a461fdb4ff1226fbcde5990660", "...
""" Resource Filtering Logic """ from __future__ import absolute_import, division, print_function, unicode_literals from datetime import datetime, timedelta import fnmatch import logging import operator import re from dateutil.tz import tzutc from dateutil.parser import parse import jmespath import ipaddress import s...
{ "content_hash": "2a50cb0858e29bdc01495aed87c445c5", "timestamp": "", "source": "github", "line_count": 530, "max_line_length": 97, "avg_line_length": 31.983018867924528, "alnum_prop": 0.5561323815704088, "repo_name": "jdubs/cloud-custodian", "id": "78df6b2d489b569ec344a95f7c19a4647745a548", "size"...
""" The following abstract structures are used to build the Abstract Syntax Tree (AST). In general, there is no hierarchy between them. For example, an ArithmeticStructure can contain a CallStructure which at the same time contains another ArithmeticStructure. However, some of them could not be inside another structure...
{ "content_hash": "9fe97951b4f5e947ac03379c23ade2de", "timestamp": "", "source": "github", "line_count": 628, "max_line_length": 76, "avg_line_length": 24.75955414012739, "alnum_prop": 0.6058267412695351, "repo_name": "JamesPHoughton/pysd", "id": "e745318796ca479bdb9f42976f93a0b059fd398a", "size": "...
""" Created on Fri Jan 27 18:31:59 2017 @author: katsuya.ishiyama """ from numpy import random # Definition of module level constants SUCCESS_CODE = 1 FAILURE_CODE = 0 class Strategy(): def __init__(self, n): _success_probability = _generate_success_probability(n) _strategy = {i: p for i, p...
{ "content_hash": "5a83823dbb44f5e9b12178860887ea3b", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 85, "avg_line_length": 23.72289156626506, "alnum_prop": 0.6211274758760792, "repo_name": "Katsuya-Ishiyama/simulation", "id": "4d649a859859bd7d05bc7f4373330dcb6efbd5bb", "s...
ANSIBLE_METADATA = { 'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.0' } DOCUMENTATION = ''' --- module: bigip_facts short_description: Collect facts from F5 BIG-IP devices description: - Collect facts from F5 BIG-IP devices via iControl SOAP API version_added: "1.6" author: ...
{ "content_hash": "ba56ee73f1fba555c1891cb9e12a3022", "timestamp": "", "source": "github", "line_count": 1710, "max_line_length": 166, "avg_line_length": 35.79941520467836, "alnum_prop": 0.6694055572798405, "repo_name": "mcheo/ansible_f5", "id": "76269dc933020baebc58e4fb9941ae9cd248222a", "size": "6...
import logging from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS from pip._internal.operations.check import ( check_package_set, create_package_set_from_installed, ) from pip._internal.utils.misc import write_output from pip._internal.utils.typing impo...
{ "content_hash": "cc860721b48df18cd14e6ce4c6a9a0d3", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 72, "avg_line_length": 32.88235294117647, "alnum_prop": 0.616577221228384, "repo_name": "TeamSPoon/logicmoo_workspace", "id": "b557ca64113c8948b2144f3a6acbed93e9bf8424", "s...
from azure.identity import DefaultAzureCredential from azure.mgmt.apimanagement import ApiManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-apimanagement # USAGE python api_management_create_certificate_with_key_vault.py Before run the sample, please set the values...
{ "content_hash": "8e8397c31f5c32d79340a5734be18d55", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 165, "avg_line_length": 35.523809523809526, "alnum_prop": 0.685656836461126, "repo_name": "Azure/azure-sdk-for-python", "id": "1c781480b49e6d2b0b0511be30132076c151add5", "s...
import ConfigParser import pickle import os import glob import sys import hashlib def get_param(param, default=""): v = raw_input(param+" ["+default+"]: ") if v == "": return default return v if not (os.path.exists("FunBot.py") and os.path.exists("games")): print "Please run me from the directory with the FunBo...
{ "content_hash": "8c424f5424046c174ee5b66d6fed9438", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 150, "avg_line_length": 30.3109756097561, "alnum_prop": 0.6708911687789177, "repo_name": "tpwrules/FunBot", "id": "1ab8b01c5687df7eab728ffaeab2d2d2d2307acf", "size": "4971...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Calendar' db.create_table(u'calendar_calendar', ( (u'auditmodel_ptr', self.gf('django.db.models.fields.r...
{ "content_hash": "f21b78eee059123a2c2326607b612171", "timestamp": "", "source": "github", "line_count": 295, "max_line_length": 268, "avg_line_length": 82.30847457627118, "alnum_prop": 0.5679749598451465, "repo_name": "unomena/unobase", "id": "57808a02d5116fae0310001a13b9fc5d57670a3a", "size": "243...
from account import Account from accountteams import AccountTeams from accountuser import AccountUser from contact import Contact from contactlist import ContactList from emailmessage import EmailMessage from survey import Survey from surveycampaign import SurveyCampaign from surveyoption import SurveyOption from surve...
{ "content_hash": "f6a1d00f6f99c15eb206a40a0e49161f", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 43, "avg_line_length": 24.84375, "alnum_prop": 0.7723270440251573, "repo_name": "infoscout/SurveyGizmo", "id": "d30bed6090f0eeed6ad7c5f3845a02049d50e893", "size": "796", ...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages import codecs import os import re import sys here = os.path.abspath(os.path.dirname(__file...
{ "content_hash": "4d331509b43ab5e8b17bc531e8e275fd", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 125, "avg_line_length": 42.744360902255636, "alnum_prop": 0.6309586631486368, "repo_name": "matheuscas/django-tastypie-simple-api-doc", "id": "5153e082414e483b811bfcd33dabc5...
from azure.identity import DefaultAzureCredential from azure.mgmt.synapse import SynapseManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-synapse # USAGE python integration_runtime_nodes_update.py Before run the sample, please set the values of the client ID, tenan...
{ "content_hash": "289fd078a5bf11005b10647711dc74a1", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 150, "avg_line_length": 36.5, "alnum_prop": 0.7374429223744292, "repo_name": "Azure/azure-sdk-for-python", "id": "1f2fccf7edb7b62ea207c6b27c6825ec477b3919", "size": "1782",...
import bee from bee.segments import * import libcontext from libcontext.socketclasses import * from libcontext.pluginclasses import * from .matrix import matrix import Spyder matrix0 = matrix(Spyder.AxisSystem(), "AxisSystem") class spawn_actor_or_entity(bee.worker): actorclassname = antenna("pull", "id") ...
{ "content_hash": "1d13e83ee313f44d2f465ff2ceadb3f4", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 100, "avg_line_length": 31.71875, "alnum_prop": 0.6586206896551724, "repo_name": "agoose77/hivesystem", "id": "e56c6f4417afcb6af1932ce2290f281ea953172f", "size": "2030", ...
""" This file contains some utility functions for using ImageNet dataset and L-OBS Author: Chen Shangyu ([email protected]) """ import os import sys import time import math import torch import torch.nn as nn import torch.nn.init as init from torch.autograd import Variable import torch.backends.cudnn as cudnn imp...
{ "content_hash": "0d2f32a7a4502e6a9ff8dacd0d4deb7e", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 97, "avg_line_length": 27.791338582677167, "alnum_prop": 0.6821079473013175, "repo_name": "csyhhu/L-OBS", "id": "cf6fabaa6eabb0a4a608dbdbd8384fec7b09f6c1", "size": "7059",...
from __future__ import print_function import warnings import sys import traceback import inspect import pickle import numpy as np from scipy import sparse import struct from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_equal from skle...
{ "content_hash": "069ea26e23543ef8f4333063de4b39b3", "timestamp": "", "source": "github", "line_count": 980, "max_line_length": 81, "avg_line_length": 35.813265306122446, "alnum_prop": 0.6018748041143117, "repo_name": "Garrett-R/scikit-learn", "id": "acdf451648830f780d8325f2fb64c1ff45b96a74", "size...
from model.group import Group from timeit import timeit def test_group_list(app, db): print(timeit(lambda: app.group.get_group_list(), number=1)) def clean(group): return Group(id=group.id, name=group.name.strip()) print(timeit(lambda: map(clean, db.get_group_list()), number=1000)) assert Fals...
{ "content_hash": "33046f6881ccab70f9e70175ec6b38a9", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 95, "avg_line_length": 36.54545454545455, "alnum_prop": 0.6890547263681592, "repo_name": "sabinaczopik/python_training", "id": "ce6424b15ff1c2e1432af5342ddd985ef93dce61", "...
"""MIT License Copyright (c) 2017 Uka Osim Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
{ "content_hash": "04f76e9306a7f0afcd464ca3f2aa0283", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 90, "avg_line_length": 39.464285714285715, "alnum_prop": 0.7036199095022625, "repo_name": "osimuka/samplecode", "id": "69092b371b7638c72c9bcc1296208d7c756beda1", "size": "2...
"""Test error messages for 'getaddressinfo' and 'validateaddress' RPC commands.""" from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, assert_raises_rpc_error, ) BECH32_VALID = 'bcrt1qtmp74ayg7p24uslctssvjm06q5phz4yrxucgnv' BECH32_INVALID_BECH32 = 'b...
{ "content_hash": "3c4d1cd0f49c582b8df14a6f073e8a4e", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 124, "avg_line_length": 38.90425531914894, "alnum_prop": 0.7128794093519278, "repo_name": "prusnak/bitcoin", "id": "8f9b2c3312d654109b6084102ee8a3f48a85f867", "size": "3871...
import os import sublime from sublime_plugin import WindowCommand, TextCommand from ..git_command import GitCommand COMMIT_HELP_TEXT = """ ## To make a commit, type your commit message and press {key}-ENTER. To cancel ## the commit, close the window. To sign off the commit press {key}-S. ## You may also reference...
{ "content_hash": "9284e492af9e971b82af36c6279f0a70", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 87, "avg_line_length": 34.817460317460316, "alnum_prop": 0.6366537497150673, "repo_name": "ypersyntelykos/GitSavvy", "id": "b425b0b555b2df4e958693dc90b11477a5c9c77b", "siz...
from typing import Optional, List, Tuple, Sequence, Union, cast, TypeVar from typing import Iterator, overload import numpy import itertools from .. import registry from ..types import Xp, Shape, DTypes, DTypesInt, DTypesFloat, List2d, ArrayXd from ..types import Array3d, Floats1d, Floats2d, Floats3d, Floats4d from .....
{ "content_hash": "afbf687c05e0fa8c3bab20b267ed3e03", "timestamp": "", "source": "github", "line_count": 1154, "max_line_length": 88, "avg_line_length": 37.14471403812825, "alnum_prop": 0.5552082118278315, "repo_name": "spacy-io/thinc", "id": "c6d9f6b09acf047fffef7577849b8eb9467e493e", "size": "4286...
""" Utilitary functions do download and parse data from Orpha net """ from requests import post from bs4 import BeautifulSoup from biomart import BiomartServer from lxml import etree from collections import defaultdict def search_orphanet(keyword, search_type='Gen'): """ Returns the HTML of a Orphanet search. ...
{ "content_hash": "32f27dcd15f5b8893f16dac8a7b4b96e", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 184, "avg_line_length": 30.967032967032967, "alnum_prop": 0.6515259048970902, "repo_name": "osvaldoreisss/orpha-tools", "id": "ba69651c543e83e9ed9f2e905e6fa11f025aeda8", "s...
from __future__ import with_statement import errno import os import sqlite3 import time from contextlib import contextmanager class CacheLockedError(Exception): pass class CacheLocker(object): def __init__(self, lockfile, polltime=0.1): self.lockfile = lockfile self.polltime = polltime ...
{ "content_hash": "47eedc669a47a1d6751552d053b61a71", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 126, "avg_line_length": 29.102803738317757, "alnum_prop": 0.5507385998715478, "repo_name": "kaiCu/mapproxy", "id": "212a749e9f8b67d9bc499eb7ff779f201ae79e23", "size": "375...
import numpy as np class mlp: """ A Multi-Layer Perceptron""" def __init__(self,inputs,targets,nhidden,beta=1,momentum=0.9,outtype='logistic'): """ Constructor """ # Set up network size self.nin = np.shape(inputs)[1] self.nout = np.shape(targets)[1] self.ndata = np....
{ "content_hash": "ab2f2b9d6ceac8611c4113e70d3920aa", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 105, "avg_line_length": 38.53174603174603, "alnum_prop": 0.5631307929969104, "repo_name": "Anderson-Lab/anderson-lab.github.io", "id": "b1f24bef156c615c15b150dcafd052b3fd86c...
from image_effects import * import translations filename = "test" filename = "thames" filename = "pumpkin" filename = "me" myImg = ImageEffects(filename, True) #myImg.set_all_pixels([0xff, 0x88, 0x00, 0xff]) #myImg.pointillism(10, 3, 2) #(10, 0, 4) #myImg.pixelate(15) #myImg.blur(10) #myImg.greyscale() #myImg.colour...
{ "content_hash": "af0edbf831ef21ae911d72640a5bcaef", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 47, "avg_line_length": 20.782608695652176, "alnum_prop": 0.7217573221757322, "repo_name": "mft25/Images", "id": "0c64ee24d65c1aa4dae508d14f0d5ba1e519ac69", "size": "478", ...
"""Tests for checkpointing the _RebatchDataset.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized from tensorflow.python.data.experimental.ops import distribute from tensorflow.python.data.kernel_tests import checkpoi...
{ "content_hash": "a3d20130448ca01eb912620a48b188cf", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 75, "avg_line_length": 34.12765957446808, "alnum_prop": 0.7256857855361596, "repo_name": "annarev/tensorflow", "id": "1c50d80afa55ff9f2d5368fd237f915a55d494c9", "size": "22...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1alpha1R...
{ "content_hash": "52446fdcdcecbf691d886e9eb8130663", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 281, "avg_line_length": 31.215384615384615, "alnum_prop": 0.5850172498767866, "repo_name": "djkonro/client-python", "id": "da53e8f2ee54104bcee82ebca19e3a2350473931", "size...
import sys def get_class_by_path(name): parts = name.split('.') module = import_module('.'.join(parts[0:-1])) return getattr(import_module('.'.join(parts[0:-1])), parts[-1]) def create_list_of_imported_objects(classlist): return [get_class_by_path(name)() for name in classlist] def create_dict_of_...
{ "content_hash": "d9b9fc77e35404c5f72f5179712739e9", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 95, "avg_line_length": 31.581818181818182, "alnum_prop": 0.6229130685089235, "repo_name": "Glucksistemi/EGS-DSM", "id": "a091b4e3f3d400893481a66531b400d71ff8b011", "size": ...
from django.conf import settings from django.db import migrations from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps from mock import patch from zerver.lib.utils import make_safe_digest from zerver.lib.upload import upload_backend from zerver...
{ "content_hash": "02af2666a7b93948b4b083dddf322f9b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 93, "avg_line_length": 39.94871794871795, "alnum_prop": 0.7612323491655969, "repo_name": "Galexrt/zulip", "id": "4531a42f1921e8b9d90274f26c0b8b76febfa923", "size": "1583", ...
from registrasion.controllers.cart import CartController from registrasion.controllers.credit_note import CreditNoteController from registrasion.controllers.invoice import InvoiceController from registrasion.models import commerce from django.core.exceptions import ObjectDoesNotExist class TestingCartController(Cart...
{ "content_hash": "6237ba0368c718e03437347fe964031b", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 79, "avg_line_length": 32.285714285714285, "alnum_prop": 0.6529006882989183, "repo_name": "chrisjrn/registrasion", "id": "1684ea7563dd0c2801b707849dbdb9d3099ef9c9", "size":...
__copyright__ = "Copyright 2014, http://radical.rutgers.edu" __license__ = "MIT" __author__ = "Ole Weidner <[email protected]>" from md_task_description import MDTaskDescription, BoundMDTask
{ "content_hash": "63279ad034f0e4fdfe5135627ba429e0", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 62, "avg_line_length": 40.4, "alnum_prop": 0.7128712871287128, "repo_name": "radical-cybertools/radical.ensemblemd.mdkernels", "id": "4aba547be173898cd697a4813880b136117838fb"...
from __future__ import unicode_literals import datetime import math import os import re import tokenize import unittest import custom_migration_operations.more_operations import custom_migration_operations.operations from django.conf import settings from django.core.validators import EmailValidator, RegexValidator f...
{ "content_hash": "4005d38dcf82a851a6c0fddd099c3c7b", "timestamp": "", "source": "github", "line_count": 523, "max_line_length": 126, "avg_line_length": 42.7112810707457, "alnum_prop": 0.6256155430208613, "repo_name": "marqueedev/django", "id": "46531df791d762178afb6a01cc743d4ca1e51a9c", "size": "22...
from datetime import datetime from sqlalchemy_utils import IPAddressType, ChoiceType from app import db ROLE_USER = 0 ROLE_ADMIN = 1 projects_users = db.Table( 'project_user', db.Column('user_id', db.Integer, db.ForeignKey('user.id')), db.Column('project_id', db.Integer, db.ForeignKey('project.id')), ...
{ "content_hash": "a22d16fb081dfd06fc6ae25acd94f637", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 80, "avg_line_length": 30.255474452554743, "alnum_prop": 0.6185765983112184, "repo_name": "iniweb/deployCD", "id": "f4776de8f603fbe163e6ca089ad1cab334083f07", "size": "414...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0139_fill_last_message_id_in_subscription_logs'), ] operations = [ migrations.AddField( model_name='realm', name='send_welcome_emails', field=m...
{ "content_hash": "264f3d3a3205ce89a6f34132301c054f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 69, "avg_line_length": 23.1875, "alnum_prop": 0.5956873315363881, "repo_name": "showell/zulip", "id": "24276818ac95a553094e73129ee20441eec66dda", "size": "421", "binary":...
from sys import maxsize class Contact: def __init__(self, first_name=None, last_name=None, address=None, home_phone=None, mobile_phone=None, work_phone=None, secondary_phone=None, email=None, email2=None, email3=None, contact_id=None, all_phones_from_home_page=None, all_emails_fr...
{ "content_hash": "c8f06c3f7aca1504de24e263bcd8abc1", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 114, "avg_line_length": 43.114285714285714, "alnum_prop": 0.6182902584493042, "repo_name": "tkapriyan/python_training", "id": "05ee731d018336afd779a8dc28a78112231ebe0b", "s...
"""房间进入接口""" import clr, sys from action import * from lang import Lang from cardAILogic import CardAILogic clr.AddReference('ZyGames.Framework.Game') clr.AddReference('ZyGames.Doudizhu.Lang') clr.AddReference('ZyGames.Doudizhu.Model') clr.AddReference('ZyGames.Doudizhu.Bll') from System.Collections.Generic i...
{ "content_hash": "4874d01af390a120dba600a4c83750d0", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 115, "avg_line_length": 34.19047619047619, "alnum_prop": 0.6685236768802229, "repo_name": "wenhulove333/ScutServer", "id": "7c9d357412a1e5e80583e31ecb48acfa45fea578", "size...
"""Blink IDL Intermediate Representation (IR) classes. Classes are primarily constructors, which build an IdlDefinitions object (and various contained objects) from an AST (produced by blink_idl_parser). This is in two steps: * Constructors walk the AST, creating objects. * Typedef resolution. Typedefs are all resol...
{ "content_hash": "e67984db7cfd42c81f73bdb3d6ab17f4", "timestamp": "", "source": "github", "line_count": 796, "max_line_length": 158, "avg_line_length": 41.89698492462311, "alnum_prop": 0.5886056971514243, "repo_name": "Fusion-Rom/android_external_chromium_org_third_party_WebKit", "id": "ee7158ab663cd...