text
stringlengths
4
1.02M
meta
dict
import math class ConsistencyProcessor: def __init__(self, candPos, levelNumber): self.name = 'Consistency processor' self.candPos = candPos self.candNumber = len(self.candPos) self.levelNumber = levelNumber def updateLevelData(self, level, candStatus, gamma): fL = ...
{ "content_hash": "41c2c2a7a1b9743cfe935b23bdc6a8ad", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 135, "avg_line_length": 47.528301886792455, "alnum_prop": 0.43985708614529573, "repo_name": "Edgar324/GeoVis", "id": "a470e9d90db1190379d621c7c8fa32e9fa4c6721", "size": "25...
from typing import Optional, Tuple, Union from hwt.interfaces.std import Signal, Rst, Rst_n, Clk from hwtLib.handshaked.fifo import HandshakedFifo from hwtLib.mem.fifoDrop import FifoDrop class HandshakedFifoDrop(HandshakedFifo): """ Fifo for handsahaked interface which allows to discard/commit written data ...
{ "content_hash": "be7c759de88bac8b7220eacd16771de1", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 78, "avg_line_length": 28.782608695652176, "alnum_prop": 0.6669184290030211, "repo_name": "Nic30/hwtLib", "id": "81c8e3c7e1d4920c2b8296e759589d985cea4b4c", "size": "1324", ...
"""Main project script.""" import logging import os import sys import time from selenium.common.exceptions import TimeoutException # necessary to import from parent directory in non-PyCharm environment sys.path.append('..') import penguin penguin.STATIC_RESOURCE_PATH = '../static' logger = logging.getLogger(__name...
{ "content_hash": "d4033b500240ac3933e8be669afc49da", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 117, "avg_line_length": 36.802083333333336, "alnum_prop": 0.6453439003679592, "repo_name": "tylerjohnhaden/penguin-website-colors", "id": "2550b51199eb5b418c438c325f6d367c635...
"""Services for Fritz integration.""" from __future__ import annotations import logging import voluptuous as vol from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.servi...
{ "content_hash": "c20d69b5391961f0699cd084bc39a26b", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 101, "avg_line_length": 31.455445544554454, "alnum_prop": 0.6436890147938307, "repo_name": "rohitranjan1991/home-assistant", "id": "c4e7de8df5e8d47fdc737b669301c6b1566f6907"...
from __future__ import print_function import unittest import numpy from nose.plugins.skip import SkipTest from six.moves import xrange import theano from theano import config from theano import tensor as T from theano import tensor from theano import gof from theano.tests import unittest_tools as utt from theano impo...
{ "content_hash": "51da60669811ef90793b2e4048aef671", "timestamp": "", "source": "github", "line_count": 1686, "max_line_length": 97, "avg_line_length": 37.80723606168446, "alnum_prop": 0.5438557959305336, "repo_name": "marcsans/cnn-physics-perception", "id": "50242cdee99d8ab09a0a538f4671f4fb7cbe2b7f"...
"""Tests module.""" from unittest import mock import pytest from github import Github from flask import url_for from .application import create_app @pytest.fixture def app(): app = create_app() yield app app.container.unwire() def test_index(client, app): github_client_mock = mock.Mock(spec=Githu...
{ "content_hash": "5f587e565e1e9d7fed16c6f35d5f4366", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 66, "avg_line_length": 28.95774647887324, "alnum_prop": 0.6215953307392996, "repo_name": "rmk135/dependency_injector", "id": "b00eeeb5c01923b76ec5e3c2f69580a92ff64df2", "si...
"""Admin classes for the server_guardian app.""" from django.contrib import admin from . import models class ServerAdmin(admin.ModelAdmin): """Custom admin for the ``Server`` model.""" list_display = ('name', 'url') fields = ('name', 'url', 'token') search_fields = ['name'] class ServerLogAdmin(adm...
{ "content_hash": "d7e830e9dacf46a6cc6b46fd2f67e3f1", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 68, "avg_line_length": 29.80952380952381, "alnum_prop": 0.6773162939297125, "repo_name": "bitmazk/django-server-guardian", "id": "319e66a6c8d45d48ed1af17ddfe15336d812adda", ...
""" Post process revisions so that Postgres properly understands backslashes. Usage: revisions_postgres_post_process (-h|--help) revisions_postgres_post_process <input> --revisions-output=<location> [--debug] [--verbose] Options: -h, --help T...
{ "content_hash": "18f0e463fd42d60e5741cfe806d63adf", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 73, "avg_line_length": 26.231884057971016, "alnum_prop": 0.5828729281767956, "repo_name": "hall1467/wikidata_usage_tracking", "id": "6a4c747c82b73b45609c01445dd859d3e7f62239"...
def select_rand_item(dict): import random return random.choice(list(dict.keys())) #bool function for checking if word terminates a statement def isterminal(word): return word[len(word)-1] == '.' or word[len(word)-1] == '?' or word[len(word)-1] == '!' #gets a random statement from a trie def random_stateme...
{ "content_hash": "391f23185b3143cb4914c94aa043bb19", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 91, "avg_line_length": 23.142857142857142, "alnum_prop": 0.5941358024691358, "repo_name": "jweinst1/SquidWord", "id": "4dbfc0a4a996d704c4de5ec4c61247862a6e2439", "size": "7...
import os from crosspm.helpers.python import get_object_from_string def test_get_object_from_string(): obj_ = get_object_from_string('os.path') assert os.path is obj_
{ "content_hash": "6921e9b10bba2908f8bac76e7fe1148b", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 57, "avg_line_length": 22.25, "alnum_prop": 0.7191011235955056, "repo_name": "devopshq/crosspm", "id": "1ac9596d88ac26d2915b62ed8d578cef1375d09b", "size": "202", "binary":...
''' BackdoorFactory (BDF) v2 - Tertium Quid Many thanks to Ryan O'Neill --ryan 'at' codeslum <d ot> org-- Without him, I would still be trying to do stupid things with the elf format. Also thanks to Silvio Cesare with his 1998 paper (http://vxheaven.org/lib/vsc01.html) which these ELF patching techniques are based on...
{ "content_hash": "2f027b3cefc3cd7aab4ce023066f722d", "timestamp": "", "source": "github", "line_count": 493, "max_line_length": 110, "avg_line_length": 48.66937119675456, "alnum_prop": 0.40201717095940653, "repo_name": "0x0mar/the-backdoor-factory", "id": "9b830c8891aaf9bc29eab31c661a55de05b717e8", ...
"""This script is used to synthesize generated parts of this library.""" import synthtool.languages.node as node node.owlbot_main(templates_excludes=['.github/bug-report.md'])
{ "content_hash": "499a7dd0cd813afd800b46a964d7870e", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 72, "avg_line_length": 35.6, "alnum_prop": 0.7696629213483146, "repo_name": "googleapis/nodejs-bigquery", "id": "02cd29578ab9b7d4c892a5ed96c260b988db231b", "size": "753", ...
from neutron.common import exceptions class TagValidationError(Exception): def __init__(self, value, message): self.value = value self.message = message class Tag(object): @classmethod def get_name(cls): """API name of the tag.""" if not hasattr(cls, 'NAME'): ...
{ "content_hash": "7d0c4b5130080a3dc06ea081b777c8d1", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 78, "avg_line_length": 28, "alnum_prop": 0.5031055900621118, "repo_name": "asadoughi/quark", "id": "d1d959be8d9f1fa692dcbde207848fa66b171b76", "size": "5133", "binary": ...
import sys sys.path.insert(0, "../..") if sys.version_info[0] >= 3: raw_input = input import logging logging.basicConfig( level=logging.INFO, filename="parselog.txt", filemode="w" ) log = logging.getLogger() import basiclex import basparse import basinterp # If a filename has been specified, we try ...
{ "content_hash": "09f086bc3428024b3b002a6b1d9e9dd1", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 63, "avg_line_length": 23.285714285714285, "alnum_prop": 0.5901840490797546, "repo_name": "todaychi/hue", "id": "9dcc7feda692e5b5a6df3a99dd2f82be34838179", "size": "1679", ...
from openstack_dashboard.test import helpers from bgpvpn_dashboard.test.test_data import utils class TestCase(helpers.TestCase): def _setup_test_data(self): super(TestCase, self)._setup_test_data() utils.load_test_data(self) class APITestCase(helpers.APITestCase): def _setup_test_data(sel...
{ "content_hash": "c8be05ca7e0903dedb8daf22a8d0a6a7", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 51, "avg_line_length": 24.176470588235293, "alnum_prop": 0.7007299270072993, "repo_name": "openstack/networking-bgpvpn", "id": "f3cfa374fc7a8e97d6aca4516eba215fd676f70a", "...
""" Unified interfaces to minimization algorithms. Functions --------- - minimize : minimization of a function of several variables. - minimize_scalar : minimization of a function of one variable. """ from __future__ import division, print_function, absolute_import __all__ = ['minimize', 'minimize_scalar'] from warn...
{ "content_hash": "3835d3762330648885cb99a8235d31aa", "timestamp": "", "source": "github", "line_count": 616, "max_line_length": 89, "avg_line_length": 42.910714285714285, "alnum_prop": 0.6386713577724814, "repo_name": "DailyActie/Surrogate-Model", "id": "622c32eaa7231178c68c4803410582e04cf97089", "...
import ast import time from heatclient import client as heat_client from heatclient import exc as heat_exc from neutron.common import log from neutron.db import model_base from neutron import manager from neutron.openstack.common import jsonutils from neutron.openstack.common import log as logging from neutron.plugins...
{ "content_hash": "38439522e5564ff6802eca17ef7c7e07", "timestamp": "", "source": "github", "line_count": 436, "max_line_length": 79, "avg_line_length": 39.97935779816514, "alnum_prop": 0.5768458493488612, "repo_name": "oneconvergence/group-based-policy", "id": "1ba54d352fd3c702e8c61ba11b07b8bab9f904dc...
SCOPE = 'https://www.googleapis.com/auth/calendar' USER_AGENT = 'GoogleCalendarDisplay/1.0' CLIENT_ID = '' CLIENT_SECRET = '' DEVELOPER_KEY = '' CALENDAR = '' TIMEZONE = ''
{ "content_hash": "a9c6b3ae6090a7e6b56bbb6c694bdcbc", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 50, "avg_line_length": 21.75, "alnum_prop": 0.6781609195402298, "repo_name": "barneyman/gcalMeetingRoom", "id": "b456935e6b7e63577aba69850341f271ce199911", "size": "174", ...
from distutils.core import setup setup( name = 'clavin', packages = ['clavin'], version = '0.7', description = 'A python wrapper for CLAVIN, a Java engine originally built by Berico Technologies', author = 'Daniel J. Dufour', author_email = 'daniel.j.dufour@gmail.com', url = 'https://github.com/danieljdu...
{ "content_hash": "093833c7a14a1f9abf6d7bf2ccf0feaa", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 101, "avg_line_length": 33.357142857142854, "alnum_prop": 0.6916488222698073, "repo_name": "DanielJDufour/clavin-python", "id": "15db8d46f5f4f07fcaf1a4a414d6554967285bfc", ...
import elementtree.ElementTree as ET from basecamp import Basecamp bc = Basecamp('https://example.basecamphq.com', 'API_KEY') # or # bc = Basecamp('https://example.basecamphq.com', 'user', 'password') # Fetch one todo list from its ID xml = bc.todo_list(14499317) items = ET.fromstring(xml).findall('todo-items/todo-i...
{ "content_hash": "a90f74291bf8dfccc2ec9eea89884c81", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 69, "avg_line_length": 32.142857142857146, "alnum_prop": 0.7333333333333333, "repo_name": "qpleple/basecamp-python-client", "id": "310f05307872a0815279b87278dbd9a6405dc216", ...
import os, httplib, json, unittest, uuid, md5 from cStringIO import StringIO from file_generator import FileGenerator from boto.exception import S3ResponseError from boto.s3.connection import S3Connection, OrdinaryCallingFormat from boto.s3.key import Key from boto.utils import compute_md5 import boto def setup_aut...
{ "content_hash": "72cd11b5c652fa19653740b32cab507a", "timestamp": "", "source": "github", "line_count": 862, "max_line_length": 226, "avg_line_length": 40.98259860788863, "alnum_prop": 0.5997678829224106, "repo_name": "yangchengjian/riak_cs", "id": "5b43194c043cb250900718f58877f39f626af41d", "size"...
from swift.common.swob import Request, HTTPException, HTTPForbidden from swift.common.middleware.crypto import decrypter from swift.common.request_helpers import get_container_update_override_key from swift.common.utils import config_true_value from swift.proxy.controllers.base import get_object_info class DecrypterO...
{ "content_hash": "69b1d4df0898c6cb8914cc362914f518", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 79, "avg_line_length": 45.12, "alnum_prop": 0.5966312056737588, "repo_name": "open-io/oio-swift", "id": "9bd49b54dcde1d08bdef6a4699abecea9b716c61", "size": "6272", "bina...
from __future__ import with_statement from fabric.api import * from fabric.context_managers import shell_env env.user = 'django' env.hosts = ['insomn.io'] def deploy(): code_dir = '/home/django/RSVPBot' with cd(code_dir): run('git pull') run('pip install -r requirements.txt') run('sudo service rsvp restart')
{ "content_hash": "a3c891f914795f844ff2aacf331c598c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 45, "avg_line_length": 24.53846153846154, "alnum_prop": 0.7084639498432602, "repo_name": "kokeshii/RSVPBot", "id": "caf73fe03521287eb58ac2cb1efdb324cf06cbda", "size": "319"...
""" Django settings for group_meeting project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ....
{ "content_hash": "bbcc89f41527d3c5ccf42400c7141fac", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 71, "avg_line_length": 25.40625, "alnum_prop": 0.7158671586715867, "repo_name": "scavedo159/group_meeting", "id": "7c51a114035c5f8fb66d7044fbf3bad9efe2142f", "size": "3252...
"""High-level utilities for manipulating image files associated with music and items' embedded album art. """ from __future__ import division, absolute_import, print_function import subprocess import platform from tempfile import NamedTemporaryFile import imghdr import os from beets.util import displayable_path, sys...
{ "content_hash": "f73ed04b0499212292fcf0b2bdfffe7f", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 77, "avg_line_length": 32.13513513513514, "alnum_prop": 0.5962994112699748, "repo_name": "Freso/beets", "id": "7a65a2b806efc938720026124634b5031a4dca98", "size": "6616", ...
import collections import uuid from datetime import datetime, timedelta import OpenSSL import swapper from django.core.exceptions import ValidationError from django.db import models from django.utils import timezone from django.utils.functional import cached_property from django.utils.safestring import mark_safe from ...
{ "content_hash": "bc75f52fa6c1fe079017bbcbdc936324", "timestamp": "", "source": "github", "line_count": 569, "max_line_length": 87, "avg_line_length": 33.96485061511424, "alnum_prop": 0.5813929421504709, "repo_name": "openwisp/django-x509", "id": "b9dc05f8dbf3d89a4933a0b2fbbaceac3a36235c", "size": ...
try: from shutil import which except ImportError: raise ValueError("The current version of Python doesn't support the" "function 'which', normally located in shutil") __author__ = "Nicholas C. Pandolfi" __copyright__ = "Copyright (c) 2016 Nicholas C. Pandolfi" __credits__ = "Stack Excha...
{ "content_hash": "6d8b033d1dd86df3362446432cec49e2", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 72, "avg_line_length": 22.61111111111111, "alnum_prop": 0.6461916461916462, "repo_name": "nickpandolfi/Cyther", "id": "02a82116ce5c653e8e1aa6d636ae0b3b17de524b", "size": "5...
from unittest import TestCase from mock import Mock from rapid.workflow.queue_handlers.container_handlers.container_handler import ContainerHandler class TestContainerHandler(TestCase): def setUp(self): self.container_handler = TestingContainerHandler(Mock()) def test_get_grain_type_split_non_split...
{ "content_hash": "587924fa9ef83012ca453678479535ad", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 113, "avg_line_length": 36.29545454545455, "alnum_prop": 0.7188478396994364, "repo_name": "BambooHR/rapid", "id": "d006fc2d23fec8cf1bbb46baedb754219995ae9a", "size": "1597"...
""" Create high-resolution head surfaces for coordinate alignment. example usage: mne make_scalp_surfaces --overwrite --subject sample """ from __future__ import print_function import os import os.path as op import sys import mne if __name__ == '__main__': from mne.commands.utils import get_optparser parser...
{ "content_hash": "b91f8f3238d5ac61b1a706874a8daca2", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 78, "avg_line_length": 36.048780487804876, "alnum_prop": 0.5757780784844384, "repo_name": "jaeilepp/eggie", "id": "a1a18ffcfd328fac3b89fdc129444d84cb0103fb", "size": "4679...
from Unix import Unix # class Android class Android(Unix): # ctor def __init__(self): Unix.__init__(self)
{ "content_hash": "f27c20e7c4e1ff6a8ba652b2da341018", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 21, "avg_line_length": 15.714285714285714, "alnum_prop": 0.6636363636363637, "repo_name": "dmsovetov/pygling", "id": "b10c5d9c4a5ed444b80e1a11c5e693fc16e6ea2f", "size": "142...
import uuid from tempest.api.identity import base from tempest.common.utils import data_utils from tempest import exceptions from tempest import test class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): _interface = 'json' @classmethod def setUpClass(cls): super(UsersNegativeTestJSON, cls)...
{ "content_hash": "92545f90691b16e38336933fe5958c40", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 77, "avg_line_length": 44.908256880733944, "alnum_prop": 0.6171603677221654, "repo_name": "cloudbase/lis-tempest", "id": "a584a7b8bba4a59e102f9c9902741db0bdfe806a", "size"...
import ssl from airflow import configuration from airflow.exceptions import AirflowConfigException, AirflowException from airflow.utils.log.logging_mixin import LoggingMixin def _broker_supports_visibility_timeout(url): return url.startswith("redis://") or url.startswith("sqs://") log = LoggingMixin().log bro...
{ "content_hash": "e8a87bb24fe733b1567a11d71a0f0a15", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 90, "avg_line_length": 43.19672131147541, "alnum_prop": 0.6717267552182163, "repo_name": "andyxhadji/incubator-airflow", "id": "d44f2b3448afff4e1555ab5ed2728671a835106b", "...
"""A handler that displays task information for a single queue.""" import datetime import urllib from google.appengine.api import apiproxy_stub_map from google.appengine.api.taskqueue import taskqueue_service_pb from google.appengine.api.taskqueue import taskqueue_stub from google.appengine.tools.devappserver2.adm...
{ "content_hash": "ded69a5ec09ffe69cdfb5bd7109bb89f", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 77, "avg_line_length": 36.955357142857146, "alnum_prop": 0.6267214302971732, "repo_name": "GoogleCloudPlatform/python-compat-runtime", "id": "ea5f11af297b43365ee45ae39a7ad56...
import numpy from chainer import function_node from chainer.utils.conv import col2im_cpu from chainer.utils.conv import col2im_gpu from chainer.utils.conv import im2col_cpu from chainer.utils.conv import im2col_gpu from chainer.utils import type_check def _pair(x): if hasattr(x, '__getitem__'): return x ...
{ "content_hash": "81b42a0cd8b311ef3c99c9966ede4ce4", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 79, "avg_line_length": 33.91975308641975, "alnum_prop": 0.5670609645131938, "repo_name": "wkentaro/chainer", "id": "0f70f81914bd7adbfc285eab7168a3865748765a", "size": "549...
import pychrono.core as chrono import pychrono.sensor as sens import math import time def main(): # ----------------- # Create the system # ----------------- mphysicalSystem = chrono.ChSystemNSC() # ----------------------------------- # add a mesh to be sensed by a camera # -------------...
{ "content_hash": "60b201dd928a606d688f573b1dc325a4", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 119, "avg_line_length": 33.87373737373738, "alnum_prop": 0.6183092291635605, "repo_name": "projectchrono/chrono", "id": "38394a3fe06b25af569c4f4cae3f73a5326bac7f", "size":...
"""Compute a statistic of many traces.""" from abc import ABC, abstractmethod import numpy as np class AbstractTraceStatistic(ABC): """Base class to compute a statistic over many traces. Example use: trace_stats = ChildClass() for e in ExampleIterator(ds_path): trace_stats.update(e['t...
{ "content_hash": "ad6d88aa8c5439eb6c53d3bc530eb499", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 58, "avg_line_length": 23.838709677419356, "alnum_prop": 0.618403247631935, "repo_name": "google/scaaml", "id": "cdda994df89a09b131a137c8d5f850fbb637cbfc", "size": "1314", ...
"""Script to parse MAF file """ from bigquery_etl.utils.gcutils import read_mysql_query import sys import json import re from pandas import ExcelWriter writer = ExcelWriter('maf.xlsx') def identify_data(config): """Gets the metadata info from database """ # cloudSql connection params host = config['cl...
{ "content_hash": "46dcb3c546e8cbca2007e466c6bef86a", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 223, "avg_line_length": 40.43589743589744, "alnum_prop": 0.6433100824350032, "repo_name": "isb-cgc/ISB-CGC-data-proc", "id": "88e8fe1549f7ea49a07c35c008577801a0bb2000", "si...
from __future__ import absolute_import import cython cython.declare(PyrexTypes=object, ExprNodes=object, Nodes=object, Builtin=object, InternalError=object, error=object, warning=object, py_object_type=object, unspecified_type=object, object_expr=object, fake_rhs_expr=objec...
{ "content_hash": "024fa5833f6f742977f109e3a852dde3", "timestamp": "", "source": "github", "line_count": 1321, "max_line_length": 107, "avg_line_length": 34.68054504163513, "alnum_prop": 0.5594481915613472, "repo_name": "c-blake/cython", "id": "b859e1bc06e9a1089e1391c0778412abb24092dc", "size": "458...
#The MIT License (MIT) #Copyright (c) 2014 Microsoft Corporation #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, mod...
{ "content_hash": "19041c0e9921c54cc99ffb9fbbcfc6fc", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 163, "avg_line_length": 40.732283464566926, "alnum_prop": 0.6584187125459114, "repo_name": "rnagpal/azure-documentdb-python", "id": "82c3e28b06e067c298f46401d1daa92bf35ff3f3...
import fixtures import itertools import os import requests import sys from unittest import mock from kolla.cmd import build as build_cmd from kolla import exception from kolla.image import build from kolla.tests import base FAKE_IMAGE = build.Image( 'image-base', 'image-base:latest', '/fake/path', parent_nam...
{ "content_hash": "cf2b15bdacb67a104c77e3d51778d887", "timestamp": "", "source": "github", "line_count": 700, "max_line_length": 79, "avg_line_length": 40.925714285714285, "alnum_prop": 0.6146676905892209, "repo_name": "stackforge/kolla", "id": "10d70ce5a84916a040a1f3c6a4dd7d5bea08dbca", "size": "29...
from intranet3 import models class FactoryMixin(object): # Current state of counter cid = 1 # Client uid = 1 # User pid = 1 # Project tid = 1 # Tracker def create_user( self, name="", domain="stxnext.pl", groups=[], **kwargs ): username ...
{ "content_hash": "21976867e5a5f670b8c1c70a28471e71", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 68, "avg_line_length": 26.043478260869566, "alnum_prop": 0.48981636060100164, "repo_name": "stxnext/intranet-open", "id": "f758077e4bdd541042768d7c9e0dc04a34aeeac5", "size...
from __future__ import absolute_import, print_function, unicode_literals from aldryn_apphooks_config.models import AppHookConfig from aldryn_apphooks_config.utils import setup_config from app_data import AppDataForm from django import forms from django.db import models from django.utils.translation import ugettext_laz...
{ "content_hash": "7a2e291aa7102e09ac21e2c1cadc4e76", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 72, "avg_line_length": 33.214285714285715, "alnum_prop": 0.7989247311827957, "repo_name": "Venturi/oldcms", "id": "b11eb075c2b16edd7e9c690a52e130b9f8f53836", "size": "954",...
""" RadioX Copyright 2012 - Rob Cakebread <cakebread@gmail.com> License: BSD git://github.com/cakebread/radiox.git RadioX is an internet radio station broadcasting Icecast2 or Shoutcast. The goal of the RadioX project is to make an easily deployable, fully featured internet radio station with live on...
{ "content_hash": "ad978907622f236c14de122665be1825", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 98, "avg_line_length": 39.59848484848485, "alnum_prop": 0.6176583126076143, "repo_name": "cakebread/radiox", "id": "c12cf3871ff74505d28267d398e0600f040a581c", "size": "104...
import sys, os, yaml, glob, shutil from datetime import datetime def fixProjName(pname): newname = pname[0].upper() postperiod = False for i in range(1, len(pname)): if pname[i] == ".": newname += pname[i] postperiod = True elif postperiod: newname += p...
{ "content_hash": "4fcf2350c1e90a18b7990cee0ea823e7", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 144, "avg_line_length": 37.371308016877634, "alnum_prop": 0.5502991983741673, "repo_name": "kate-v-stepanova/scilifelab", "id": "ed33692156b57f4b61d73316c28ff121294125ac", ...
import json import os from cloudify.context import BootstrapContext from cloudify.mocks import MockCloudifyContext RETRY_AFTER = 1 # Time during which no retry could possibly happen. NO_POSSIBLE_RETRY_TIME = RETRY_AFTER / 2.0 BOOTSTRAP_CONTEXTS_WITHOUT_PREFIX = ( { }, { 'resources_prefix': '' ...
{ "content_hash": "0487a192f3eb0e80b3a0815b168c270d", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 76, "avg_line_length": 25.325, "alnum_prop": 0.684106614017769, "repo_name": "GigaSpaces-ProfessionalServices/cloudify-openstack-plugin", "id": "13099292cac9bd119db4c4d68d73c...
from django.core.exceptions import ImproperlyConfigured from django.core.mail import EmailMessage from django.template import TemplateDoesNotExist from django.test import TestCase from mail_utils import TemplateMixin class TemplatelessMessage(TemplateMixin, EmailMessage): template_name = None class Message(Tem...
{ "content_hash": "3504448207bd5d3d3d27e370f58ec16a", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 78, "avg_line_length": 37.36363636363637, "alnum_prop": 0.7031630170316302, "repo_name": "koorgoo/django-mail-utils", "id": "6475f32e7c243247e3cb2799dd21197eb479ee5a", "siz...
import os import marshal import cPickle import array class HuffmanNode(object): recurPrint = False def __init__(self, ch=None, fq=None, lnode=None, rnode=None, parent=None): self.L = lnode self.R = rnode self.p = parent self.c = ch self.fq = fq def __repr__(self): ...
{ "content_hash": "9d698f9f7d8eb7b0b0cdf90a0bf47fc2", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 84, "avg_line_length": 31.07766990291262, "alnum_prop": 0.5292096219931272, "repo_name": "fepe55/RAMB0", "id": "81437c039dfb3f20319a4b2896ec69b86b1527f8", "size": "6447", ...
import builtins import os import tempfile import unittest from mock import patch, sentinel # noqa from pylancard import cli from pylancard import store from pylancard import trainer from pylancard.plugins import base as plugins_base from pylancard.plugins import cz as lang_cz class FakeStore(store.Store): def...
{ "content_hash": "2a1f3161c7209c8226968f84ca5f3f19", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 76, "avg_line_length": 39.03252032520325, "alnum_prop": 0.6435117683815872, "repo_name": "dtantsur/pylancard", "id": "0df01a3bdd7e4a842da9545a40e7e2c428e63b6f", "size": "9...
import unittest import warnings from functools import partial from unittest import mock from scrapy.utils.misc import is_generator_with_return_value, warn_on_generator_with_return_value def _indentation_error(*args, **kwargs): raise IndentationError() def top_level_return_something(): """ docstring """...
{ "content_hash": "10052caf313c960dae9923562d29f99b", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 111, "avg_line_length": 30.852272727272727, "alnum_prop": 0.5760589318600369, "repo_name": "scrapy/scrapy", "id": "562f72fee8bf33dabec0fa1f468d99b8dfd25ccb", "size": "8145...
import numpy as np from scipy._lib.decorator import decorator as _decorator __all__ = ['delaunay_plot_2d', 'convex_hull_plot_2d', 'voronoi_plot_2d'] @_decorator def _held_figure(func, obj, ax=None, **kw): import matplotlib.pyplot as plt # type: ignore[import] if ax is None: fig = plt.figure() ...
{ "content_hash": "c429e28a68ffe1099aff03e3ff719f3e", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 77, "avg_line_length": 26.553435114503817, "alnum_prop": 0.5755354319390542, "repo_name": "person142/scipy", "id": "dfdcec86da3daf949fd3a7c80d657fa29a960134", "size": "695...
def return_slice_of_data(arr, start_idx, end_idx): return arr[start_idx:end_idx] def print_filename_and_raise(arr): from joblib._memmapping_reducer import _get_backing_memmap print(_get_backing_memmap(arr).filename) raise ValueError
{ "content_hash": "a7d09f8b39310e5362c827173feb9672", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 62, "avg_line_length": 31.375, "alnum_prop": 0.7290836653386454, "repo_name": "ryfeus/lambda-packs", "id": "20ec8c1ba0a50da6be9fce3686ac1950b1a55ab5", "size": "251", "bina...
from django import forms from django.conf import settings from django.contrib.auth.models import User from django.contrib.auth.forms import SetPasswordForm, PasswordChangeForm, \ AdminPasswordChangeForm as DjagnoAdminPasswordChangeForm, UserCreationForm, \ AuthenticationForm as DjangoAuthenticationForm from lo...
{ "content_hash": "25d92df0a3a33ca95519af4932f0a50d", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 121, "avg_line_length": 45.01149425287356, "alnum_prop": 0.7040347293156282, "repo_name": "jacoor/sew_django", "id": "79fafa8e74f6e8d3217a5dd862e1ffa72356482d", "size": "39...
""" DB abstraction for <Project_name> """ from <project_name>.db.api import * # noqa
{ "content_hash": "21edef09b1f1fd424e11bc97707d3e45", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 43, "avg_line_length": 17.4, "alnum_prop": 0.6551724137931034, "repo_name": "hahaps/openstack-project-generator", "id": "887cc3d597b4754854d339646df0eb223e8a81a9", "size": "...
import sublime import sublime_plugin import random as r import datetime import string import os import uuid import logging PACKAGES_PATH = os.path.dirname(os.path.realpath(__file__)) def get_settings(): return sublime.load_settings('Random.sublime-settings') """ Base class for the Random generator. Extends the W...
{ "content_hash": "8c255717ea8d34af70a326738467e199", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 111, "avg_line_length": 29.446202531645568, "alnum_prop": 0.6184846856528748, "repo_name": "kimpettersen/random-sublime-text-plugin", "id": "d36ca877f618fa8513112fb382d51307...
"""Tests for saving/loading function for keras Model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil from absl.testing import parameterized import numpy as np from tensorflow.python import keras from tensorflow.python.keras impo...
{ "content_hash": "ff70267153b3dad9d7a22eb8d9367439", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 79, "avg_line_length": 31.659574468085108, "alnum_prop": 0.6656586021505376, "repo_name": "renyi533/tensorflow", "id": "fe7b7e476b015eaaab8e89bfea1fe79b4dcf52e8", "size": "...
from time import gmtime, strftime from kritzbot.commandmanager import CommandManager from kritzbot.logger import Logger log = Logger(__name__) class ChatStream: def __init__(self, message, user): self.msg = message self.user = user self.timestamp = strftime("%Y-%m-%d %H:%M:%S", gmtime()) self.msg_length = l...
{ "content_hash": "310ef653a1dcddde3b02e0a17aca14ba", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 66, "avg_line_length": 23.46153846153846, "alnum_prop": 0.6808743169398908, "repo_name": "LouisBluhm/PyBot", "id": "4d7e8cbc087c62ae1db9ed6e0236d4638ee4c743", "size": "915"...
from atom.api import Str, Int, Float, Bool, Enum from Instrument import Instrument class DCSource(Instrument): output = Bool(False).tag(desc='Output enabled') mode = Enum('voltage', 'current').tag(desc='Output mode (current or voltage source)') value = Float(0.0).tag(desc='Output value (current or voltage)') clas...
{ "content_hash": "6e8434d6e70ea70f1f970fb7b83e8596", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 86, "avg_line_length": 37.294117647058826, "alnum_prop": 0.7334384858044164, "repo_name": "rmcgurrin/PyQLab", "id": "e5fd750d6da2af97cdc4da3356f30b98c0919f97", "size": "634...
""" Django settings for fitnessTracker project. Generated by 'django-admin startproject' using Django 1.9. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import ...
{ "content_hash": "3cc23582e9303fd95eaa5530a7a35c69", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 93, "avg_line_length": 27.076923076923077, "alnum_prop": 0.6647727272727273, "repo_name": "Girardvjonathan/anotherFitnessApp", "id": "b9f16fc8d3eaef9c9485e8a86b028ec333eee3c...
import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if sys.version_info >= (3, 8): from typing import ...
{ "content_hash": "f8cf8c2d3b0cfd96b5ba826a50f1df7f", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 109, "avg_line_length": 51.294117647058826, "alnum_prop": 0.716743119266055, "repo_name": "Azure/azure-sdk-for-python", "id": "75df0524e20b03a4491670da34a0414463496bfd", "s...
import xlsxwriter # Create a workbook and add a worksheet. output_file = 'output/test_formula.xlsx' workbook = xlsxwriter.Workbook(output_file) worksheet = workbook.add_worksheet() # Add a bold format to use to highlight cells. bold = workbook.add_format({'bold': True}) # Add a number format for cells with money. mo...
{ "content_hash": "5949b9a96ead176c928efb5baf92bd23", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 53, "avg_line_length": 24.75, "alnum_prop": 0.6717171717171717, "repo_name": "prajesh-ananthan/Tools", "id": "12a3030efb2bda20a4075253f15336e2c008e8dc", "size": "990", "b...
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("data", "0035_auto_20210422_1926"), ("people_admin", "0006_alter_persondelta_data_changes"), ] operations = [ migrations.CreateModel( nam...
{ "content_hash": "6615b4cbdb547b405c3fe7a47e26a8f0", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 85, "avg_line_length": 31.733333333333334, "alnum_prop": 0.4096638655462185, "repo_name": "openstates/openstates.org", "id": "97c097811409da0655842e41d753d647c0eaaeaf", "si...
class IView(object): def __init__(self): super(IView, self).__init__() self.viewmodel = None def update(self): """ Main function of the view component in MVVM pattern, draws the contents of the model to the output device. """ raise NotImplementedError() class I...
{ "content_hash": "b3cf3db422bab0b3cfa2d17d6dac4025", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 114, "avg_line_length": 25.444444444444443, "alnum_prop": 0.5731441048034934, "repo_name": "pdyban/dicombrowser", "id": "d4b08889af739d614370b7a476c6bc7a63928940", "size": ...
"""This file is part of the django ERP project. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ...
{ "content_hash": "4d0db559e0bc6d08a78fd7426e1f2a95", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 101, "avg_line_length": 36.44736842105263, "alnum_prop": 0.7574007220216606, "repo_name": "django-erp/django-erp", "id": "1f59c8869b434ad26d83d9314c8ab83cb6dd7851", "size":...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA import multiprocessing as mp import os import signal import ...
{ "content_hash": "c6912350d358c33e5b98ee8471dff830", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 78, "avg_line_length": 38.206422018348626, "alnum_prop": 0.574618801776924, "repo_name": "toslunar/chainerrl", "id": "6e52de85d56329c9721dae5ec83cbf5b2e4f6369", "size": "8...
from __future__ import print_function # Time: O(n) # Space: O(1) # Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. # You may assume the integer do not contain any leading zero, except the number 0 itself. # The digits are stored such that the most significant digit is...
{ "content_hash": "c7c68bb62fce9e9f881aaec25ad9c2f6", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 99, "avg_line_length": 27.195652173913043, "alnum_prop": 0.5419664268585132, "repo_name": "tudennis/LeetCode---kamyu104-11-24-2015", "id": "335dcaf534e68a39ec4d2bfe1c20fc017e...
import unittest import numpy from cupy import testing # Note that numpy.bincount does not support uint64 as it casts an input array # to int64. _except_uint64 = ( numpy.float16, numpy.float32, numpy.float64, numpy.int8, numpy.int16, numpy.int32, numpy.int64, numpy.uint8, numpy.uint16, numpy.uint32, ...
{ "content_hash": "6e4235357a8416acbf82df7b323e31d8", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 77, "avg_line_length": 31.80952380952381, "alnum_prop": 0.6482035928143712, "repo_name": "muupan/chainer", "id": "920e3c82e31a049d94ab7f15856c8f1857ae1658", "size": "2672",...
import os import os.path as op import warnings import numpy as np from scipy import sparse from ..externals.six import string_types from ..utils import verbose, logger from ..io.pick import (channel_type, pick_info, pick_types, _check_excludes_includes) from ..io.constants import FIFF def _g...
{ "content_hash": "3fbe9bace69339c686ce39efde68a68e", "timestamp": "", "source": "github", "line_count": 736, "max_line_length": 79, "avg_line_length": 35.30434782608695, "alnum_prop": 0.5447583128078818, "repo_name": "andyh616/mne-python", "id": "180bfffd24ed110cee84c64aa9c8c9f2c36668c7", "size": "...
from __future__ import absolute_import import collections import logging import os import re import warnings from pip._vendor import pkg_resources, six from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.pkg_resources import RequirementParseError from pip._internal.exceptions import Installati...
{ "content_hash": "55d44c880152e10f406cbc93c1cefdd5", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 79, "avg_line_length": 39.78174603174603, "alnum_prop": 0.4682294264339152, "repo_name": "Microsoft/PTVS", "id": "b6821c0e7eff728787beafdb016760c6ecee5b55", "size": "10025...
''' DQNAgentClass.py: Class for Deep Q-network agent. Built based on the network in DeepMind, Multi-agent RL in Sequential Social Dilemmas paper. ''' # Python imports. import tensorflow as tf import numpy as np import random # Other imports. from simple_rl.agents.AgentClass import Agent class DQNAgent(Agent): N...
{ "content_hash": "6df7c0e307ec7ee69bc227fefde0de2c", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 205, "avg_line_length": 39.70673076923077, "alnum_prop": 0.6080639302579005, "repo_name": "david-abel/simple_rl", "id": "8a5e243f4c5c110538775c96c050d318ba57a7f8", "size":...
"""Volume v2 host action implementations""" from osc_lib.command import command from openstackclient.i18n import _ class FailoverVolumeHost(command.Command): _description = _("Failover volume host to different backend") def get_parser(self, prog_name): parser = super(FailoverVolumeHost, self).get_p...
{ "content_hash": "0cf813c3e256ee524922ba19f258ef5c", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 73, "avg_line_length": 33.47540983606557, "alnum_prop": 0.5861900097943193, "repo_name": "openstack/python-openstackclient", "id": "2fdeb9684b96812e010ac57c228dccc12ce9c067",...
from zipfile import ZipFile from cStringIO import StringIO from string import punctuation from django.template import Context from django.template.loader import get_template from _base import BaseExporter from _csv import CSVExporter class RExporter(BaseExporter): short_name = 'R' long_name = 'R Programming L...
{ "content_hash": "43163230ad8235cb2b2c69162f746b35", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 77, "avg_line_length": 28.761467889908257, "alnum_prop": 0.5400318979266348, "repo_name": "murphyke/avocado", "id": "12af63a9d730839259076282f9127ef2b30ba1aa", "size": "31...
from django.contrib import admin from .models import Category, Thread, Post admin.site.register(Category) admin.site.register(Thread) admin.site.register(Post)
{ "content_hash": "8c88ff1301424b61c4bb1fd87d07992f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 42, "avg_line_length": 23.142857142857142, "alnum_prop": 0.808641975308642, "repo_name": "maur1th/naxos", "id": "abf989f1c0dc6a52e0f1f6807bccc656e0e04fe3", "size": "162", ...
"""Test NCSS access code.""" from contextlib import contextmanager from datetime import datetime import numpy as np from siphon.ncss import NCSS, NCSSQuery, ResponseRegistry import siphon.testing recorder = siphon.testing.get_recorder(__file__) def test_ncss_query_proj_box(): """Test forming a query with a pr...
{ "content_hash": "b9fbcff14054feaecccd4721eb105264", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 95, "avg_line_length": 33.315, "alnum_prop": 0.6307969383160739, "repo_name": "Unidata/siphon", "id": "77e871fcb4c486a3b27aaafd6d56526fe3194042", "size": "6809", "binary...
from django.shortcuts import render, redirect from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.utils.translation import ugettext as _ from django.core.mail import send_mail from . import forms def home(request): """ Na...
{ "content_hash": "35b1e9a3025079f74d27e3c030323583", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 108, "avg_line_length": 28.106060606060606, "alnum_prop": 0.6226415094339622, "repo_name": "ceos-seo/data_cube_ui", "id": "c4d5d2a0fc1e59aebc4a7c294b5d9eec0e418e8e", "size"...
import re from . import AWSHelperFn, AWSObject, AWSProperty, Ref from .validators import boolean, network_port, integer, positive_integer # Taken from: # http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_CreateDBInstance.html VALID_STORAGE_TYPES = ('standard', 'gp2', 'io1') VALID_DB_ENGINES = ('MySQL', 'o...
{ "content_hash": "b61e2fc0f4fdbfd8baa142328f2ed400", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 84, "avg_line_length": 37.60576923076923, "alnum_prop": 0.5804142163129634, "repo_name": "ptoraskar/troposphere", "id": "02994916ce136d36dad102033d468b11d4946026", "size":...
"""Control.py - Command line control for ruffus pipelines ========================================================= The functions :func:`writeConfigFiles`, :func:`clean`, :func:`clonePipeline` and :func:`peekParameters` provide the functionality for particular pipeline commands. :class:`MultiLineFormatter` improves t...
{ "content_hash": "b2ccbe4d65974627ab66155237df236e", "timestamp": "", "source": "github", "line_count": 1165, "max_line_length": 97, "avg_line_length": 35.25150214592275, "alnum_prop": 0.5563942729132171, "repo_name": "AntonioJBT/CGATPipeline_core", "id": "1d229b1473caa99d40f1b1010d40fbf378821a23", ...
""" Test suite for VMware VMDK driver volumeops module. """ import mock from oslo_utils import units from oslo_vmware import exceptions from oslo_vmware import vim_util from cinder import test from cinder.volume.drivers.vmware import exceptions as vmdk_exceptions from cinder.volume.drivers.vmware import volumeops c...
{ "content_hash": "4634b08d74b59a054333b728afbdef40", "timestamp": "", "source": "github", "line_count": 1754, "max_line_length": 79, "avg_line_length": 45.754275940706954, "alnum_prop": 0.5506834635465341, "repo_name": "petrutlucian94/cinder", "id": "fbad28415361013b189c9b2015dd1d31c30d7ca6", "size...
from recipe_scrapers.heinzbrasil import HeinzBrasil from tests import ScraperTest class TestHeinzBrasilScraper(ScraperTest): scraper_class = HeinzBrasil def test_host(self): self.assertEqual("heinzbrasil.com.br", self.harvester_class.host()) def test_canonical_url(self): self.assertEqua...
{ "content_hash": "cf99579a91baafe48b55892d97f186ce", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 266, "avg_line_length": 39.05882352941177, "alnum_prop": 0.6049196787148594, "repo_name": "hhursev/recipe-scraper", "id": "81978a680f51016769e63f76e6e08e24deaebc08", "size"...
from mock import Mock, patch from datetime import datetime as dt from tests.ditest import DependencyInjectionTestBase class LoggingTests(DependencyInjectionTestBase): def setUp(self): super(LoggingTests, self).setUp() #self.repo.byLocation.return_value = True self.opts = Mock() se...
{ "content_hash": "c39cc670012dac18c12c5806829a9102", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 94, "avg_line_length": 41.94615384615385, "alnum_prop": 0.6246103062534385, "repo_name": "ilogue/niprov", "id": "b612b1108647121b61fa51d9ef200bca1651f157", "size": "5453",...
import errno import os import re import subprocess import sys def get_keywords(): # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). ...
{ "content_hash": "1d7cb9a54410cd6020ee52adf27373f6", "timestamp": "", "source": "github", "line_count": 450, "max_line_length": 79, "avg_line_length": 34.03777777777778, "alnum_prop": 0.5720441339687928, "repo_name": "stejesh/distributed-frontera", "id": "b4fca205550b7d183b1ac4b818e04f2bedd5547c", ...
"""Unit test package for BitcoinExchangeFH."""
{ "content_hash": "5dc69bdf7f93ff009e4e4ba1b1e43fbd", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 46, "avg_line_length": 47, "alnum_prop": 0.7446808510638298, "repo_name": "gavincyi/BitcoinExchangeFH", "id": "88e5dd36f1d2d6b05bb79a680ba0bd7cbc6a4205", "size": "72", "bi...
try: import asyncio except ImportError: import trollius asyncio = trollius import argparse from time import time from couchbase.user_constants import FMT_BYTES from couchbase.experimental import enable; enable() from acouchbase.bucket import Bucket ap = argparse.ArgumentParser() ap.add_argument('-t', '...
{ "content_hash": "0fa17f031b551129389a4596898104cf", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 85, "avg_line_length": 30.982758620689655, "alnum_prop": 0.6160267111853088, "repo_name": "mnunberg/couchbase-python-client", "id": "47b2449114c321eaacc99bbba9c8da1c5e3d0098...
""" Read from the Senseval 2 Corpus. SENSEVAL [http://www.senseval.org/] Evaluation exercises for Word Sense Disambiguation. Organized by ACL-SIGLEX [http://www.siglex.org/] Prepared by Ted Pedersen <tpederse@umn.edu>, University of Minnesota, http://www.d.umn.edu/~tpederse/data.html Distributed with permi...
{ "content_hash": "1a6e84b3f4a3c579771079ac07865411", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 78, "avg_line_length": 39.91752577319588, "alnum_prop": 0.49393078512396693, "repo_name": "enriquesanchezb/practica_utad_2016", "id": "6ac715cf3ad5a38eceb0a835c2fb44d490a5d1...
"""Test the custom plugin demoed on http://jakevdp.github.io/blog/2014/01/10/d3-plugins-truly-interactive/ """ import matplotlib import matplotlib.pyplot as plt import numpy as np from mpld3_rewrite import plugins, utils import jinja2 import json class LinkedView(plugins.PluginBase): """A simple plugin showing ho...
{ "content_hash": "0ea2e4426f99e70cea25985fc461da7f", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 70, "avg_line_length": 28.9125, "alnum_prop": 0.5685257241677475, "repo_name": "mpld3/mpld3_rewrite", "id": "c51cf3a02f819d841b5325ea5eaa1bc2841a8d14", "size": "2313", "b...
from setuptools import setup from g1.devtools import buildtools setup( name='g1.files', cmdclass={ 'bdist_zipapp': buildtools.make_bdist_zipapp(main_optional=True), }, packages=[ 'g1.files', ], install_requires=[ 'g1.bases', ], zip_safe=False, )
{ "content_hash": "22279c88ef776f073907502762956cfa", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 73, "avg_line_length": 17.88235294117647, "alnum_prop": 0.5921052631578947, "repo_name": "clchiou/garage", "id": "bbf09a54081b4a835093dbfb9320e73b64787965", "size": "304", ...
from django.conf.urls import url, include from rest_framework.routers import DefaultRouter from views import TodoItemViewSet __author__ = "wangyixiang" dr = DefaultRouter() dr.register("item", TodoItemViewSet) urlpatterns = [ url(r'^', include(dr.urls)), ]
{ "content_hash": "e9c388bc46a9b543fa7e47604be991e2", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 48, "avg_line_length": 22, "alnum_prop": 0.7424242424242424, "repo_name": "wangyixiang/sstest", "id": "a807f4380f7fab5586a59e4658cd60862998fc92", "size": "311", "binary":...
import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/500...
{ "content_hash": "da1c03da52c0a977550f785d6b278f9d", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 106, "avg_line_length": 30.13533834586466, "alnum_prop": 0.5474051896207585, "repo_name": "yugang/crosswalk-test-suite", "id": "4579cdf531239379c11addb00031833b071b33fc", ...
from .base import Actionable, ResourceWithID, fromISO8601 class Image(Actionable, ResourceWithID): """ An image resource, representing an OS image that can be used to create or reset a droplet. New images can be created via the :meth:`Droplet.snapshot` method. They are also automatically creat...
{ "content_hash": "e930a021fe541a57601512d6f7a6c60b", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 79, "avg_line_length": 34.31496062992126, "alnum_prop": 0.6195502524093621, "repo_name": "jwodder/doapi", "id": "958aff754bdaac293204d1867f3bf6ef5e332b5e", "size": "4358",...
from neutron.common import exceptions class CorruptedSystemError(exceptions.NeutronException): message = _('System contain conflicts: %(description)s.') class VRouterConnectFailure(exceptions.NeutronException): """Couldn't connect to instance.""" message = _("Couldn't connect to Vyatta vRouter [%(ip_add...
{ "content_hash": "84a7bd037ea967ffe1198ee138138b72", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 76, "avg_line_length": 32.30434782608695, "alnum_prop": 0.7379991027366533, "repo_name": "rmadapur/networking-brocade", "id": "f7765cdf75e545d331bb968dde5df6d9ca9f04f5", "s...
from timeit import default_timer class instrument(object): def __init__(self): self.lap_stack = [] self.guard_stack = [] self.lap_table = {} def start(self): self.start_time = default_timer() def stop(self): self.end_time = default_timer() def lap(self, fu...
{ "content_hash": "29edf7e8f81ad25d40f9cae24972119b", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 96, "avg_line_length": 30.136363636363637, "alnum_prop": 0.5211161387631976, "repo_name": "inbloom/secure-data-service", "id": "4fffdb44d806e1577b9430ea8b3d83b6308c721a", "...
"""Phylogenetics command line tool wrappers.""" __docformat__ = "restructuredtext en" from _Phyml import PhymlCommandline from _Raxml import RaxmlCommandline #Make this explicit, then they show up in the API docs __all__ = ["PhymlCommandline", "RaxmlCommandline", ]
{ "content_hash": "cf29fe074e180a7c89bebf5b159f6154", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 54, "avg_line_length": 29, "alnum_prop": 0.696551724137931, "repo_name": "bryback/quickseq", "id": "01dd11c9268e45c7c6b27802d42ea41101487e17", "size": "515", "binary": fa...
class CommandError(Exception): pass class VcsCommandError(Exception): pass class NoVcsError(Exception): pass class ShellCommandError(Exception): def __init__(self, message, output, *args, **kwargs): super(ShellCommandError, self).__init__(message, *args, **kwargs) self.output = output ...
{ "content_hash": "14025868d8b57d7f024f26f182a1ee06", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 73, "avg_line_length": 35.07692307692308, "alnum_prop": 0.6425438596491229, "repo_name": "adamcharnock/seed", "id": "3ee6cba52e85dde2f496531a3494aa6a1c8e0d7f", "size": "457...
import os import time from glob import glob from collections import defaultdict if __name__ == '__main__': db = defaultdict(lambda: None) while True: remake = False for file in glob('*.rst'): mt = os.stat(file).st_mtime if mt != db[file]: re...
{ "content_hash": "a01c0568a1e90fc602bc49076a3578c0", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 39, "avg_line_length": 22.181818181818183, "alnum_prop": 0.48155737704918034, "repo_name": "consec/ConSec", "id": "c652351de75544dfbb43d07acc559208bcadabc5", "size": "488",...
from functools import partial from ..params.encodings import EncodingParam from ..params.values import URLParam from .base import StringProp __all__ = ["PhotoProp"] class PhotoProp(StringProp): authorized_params = ["ENCODING", "TYPE", "VALUE"] name = "PHOTO" def export(self, path): """Export...
{ "content_hash": "fe30045c3494d787e31458c13b1f306e", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 75, "avg_line_length": 25.837209302325583, "alnum_prop": 0.5733573357335734, "repo_name": "Jorispilot/pycard", "id": "b32f33a531f0049b46183249705db956f034e619", "size": "11...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('event', '0001_initial'), ] operations = [ migrations.AddField( model_name='session', name='tags', field=models.T...
{ "content_hash": "d1e7912cbb26cee7fe63667c51108a5c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 58, "avg_line_length": 20.555555555555557, "alnum_prop": 0.581081081081081, "repo_name": "pytexas/PyTexasBackend", "id": "b7a7199b302fb2d92b59744a2a71d31e445b3ad5", "size":...
from pyasn1 import debug from pyasn1 import error from pyasn1.codec.ber import eoo from pyasn1.compat.integer import from_bytes from pyasn1.compat.octets import oct2int, octs2ints, ints2octs, null from pyasn1.type import base from pyasn1.type import char from pyasn1.type import tag from pyasn1.type import tagmap from p...
{ "content_hash": "f357e8a473eb0df789b50edc39585758", "timestamp": "", "source": "github", "line_count": 1644, "max_line_length": 277, "avg_line_length": 35.2147201946472, "alnum_prop": 0.5351769643998411, "repo_name": "kawamon/hue", "id": "3f2d180d1d8556b71b2d24c354a4c54605bb15b0", "size": "58050",...
import datetime from django.db import models from django.contrib.auth.models import AbstractBaseUser from users.managers import UserManager class User(AbstractBaseUser): """Покупатель""" STATUS_ADMIN = 0 STATUS_CUSTOMER = 1 STATUS_WHOLESALE = 2 STATUS_FRANCHISEE = 3 STATUS_CHOICES = ( ...
{ "content_hash": "204267273aa7c72ae05e5252bce1f3d6", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 102, "avg_line_length": 33.58450704225352, "alnum_prop": 0.6777102117844411, "repo_name": "Lisaveta-K/lisaveta-k.github.io", "id": "ca65cdecfd79061030b3ae54ab25915efd4a5243"...
from distutils.core import setup import py2exe # Create an executable from a python script # Use: python setup.py py2exe setup(console=['passcodes.py']) # Enter name of script
{ "content_hash": "c9891b6e2f8c0afe5ab97fc6203c07a5", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 54, "avg_line_length": 26.428571428571427, "alnum_prop": 0.7405405405405405, "repo_name": "fatty-duck/lib-lockdown", "id": "4f426d4f2491a54307bad1254111f71b22d9837f", "size"...
class Test(object): def run(self): raise NotImplementedError("Implement this!") def add(self, test): pass class TestCase(Test): def run(self): print "Running test: %s" % self class TestSuite(Test): def __init__(self): self.tests = [] def run(self): for t...
{ "content_hash": "981f8d600f6c5f44290da8539e8a05cb", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 52, "avg_line_length": 18.622222222222224, "alnum_prop": 0.5978520286396182, "repo_name": "pgularski/snippets", "id": "ba8bb877d00153b6aa7559d470715f1b4c054357", "size": "8...
import logging from registry import registry_connect __author__ = 'Joji Vithayathil Johny' __version__ = '0.0.1' def set_logger_status(name='pydockertools', level=logging.DEBUG, format_string=None): """ Add a stream handler for the given name and level to the logging module. By default, this logs all pyd...
{ "content_hash": "ecb564881597e63258d06426b145a487", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 85, "avg_line_length": 33.6, "alnum_prop": 0.6811224489795918, "repo_name": "jojees/pydocker-tools", "id": "b0f6c39dbffa2b0c624266e0bb92b89739a8194e", "size": "2312", "bi...