text
stringlengths
4
1.02M
meta
dict
from pykechain.exceptions import _DeprecationMixin from pykechain.models import DatetimeProperty class DatetimeProperty2(DatetimeProperty, _DeprecationMixin): """A virtual object representing a KE-chain datetime property.""" pass
{ "content_hash": "8d3121c4d221b4791b66090714cc9faf", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 69, "avg_line_length": 30.125, "alnum_prop": 0.8049792531120332, "repo_name": "KE-works/pykechain", "id": "e7d01cf698ba8e16cedae5b292c73c0b246a3fed", "size": "241", "binar...
""" Passenger WSGI file for IGG. Ensures that a virtualenv exists and that the current interpreter is the one inside this virtualenv. Also appends ``apps`` and ``src`` to the current python path so that the igg and third-party modules can be imported. Imports the Django WSGI application handler from ``igg.wsgi``. ""...
{ "content_hash": "e5be6280474d379b2b6a7f8e84a5f1a4", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 79, "avg_line_length": 30.5, "alnum_prop": 0.7081967213114754, "repo_name": "IndieGamesForGood/IGG-v2", "id": "3269b23bce2fc7336a78ba62c8c5c5037730b31f", "size": "1220", ...
DEPS = [ 'checkout', 'env', 'infra', 'recipe_engine/file', 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/python', 'recipe_engine/step', 'run', 'vars', ] DOCKER_IMAGE = 'gcr.io/skia-public/gold-karma-chrome-tests:68.0.3440.106_v6' INNER_KARMA_SCRIPT = '/SRC/skia/infra/canvaskit/t...
{ "content_hash": "92a6d9768a41048b8f23f883b304811d", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 82, "avg_line_length": 32.73381294964029, "alnum_prop": 0.5876923076923077, "repo_name": "Hikari-no-Tenshi/android_external_skia", "id": "849d9c4b738425a6de670071c22ad5adf6b...
__author__ = "Guillaume Luchet <[email protected]>" from rest_framework import serializers from geelweb.django.quickpoll.models import Poll, Question, Rule class PollSerializer(serializers.ModelSerializer): class Meta: model = Poll class RuleSerializer(serializers.ModelSerializer): class Meta: ...
{ "content_hash": "02b2ff297d7556d49a1baf9e2fb957a3", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 64, "avg_line_length": 28.25, "alnum_prop": 0.7492625368731564, "repo_name": "geelweb/geelweb-django-quickpoll", "id": "e5e4ec9c8c8862bc370fc2c1958876e97e33a341", "size": "...
""" Handles all requests relating to consistency groups. """ import functools from oslo.config import cfg from cinder.db import base from cinder import exception from cinder.i18n import _ from cinder.openstack.common import excutils from cinder.openstack.common import log as logging from cinder.openstack.common imp...
{ "content_hash": "9bf649a4e957696cd46f54ebc01b9e7f", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 79, "avg_line_length": 38.80548628428928, "alnum_prop": 0.5561339245549772, "repo_name": "e0ne/cinder", "id": "b1ae8e47f03d5db67c643877e548e8d5287e2e57", "size": "16204", ...
from collections import defaultdict from typing import ( Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Set, Tuple, Union, ) import orjson from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.core.exceptions imp...
{ "content_hash": "b739efef7416ecaaa8d0ec0b20e2ff0e", "timestamp": "", "source": "github", "line_count": 811, "max_line_length": 109, "avg_line_length": 42.057953144266335, "alnum_prop": 0.6385997830484623, "repo_name": "showell/zulip", "id": "8e53fa7d016d927e028867472d12634f0df749f0", "size": "3410...
''' Created on 10 dec. 2013 @author: TuRz4m ''' import ConfigParser import logging import sys from api.APIUtils import BetaSerieAPI, BadLoginException, SickBeardAPI import os.path logger = logging.getLogger(__name__) logging.getLogger(__name__).setLevel(logging.INFO) logging.getLogger(__name__).addHand...
{ "content_hash": "611aab5308d7df40eac2ad23517ac552", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 185, "avg_line_length": 38.736170212765956, "alnum_prop": 0.5448753158299462, "repo_name": "TuRz4m/BetaBeard", "id": "3e421af24838ddaca7fa83c53e020f951139a8b2", "size": "9...
from datetime import timedelta, datetime from mock import Mock, MagicMock from azurelinuxagent.common.osutil.default import DefaultOSUtil from azurelinuxagent.common.protocol.goal_state import RemoteAccess from azurelinuxagent.common.protocol.util import ProtocolUtil from azurelinuxagent.common.protocol.wire import Wi...
{ "content_hash": "62bc08316699a55af1f17d39622ce97f", "timestamp": "", "source": "github", "line_count": 494, "max_line_length": 161, "avg_line_length": 54.520242914979754, "alnum_prop": 0.6244012920951992, "repo_name": "Azure/WALinuxAgent", "id": "37187702e3812f537132ef04d4288be354c9a81e", "size": ...
""" Script to handle interwiki links based on Wikibase. This script connects pages to Wikibase items using language links on the page. If multiple language links are present, and they are connected to different items, the bot skips. After connecting the page to an item, language links can be removed from the page. Th...
{ "content_hash": "72a1c9f23096b43e58b42829bec2b6a6", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 79, "avg_line_length": 34.149193548387096, "alnum_prop": 0.5742118313850514, "repo_name": "hasteur/g13bot_tools_new", "id": "a480dfda39954d94baded973dc10cbd4ce3a73d5", "si...
""" MoinMoin - run standalone server, optionally daemonizing it @copyright: 2008 MoinMoin:ForrestVoight @license: GNU GPL, see COPYING for details. """ import os import sys import signal from MoinMoin.script import MoinScript from MoinMoin.util.daemon import Daemon from MoinMoin.web.serving import run_se...
{ "content_hash": "df6f282e4b6a35c248e01286b3287de6", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 145, "avg_line_length": 36.6096256684492, "alnum_prop": 0.5718667835232253, "repo_name": "RealTimeWeb/wikisite", "id": "80a72e27301771a6371af76d565b090895aff973", "size": ...
import io import sys import unittest def is_weird(value): if (value % 2) == 1: return True if 2 <= value <= 5: return False if 6 <= value <= 20: return True return False def main(): print('Weird' if is_weird(int(input().strip())) else 'Not Weird') if __name__ == '__main...
{ "content_hash": "486eddb6374b74bc4ac1404724ed342c", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 73, "avg_line_length": 27.022222222222222, "alnum_prop": 0.5542763157894737, "repo_name": "altermarkive/Coding-Interviews", "id": "020fb0fa17764450cc746c65510ef1871546f2b2", ...
__author__ = "Markus Gumbel" __copyright__ = "The authors" __license__ = "Apache 2" __email__ = "[email protected]" __status__ = "Production" from PySteppables import SteppableBasePy class ModuroSteppable(SteppableBasePy): def __init__(self, simulator, model, _frequency=1): SteppableBasePy.__init__(...
{ "content_hash": "23fa74fbdf892bbb0ef556eafbce7d09", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 61, "avg_line_length": 30, "alnum_prop": 0.6492063492063492, "repo_name": "informatik-mannheim/Moduro-CC3D", "id": "25261e3ab5efe95f5ce616b8e34e6c61b25ef771", "size": "1244...
""" Authors: Thomas J. Sargent, John Stachurski Filename: lss.py Computes quantities related to the Gaussian linear state space model x_{t+1} = A x_t + C w_{t+1} y_t = G x_t The shocks {w_t} are iid and N(0, I) """ from textwrap import dedent import numpy as np from numpy.random import multivariate_no...
{ "content_hash": "48e17f8027504d1a8c971874ab2b783d", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 72, "avg_line_length": 30.66181818181818, "alnum_prop": 0.532139468690702, "repo_name": "chenxulong/quanteco", "id": "c25a6eb9ce9505542c1e6f4ce311c383b572d823", "size": "8...
import sys import os.path #sys.path.insert(0, '/home/andy/theano/tool_examples/theano-lstm-0.0.15') from theano_lstm import Embedding, LSTM, RNN, StackedCells, Layer, create_optimization_updates, masked_loss from utilities import * import dill import argparse #import cPickle import pickle import numpy from collections...
{ "content_hash": "102d845e3831971e7db0fc3fcf2ef599", "timestamp": "", "source": "github", "line_count": 709, "max_line_length": 164, "avg_line_length": 36.34555712270804, "alnum_prop": 0.6830299972835577, "repo_name": "darongliu/Lstm_Turing_LM", "id": "441640342e688624f6c3f22f477e5eea51bf73e0", "si...
''' Test for deleting and expunge iso cloned vm ops. The key step: -add iso -create vm1 from iso -clone vm2 from vm1 -del iso -attach iso/volume to vm2 -expunge and detach iso -migrate vm2 @author: PxChen ''' import os import apibinding.inventory as inventory import zstackwoodpecker.test_util as test_util import zst...
{ "content_hash": "b265e53cf778cfa7ce5828771578aaa3", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 117, "avg_line_length": 28.586206896551722, "alnum_prop": 0.6948130277442702, "repo_name": "zstackorg/zstack-woodpecker", "id": "4d0850631793210b6c0da454c0ddc6965cc4f674", ...
from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from ampadb.support import is_admin from usermanager.models import Profile @login_required def index(request): if is_admin(request.user): return redirect('contactboard:adminlist') profile = Profile....
{ "content_hash": "ea2836c1f24037375e9a5d97a0a1b984", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 74, "avg_line_length": 30, "alnum_prop": 0.7683333333333333, "repo_name": "ampafdv/ampadb", "id": "da27a125bde6718ca9cf55a6095f9e5f5df407e7", "size": "600", "binary": fal...
import struct, sys def seekread(f, offset=None, length=0, relative=True): if (offset != None): # offset provided, let's seek f.seek(offset, [0,1,2][relative]) if (length != 0): return f.read(length) def parse_pbzx(pbzx_path): section = 0 xar_out_path = '%s.part%02d.cpio.xz' % (...
{ "content_hash": "6f628978cfa5df92144473cf5189ce30", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 111, "avg_line_length": 34.971014492753625, "alnum_prop": 0.5337753833402403, "repo_name": "phatblat/dotfiles", "id": "1b92e55ffa89fd9b2e31990151b15556be17d369", "size": "2...
import os import sqlite3 from time import time, strftime, gmtime from waskr.config import options import log # Fixes Database Absolute Location FILE_CWD = os.path.abspath(__file__) FILE_DIR = os.path.dirname(FILE_CWD) DB_FILE = FILE_DIR+'/waskr.db' # Engines Supported engines_supported = ['sqlite', 'mongodb'] cla...
{ "content_hash": "eaf658db7dbc7fdf1271740964d0fa60", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 106, "avg_line_length": 25.933333333333334, "alnum_prop": 0.5780389276533235, "repo_name": "AloneRoad/waskr", "id": "ce5a6d147fd5270a884a91784e35f820bf587d8e", "size": "27...
import numpy as np import pdb """ Factor Graph classes forming structure for PGMs Basic structure is port of MATLAB code by J. Pacheco Central difference: nbrs stored as references, not ids (makes message propagation easier) Note to self: use %pdb and %load_ext autoreload followed by %autorelo...
{ "content_hash": "1501fd46c6e51633e7b1a46ea133c8ad", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 98, "avg_line_length": 35.65841584158416, "alnum_prop": 0.5415798972650284, "repo_name": "dksahuji/pyfac", "id": "1c62d671512e720a3a7d35d9e80bfd5957fa4736", "size": "7203"...
""" Role tests """ import os import pytest from testinfra.utils.ansible_runner import AnsibleRunner testinfra_hosts = AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') @pytest.mark.parametrize('name,codenames', [ ('openjdk-8-jdk', ['stretch']), ('openjdk-11-jdk', ['bionic', 'buster...
{ "content_hash": "2d7c9d63351b296209c926f9773e59bf", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 79, "avg_line_length": 33.18421052631579, "alnum_prop": 0.6352101506740682, "repo_name": "infOpen/ansible-role-openjdk-jdk", "id": "480c98169036d8fb5f54386fd2169ad6081aff29",...
from rest_framework import viewsets from rest_framework.response import Response from rest_framework.exceptions import PermissionDenied import django_filters from lims.permissions.permissions import IsInStaffGroupOrRO from lims.shared.mixins import AuditTrailViewMixin from lims.shared.mixins import StatsViewMixin fr...
{ "content_hash": "5d80ac9a4abbed37bfa03b99dade0e65", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 98, "avg_line_length": 40.5, "alnum_prop": 0.687616909839132, "repo_name": "GETLIMS/LIMS-Backend", "id": "5225b1664c9441d677f9570d6d70d232c49d3274", "size": "2674", "bina...
from msrest.exceptions import ( ClientException, SerializationError, DeserializationError, TokenExpiredError, ClientRequestError, AuthenticationError, HttpOperationError, ) from .api_client import AutoRestComplexTestService, AutoRestComplexTestServiceConfiguration __all__ = [ 'ClientEx...
{ "content_hash": "908484c75fd963b2adb0a9695b7c07ca", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 91, "avg_line_length": 24.782608695652176, "alnum_prop": 0.7508771929824561, "repo_name": "vulcansteel/autorest", "id": "dd72afda441ee3a0826690ab9e3c167d06961f02", "size": ...
import pdb import json import couchdb import re from collections import defaultdict import unicodedata def initial_data(): couch = couchdb.Server('http://isak:[email protected]:5984') db = couch['x_flowcells'] view = db.view('names/project_ids_list') #Creates a proj -> FCs structure...
{ "content_hash": "5f43d64e9ebba562393f61578b592b82", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 139, "avg_line_length": 41.53, "alnum_prop": 0.5550204671321936, "repo_name": "sylvinite/cluster_pooler", "id": "38e7b44ce1cdc60d1c24f638f1a91b034fcfeea4", "size": "4153",...
from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^register/$', 'accounts.views.register', name='accounts_register'), url(r'^login/$', 'accounts.views.login', name='accounts_login'), url(r'^logout/$', 'accounts.views.logout', name='accounts_logout'), url(r'^password/r...
{ "content_hash": "e504073ae685ede9780fc9cb5d3d942c", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 94, "avg_line_length": 50.63636363636363, "alnum_prop": 0.6678635547576302, "repo_name": "theju/f1oracle", "id": "d5ea187d40c2e1a4e8e906130255b317c8779d98", "size": "557", ...
from django.db import models class TimeStampedModel(models.Model): """ Абстрактный базовый класс, предоставляющий поля создания и обновления экземпляра """ created = models.DateTimeField('Создан', auto_now_add=True) updated = models.DateTimeField('Обновлён', auto_now=True) class Meta: abstract = True
{ "content_hash": "07ccd020b96ec4c89f62df19f6480fb1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 60, "avg_line_length": 22.5, "alnum_prop": 0.7587301587301587, "repo_name": "h4/fuit-webdev", "id": "d869a73f1bacbae718575cedbb0a9126c261a9fc", "size": "417", "binary": f...
''' liveMic.py Returns opens mic and returns frameData ''' import pyaudio import numpy class mic(): CHUNK = 1024 p = pyaudio.PyAudio() def __init__(self, **kwargs): FORMAT = pyaudio.paInt16 CHANNELS = 2 self.RATE = 44100 self.form = FORMAT self.stream = ...
{ "content_hash": "6478cf14c04ee2559a6357a478313aff", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 70, "avg_line_length": 24.205882352941178, "alnum_prop": 0.5504252733900364, "repo_name": "ThisIsRobokitty/sound-particle-generator", "id": "0c8cf83e19dfba7de647430439a301c1d...
"""SEED agent using Keras.""" import collections from seed_rl.common import utils import tensorflow as tf AgentOutput = collections.namedtuple('AgentOutput', 'action q_values') AgentState = collections.namedtuple( # core_state: the opaque state of the recurrent core of the agent. # frame_stacking_state: a lis...
{ "content_hash": "4623073f5399a67392b5fe036e42a10b", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 80, "avg_line_length": 40.39692307692307, "alnum_prop": 0.6482595780333613, "repo_name": "google-research/seed_rl", "id": "b2a692632377f5b0b8a62b48b0f4df3babd00a2e", "size...
"""ApacheParser is a member object of the ApacheConfigurator class.""" import fnmatch import itertools import logging import os import re import subprocess from letsencrypt import errors from letsencrypt_apache import constants logger = logging.getLogger(__name__) class ApacheParser(object): """Class handles t...
{ "content_hash": "80fafcd4ad488ed21950d956b765b383", "timestamp": "", "source": "github", "line_count": 644, "max_line_length": 91, "avg_line_length": 37.45031055900621, "alnum_prop": 0.5716062691765487, "repo_name": "TheBoegl/letsencrypt", "id": "3c13aae5ff3ceeb0225c9e467813596735ffbb07", "size": ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('django_docusign_demo', '0001_initial'), ] operations = [ migrations.AlterField( model_name='signer', name='email', ...
{ "content_hash": "1e4c9948e3202a49284094b511309584", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 138, "avg_line_length": 28.956521739130434, "alnum_prop": 0.6081081081081081, "repo_name": "novafloss/django-docusign", "id": "51fdb3f654bf70f1374b0085c6e4d8475a47acaa", "s...
''' Copyright 2014-2015 Teppo Perä Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to i...
{ "content_hash": "8a23af964e1c27b0650f597183451cb8", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 75, "avg_line_length": 38.55, "alnum_prop": 0.7704280155642024, "repo_name": "Debith/py2traits", "id": "62db016b46433a1de0a00b08562c17667f9cc81d", "size": "818", "binary"...
import testtools from unittest import mock from troveclient.v1 import databases """ Unit tests for databases.py """ class DatabasesTest(testtools.TestCase): def setUp(self): super(DatabasesTest, self).setUp() self.orig__init = databases.Databases.__init__ databases.Databases.__init__ = m...
{ "content_hash": "09016f3be8a74f5f0e6bee971f7a4f4c", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 77, "avg_line_length": 36.098765432098766, "alnum_prop": 0.6025991792065664, "repo_name": "openstack/python-troveclient", "id": "d8b30eaec20fdc1cdbdd7376f02c2904d05432c5", ...
"""pySTS - Server Application""" import select from hashlib import sha256 import pysts.util as sutil import pysts.cryptography as crypto from pysts.protocol import STSClient from pysts.protocol import STServer from pysts.protocol import STSWorker def comunicate(worker, connection): """Comunicate with client""" ...
{ "content_hash": "8ab9b797ac2c06a4929f91090373c022", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 63, "avg_line_length": 26.254901960784313, "alnum_prop": 0.5959671396564601, "repo_name": "c-square/homework", "id": "8236375221c95daffc3e7c63cc696f5be9ba90fa", "size": "13...
"""Provides an easy-to-use Python interface to NLPIR/ICTCLAS. The functions below are not as extensive as the full set of functions exported by NLPIR (for that, see :mod:`pynlpir.nlpir`). A few design choices have been made with these functions as well, e.g. they have been renamed and their output is formatted differe...
{ "content_hash": "ce184ac730b994d4c5b20f54c0da3ccc", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 79, "avg_line_length": 39.36363636363637, "alnum_prop": 0.6126935249337097, "repo_name": "tsroten/pynlpir", "id": "349e74ce531f35410186ca21a5005d4acdd9b05f", "size": "1173...
import sys import unittest import getpass import inspect import atom.mock_http_core import gdata.gauth """Loads configuration for tests which connect to Google servers. Settings used in tests are stored in a ConfigCollection instance in this module called options. If your test needs to get a test related setting, us...
{ "content_hash": "431d9dc5c91d01a2fb5956ab3d09fb4b", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 82, "avg_line_length": 40.716981132075475, "alnum_prop": 0.6749304911955515, "repo_name": "webmedic/booker", "id": "d6310ea9817c7d65a8fc5c4438770ecf8f758d8e", "size": "178...
import numpy as np from net import Controller from director import vtkAll as vtk from director.debugVis import DebugData from director import ioUtils, filterUtils class MovingObject(object): """Moving object.""" def __init__(self, velocity, polydata): """Constructs a MovingObject. Args: ...
{ "content_hash": "067b62603c84883f9259625942bc73c8", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 79, "avg_line_length": 28.38050314465409, "alnum_prop": 0.540831024930748, "repo_name": "anassinator/dqn-obstacle-avoidance", "id": "1ef3500df417636c9ae3b0088446ad11cba3330e...
from tokit.models import Token def get_api_key(aKey) : try : token = Token.objects.get( key = aKey, is_valid=True ) return token except Token.DoesNotExist : return None def extract_api_key(request): if hasattr(request, "META"): if request.META.get("HTTP_API_KEY") : # HTTP i...
{ "content_hash": "227bb73826be5e18f482522a073ed6e8", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 89, "avg_line_length": 30.42105263157895, "alnum_prop": 0.6072664359861591, "repo_name": "nfb-onf/tokit", "id": "23ea3ec555a165421def1f2054848df51416c422", "size": "691", ...
from __future__ import division, print_function try: from astropy.io import fits as pyfits except ImportError: try: import pyfits except ImportError: raise ImportError('You need astropy or pyfits modules') import os import numpy as np def TPF2Im(filename,newdir=True): """ Convert ...
{ "content_hash": "e25a58bd76dccd3a22047e24b9840ee0", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 88, "avg_line_length": 28, "alnum_prop": 0.5612244897959183, "repo_name": "mrtommyb/TPFtoImages", "id": "446672472794e0304a165b54b6e182ebc5b87165", "size": "1568", "binar...
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 ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION if sys.version_info >= (3, 8): from typing i...
{ "content_hash": "dfe598b200bf7d90dee0c1ba6cec50ed", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 107, "avg_line_length": 52.49230769230769, "alnum_prop": 0.7215709261430246, "repo_name": "Azure/azure-sdk-for-python", "id": "377c11fab5174e80515fbcb2fb62d8cdd4b10f84", "s...
from flask import render_template, current_app, send_from_directory, abort from flask.ext.login import login_required, current_user import os from .blueprint import * from ..models import * @roster.route('/') @roster.permission_required('view-roster') @roster.menu('index', None) def index(): return render_temp...
{ "content_hash": "bb0da7773be55039ae7ef8c93ffdd50c", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 75, "avg_line_length": 25.414634146341463, "alnum_prop": 0.7005758157389635, "repo_name": "team294/surfmanage", "id": "8cf54138af4b16d47ff1c8029e1bc777f391c8bf", "size": "1...
from django.shortcuts import render from pool_app.models import * import json from django.core.exceptions import ObjectDoesNotExist from django.contrib.auth.decorators import login_required from django.contrib.auth import logout from django.views.decorators.csrf import csrf_protect from django.shortcuts import render_t...
{ "content_hash": "36e820abaebab39267a87ad691e788c9", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 81, "avg_line_length": 32.619883040935676, "alnum_prop": 0.6964861957690929, "repo_name": "kantanand/pool", "id": "4d2605339896b4365124ea54d444db2191c5abc3", "size": "5578...
from __future__ import unicode_literals import logging import threading import spotify from spotify import ffi, lib, serialized, utils __all__ = ['Artist', 'ArtistBrowser', 'ArtistBrowserType'] logger = logging.getLogger(__name__) class Artist(object): """A Spotify artist. You can get artists from trac...
{ "content_hash": "53c7cf58f9648dd7015c7ad8547d6c64", "timestamp": "", "source": "github", "line_count": 459, "max_line_length": 80, "avg_line_length": 31.14161220043573, "alnum_prop": 0.5831817545823422, "repo_name": "mopidy/pyspotify", "id": "867812ae9266ae06917136214cf2dddbd9fcd7b8", "size": "142...
"""Hardware interfaces for sound output""" # Authors: Dan McCloy <[email protected]> # Eric Larson <[email protected]> # # License: BSD (3-clause) import sys import os import warnings import numpy as np import pyglet _use_silent = (os.getenv('_EXPYFUN_SILENT', '') == 'true') _opts_dict = dict(linux2=('pulse',...
{ "content_hash": "27e10d4b00f321adc9689f16d8f42cca", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 78, "avg_line_length": 31.425, "alnum_prop": 0.6004375497215593, "repo_name": "rkmaddox/expyfun", "id": "0558e7ec3d74394335b43208c587c86c4a4a0f21", "size": "5028", "bina...
"""Test cases for /api/robot, mostly focusing on csv output""" from unittest.mock import patch import dateutil.parser from django.utils import timezone from guardian.shortcuts import assign_perm from rest_framework.test import APIClient, APITestCase from metaci.api.views.robot import RobotTestResultViewSet from meta...
{ "content_hash": "e24fb60d51d7331d90da514c4ca68f1c", "timestamp": "", "source": "github", "line_count": 380, "max_line_length": 116, "avg_line_length": 41.4, "alnum_prop": 0.5814263920671243, "repo_name": "SalesforceFoundation/mrbelvedereci", "id": "7ca3e98aa7b3a5e05816fd6f860813d478bac405", "size"...
"""Contains the Service and ServiceImage models.""" from django.contrib.gis.db import models as geo_models from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ from autoslug import AutoSlugField from django_markdown.models import MarkdownFie...
{ "content_hash": "b14b7b0fc926415c97f0c61a956f5a23", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 76, "avg_line_length": 30.526315789473685, "alnum_prop": 0.6735632183908046, "repo_name": "empowerhack/HealthMate", "id": "a99d1ffe95ee58a7b7d6293814da8b5dfbbcaf33", "size"...
__version__ = '$Id$' import cgitb; cgitb.enable() import os, cgi, urllib # #(C) 2009 Legoktm, MIT License # import monobook class Page: def __init__(self, name, repmess = 'status'): try: self.qstring = dict(cgi.parse_qsl(os.environ['REQUEST_URI'].split('?')[1])) except IndexError: ...
{ "content_hash": "5448b07786eacbac9a51592f4da64770", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 227, "avg_line_length": 36.11834319526627, "alnum_prop": 0.5791284403669725, "repo_name": "legoktm/legobot-old", "id": "cacc39e9b79a9e0580801fb474f3e8d10607df2a", "size": ...
import hazelcast client = hazelcast.HazelcastClient( # Set up cluster name for authentication cluster_name="YOUR_CLUSTER_NAME", # Set the token of your cloud cluster cloud_discovery_token="YOUR_CLUSTER_DISCOVERY_TOKEN", # If you have enabled encryption for your cluster, also configure TLS/SSL for t...
{ "content_hash": "a1fb46cdef3fa99c4ea082443c912b28", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 93, "avg_line_length": 30.545454545454547, "alnum_prop": 0.6964285714285714, "repo_name": "hazelcast/hazelcast-python-client", "id": "de7eca04602d2d054043fb59d43ab0e24ade8158...
import redis from redis import sentinel from redis import exceptions import random class DisconnectingSentinel(sentinel.Sentinel): """ sentinel that disconnections after slave/master discovery """ def disconnect_sentinels(selfie): for s in selfie.sentinels: s.connection_pool.disco...
{ "content_hash": "9115cf9b82c086f57b2017b069e7c871", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 79, "avg_line_length": 36.51923076923077, "alnum_prop": 0.5726698262243286, "repo_name": "alanquillin/twiceredis", "id": "b348d6225d8797e37dca9408133e6ac133876e86", "size"...
from configparser import ConfigParser, NoOptionError # End Python 3 import requests import os import shutil import fnmatch import time import getpass import itertools from ltk import exceptions from ltk.apicalls import ApiCalls from ltk.utils import * from ltk.managers import DocumentManager, FolderManager from ltk.con...
{ "content_hash": "4cdca40329bd48bad0ecfa4ab4801842", "timestamp": "", "source": "github", "line_count": 568, "max_line_length": 168, "avg_line_length": 43.4137323943662, "alnum_prop": 0.5776389959041324, "repo_name": "Lingotek/translation-utility", "id": "541307ec23476dccb6736955756ba1e9f95dc53a", ...
import _plotly_utils.basevalidators class AutorangeValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="autorange", parent_name="layout.scene.xaxis", **kwargs ): super(AutorangeValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "20e6f705224dc63d86e251ad424e003a", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 81, "avg_line_length": 37.266666666666666, "alnum_prop": 0.6028622540250447, "repo_name": "plotly/plotly.py", "id": "753bbaa11906a5131051bd2810a73a670d5b0ebd", "size": "559...
import os.path import shutil import time import urlparse import sys try: import engage except: sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))) import engage.tests.test_common as tc from engage.engine.cmdline_install import APPLICATION_ARCHIVE_PROP from engage.engine.password...
{ "content_hash": "91af51f41f852b05fe302c1c8f9c7570", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 94, "avg_line_length": 39.128, "alnum_prop": 0.6150071560008178, "repo_name": "quaddra/engage", "id": "2977a19fbef68d8e26a7b06ab9c95e772e1ba5de", "size": "4891", "binary...
""" WSGI config for web 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/dev/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings") from django.core.wsgi impo...
{ "content_hash": "ba2c669cd64f3421fcd90a3060bafbf1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.214285714285715, "alnum_prop": 0.7716535433070866, "repo_name": "mblaauw/pre-publish-predictor", "id": "2b0f73c3a32995baf11f84090e97efd82c2f9792", ...
from __future__ import print_function from __future__ import division from freetype import * def platform_name(platform_id): for key, value in TT_PLATFORMS.items(): if value == platform_id: return key return 'Unknown platform' def encoding_name(platform_id, encoding_id): if platform_id...
{ "content_hash": "16ce4a36cbd7944c7d8739782c5b9935", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 60, "avg_line_length": 30.3, "alnum_prop": 0.5962596259625963, "repo_name": "davidcox/freetype-py", "id": "ffebc00a5f253952b2a6d9dfaf83f956991743d2", "size": "2149", "bin...
__title__ = 'wp2github' __description__ = 'Convert WordPress plugin readme file to GitHub Flavored Markdown' __version_info__ = (1, 1, 3) __version__ = '.'.join(map(str, __version_info__)) __author__ = 'Sergey Storchay' __author_email__ = '[email protected]' _url_ = 'https://github.com/r8/wp2github.py'
{ "content_hash": "96f143e6a5301cc67148514cf93a0bcd", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 84, "avg_line_length": 42.714285714285715, "alnum_prop": 0.6454849498327759, "repo_name": "r8/wp2github.py", "id": "072ec6a01f49b6a963267619491f191008a9c27a", "size": "299",...
from setuptools import setup from codecs import open with open('README.rst', 'r', 'utf-8') as f: readme = f.read() setup( name="reflexif", packages=['reflexif'], version="0.1.0.dev2", author="Christoph Schmitt", author_email="[email protected]", description="A library to read, inspect and ...
{ "content_hash": "36e6fb0b0e6a2a6ff46eca93e8300c43", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 93, "avg_line_length": 30.366666666666667, "alnum_prop": 0.6278814489571899, "repo_name": "chschmitt/reflexif", "id": "62e009cf3aa27cac99da743a1f89988da35f511e", "size": "9...
import unittest from g1.operations.databases.bases import interfaces class InterfacesTest(unittest.TestCase): def test_next_key(self): self.assertEqual(interfaces.next_key(b'\x00'), b'\x01') self.assertEqual(interfaces.next_key(b'\x01'), b'\x02') self.assertEqual(interfaces.next_key(b'\x...
{ "content_hash": "e8c653f7e1781f3d1b2c23016a58ca5a", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 75, "avg_line_length": 37.130434782608695, "alnum_prop": 0.6358313817330211, "repo_name": "clchiou/garage", "id": "b13461d7814234f8d51c3958608fd8caff543f83", "size": "854",...
""" Flask App Setup :Author: Fabio Scala <[email protected]> """ import os import sys import config basedir = config.basedir appdir = os.path.abspath(os.path.dirname(__file__)) from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.cache import Cache cache = Cache(config={'CACHE_TYPE': 'simple'}) db = S...
{ "content_hash": "c2efaaf68622c2806440cf949a8b2f5a", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 89, "avg_line_length": 23.36, "alnum_prop": 0.7080479452054794, "repo_name": "fabioscala/poitour-backend", "id": "b8256ffaf3f11f0e4d35b8b619f92ab5db0b9659", "size": "1168",...
import unittest import numpy import collections import paddle.fluid as fluid import paddle.fluid.core as core from paddle.fluid.initializer import ConstantInitializer from paddle.fluid.param_attr import WeightNormParamAttr class TestWeightNormalization(unittest.TestCase): batch_size = 3 hidden_size = 5 da...
{ "content_hash": "87f07f04c1b61c2e07823aea0fc8e088", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 80, "avg_line_length": 36.77570093457944, "alnum_prop": 0.5212198221092758, "repo_name": "jacquesqiao/Paddle", "id": "436f9b9f86fb86270e47c8e30c5c0701787ca0f1", "size": "4...
""" Manage the output messages for the user. """ import sys OK = "ok" ANOMALY = "ANOMALY" SKIPPING = "collecting data" INITIAL_STATE = (None, -1, -1) def update_state(prev, skipped, anomaly_detected, timestamp): """ Update the state and print the status to the stdout """ prev_state, prev_streak, last_change...
{ "content_hash": "eb8ed2c81fe6c91550c41d8d6db0b9f7", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 70, "avg_line_length": 26.36, "alnum_prop": 0.6198786039453718, "repo_name": "simonrozsival/mff-ai-anomaly-detector", "id": "18186b18b539caec0222b7675fa96b08884e5718", "siz...
import sys import os ############################################################################### # monkey patch sphinx to suppress "nonlocal image URI found" warning # http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format # https://github.com/SuperCowPowers/workbe...
{ "content_hash": "c448e63ccc9e81364fc98ff3d6cbdcb1", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 106, "avg_line_length": 31.863970588235293, "alnum_prop": 0.7005884389061959, "repo_name": "sotte/nphelper", "id": "62331b9d12d661b41f6610e4b3976756e20f68ca", "size": "908...
import unittest from hwt.hdl.constants import INTF_DIRECTION, DIRECTION from hwt.pyUtils.arrayQuery import single, NoValueExc class BaseSynthesizerTC(unittest.TestCase): def assertIsM(self, intf): self.assertEqual(intf._direction, INTF_DIRECTION.MASTER) def assertIsS(self, intf): self.assertE...
{ "content_hash": "194e4a321ba954fbfa245b22acd77401", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 106, "avg_line_length": 35.714285714285715, "alnum_prop": 0.688, "repo_name": "Nic30/hwtLib", "id": "9ba06dadae74b285bb0388cdea34672cab1bb5d9", "size": "1000", "binary": ...
from subprocess import check_call from random import randint from time import sleep from abc import ABC from os import makedirs class captureAgent (ABC): ''' captureAgent uses applescript helper functions to automatically take pictures of parts of websites. The class that instantiates this abstract b...
{ "content_hash": "47eb338a017555b861a1d457692ef529", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 74, "avg_line_length": 38, "alnum_prop": 0.6056588840522359, "repo_name": "scarrico/BayAreaFresh", "id": "ef753de7bad2c93114f59b68a3c8a5c9c00e7463", "size": "5119", "bin...
""" Django settings for project project. Generated by 'django-admin startproject' using Django 1.10. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
{ "content_hash": "a260eed7277ee29c1efcf20302ea5372", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 91, "avg_line_length": 26.05426356589147, "alnum_prop": 0.6810473073490033, "repo_name": "sicnarf74/alpine-djangorestframework-docker", "id": "4606e39a84e49c210539ce4fea268a...
from __future__ import print_function from __future__ import absolute_import from builtins import str import ctypes from collections import defaultdict, namedtuple from . import lib_openal as al from . import lib_alc as alc import pyglet from pyglet.debug import debug_print from pyglet.media.exceptions import MediaEx...
{ "content_hash": "632658e15d3d47dcb3f72436ef6a4391", "timestamp": "", "source": "github", "line_count": 500, "max_line_length": 92, "avg_line_length": 34.518, "alnum_prop": 0.5951097977866621, "repo_name": "nicememory/pie", "id": "2c2ce60747e61ba3d27c8277533ef56f5f26057d", "size": "18981", "binar...
""" grid.place_network_ui.py -- Chaco2 and Traits UI interface for PlaceNetwork model class Subclass of grid.place_network.PlaceNetwork which enables a graphical interface. Copyright (c) 2007 Columbia University. All rights reserved. """ # Library imports import numpy, time, wx # Package imports from .place_network...
{ "content_hash": "a46d0b93646d76aff28adcf9988b554d", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 111, "avg_line_length": 39.15238095238095, "alnum_prop": 0.504986621260034, "repo_name": "jdmonaco/grid-remapping-model", "id": "0cd614b06160c7c2f6c21a4657b8bf63c064e89b", ...
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.pagin...
{ "content_hash": "a1131ece934baac27acada6525204f80", "timestamp": "", "source": "github", "line_count": 814, "max_line_length": 208, "avg_line_length": 44.853808353808354, "alnum_prop": 0.6493111664977678, "repo_name": "Azure/azure-sdk-for-python", "id": "8f282710cde00c87e21c868c60e008a079ed19c5", ...
from oslotest import base as test_base import testscenarios.testcase from oslo.i18n import _locale class LocaleDirVariableTest(testscenarios.testcase.WithScenarios, test_base.BaseTestCase): scenarios = [ ('simple', {'domain': 'simple', 'expected': 'SIMPLE_LOCALEDIR'}), ...
{ "content_hash": "8989d8315f2ca8d27454136be69167ba", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 34.77777777777778, "alnum_prop": 0.6357827476038339, "repo_name": "citrix-openstack-build/oslo.i18n", "id": "ca874829352983a37f1d0e38b344426463e438de",...
"""Define tests for v2 Sensor objects.""" # pylint: disable=unused-argument import aiohttp import pytest from simplipy import API from simplipy.errors import SimplipyError from tests.common import TEST_AUTHORIZATION_CODE, TEST_CODE_VERIFIER, TEST_SYSTEM_ID @pytest.mark.asyncio async def test_properties_v2(aresponse...
{ "content_hash": "cdd69fb4fa098d1db8d85d8ead4c6fe1", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 84, "avg_line_length": 35.5, "alnum_prop": 0.6859154929577465, "repo_name": "w1ll1am23/simplisafe-python", "id": "9115043df0ab4beb770002f44e644d4115ac2c73", "size": "1420",...
from .fitters import * from .regions import * from .optregion import * from .findbase import * from .fit import * from .utils import OptionalAttributeError
{ "content_hash": "1398b0c7ce8b18aa9065d007f7327445", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 41, "avg_line_length": 26, "alnum_prop": 0.7756410256410257, "repo_name": "hamogu/psfsubtraction", "id": "6052eb0c63e3acfbf90dd28c30532b8a4e336161", "size": "156", "binary...
from . someclass import *
{ "content_hash": "b8684e879472271b41cb1e5eab1836f3", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 25, "avg_line_length": 26, "alnum_prop": 0.7307692307692307, "repo_name": "audy/SomePackage", "id": "b6a239ab2e0dc4426c830af2d6d43db170ffa501", "size": "26", "binary": fal...
from .action import * from .page import * from .form import * from .hook import * @IN.register def register(): ''' instance : class - class type assigned directly instance - instance will be created and assigned, all object will use the same member instance ''' return { # all field type class should have Fie...
{ "content_hash": "e9721b7b1ae6049a54e3ccc80d071e8b", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 96, "avg_line_length": 26.52173913043478, "alnum_prop": 0.6295081967213115, "repo_name": "vinoth3v/In", "id": "3b6708b21c9042b611463c617e463dca470ddf08", "size": "610", "...
from django import forms from tinycontent.models import TinyContent class GIODOMixin(object): def __init__(self, *args, **kwargs): super(GIODOMixin, self).__init__(*args, **kwargs) self.fields['giodo'] = forms.BooleanField(required=True) try: self.fields['giodo'].label = TinyC...
{ "content_hash": "831d7a07e4bdff3d7d07147897d9d66c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 89, "avg_line_length": 35.38461538461539, "alnum_prop": 0.65, "repo_name": "ad-m/django-atom", "id": "fabd72a4392f94024ffe132283a045f7e026debb", "size": "460", "binary": ...
"""Serves a list of stations found via multicast. Run with: python -m openhtf.output.servers.dashboard_server """ import argparse import collections import json import logging import socket import threading import time from openhtf.output.servers import pub_sub from openhtf.output.servers import station_server f...
{ "content_hash": "62c17b6014fdb215b2ff7d51ec533ba1", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 95, "avg_line_length": 30.690821256038646, "alnum_prop": 0.6604753659688336, "repo_name": "google/openhtf", "id": "a1276dacf2397534ab6d11e4acc80ae25cc44f56", "size": "6929...
import geojson.geometry from typing import Callable, Tuple from shapely.geometry import LineString def geojson_linestring_to_shp_linestring(geojson_linestring: geojson.geometry.LineString, coordinate_convertor: Callable[[float, float], Tuple[float, float]] = None) -> LineString: points = [] for point in geojson_l...
{ "content_hash": "6fd2dcf16c3bc17f0f8f128d862b5536", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 91, "avg_line_length": 28.05263157894737, "alnum_prop": 0.7504690431519699, "repo_name": "aicenter/roadmap-processing", "id": "e8b20f4826e919d35265da88a8e42e34846884ab", "s...
from collections import namedtuple from io import BytesIO from operator import attrgetter, itemgetter from dateutil.relativedelta import relativedelta from flask import flash, jsonify, redirect, render_template, request, session from markupsafe import Markup, escape from marshmallow import fields from marshmallow_enum...
{ "content_hash": "4db5517298e1d25636888769b701ca57", "timestamp": "", "source": "github", "line_count": 866, "max_line_length": 120, "avg_line_length": 45.45842956120092, "alnum_prop": 0.6167094266771661, "repo_name": "DirkHoffmann/indico", "id": "6e1002667f05c9adab9c12a7e58a7c38a4d91684", "size": ...
"""Console functionality for command line tools.""" import codecs import getpass import shutil import sys import textwrap from django.core.exceptions import ValidationError from django.core.management.color import color_style, no_style from django.utils import termcolors _console = None class _StyledWrapperIndent...
{ "content_hash": "661b769353326e7041ba4290b28dfe4f", "timestamp": "", "source": "github", "line_count": 733, "max_line_length": 79, "avg_line_length": 30.289222373806275, "alnum_prop": 0.5234213133951896, "repo_name": "reviewboard/reviewboard", "id": "42b30513db6f10af19f86d451bdb14ec13362cb8", "siz...
from django.test import TestCase from rest_framework.test import APIClient from django.core.urlresolvers import reverse from .models import Company, Team from users.models import User class CompanyTest(TestCase): def setUp(self): self.client = APIClient() def test_api_can_create_team(self): ...
{ "content_hash": "c662cbcbb7a65b94b4d6bdef58a54fd8", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 84, "avg_line_length": 30.7, "alnum_prop": 0.5537459283387622, "repo_name": "teamworkquality/twq-app", "id": "190968a80e782a54ebb23262b6ba39f789367615", "size": "3377", ...
from django.core import management if __name__ == "__main__": management.execute_from_command_line()
{ "content_hash": "5a355b345b39bd138baf4546c987f9a8", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 42, "avg_line_length": 26.5, "alnum_prop": 0.6792452830188679, "repo_name": "boooka/GeoPowerOff", "id": "208a0fa7ddaaae718bce93e13ce7048ac1a4b397", "size": "165", "binary"...
from unittest import mock from senlin.common import consts from senlin.common import exception as exc from senlin.common import scaleutils as su from senlin.engine import cluster as cm from senlin.policies import base as pb from senlin.policies import region_placement as rp from senlin.tests.unit.common import base fr...
{ "content_hash": "5cd94fcb7e3aefce56457c1acec2c686", "timestamp": "", "source": "github", "line_count": 414, "max_line_length": 79, "avg_line_length": 36.97584541062802, "alnum_prop": 0.5796968905147635, "repo_name": "stackforge/senlin", "id": "4e994f928e2103b1afcc3f094cb3d0e63335c1be", "size": "15...
import argparse import boto import boto.ec2 from boto_cli import configure_logging from boto_cli.ec2 import * import logging log = logging.getLogger('boto_cli') from pprint import pprint # configure command line argument parsing parser = argparse.ArgumentParser(description='Create snapshots of EBS volumes in all/some ...
{ "content_hash": "6b52728aab63ac2241e0c3048c7f761c", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 152, "avg_line_length": 45.96363636363636, "alnum_prop": 0.7021360759493671, "repo_name": "cityindex-attic/ec2-clock-accuracy-research", "id": "a71a91a2d9c3b42fe86d2197839fd9...
"""@package src.wi.utils.messages_ajax @author Piotr Wójcik @date 23.11.2010 """ import json from django.http import HttpResponse from django.utils.translation import ugettext as _ from wi.utils.exceptions import RestErrorException def success(message, status=0): """ Returns json encoded ajax response. ...
{ "content_hash": "e68d40af1c6f514c6c6e29071abbff38", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 145, "avg_line_length": 25.84, "alnum_prop": 0.6509287925696594, "repo_name": "cc1-cloud/cc1", "id": "756f9b6774bde24b9404f81a37981c458aab36cc", "size": "1991", "binary":...
import wrappers import piqi import piq import piqi_of_json # config # # TODO: make configurable piq_relaxed_parsing = True # state # # TODO, XXX: wrap in a Parser class? _depth = 0 class ParseError(Exception): def __init__(self, loc, error): self.depth = _depth # used for backtracking self.e...
{ "content_hash": "e4b069d39fa69c2732acc386944d0914", "timestamp": "", "source": "github", "line_count": 560, "max_line_length": 127, "avg_line_length": 32.68928571428572, "alnum_prop": 0.591554681525183, "repo_name": "alavrik/piqi-python", "id": "ab95c13612d9d557faa82de06774b71ee39e7b40", "size": "...
from ._wrapper import * from ._utils import * from ._kernels import * from ._settings import *
{ "content_hash": "5af51ad085dcd168d1c98755e8ee8e10", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 24, "avg_line_length": 23.75, "alnum_prop": 0.7052631578947368, "repo_name": "johnnygreco/hugs", "id": "968a2389ba74916eb0f7191ce3895cfc656ab4b4", "size": "95", "binary": ...
import ctypes lib = ctypes.cdll.LoadLibrary("./libijson.so"); def compact(value): out = ctypes.create_string_buffer(len(value)) out_len = lib.ijson_compact(value, len(value), out) return out.raw[:out_len]
{ "content_hash": "a71effb9c1e2c04cfc1795f6e894d346", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 55, "avg_line_length": 27.375, "alnum_prop": 0.6894977168949772, "repo_name": "NegativeMjark/indolent-json", "id": "dd4d0c4fa92c5bd95328895b7de86e94bd15bcc1", "size": "219",...
from userprofile.models import UserProfile from social_auth.backends.facebook import FacebookBackend from social_auth.backends.twitter import TwitterBackend def update_user_social_data(backend, details, response, social_user, uid, user, *args, **kwargs): """Update the information for ...
{ "content_hash": "65f281d09e7c2270a53134ce9f1c0b95", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 73, "avg_line_length": 33.9, "alnum_prop": 0.668141592920354, "repo_name": "andresfcardenas/marketing-platform", "id": "bbcacdeb4efa180909c9c4cd15e1e5e49e591f0f", "size": "...
from malscrape.misc import validate_media from bs4 import BeautifulSoup as soup import requests def extract_info(html): page_data = soup(html, 'html.parser') return { 'members': _extract_members(page_data), 'name': _extract_mal_title(page_data), 'eng_name': _extract_english_name(page_d...
{ "content_hash": "3379924f53092cc561f5e283bd95669c", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 81, "avg_line_length": 26.12280701754386, "alnum_prop": 0.5845086187597941, "repo_name": "Arctice/anime-birb-uk", "id": "93035370ed8bf6e36fa382e1b1e6ef0c218244e3", "size":...
import dynet import numpy as np class CRF(): def __init__(self, model, id_to_tag): self.id_to_tag = id_to_tag self.tag_to_id = {tag: id for id, tag in id_to_tag.items()} self.n_tags = len(self.id_to_tag) self.b_id = len(self.tag_to_id) self.e_id = len(self.tag_to_id) + 1 ...
{ "content_hash": "3fa0b093003ac98a558bd233875ef4e4", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 113, "avg_line_length": 43.12820512820513, "alnum_prop": 0.5661910424098295, "repo_name": "onurgu/ner-tagger-tensorflow", "id": "5c88233baeb93a072bd0368628f3e0248b191dad", ...
from setuptools import setup import version setup( name = 'distci', version = version.git_version(), packages = [ 'distci', 'distci.frontend', 'distci.distcilib', 'distci.worker', 'distci.worker.build_control', 'distci.wor...
{ "content_hash": "a344fc06534635a3235284912a6e82fa", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 100, "avg_line_length": 42.395348837209305, "alnum_prop": 0.521667580910587, "repo_name": "F-Secure/distci", "id": "67844a532e1d3779b80f67b6c3db48a51a8c2f94", "size": "1845...
import pytest from six import PY2 from datadog_checks.dev.tooling.configuration.consumers.example import DESCRIPTION_LINE_LENGTH_LIMIT from ..utils import get_example_consumer, normalize_yaml def test_option_no_section(): consumer = get_example_consumer( """ name: foo version: 0.0.0 ...
{ "content_hash": "325b5f398d697ae6d9ff96f9af2529c7", "timestamp": "", "source": "github", "line_count": 1711, "max_line_length": 120, "avg_line_length": 25.26300409117475, "alnum_prop": 0.465748987854251, "repo_name": "DataDog/integrations-core", "id": "dc39461eb83ad2670003fb661b542dac544a700c", "s...
""" sockless ======== A friendlier interface to `socket`. ``sockless`` emulates file-like objects, allowing you to call familiar methods & iterate over the lines. It also includes Usage:: import sockless with sockless.open('irc.freenode.net:6665', mode='rw') as sock: # Writing. sock.write(...
{ "content_hash": "5df48ddcb5d6daad8d055a4d904ea881", "timestamp": "", "source": "github", "line_count": 375, "max_line_length": 78, "avg_line_length": 23.266666666666666, "alnum_prop": 0.5365042979942694, "repo_name": "toastdriven/sockless", "id": "78274cf6c8989b57e1a06c3080a8fb4bdfad934f", "size":...
from jsonrpc import ServiceProxy import sys import string import getpass # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:2627") e...
{ "content_hash": "c0fdb619fbea29fd914add096f3a9541", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 101, "avg_line_length": 28.673590504451038, "alnum_prop": 0.5684570009313877, "repo_name": "zeurocoin-dev/zeurocoin", "id": "7bf8016e58e03f9f7b317eadda93446a277336c9", "si...
"""Parser for NWChem output files""" import itertools import re import numpy from . import logfileparser from . import utils class NWChem(logfileparser.Logfile): """An NWChem log file.""" def __init__(self, *args, **kwargs): # Call the __init__ method of the superclass ...
{ "content_hash": "2b9e34233e2874f60e127a495c75980b", "timestamp": "", "source": "github", "line_count": 1114, "max_line_length": 137, "avg_line_length": 46.76750448833034, "alnum_prop": 0.4770341081402714, "repo_name": "Schamnad/cclib", "id": "112bacd730a041ee5da868e60d073dffec10bd2b", "size": "523...
import os import re from setuptools import setup, find_packages __description__ = 'Pagar.me Python' __long_description__ = 'Python library for Pagar.me API' __author__ = 'Murilo Henrique, Victor Messina' __author_email__ = '[email protected]' __special_things__ = 'Derek Stavis, Rodrigo Amaral' testing_extras = [ ...
{ "content_hash": "f7f78e24947f2decd246e7392a5bf59d", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 70, "avg_line_length": 26.863636363636363, "alnum_prop": 0.6153412295544275, "repo_name": "pagarme/pagarme-python", "id": "514d6d5aaca3b23ef4af69ffad1e4b99fd19c64c", "size"...
import itertools from ..task import DecisionTask, ActivityTask from ..events import ProcessStartedEvent from ..defaults import Defaults class Manager(object): """ Handles the creation and execution of workflows. # Start a new process mgr = manager(backend, workflows) process = Process(workflow=Foo...
{ "content_hash": "d6e9eaee5ad4187f19db2bd8c730d577", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 89, "avg_line_length": 37.398058252427184, "alnum_prop": 0.6612149532710281, "repo_name": "pyworkflow/pyworkflow", "id": "0b23651366fc177f5104d8393aa51c8e8021bcdf", "size"...
""" relatrix.py A class for relating residues using Rosetta numbering, PDB ATOM numbering, SEQRES/FASTA sequences, and UniParc sequences. Created by Shane O'Connor 2013 """ import types import traceback from .fasta import FASTA from .pdb import PDB, PDBMissingMainchainAtomsException, ROSETTA_HACKS_residues_to_remove...
{ "content_hash": "6b7f8d3b44a60b7f87e9151daee7b681", "timestamp": "", "source": "github", "line_count": 711, "max_line_length": 333, "avg_line_length": 61.77074542897328, "alnum_prop": 0.6137890206971925, "repo_name": "Kortemme-Lab/klab", "id": "2bf710d3158af54869b62d545a2912397070148e", "size": "4...
import unittest import os from pprint import pprint from docx import fullyQualifiedName from docx import DocxProcessor from document import Document from fragments import * class DocxTests (unittest.TestCase): def fragment(self, lineNumber, range, text, attributes): if range: result = LineChunkFragmentIdent...
{ "content_hash": "a0c179521074eaa26277c2223b990395", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 214, "avg_line_length": 46.41269841269841, "alnum_prop": 0.7323871409028728, "repo_name": "simplicissimus/metadata-processor", "id": "1427395a157e7f81797eacf94665ef672ad10af...
from ..libs.pluginbase import PluginBase class Plugin(PluginBase): def __init__(self, start, *args): super().__init__(start, *args) def _plugin_info(self): self.data_dir = "load_image" self.version = "0.11.0" self.name = "Image Loader" self.author = "Infected" def ...
{ "content_hash": "66caaf886a97f3b954ff64ac988792e4", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 55, "avg_line_length": 25.727272727272727, "alnum_prop": 0.5848056537102474, "repo_name": "tomsimonart/GLM-web-interface", "id": "bbaa296e0d65e8ea05a32075daf14685374ecd5c", ...
import unittest from defcon import Font, Glyph, Contour, Component, Anchor, Guideline, Layer from defcon.test.testTools import getTestFontPath class GlyphTest(unittest.TestCase): def __init__(self, methodName): unittest.TestCase.__init__(self, methodName) def test_identifiers(self): glyph = ...
{ "content_hash": "1f68da7ccbcaa0817d5016b384af141d", "timestamp": "", "source": "github", "line_count": 647, "max_line_length": 78, "avg_line_length": 36.80216383307573, "alnum_prop": 0.6069883667212633, "repo_name": "moyogo/defcon", "id": "784a386ddd16da7bdb1f6e512408782bd01686db", "size": "23811"...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('tasks', '0001_initial'), ] operations = [ migrations.AlterUniqueTogether( name='project', unique_together=set([('name', 'user')]), ...
{ "content_hash": "287a1210dbd86d3bd254fdbb391aa48e", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 52, "avg_line_length": 19.764705882352942, "alnum_prop": 0.5803571428571429, "repo_name": "polarkac/TaskTracker", "id": "1b2110c9c1bb528e0f26a44beec8b2eef95135ee", "size": ...
''' ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License");...
{ "content_hash": "294770ca633ce613551c1415577aa1e0", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 143, "avg_line_length": 41.45985401459854, "alnum_prop": 0.7246478873239437, "repo_name": "reveller/trafficserver", "id": "1be7211ad766deea2e6fcf75a9dae2b8d09d6d58", "size...
import inspect from functools import wraps from time import perf_counter DO_TIMING = False DISPLAY_LESS_PROGRESS = False timer_dict = {} counter = 0 def time(f): @wraps(f) def wrap(*args, **kw): if DO_TIMING: # Run function with timing ts = perf_counter() result = ...
{ "content_hash": "1c564ae8f19b5502673a00b4adceaed8", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 124, "avg_line_length": 35.27272727272727, "alnum_prop": 0.4789518900343643, "repo_name": "SysCV/tet", "id": "daf147ab73b5f6636a56dd396c0ceec800a27c1a", "size": "2328", "...