text
stringlengths
4
1.02M
meta
dict
from io import StringIO from unittest.mock import Mock, call, patch from django.test import TestCase from jarbas.chamber_of_deputies.management.commands.receipts_text import Command from jarbas.chamber_of_deputies.models import Reimbursement class TestCommand(TestCase): def setUp(self): self.command = ...
{ "content_hash": "a1ca4f535fb613cb1f240e372705f1ba", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 98, "avg_line_length": 42.06293706293706, "alnum_prop": 0.6801330008312552, "repo_name": "marcusrehm/serenata-de-amor", "id": "c588360b1ad557596a0c972ab95be7148a687a5a", "...
from django.views.generic import TemplateView class HomepageView(TemplateView): template_name = 'index.html'
{ "content_hash": "0eea2478ab4b44c2aa39781aacba1f24", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 45, "avg_line_length": 22.8, "alnum_prop": 0.7894736842105263, "repo_name": "andremrsantos/s-score-view", "id": "5314d8692c76ff1c94f5822f627b0cf822d8494b", "size": "114", ...
from rapidsms.apps.base import AppBase class PingPong(AppBase): def handle(self, msg): if msg.text == 'ping': # when received msg's text = 'ping' ==> send an answer to the sending number... msg.respond('pong') # .. with text 'pong' return True return False
{ "content_hash": "218f9ed81ac877c0213252bbe91144a2", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 110, "avg_line_length": 33.55555555555556, "alnum_prop": 0.6059602649006622, "repo_name": "dragGH102/rapidsms-example-with-rest-services", "id": "6eedd36551cdf0d17c68df4774678...
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'lci.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), #user accounts ...
{ "content_hash": "5df7df523d0d8664ff216ee9b3803d70", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 51, "avg_line_length": 24.466666666666665, "alnum_prop": 0.6321525885558583, "repo_name": "b3ngmann/gratia-sensei", "id": "50cdf6b6fa04815d91e81eef1813963946ea14ad", "size"...
""" urlresolver XBMC Addon Copyright (C) 2011 t0mm0 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
{ "content_hash": "cf37a60e20fe276781066532f83434c2", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 88, "avg_line_length": 35.23529411764706, "alnum_prop": 0.6555370061213133, "repo_name": "mrknow/filmkodi", "id": "1fb316d7464ef232b6e27df164a2e33be675437a", "size": "1797"...
""" Tests For Base Scheduler """ import mock from oslo_config import cfg from oslo_utils import timeutils from manila import context from manila import db from manila.scheduler.drivers import base from manila import test from manila import utils CONF = cfg.CONF class SchedulerTestCase(test.TestCase): """Test c...
{ "content_hash": "31356c06b1729b4ce907fceb704bf63d", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 78, "avg_line_length": 35.65555555555556, "alnum_prop": 0.6076659395450296, "repo_name": "NetApp/manila", "id": "c0f48b48098bae50f8fd27c79003cd1abb740f30", "size": "3940", ...
''' Created on Dec 15, 2011 @author: uqtdettr ''' import urllib2 from django.conf import settings from django.contrib.auth.models import User from tardis.tardis_portal.auth.interfaces import AuthProvider from tardis.tardis_portal.auth.utils import configure_user class HttpBasicEndpointAuth(AuthProvider): ''' ...
{ "content_hash": "891052d66035e3b3fd37115a7d8bab05", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 78, "avg_line_length": 33.19047619047619, "alnum_prop": 0.648493543758967, "repo_name": "pansapiens/mytardis", "id": "6974a2e46ffe050df4d0ced11cabc1a4709619c3", "size": "27...
import time import cherrypy from girder.api.rest import getCurrentToken from girder.utility.model_importer import ModelImporter LoadModelCache = {} LoadModelCacheMaxEntries = 100 LoadModelCacheExpiryDuration = 300 # seconds def invalidateLoadModelCache(*args, **kwargs): """ Empty the LoadModelCache. "...
{ "content_hash": "c365614b253133f9d2de1dcf49228444", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 76, "avg_line_length": 37.10294117647059, "alnum_prop": 0.6611177170035671, "repo_name": "girder/large_image", "id": "fbb94db018723a1a655fa72c7ea723608507ccf5", "size": "32...
"""mod_steps -- behavior steps for Mod features. """ from behave import given, when, then @when(u'I subclass Mod') def step(context): class OfDoom(context.blueprint.Mod): name = context.blueprint.FormatTemplate('{meta.source.name} of DOOM') value = lambda _: _.meta.source.value * 20 damage...
{ "content_hash": "327cd914d4cb7443acb1570bfcedaab9", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 83, "avg_line_length": 32.67741935483871, "alnum_prop": 0.6495557749259625, "repo_name": "0ion9/blueprint", "id": "504047024b407630de676e289a7aa60103a7e5d6", "size": "1037"...
from iptest.assert_util import * import _random #getrandbits def test_getrandbits(): #the argument is a random int value rand = _random.Random() for i1 in xrange(1, 1984, 6): Assert(rand.getrandbits(i1) < (2**i1)) Assert(rand.getrandbits(i1) < (2**i1)) Assert(rand.getrandbits(i1+1...
{ "content_hash": "fbe4bfa6b4b1346abac0a1374cf1559a", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 110, "avg_line_length": 25.171875, "alnum_prop": 0.5943513345747983, "repo_name": "paweljasinski/ironpython3", "id": "6bb04e7944df1184732aa421bba6cb2455eb6ecf", "size": "3...
from twisted.conch.ssh import keys, userauth from twisted.internet import defer class AuthClient(userauth.SSHUserAuthClient): def __init__(self, options, *args): userauth.SSHUserAuthClient.__init__(self, str(options["user"]), *args) self.options = options def serviceStarted(self): use...
{ "content_hash": "f02a666e177ccf8228246ea35171da2d", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 78, "avg_line_length": 32.5, "alnum_prop": 0.7005917159763314, "repo_name": "kradalby/webmux", "id": "3ab2d878cc4f46451a0716849c9c716c38b73970", "size": "845", "binary": ...
import logging import simplejson as json from django import forms from django.core.serializers.json import DjangoJSONEncoder from django.db import models from django.utils.functional import curry from django.utils.translation import ugettext_lazy as _ import plata try: json.dumps([42], use_decimal=True) except ...
{ "content_hash": "f1dd4f8dad962a67bafa79f8f7cd53d2", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 116, "avg_line_length": 30.953703703703702, "alnum_prop": 0.6422375112174693, "repo_name": "allink/plata", "id": "6c9d857c66396249803707c45a8b97d098cd8233", "size": "3343"...
from django.conf.urls import patterns, url
{ "content_hash": "09eb5f5f7aa005a123b12276060f113a", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 42, "avg_line_length": 43, "alnum_prop": 0.813953488372093, "repo_name": "lfalvarez/votai-theme", "id": "025ff92653a0a4e22895332e4444f3c60ed986fc", "size": "43", "binary":...
""" Write a function that takes minlen and a list of words, and returns only the words longer than minlen """ def longer_than(minlen, *args): return [word for word in args if len(word) > minlen] print longer_than(4, "foo", "bar", "fantastic", "python", "abc")
{ "content_hash": "b512fc3757adcab7fa0b0c621dd11a25", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 64, "avg_line_length": 22.333333333333332, "alnum_prop": 0.6828358208955224, "repo_name": "nonZero/python-examples", "id": "18a7b9dce2d4398f5978d147dce331d6047192e8", "size...
import random from django.db import models from django import forms from staging.generators import BaseGenerator class ValueFromListForm(forms.Form): lines = forms.CharField(widget=forms.Textarea) class NotInitialized(): pass class Generator(BaseGenerator): name = 'Value from list' slug = 'value-f...
{ "content_hash": "e0a21585924f801df6a95b5391370a86", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 112, "avg_line_length": 31.463414634146343, "alnum_prop": 0.6496124031007752, "repo_name": "vparitskiy/django-staging", "id": "3c5edd36a732b075f5e397be6a1ac08cc0e9656f", "s...
import sys, time, math import datetime sys.path.append('/var/lib/virtdc/framework') from VM_Info_Updater import addOrUpdateDictionaryOfVM from Guest import Guest from VM_migrateGuest import vm_migrate_guest from VM_cpuScaling import vm_cpu_scaling from VM_memoryScaling import vm_memory_scaling, vm_max_memory_scaling fr...
{ "content_hash": "345ed54c10dca47fbd46eec9872a34d0", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 261, "avg_line_length": 46.423312883435585, "alnum_prop": 0.6739791198625611, "repo_name": "OnePaaS/virtdc", "id": "04d651494cda9236cc83e60a518bad2e54c1e645", "size": "758...
from tryhaskell import TryHaskell TryHaskell.repl()
{ "content_hash": "f8012492abc505f9337b9b07551c888e", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 33, "avg_line_length": 17.666666666666668, "alnum_prop": 0.8301886792452831, "repo_name": "carymrobbins/py-tryhaskell", "id": "94f3defbcb6501992f83388fff5754117fe2bfd3", "si...
import exceptions import hmac import random import socket import struct from perfrunner.lib.mc_bin_client import memcacheConstants from perfrunner.lib.mc_bin_client.memcacheConstants import ( INCRDECR_RES_FMT, MIN_RECV_PACKET, REQ_MAGIC_BYTE, REQ_PKT_FMT, RES_MAGIC_BYTE, RES_PKT_FMT, SET_PK...
{ "content_hash": "4ec9d1eca6e3ebaceb6e4ddd854c8f7a", "timestamp": "", "source": "github", "line_count": 452, "max_line_length": 79, "avg_line_length": 37.5353982300885, "alnum_prop": 0.5757986561358011, "repo_name": "EricACooper/perfrunner", "id": "d32f10d34fbd636ebdfef93f6eb271490e15ca60", "size":...
from __future__ import absolute_import from PySide import QtGui, QtCore from .worker import Worker import os import sys import time import importlib from .. import compat __all__ = ['Application', 'Dialog', 'MutexLocker'] TOP_SECTION = '<b>%s</b>' SECTION = '<br><b>%s</b>' class Dialog(QtGui.QDialog): def __...
{ "content_hash": "9d7a0c3a4b4af33c89f40b20e7ba78d0", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 74, "avg_line_length": 26.850299401197606, "alnum_prop": 0.5628902765388046, "repo_name": "moreati/python-yubicommon", "id": "5ebaf42ea16a559f1c6534bbc3f0a88f4a011f28", "s...
from eight_mile.version import __version__
{ "content_hash": "7f7204e553e60af88d06edc83b892d8d", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 42, "avg_line_length": 43, "alnum_prop": 0.7674418604651163, "repo_name": "dpressel/baseline", "id": "7002eda13b0ef1d5e9accbc30674d7ab6fc0382d", "size": "43", "binary": fa...
from tcga_encoder.models.vae.batcher_ABC import * class TCGABatcher( TCGABatcherABC ): pass
{ "content_hash": "ae875d6281de3cf2ace9ac42c3c6ba93", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 49, "avg_line_length": 16, "alnum_prop": 0.578125, "repo_name": "tedmeeds/tcga_encoder", "id": "615a2ddbad2c29ba18695c2c80f631f7e265eeda", "size": "128", "binary": false, ...
from pylatex import Document, Section, Subsection, Command, Math, TikZ, Axis, \ Plot, Figure, LongTabu, Tabu, Head, PageStyle from pylatex.utils import italic, NoEscape, bold import os import csv import numpy as np import matplotlib.pyplot as plt # get the absolute path of the testing directory instead of hard cod...
{ "content_hash": "78fe6e5515dccfb869c244c6f595124e", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 127, "avg_line_length": 35.72769953051643, "alnum_prop": 0.6779237844940867, "repo_name": "miyurud/siddhi-benchmarks", "id": "8c585908244062736d7ec549b4c1204e43e7668f", "s...
from tempest.services.volume.json import volumes_client class VolumesV2ClientJSON(volumes_client.BaseVolumesClientJSON): """ Client class to send CRUD Volume V2 API requests to a Cinder endpoint """ def __init__(self, auth_provider): super(VolumesV2ClientJSON, self).__init__(auth_provider) ...
{ "content_hash": "03dafc0d8811d3fbc22ea1dea072b137", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 73, "avg_line_length": 29.25, "alnum_prop": 0.7008547008547008, "repo_name": "Mirantis/tempest", "id": "1f16eadc34b4976f05b0b652921877fd04969027", "size": "987", "binary"...
from operator import itemgetter from typing import List import itertools from Src.BioAnalyzer.Analysis.GenePrioritization.Utils.Utils import Utils from Src.BioAnalyzer.CrossCutting.DTOs.GenePrioritization.GeneRankingDto import GeneRankingDto from Src.BioAnalyzer.CrossCutting.DTOs.GenePrioritization.GeneRankingItemDto ...
{ "content_hash": "ec3e0c66829287036a9ed155922b7a7c", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 117, "avg_line_length": 52.36734693877551, "alnum_prop": 0.5257209664848013, "repo_name": "cemarchi/biosphere", "id": "8078ce10c329f31eb717d3494a7d022824f019e1", "size": "5...
from sqlalchemy import create_engine import vmcatcher.databaseDefinition as model import os import logging import optparse from smimeX509validation import TrustStore, LoadDirChainOfTrust,smimeX509validation, smimeX509ValidationError import sys from vmcatcher.__version__ import version from sqlalchemy.orm import sessio...
{ "content_hash": "8f3caf9e2a44e2d493d8c252e50b96d8", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 114, "avg_line_length": 42.73303167420814, "alnum_prop": 0.6060991105463787, "repo_name": "hepix-virtualisation/vmcatcher", "id": "7017271df3b6d085384e60ef7c960e997a03db6c",...
import abc import collections import threading import fasteners import futurist from oslo_utils import reflection from oslo_utils import timeutils import six from taskflow.engines.action_engine import executor from taskflow import exceptions as excp from taskflow import logging from taskflow.types import failure as f...
{ "content_hash": "10efa1ae92db2bdfb94315ddea072bef", "timestamp": "", "source": "github", "line_count": 514, "max_line_length": 79, "avg_line_length": 33.511673151750976, "alnum_prop": 0.5394484760522497, "repo_name": "pombredanne/taskflow-1", "id": "63556c259342a7b30507cbc4b36072e8c27ec06a", "size...
"""Tests for discriminator.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf from tensorflow_gan.examples.cyclegan import discriminator class DiscriminatorTest(tf.test.TestCase): def _layer_output_size(self, input_si...
{ "content_hash": "d643754caa1cb5666bbdc5abd1305673", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 75, "avg_line_length": 37.733333333333334, "alnum_prop": 0.6604240282685513, "repo_name": "tensorflow/gan", "id": "fe2310566ccc22c581ff25ec8f735827514a8970", "size": "3437"...
from pytest import mark, raises from voting.models import Vote from voting.tests.fixtures.vote import get_random_vote def _submit_vote(client, submission, **kwargs): value_index = kwargs.get("value_index", get_random_vote()) defaults = {"value": value_index, "submission": submission.hashid} variables = ...
{ "content_hash": "553dda1d6c4fbbdfc86b187c6cc40cd6", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 87, "avg_line_length": 31.261627906976745, "alnum_prop": 0.648688859959085, "repo_name": "patrick91/pycon", "id": "1484075353bd41bf998ac730c0360817c870abc3", "size": "5377...
""" comment export DJANGO_SETTINGS_MODULE="opentrain.settings" """ import os import sys sys.path.append(os.getcwd()) sys.path.append(os.path.dirname(os.getcwd())) os.environ['DJANGO_SETTINGS_MODULE'] = 'opentrain.settings' #/home/oferb/docs/train_project/OpenTrains/webserver import timetable.services import analysis.m...
{ "content_hash": "8cad33f9dd9b9ffbc6dd9567e201c19c", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 159, "avg_line_length": 42.660377358490564, "alnum_prop": 0.6429308565531475, "repo_name": "hasadna/OpenTrain", "id": "c4904d3901bbd923151dc0db976bb494bdc81b65", "size": "...
"""functools.py - Tools for working with functions and callable objects """ # Python module wrapper for _functools C module # to allow utilities written in Python to be added # to the functools module. # Written by Nick Coghlan <ncoghlan at gmail.com> # Copyright (C) 2006 Python Software Foundation. # See C so...
{ "content_hash": "c9f45493e7d1afbd1b65a02bf62ea4aa", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 75, "avg_line_length": 43.3921568627451, "alnum_prop": 0.6764572977858111, "repo_name": "babyliynfg/cross", "id": "539c476b944c817f5d2f2bb518950a9b5d80d0e3", "size": "2213"...
from __future__ import absolute_import import logging from random import choice import time try: import simplejson as json _ = json # pyflakes except ImportError: import json from pyleus.storm import Spout log = logging.getLogger('requests_generator') FIRST = ( "www.ninjacorp.com", "www.ninja...
{ "content_hash": "095a9e16614319689afebac65ce51055", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 65, "avg_line_length": 21.03076923076923, "alnum_prop": 0.5683979517190929, "repo_name": "imcom/pyleus", "id": "c4decda5303bf7216cbb00e5c7becebdeae23b04", "size": "1367", ...
""" This is a web-server which integrates with the twisted.internet infrastructure. """ # System Imports import warnings import string import types import copy import os from urllib import quote from zope.interface import implements from urllib import unquote #some useful constants NOT_DONE_YET = 1 # Twisted Impo...
{ "content_hash": "7d4e9af9712bc9b24daf6d5f8d886636", "timestamp": "", "source": "github", "line_count": 587, "max_line_length": 100, "avg_line_length": 32.335604770017035, "alnum_prop": 0.5826352668457931, "repo_name": "Varriount/Colliberation", "id": "d03bec66d62b616a01f8f4deecb93eba3c0f1892", "si...
import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-astrocoinrpc")) import json import shutil import subprocess import tempfile import traceback from astrocoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * def check_array_result(object_ar...
{ "content_hash": "ece6cc8ff54b41a89b3bd89d6157b34c", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 105, "avg_line_length": 39.60958904109589, "alnum_prop": 0.5593982362095798, "repo_name": "corefork/astrocoincore", "id": "0e83630cb33b3377a3d0ddd6629b59ebca4844bc", "size...
import sys import os import string import rfidiot try: card= rfidiot.card except: print "Couldn't open reader!" os._exit(True) card.info('isotype v0.1n') typed= 0 if card.readertype == card.READER_ACG: for command, cardtype in card.ISOTags.iteritems(): if not card.settagtype(command): print '...
{ "content_hash": "aea2754c04bf6b2f3cfcb1760cc077e3", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 54, "avg_line_length": 25.31168831168831, "alnum_prop": 0.6275012827090816, "repo_name": "kaosbeat/datakamp", "id": "786dfbde0b68848e4fc35c0c0b08c8dcbe194c5e", "size": "276...
from unittest import TestCase from biicode.common.model.bii_type import BiiType, PYTHON from biicode.common.model.brl.block_cell_name import BlockCellName from biicode.common.model.declare.python_declaration import PythonDeclaration, PythonImport from biicode.common.dev.system_resource_validator import getSystemNameVal...
{ "content_hash": "fef32a9180e0a35c777ae32ebb79cf82", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 101, "avg_line_length": 50.786127167630056, "alnum_prop": 0.6406783519235146, "repo_name": "franramirez688/common", "id": "5a6f0c0450388d43c8cd4c03945f47b41a6407ea", "size...
import os import subprocess import tempfile from q2cli.core.usage import CLIUsage from qiime2.core.testing.util import get_dummy_plugin import pytest def _rt_labeler(val): if hasattr(val, 'id'): return val.id return val @pytest.fixture def dummy_plugin(monkeypatch): monkeypatch.setenv('QIIMETE...
{ "content_hash": "63ff01793a45385f67b153677fe7f38b", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 77, "avg_line_length": 26.338709677419356, "alnum_prop": 0.6148193508879363, "repo_name": "qiime2/q2cli", "id": "34d7c195841fccd3bc561855508ca7dae052644c", "size": "5249",...
"""Provides device automations for Cover.""" from __future__ import annotations import voluptuous as vol from homeassistant.components.automation import AutomationActionType from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA from homeassistant.components.homeassistant.triggers import ( num...
{ "content_hash": "509f69fc82d0ce6c76b333cdf2c0bdfe", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 85, "avg_line_length": 32.083769633507856, "alnum_prop": 0.5969321148825065, "repo_name": "kennedyshead/home-assistant", "id": "9b94833bb296412aa235bfb71535291d9b1adb05", ...
"""Test HTML utils""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import ctypes import os import nose.tools as nt from traitlets.tests.utils import check_help_all_output from notebook.utils import url_escape, url_unescape, is_hidden, is_file_hidden from ipyth...
{ "content_hash": "0459c0cc6ecbe7336cbe60f6f194b4fe", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 95, "avg_line_length": 37.472527472527474, "alnum_prop": 0.6730205278592375, "repo_name": "ammarkhann/FinalSeniorCode", "id": "8922beb38968077812768921bec9f58970ed3a3d", "s...
from __future__ import unicode_literals import os from collections import namedtuple, defaultdict from ansible.executor.task_queue_manager import TaskQueueManager from ansible.vars import VariableManager from ansible.parsing.dataloader import DataLoader from ansible.executor.playbook_executor import PlaybookExecutor ...
{ "content_hash": "778d0dee0b3dff32d95287b95b841623", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 97, "avg_line_length": 32.782467532467535, "alnum_prop": 0.535010399128454, "repo_name": "chenvista/flask-demos", "id": "7be9e947d1ec32fff58e07f6efab682b7b4b57bb", "size":...
r"""Wrapper script to set up import paths for endpointscfg. The actual implementation is in _endpointscfg_impl, but we have to set up import paths properly before we can import that module. See the docstring for endpoints._endpointscfg_impl for more information about this script's capabilities. """ import sys impor...
{ "content_hash": "812a03381769f797382871c85a6e2ff7", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 70, "avg_line_length": 29.125, "alnum_prop": 0.7682403433476395, "repo_name": "inklesspen/endpoints-python", "id": "1557cb74cd3a67ab93c31bee4d1eb757dc9431e7", "size": "1081...
"Base Cache class." from __future__ import unicode_literals import time import warnings from django.core.exceptions import DjangoRuntimeWarning, ImproperlyConfigured from django.utils.module_loading import import_string class InvalidCacheBackendError(ImproperlyConfigured): pass class CacheKeyWarning(DjangoRun...
{ "content_hash": "eb83a7047d641d2d3c41540d8877ede5", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 91, "avg_line_length": 35.87407407407407, "alnum_prop": 0.6121205864133802, "repo_name": "wetneb/django", "id": "26113aaa31fc09816d44afe31a162e80366ed9ee", "size": "9686",...
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.pylab as pylab import matplotlib import errno import ffn # General settings matplotlib.style.use('seaborn-colorblind') params = {'legend.fontsize': 'x-large', 'figure.figsize': (20, 10), 'figure.facec...
{ "content_hash": "e4df3a19e9a90f91724906ebbf5642b1", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 139, "avg_line_length": 41.040650406504064, "alnum_prop": 0.6492340200739567, "repo_name": "pnecchi/Thesis", "id": "fcc678adbc5b09fdad448a3df46c60a01fddc136", "size": "155...
from __future__ import unicode_literals, division, absolute_import import logging import csv import re from cgi import parse_header from flexget import plugin from flexget.event import event from flexget.utils import requests from flexget.utils.imdb import make_url from flexget.utils.cached_input import cached from fl...
{ "content_hash": "8bb87eac3994c65ebbc0d08e5ab05123", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 117, "avg_line_length": 41.27049180327869, "alnum_prop": 0.5574975173783515, "repo_name": "asm0dey/Flexget", "id": "94ab89329e1e8d21fdf4f0afd6cf1505ddff09be", "size": "503...
"""Utility functions for signurl command.""" import base64 from datetime import datetime import hashlib from gslib.utils.constants import UTF8 import six from six.moves import urllib _CANONICAL_REQUEST_FORMAT = ('{method}\n{resource}\n{query_string}\n{headers}' '\n{signed_headers}\n{hash...
{ "content_hash": "f60cdf65ac3eb61d1a45ad4b11e01f3f", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 80, "avg_line_length": 36.75590551181102, "alnum_prop": 0.6478149100257069, "repo_name": "GoogleCloudPlatform/gsutil", "id": "3aaf64a59d185c0616521d4484a4ad2c2e78230d", "s...
import sys import re from optparse import OptionParser from rdkit import Chem from rdkit.Chem import AllChem def smiles_to_smarts(smi): mol = Chem.MolFromSmiles(smi) if (mol is None): sys.stderr.write("Can't generate mol for: %s\n" % (smi)) return None #change the isotope to 42 for atom in mol.GetAt...
{ "content_hash": "332b9aa58f5f785d381b79be8e86a8b1", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 92, "avg_line_length": 29.32967032967033, "alnum_prop": 0.6421880854252529, "repo_name": "bp-kelley/rdkit", "id": "95ec2c4d6a52002acb8809dd433a2fde8f987382", "size": "4351"...
import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt import Procrustes def load_curve_data(filename): with open(filename) as f: line = f.readline() data = line.split(",") version = data[0] num_points = data[1] dat...
{ "content_hash": "eaaaa71151da24e86c8df5eafedb0218", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 92, "avg_line_length": 32.529411764705884, "alnum_prop": 0.64376130198915, "repo_name": "steveryb/pyprocrustes", "id": "240783e69a058377674aecd9f3bdd8eadffdad2f", "size": "...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class WalletTest (BitcoinTestFramework): def check_fee_amount(self, curr_balance, balance_with_fee, fee_per_byte, tx_size): """Return curr_balance after asserting the fee was in range""" fee = balance_...
{ "content_hash": "b1c590cb54439ff7ed029fdd92181859", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 165, "avg_line_length": 44.646198830409354, "alnum_prop": 0.6169362761150042, "repo_name": "rsdevgun16e/energi", "id": "d9d775f035d9b4a13ac4e510ca9469d2993ac825", "size": ...
{ ' (leave empty to detach account)': ' (leave empty to detach account)', ' Module is the main communications hub of the Sahana system. It is used to send alerts and/or messages using SMS & Email to various groups and individuals before, during and after a disaster.': ' Module is the main communications hub of the Sa...
{ "content_hash": "62261e813bdc41bddd959165e04197b8", "timestamp": "", "source": "github", "line_count": 4038, "max_line_length": 951, "avg_line_length": 61.80534918276374, "alnum_prop": 0.7370597427575429, "repo_name": "ptressel/sahana-eden-madpub", "id": "966fdfef4fe8dbb5db0078b1a0e3ab7ec74b4979", ...
""" The ios vlans fact class It is in this file the configuration is collected from the device for a given resource, parsed, and the facts tree is populated based on the configuration. """ from __future__ import absolute_import, division, print_function __metaclass__ = type from copy import deepcopy from ansible.mod...
{ "content_hash": "5cbfcf9680870ce4aacff774091e0352", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 80, "avg_line_length": 35.56115107913669, "alnum_prop": 0.5209387011936071, "repo_name": "thaim/ansible", "id": "0450ad9a398b967374741dac5e303430ff121a16", "size": "5089",...
import time from web3.exceptions import StaleBlockchain SKIP_STALECHECK_FOR_METHODS = set([ 'eth_getBlockByNumber', ]) def _isfresh(block, allowable_delay): return block and time.time() - block['timestamp'] <= allowable_delay def make_stalecheck_middleware( allowable_delay, skip_stalecheck...
{ "content_hash": "4e42aed2a60a464c1f3a02e4c3b105a0", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 98, "avg_line_length": 34.21739130434783, "alnum_prop": 0.6378653113087674, "repo_name": "pipermerriam/web3.py", "id": "cd2a9bd3b0787668c72b7579e5b15416cbccda95", "size": "...
import pylibmc try: mc = pylibmc.Client(["127.0.0.1"]) mc["some_key"] = "Some value" except pylibmc.ConnectionError: print("Could not connect")
{ "content_hash": "b07310fbd92c0eaaad2188f1cc4ab97d", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 38, "avg_line_length": 17.666666666666668, "alnum_prop": 0.6477987421383647, "repo_name": "jimlindeman/python-buildpack-collectd", "id": "6167d102b199b6d56e132ec3fd6f600394e32...
"""A module to help add Raspberry Pi IO expander chips. Examples: >>> from rasio import PinControler >>> control = PinControler() >>> control.add_mcp(0x20) >>> control.add_mcp(0x21) >>> control.add_mcp(0x22) """ from functools import partial import time import smbus class PinControler(object): ...
{ "content_hash": "5fa9c28ff6fbfe946b71fb293ca16cc5", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 84, "avg_line_length": 38.223880597014926, "alnum_prop": 0.5843420538852011, "repo_name": "Digirolamo/RasIO", "id": "94e8c9afd8a48e32730ccdc469559b557a1d8bbf", "size": "51...
import asyncio from unittest import mock import pytest from multidict import CIMultiDict from yarl import URL import aiohttp from aiohttp import web from aiohttp.test_utils import TestClient as _TestClient from aiohttp.test_utils import TestServer as _TestServer from aiohttp.test_utils import (AioHTTPTestCase, loop_c...
{ "content_hash": "ebe564c56e8e13d1241b19c99e864d6a", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 70, "avg_line_length": 28.866906474820144, "alnum_prop": 0.6301557632398754, "repo_name": "AraHaanOrg/aiohttp", "id": "8aef4e89db80e3d8ce6db81fb47fe724391968df", "size": "...
import sys try: import unittest2 as unittest except ImportError: import unittest from tests.base import BaseTestCase from pyasn1.compat import octets class OctetsTestCase(BaseTestCase): if sys.version_info[0] > 2: def test_ints2octs(self): assert [1, 2, 3] == list(octets.ints2octs...
{ "content_hash": "1c9ee335552f6f05dc4e2fb7ae3c4876", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 72, "avg_line_length": 30.56756756756757, "alnum_prop": 0.5797229590333038, "repo_name": "gsutil-mirrors/pyasn1", "id": "b40b1517b42a93475134b60b8995b590495225b1", "size":...
from __future__ import unicode_literals, division, absolute_import import logging from flexget import options from flexget.event import event from flexget.manager import Session from flexget.utils.tools import console log = logging.getLogger('perftests') TESTS = ['imdb_query'] def cli_perf_test(manager, options): ...
{ "content_hash": "6527001566651eafd89f1eacfc807970", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 104, "avg_line_length": 33.05194805194805, "alnum_prop": 0.6542239685658153, "repo_name": "BrainDamage/Flexget", "id": "f900ebe10978a7a7c83a468ec6bd944b70e12a04", "size": "...
import collections import decimal import json as jsonlib import os import random import re from operator import attrgetter from urlparse import urljoin from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.forms import CheckboxInput from django.utils.translation import ( ...
{ "content_hash": "8a0d90dbc3432ca3f99d94f8b925916a", "timestamp": "", "source": "github", "line_count": 565, "max_line_length": 78, "avg_line_length": 29.67787610619469, "alnum_prop": 0.642175572519084, "repo_name": "harikishen/addons-server", "id": "0539d7913d1bf707c368cd7077e7747975310646", "size...
import datetime import json import mimetypes import os import re import sys import time from email.header import Header from http.client import responses from urllib.parse import quote, urlparse from django.conf import settings from django.core import signals, signing from django.core.exceptions import DisallowedRedir...
{ "content_hash": "24d55253238d3f49721e6729aee7c220", "timestamp": "", "source": "github", "line_count": 589, "max_line_length": 97, "avg_line_length": 35.61290322580645, "alnum_prop": 0.6059305873379099, "repo_name": "georgemarshall/django", "id": "269953c0aff3f9b834ab4ea9e715aab8d6fb2c2b", "size":...
from BinPy.config.constants import *
{ "content_hash": "c0c30cfe83b3f52018ec79431871c952", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 36, "avg_line_length": 37, "alnum_prop": 0.8108108108108109, "repo_name": "MridulS/BinPy", "id": "13349713789b51979160e0807a0b50f88c1f69ca", "size": "37", "binary": false,...
from .profile_edit import *
{ "content_hash": "706c20f3889b133ebfb55d9c3984175e", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 27, "avg_line_length": 27, "alnum_prop": 0.7777777777777778, "repo_name": "vinoth3v/In", "id": "245f1e9f9c2a1eb6ec3896f2ff053fd0963f824b", "size": "28", "binary": false, ...
import pytest # noqa from django.template.base import Context, Template def test_import(): import apptemplates assert apptemplates.__name__ == 'apptemplates' def test_render(): c = Context() t = Template('{% extends "admin:admin/base.html" %}') t.render(c)
{ "content_hash": "7f0d3db010a0f9ea7a4d66592510f726", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 21.692307692307693, "alnum_prop": 0.6631205673758865, "repo_name": "jdotjdot/django-apptemplates", "id": "199bc240c6cb7063fa5b3341fb429d3d1008d175", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='User', fields=[ ('...
{ "content_hash": "1da45537b4ac8bcbaf763df97b46b64a", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 185, "avg_line_length": 32.8974358974359, "alnum_prop": 0.5424785658612626, "repo_name": "tassolom/twq-app", "id": "e034f02cf8d829f79e5b70874af06edbde4741ac", "size": "1356...
import subprocess, uuid from PIL import Image, ImageDraw, ImageFont from StringIO import StringIO from utils import guess_type, create_temporary_file, get_video_duration, resize_image, file_extension_for_type from constants import MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO, DEFAULT_DURATION, SNAP_IMAGE_DIMENSIONS from excepti...
{ "content_hash": "e9b4145b85e84511d1f210414179b193", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 110, "avg_line_length": 34.1125, "alnum_prop": 0.5851960425064126, "repo_name": "ahoskins/Snapper", "id": "d4e820bc256e80baf71ec95b1995106c3eed1659", "size": "2729", "bin...
"""Define a model for favorited referendums.""" from sqlalchemy import ( Column, Integer, UnicodeText, ForeignKey ) from .meta import Base class FavoriteReferendum(Base): """Define a model for favorited referendums.""" __tablename__ = 'favoritereferendums' id = Column(Integer, primary_ke...
{ "content_hash": "9243c02029d2f585c3a7821b562697bd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 52, "avg_line_length": 24, "alnum_prop": 0.6895833333333333, "repo_name": "Elections-R-Us/Elections-R-Us", "id": "f637ac3067ac743fa5bcb0be60ff7f4ad748dea8", "size": "480", ...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General conf...
{ "content_hash": "68d1a3808ad23a87ad85189904621c6a", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 79, "avg_line_length": 31.577868852459016, "alnum_prop": 0.7046073977936405, "repo_name": "apetrone/gemini", "id": "556235a04acd4c1e5930ae76effaaff4b35aee1f", "size": "812...
""" WSGI config for sample project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sample.settings") from django.core.wsg...
{ "content_hash": "d937594329037db83b15610bb6388dd8", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.642857142857142, "alnum_prop": 0.772609819121447, "repo_name": "cmheisel/ebdocker-py", "id": "5990b83c6aff841b2dac6acc22c5433f7bf2b751", "size": "...
import requests import unicodecsv from io import StringIO #what country has the most serious earthquakes lately? url = "http://python-gijc15.s3.eu-central-1.amazonaws.com/all_month.csv" r = requests.get(url) text = StringIO(r.text) reader = unicodecsv.DictReader(text, dialect='excel') new_collection = [] for row i...
{ "content_hash": "71f04504443424c5299945a46ab546b5", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 95, "avg_line_length": 25.128205128205128, "alnum_prop": 0.6632653061224489, "repo_name": "tommeagher/pythonGIJC15", "id": "22c41451f136c5ab0a63fa5a75910c13a9b41021", "size...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('boards', '0055_auto_20170311_0321'), ] operations = [ migrations.AddField( model_name='board', name='identicon', ...
{ "content_hash": "643fdab3280f28a33fd82d133202dc9b", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 195, "avg_line_length": 34.56521739130435, "alnum_prop": 0.6276729559748427, "repo_name": "diegojromerolopez/djanban", "id": "44490e731457d2692bdf2420155b2c70ea95b5db", "si...
""" Generator for C/C++. """ # Serge Guelton: The licensing terms are not set in the source package, but # pypi[1] says the software is under the MIT license, so I reproduce it here # [1] http://pypi.python.org/pypi/cgen # # Copyright (C) 2008 Andreas Kloeckner # # Permission is hereby granted, free of charge, to any ...
{ "content_hash": "cddbd581be580bc522eac3f9e1015ca4", "timestamp": "", "source": "github", "line_count": 522, "max_line_length": 79, "avg_line_length": 29.683908045977013, "alnum_prop": 0.5794127137786382, "repo_name": "artas360/pythran", "id": "3bdbdba87f884604318d2458b15df52e3a585272", "size": "15...
import imp from setuptools import setup, find_packages version = imp.load_source('pyluos.version', 'pyluos/version.py') with open("README.md", "r") as fh: long_description = fh.read() setup(name='pyluos', version=version.version, author="Luos", author_email="[email protected]", url="https://...
{ "content_hash": "3a7bfb1c7b3ca519ff3ba0c67419ef0a", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 112, "avg_line_length": 32.648648648648646, "alnum_prop": 0.5223509933774835, "repo_name": "pollen/pyrobus", "id": "944c34ddfbd95755e1dd678c45b907bedf30b237", "size": "1231...
from djangospam.akismet import moderator import warnings def register(*args, **kwargs): warnings.warn("Using 'register' from djangospam.akismet is deprecated. \ Import it from djangospam.akismet.moderator instead.",\ category=DeprecationWarning, stacklevel=2) return register.moderator(*args, **kwargs) cla...
{ "content_hash": "f811032643e039897045add9bf38daa0", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 76, "avg_line_length": 46.172413793103445, "alnum_prop": 0.7221807318894697, "repo_name": "leandroarndt/djangospam", "id": "6f591120ae45b2a6cc17ca651f5277b67ecc173a", "size...
""" .. _ex-inverse-source-power: ========================================== Compute source power using DICS beamformer ========================================== Compute a Dynamic Imaging of Coherent Sources (DICS) :footcite:`GrossEtAl2001` filter from single-trial activity to estimate source power across a frequency...
{ "content_hash": "d226f3d504380da67641c91a95805bd6", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 78, "avg_line_length": 34, "alnum_prop": 0.696078431372549, "repo_name": "Teekuningas/mne-python", "id": "a73ee81f90c8a242f40ba34c7b4e4f8c5b8e08d1", "size": "3492", "bin...
from unittest import TestCase from tapiriik.testing.testtools import TestTools, TapiriikTestCase from tapiriik.sync import Sync from tapiriik.services import Service from tapiriik.services.interchange import Activity, ActivityType, Waypoint, WaypointType from tapiriik.sync import Sync from datetime import datetime, ...
{ "content_hash": "cf98c8adfbc6695013c8ad9fb8934f38", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 166, "avg_line_length": 56.84563758389262, "alnum_prop": 0.6665879574970484, "repo_name": "dmschreiber/tapiriik", "id": "b86272b97fd8c3a29bbd0b0dad2c538f4257069f", "size":...
from .Portals import Portals
{ "content_hash": "7ba83ad876c1c7ad41372000e303ce6b", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 28, "avg_line_length": 28, "alnum_prop": 0.8571428571428571, "repo_name": "DavidWhittingham/agsadmin", "id": "7a3d33f019604a9d682ba53c279b506fcb078997", "size": "28", "bin...
import re import json import urllib.parse import demistomock as demisto # noqa: F401 import requests from CommonServerPython import * # noqa: F401 # disable insecure warnings requests.packages.urllib3.disable_warnings() entryList = [] deviceList = [] deviceEntry = {} args = demisto.args() if 'hostname' in args: ...
{ "content_hash": "fbf412bde40baa4e353476eabb493ff0", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 117, "avg_line_length": 34.47787610619469, "alnum_prop": 0.6083162217659137, "repo_name": "demisto/content", "id": "495ab73ad05a8d192688378827dd7d4456ecb4f0", "size": "779...
__author__ = 'amryf' #!/usr/bin/env python # -*- coding: utf-8 -*- from ctypes import * import time from .ic_grabber_dll import IC_GrabberDLL from .ic_exception import IC_Exception from .ic_property import IC_Property from . import ic_structures as structs from IPython import embed GrabberHandlePtr = POINTER(struc...
{ "content_hash": "5a50c32c0ccafee4f6acbbc99a8486e6", "timestamp": "", "source": "github", "line_count": 485, "max_line_length": 105, "avg_line_length": 32.705154639175255, "alnum_prop": 0.5535871895095196, "repo_name": "amryfitra/icpy3", "id": "50e7a004e9c1431706ed78ce6a9adb63171ab4c8", "size": "15...
""" WSGI config for agilepkg project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETT...
{ "content_hash": "c306cfc3514bedd59b246efd575b8139", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.5625, "alnum_prop": 0.7709923664122137, "repo_name": "lerina/agileAuth", "id": "d0f1f4fafe100afaaafd0baf891a7afcde8b3105", "size": "393", "binar...
from __future__ import unicode_literals from django.core.exceptions import PermissionDenied from django.http import Http404 from django.test import TestCase from django.template import TemplateDoesNotExist, Template import django.template.loader from rest_framework import status from rest_framework.compat import patter...
{ "content_hash": "24a50e22e617e301cb2bf56a5ae11378", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 78, "avg_line_length": 34.90833333333333, "alnum_prop": 0.6700883265695871, "repo_name": "MobileWebApps/backend-python-rest-gae", "id": "95ca42341e00a8f12546ff54ee8e0f54c4dd...
import android_commands import constants import logging import os import run_tests_helper import subprocess import time class FakeDns(object): """Wrapper class for the fake_dns tool.""" _FAKE_DNS_PATH = constants.TEST_EXECUTABLE_DIR + '/fake_dns' def __init__(self, adb): """ Args: adb: the An...
{ "content_hash": "baaadc3c237c823b6d040b2656b5264f", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 80, "avg_line_length": 33.86206896551724, "alnum_prop": 0.6537678207739308, "repo_name": "paul99/clank", "id": "cc7cb5af4e8f9c0d31eed2f1c1b6a40dbc800de9", "size": "2149", ...
import docker import docker.errors try: from kazoo.client import KazooClient except ImportError: print("Kazoo library not found, Zookeeper connect URLs will not work") KazooClient = None class SwarmClient: def __init__(self, swarm_url): assert isinstance(swarm_url, str) self.cli = Non...
{ "content_hash": "e6154d116e5c25c9c4fcbcd05995d8cf", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 74, "avg_line_length": 32.57142857142857, "alnum_prop": 0.5450558213716108, "repo_name": "DistributedSystemsGroup/swarm-dns", "id": "a521f8b5c5a004613ffe8f519b7574f829db6e3d"...
""" Utilities to assist with orchestrating and testing an onprem deployment """ import copy import itertools import logging from typing import List import requests from retrying import retry from ssh.ssher import Ssher from test_util.helpers import ApiClientSession, Host, Url log = logging.getLogger(__name__) def...
{ "content_hash": "9b5c9699016b687b33ce8440fca4d084", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 102, "avg_line_length": 37.60669456066945, "alnum_prop": 0.6011348464619493, "repo_name": "vishnu2kmohan/dcos", "id": "497a4ff02ca49a2293a97584de6cd9ebf9a5e827", "size": "...
import json import os import re from os import walk # TODO - handle types used by conf files def get_examples(src_dir, path_index): examples = {} fbp_files = [] for (dirpath, dirnames, filenames) in walk(src_dir): for filename in filenames: if filename.endswith(".fbp"): ...
{ "content_hash": "b77bd13e95a062ebf41619d3be35f3f1", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 87, "avg_line_length": 31.934065934065934, "alnum_prop": 0.5677907777013076, "repo_name": "bsmelo/soletta", "id": "49501f029b1dfe4c42696b37fe3a98539016735a", "size": "3874"...
import matplotlib.pyplot as plt def plot(S, limit, plt_num=1): fig=plt.figure(plt_num) rpoints=[cnum.real for cnum in S] cpoints=[cnum.imag for cnum in S] plt.plot(rpoints, cpoints, 'ro') plt.axis([-limit, limit, -limit, limit]) plt.grid() def quniver(start, cvector, limit, plt_num=1): fig...
{ "content_hash": "d0fc86b5097a5262d0214cbf24d42407", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 104, "avg_line_length": 28.894736842105264, "alnum_prop": 0.644808743169399, "repo_name": "RyodoTanaka/Coding_The_Matrix", "id": "bd683e3fca2c18849055ba47f8e075d484f15b6f", ...
""" Qt utilities. """ import os from qtpy.compat import to_qvariant from qtpy.QtCore import Qt, QLocale, QTranslator, QLibraryInfo, QTimer from qtpy.QtWidgets import QAction, QApplication, QMenu, QToolButton def qapplication(translate=True, test_time=3): """Return QApplication instance Create...
{ "content_hash": "e72651533be11f03b30fb5d4ffb49b9e", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 79, "avg_line_length": 33.63865546218487, "alnum_prop": 0.6325256057956533, "repo_name": "spyder-ide/conda-manager", "id": "feddbc305709a7274b329863293ee41623a51556", "siz...
import os import unittest from conans.test.utils.tools import TestClient from conans.paths import CONANFILE conanfile = """ from conans import ConanFile, tools class AConan(ConanFile): name = "Hello0" version = "0.1" def build(self): self.output.warn("build() IN LOCAL CACHE=> %s" % str(self.in_l...
{ "content_hash": "514661e67e1a5a98e5713f2e0d22b511", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 84, "avg_line_length": 33.27536231884058, "alnum_prop": 0.6337108013937283, "repo_name": "birsoyo/conan", "id": "e56dcfeff0eca18ef9df79d1a0c3e8ccbc59fb99", "size": "2296", ...
def main(request, response): response.headers.set("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'") response.headers.set("X-Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'") response.headers.set("X-WebKit-CSP", "default-src 'none'; style-src 'unsafe-inline'...
{ "content_hash": "87a3c9a6b1e4e51d44248b2a3fa4c140", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 102, "avg_line_length": 42.42372881355932, "alnum_prop": 0.7203355972832601, "repo_name": "yugang/crosswalk-test-suite", "id": "2a45ef8585581fd326bf6e63056d41ff4beeb4c2", "...
from website import db class Position(db.Model): id = db.Column(db.Integer, primary_key=True) key = db.Column(db.Text) name = db.Column(db.Text)
{ "content_hash": "b0e2d0fc2d5c68f98f1436e3df26479e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 48, "avg_line_length": 22.714285714285715, "alnum_prop": 0.6729559748427673, "repo_name": "alexraileanu/worldcup", "id": "7db0fc5ed587c00edddc6a30a1abe6ace48fc15b", "size": ...
""" A minimal array class for debugging distributed AbstractShardedProbabilityFunction operations. The array class can be used instead of jax-arrays to debug operations on the static attributes of AbstractShardedProbabilityFunction for cases where using actual jax-arrays would be infeasible due to memory constraints. "...
{ "content_hash": "c28646fc1211d6714ad7fe2e84e5e6dd", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 82, "avg_line_length": 31.788732394366196, "alnum_prop": 0.6566238369517058, "repo_name": "google/distla_core", "id": "64032cb0e93ac8e98ac6273533821114888552f2", "size": "2...
"""Helpers for testing django apps.""" import os.path try: from PIL import Image except ImportError: try: import Image except ImportError: Image = None from django.conf import settings from django.db import models class StandardModel(models.Model): foo = models.CharField(max_length=...
{ "content_hash": "305dfb869c96659923d50a39707f9820", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 75, "avg_line_length": 20.00862068965517, "alnum_prop": 0.7035760448082723, "repo_name": "rrauenza/factory_boy", "id": "20cdb8c04e773dfd9e488f8ee1571a8e88f19a7c", "size": ...
from .vip_dataset import load_stock_data
{ "content_hash": "e929744be39cfc2d31f487fa864458b7", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 40, "avg_line_length": 41, "alnum_prop": 0.8048780487804879, "repo_name": "stonewell/learn-curve", "id": "8572ac8f21554559456eb3bcd0c218e6fc6c13ab", "size": "81", "binary"...
""" WSGI config for {{cookiecutter.project_name}} project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the...
{ "content_hash": "2945c522a5b9b868e716b07ec577d5b7", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 89, "avg_line_length": 43.193548387096776, "alnum_prop": 0.7871545929798357, "repo_name": "wildfish/wildfish-django-starter", "id": "27619299eb07e3afbc60fe69457bc20b8b6100c9"...
from functools import wraps from .. import Filter from webob.exc import HTTPUnauthorized, HTTPForbidden class AuthenticationProvider: def __init__(self, ctx, request): self.request = request self.ctx = ctx @property def principal(self): raise HTTPUnauthorized() def has_permis...
{ "content_hash": "bc07ed538561e1a836f07240b86e6b0b", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 79, "avg_line_length": 28.603448275862068, "alnum_prop": 0.6154309825195902, "repo_name": "comynli/m", "id": "10880671b75ea59cefca2000d249fa44e5d5306f", "size": "1659", "...
""" oVirt dynamic inventory script ================================= Generates dynamic inventory file for oVirt. Script will return following attributes for each virtual machine: - id - name - host - cluster - status - description - fqdn - os_type - template - tags - statistics - devices When run in --li...
{ "content_hash": "7b766d017c005f3d5fb8e0bac6baaa02", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 96, "avg_line_length": 29.282157676348547, "alnum_prop": 0.6001133626186765, "repo_name": "wwitzel3/awx", "id": "cf2f7ad3c98b1b178faa8c716ce0f65ede3c679d", "size": "7797",...
import os import __main__ as main import Lib.ModulLoader as mod from Lib.ClinqApp import ClinqApp import logging scriptDir = os.path.dirname(os.path.realpath(main.__file__)) logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s', datefmt='%m-%d...
{ "content_hash": "d20f403560da02c5556feb85b6a7ffcf", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 73, "avg_line_length": 25.105263157894736, "alnum_prop": 0.6677148846960168, "repo_name": "Ahn1/Clinq", "id": "529c841abd7d43ba742f1787ada532a12417ed8f", "size": "977", "...
from hashlib import sha512 from openprocurement.api.utils import ( json_view, opresource, APIResource, save_tender, ROUTE_PREFIX, context_unpack ) from openprocurement.relocation.api.utils import ( extract_transfer, update_ownership, save_transfer ) from openprocurement.relocation.api.valida...
{ "content_hash": "412c7129cd3ae3a7de495551137f936e", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 110, "avg_line_length": 40.55357142857143, "alnum_prop": 0.6261558784676354, "repo_name": "Leits/openprocurement.relocation.api", "id": "d1dc89a42c8d2d21763117348b29ccb43b162...
""" This module holds all view functions for the authentication module. These functions include the following: """ from flask import Blueprint, flash, redirect, render_template, request, session, url_for from app import logger from app.mod_auth.form import LoginForm, RegistrationForm from app.mod_auth.helper import ...
{ "content_hash": "b7246de1394b25c8fae3dd2c357fc634", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 88, "avg_line_length": 39.55434782608695, "alnum_prop": 0.6564990381973069, "repo_name": "Zillolo/mana-vault", "id": "75c0459a598c975f7dce633a16fa081cb766d9fb", "size": "36...
""" ************************* Plot classes and tools for use in Orange widgets ************************* The main class of this module is :obj:`.OWPlot`, from which all plots in visualization widgets should inherit. This module also contains plot elements, which are normally used by the :obj:`.OWPlot`, but can al...
{ "content_hash": "dc2ff35ba2dfe5de87ad5e6100897eb6", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 88, "avg_line_length": 23.444444444444443, "alnum_prop": 0.655608214849921, "repo_name": "qusp/orange3", "id": "46adf8b04ee658d0182709b336a4a8b57884469e", "size": "633", ...
import json import os import pathlib import pytest import string from autorelease import github from autorelease.common import _determine_language, guess_language if not os.environ.get("GITHUB_TOKEN"): pytest.skip( "skipping tests that require a valid github token", allow_module_level=True ) def re...
{ "content_hash": "aa904a95fca948d278d315ba3e9b3a8e", "timestamp": "", "source": "github", "line_count": 1852, "max_line_length": 88, "avg_line_length": 35.05453563714903, "alnum_prop": 0.7112336532092851, "repo_name": "googleapis/releasetool", "id": "b8144b493d8f5b5c15c4cb291d2d3bc95073effb", "size...
from setuptools import setup, find_packages setup( name="livereload_server", version='0.1', description="A livereloading HTTP server for static files", keywords='http,server,livereload', author='Prashanth Ellina', author_email="Use the github issues", url="https://github.com/prashanthellina...
{ "content_hash": "888ad22729bece03806f81758967cfb6", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 63, "avg_line_length": 27.6, "alnum_prop": 0.6347826086956522, "repo_name": "prashanthellina/livereload_server", "id": "c5f8c54a0768e5fa763851ad18b9798d554b39bb", "size": "...
from msrest.serialization import Model class EventTypesListResult(Model): """Result of the List Event Types operation. :param value: A collection of event types :type value: list of :class:`EventType <azure.mgmt.eventgrid.models.EventType>` """ _attribute_map = { 'value': {'key': 'v...
{ "content_hash": "199d362745f128151697bf94e8539dbd", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 57, "avg_line_length": 24.764705882352942, "alnum_prop": 0.6294536817102138, "repo_name": "samedder/azure-cli", "id": "f6964bb6970fec16e578cef9d1c16c54f82caafa", "size": "1...
from parser.Parser import Parser, ParserUtils from schema.PgSequence import PgSequence class AlterSequenceParser(object): @staticmethod def parse(database, statement): parser = Parser(statement) parser.expect("ALTER", "SEQUENCE") sequenceName = parser.parseIdentifier() schemaN...
{ "content_hash": "5163042a1417e8ec3bfa3183e8d18e02", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 129, "avg_line_length": 34.9375, "alnum_prop": 0.6332737030411449, "repo_name": "Dancer3809/PgDumpLoader", "id": "800d5c1a214d88993b86cb8852f5231f6dd59e7d", "size": "1118",...