text
stringlengths
4
1.02M
meta
dict
"""Create the asset.""" import argparse import os import subprocess NODE_URL = "https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-x64.tar.xz" NODE_EXTRACT_NAME = "node-v12.16.3-linux-x64" def create_asset(target_dir): """Create the asset.""" p1 = subprocess.Popen(["curl", NODE_URL], stdout=subprocess.PIPE)...
{ "content_hash": "fd900dd3336fcf15cc1d0685c3c8cb1f", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 79, "avg_line_length": 24.363636363636363, "alnum_prop": 0.6529850746268657, "repo_name": "aosp-mirror/platform_external_skia", "id": "33351c8e7cc890fefa3fe1ab7b749838e7ec0b5...
from abc import abstractmethod from .base_cvxproblem import Relevance_CVXProblem class LUPI_Relevance_CVXProblem(Relevance_CVXProblem): def __init__( self, current_feature: int, data: tuple, hyperparameters, best_model_constraints, preset_model=None, best_m...
{ "content_hash": "7cea08912adfb22f519399e8c9b633f8", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 82, "avg_line_length": 30.4625, "alnum_prop": 0.5937628231432088, "repo_name": "lpfann/fri", "id": "f24f084baed52d7949a45e78596b50691f3ddf6e", "size": "2437", "binary": f...
from django.conf.urls import patterns, url from django.conf import settings urlpatterns = patterns('modelmanager.views', # Get all the ContentModels as JSON or HTML url(r'^contentmodels\.(?P<extension>json|html|xml|drupal)$', 'get_all_models'), # G...
{ "content_hash": "3405c1b0300445097439db9376fa944d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 119, "avg_line_length": 39.8235294117647, "alnum_prop": 0.4807976366322009, "repo_name": "usgin/modelmanager", "id": "beee6f9ed0751fa9d18c28592fae78b8059fbd5a", "size": "13...
from django.conf.urls import patterns, include, url from .views import retrieve_token,like,unlike,like_count,fill_modal,user_like urlpatterns = patterns('', url(r'^getCookie/$',retrieve_token, name = 'token'), url(r'^like/$',like.as_view(),name='like'), url(r'^unlike/$',unlike,name='unlike'), url(...
{ "content_hash": "228214e6d97f55063526e86747cb0ff7", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 77, "avg_line_length": 25.05, "alnum_prop": 0.626746506986028, "repo_name": "amartinez1/confessions", "id": "92dd42807a9d0ae240f773161c254370c4f96f9d", "size": "501", "bi...
import json from django import forms from django.core.urlresolvers import reverse from django.test.utils import override_settings from curling.lib import HttpClientError, HttpServerError from mock import Mock, patch from nose.tools import eq_, ok_ from rest_framework.request import Request from test_utils import Requ...
{ "content_hash": "cab5d2635c6cf9efd0b8460860aa04dd", "timestamp": "", "source": "github", "line_count": 469, "max_line_length": 79, "avg_line_length": 37.091684434968016, "alnum_prop": 0.6102552310876064, "repo_name": "ngokevin/zamboni", "id": "2201ba1d7cf7ec4ecad2868c4cd9c46b9af6c102", "size": "17...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('bhs', '0003_auto_20190906_2147'), ] operations = [ migrations.RemoveField( model_name='group', name='chapters', ), migrations.RemoveField( model_...
{ "content_hash": "390c493f064c2abaa0e6d484eae77d55", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 43, "avg_line_length": 21, "alnum_prop": 0.5093167701863354, "repo_name": "dbinetti/barberscore-django", "id": "9769041b8622db9295dc711086c167a61c5c1f46", "size": "532", ...
import frida import sys from pwn import log import json import os MODULES = [] FUNCTIONS = [] SCRIPT = """ Interceptor.attach(ptr("{addr}"), {{ onEnter: function(args) {{ send({format}); }} }}); """ PATH = "" def on_message(message, data): if message['type'] == 'send': ...
{ "content_hash": "ed7356063460825f56b97aa0f0e30365", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 76, "avg_line_length": 29.894736842105264, "alnum_prop": 0.4940580985915493, "repo_name": "sigttou/analyzecrypt.py", "id": "6ef6448137e8d63b3c26f2da89a28609a4c8e446", "siz...
from tweepy.error import TweepError from tweepy.utils import parse_datetime, parse_html_value, parse_a_href, \ parse_search_datetime, unescape_html class ResultSet(list): """A list like object that holds results from a Twitter API query.""" class Model(object): def __init__(self, api=None): ...
{ "content_hash": "090eb4ed30297d16a1c5383b75c90849", "timestamp": "", "source": "github", "line_count": 423, "max_line_length": 84, "avg_line_length": 28.728132387706857, "alnum_prop": 0.5506912442396313, "repo_name": "sanoju/GaeTwWpBot", "id": "fe87adb0779d56d2cf20878d1b649f539912c2d7", "size": "1...
from pycrans.refactor.rules import match_rule class Rewriter(object): """ Rewrite a script based on a certain set of rules """ def __init__(self, script, analysis): super(self.__class__, self).__init__() self.script = script self.analysis = analysis def rewrite(self): ...
{ "content_hash": "fe2eb470b278219cd4eef6483c028b13", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 61, "avg_line_length": 24.565217391304348, "alnum_prop": 0.5911504424778761, "repo_name": "citeaalexandru/PyCrans", "id": "c27b808ff5b4e104ca1454b20eb38027341d4d13", "size"...
import os import sys import re def get_version(package): """ Return package version as listed in `__version__` in `init.py`. """ init_py = open(os.path.join(package, '__init__.py')).read() return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) version = get_version('stored_messag...
{ "content_hash": "567db6bf9cde6110ab9a65415df495c7", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 75, "avg_line_length": 30.227272727272727, "alnum_prop": 0.587468671679198, "repo_name": "nthall/django-stored-messages", "id": "d3fc92f67f2dba9af7a8ff94d11edb0d328a1489", ...
""" Lookup an MX record and printout all the MX preference, target, and associated IP addresses of the targets. """ import getdns, pprint, sys extensions = { "return_both_v4_and_v6" : getdns.EXTENSION_TRUE } def get_ip(ctx, qname): iplist = [] try: results = ctx.address(name=qname, extensions=extens...
{ "content_hash": "e3a022e6f74958964655531d5c2c4f08", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 91, "avg_line_length": 31.20689655172414, "alnum_prop": 0.5762430939226519, "repo_name": "getdnsapi/getdns-python-bindings", "id": "6399debb0bd58308e0e1a3b1e73177e758d6e1eb",...
""" Register nodes with HaaS. This is intended to be used as a template for either creating a mock HaaS setup for development or to be modified to register real-life nodes that follow a particular pattern. In the example environment for which this module is written, there are 10 nodes which have IPMI interfaces that ...
{ "content_hash": "841355b187cb192a971fbfdd461e2824", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 79, "avg_line_length": 32.25581395348837, "alnum_prop": 0.7072819033886085, "repo_name": "kylehogan/hil", "id": "5e9da6fdf171f54130aee03068b3afad3a1495a2", "size": "1405", ...
'''Python requirement files classifiers tests.''' import re import mock import pytest from reqfiles import classifiers from . import common @pytest.mark.parametrize(('name', 'key_keyword'), common.KEY_FIXTURES) def test_keyword_for(classifier, name, key_keyword): '''Tests :py:meth:`reqfiles.classifiers.Basecla...
{ "content_hash": "5baa9f7dbc1f2c380d1214c31d0abd73", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 92, "avg_line_length": 34.41379310344828, "alnum_prop": 0.6780227120908484, "repo_name": "rafaduran/reqfiles", "id": "b8f5f07ea7f732837c7f524bbf74180f0f63323d", "size": "29...
""" Copyright (c) 2014 High-Performance Computing and GIS (HPCGIS) Laboratory. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Authors and contributors: Eric Shook (eshook@kent.edu); Zhengliang Feng (odayfans@gmail.com, zfeng2@kent.edu) """ from ..u...
{ "content_hash": "555c80e166a2bc4c968a32099f3305fd", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 161, "avg_line_length": 51.91724137931035, "alnum_prop": 0.6644527098831031, "repo_name": "HPCGISLab/pcml", "id": "5d9f50b8613ab3484e3f82ccf81cfbc8dbdc15f6", "size": "7528...
import socket import os import sys import time import random from itertools import chain from fdfs_client.exceptions import ( FDFSError, ConnectionError, ResponseError, InvaildResponse, DataError ) # start class Connection class Connection(object): '''Manage TCP comunication to and from Fas...
{ "content_hash": "e6bd81ec7162a58aca271b0e99768be2", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 93, "avg_line_length": 33.796954314720814, "alnum_prop": 0.557074196455392, "repo_name": "golden-tech-native/gd_facerecognize", "id": "ad8a5d627907ee7fe4178a5a4a549bdf3a4b64...
from oslo.config import cfg from neutron.plugins.embrane.common import config # noqa from neutron.tests.unit import test_extension_extraroute as extraroute_test from neutron.tests.unit import test_l3_plugin as router_test PLUGIN_NAME = ('neutron.plugins.embrane.plugins.embrane_fake_plugin.' 'EmbraneFa...
{ "content_hash": "2db671ae75e85093260be131b2005dc2", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 75, "avg_line_length": 34, "alnum_prop": 0.7573529411764706, "repo_name": "CingHu/neutron-ustack", "id": "cd4dc615022d0059fd238fe1935cd6bea52c0804", "size": "1351", "bina...
import cinderclient from cinderclient import api_versions from cinderclient import exceptions from os_brick.initiator import connector from oslo_utils import uuidutils from pbr import version as pbr_version from brick_cinderclient_ext import brick_utils from brick_cinderclient_ext import volume_actions as actions cl...
{ "content_hash": "dec345d91685cd213788419fb510d27d", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 79, "avg_line_length": 42.02325581395349, "alnum_prop": 0.5832872163807415, "repo_name": "openstack/python-brick-cinderclient-ext", "id": "18b440bd9d706d8a205b4047d657c0e6aa...
"""An integration test for datastore_write_it_pipeline This test creates entities and writes them to Cloud Datastore. Subsequently, these entities are read from Cloud Datastore, compared to the expected value for the entity, and deleted. There is no output; instead, we use `assert_that` transform to verify the result...
{ "content_hash": "6795e9caa854999bf2e411619b73cbb7", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 80, "avg_line_length": 29.130434782608695, "alnum_prop": 0.7189054726368159, "repo_name": "axbaretto/beam", "id": "4961da01c142f8a50f107cd502fe77b522057f91", "size": "2795"...
import json from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import tables from horizon import tabs from horizon.utils import memoized from openstack_dashboard.api import glance from opensta...
{ "content_hash": "11f1e0445350232c5c891809d514bb23", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 79, "avg_line_length": 36.42567567567568, "alnum_prop": 0.6112038582823224, "repo_name": "CiscoSystems/avos", "id": "dce599611db8c50010ed60a3af298b4d0da86227", "size": "60...
"""ImageNet preprocessing.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import logging import tensorflow.compat.v1 as tf IMAGE_SIZE = 224 CROP_PADDING = 32 def distorted_bounding_box_crop(image_bytes, bbox...
{ "content_hash": "93e7d4c04777e652a0c8559821366d1d", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 139, "avg_line_length": 39.21862348178138, "alnum_prop": 0.652111076700733, "repo_name": "tensorflow/examples", "id": "85b94e6bb03b61dff40cba509736fa890c03dd42", "size": "...
""" BoardGameGeek.com interface for pyprototypr Based off of the BGGGame object, for example:: {'_comments': [], '_data': {'accessory': False, 'alternative_names': ['德国大选', '디 마허'], 'artists': ['Marcus Gschwendtner', 'Harald Lieske'], 'categories': ['Economic', 'N...
{ "content_hash": "f3a841fc4f99122601bc4204b1e59476", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 172, "avg_line_length": 48.04788732394366, "alnum_prop": 0.5053057395790584, "repo_name": "gamesbook/pyprototypr", "id": "97bbb0165f1be6203fe49292b43e769198c1293f", "size"...
import numpy as np import time from tridesclous.waveformtools import extract_chunks #~ size = 1000000 size = 1000 nb_channel = 5 #~ nb_channel = 300 width = 150 nb_peak = 20003 def test_extract_chunks_memory(): signals = np.random.randn(size, nb_channel).astype('float32') indexes = np.random.randint(low=wi...
{ "content_hash": "621458c3248af6cfa6b7f9d1cbf091c8", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 112, "avg_line_length": 26.705882352941178, "alnum_prop": 0.6657488986784141, "repo_name": "tridesclous/tridesclous", "id": "7273637a9b0149ce91c3ad6c1c0da08442015e42", "siz...
from django.contrib.auth.models import AbstractUser from django.db import models from dicom_models.staging.models import RadiologyStudy from prioritizers import registry as prioritizers from solo.models import SingletonModel class StudyList(models.Model): name = models.CharField(max_length=100, blank=True, null=Tr...
{ "content_hash": "a297124da0528e1002e4e1ce7ad7fba1", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 81, "avg_line_length": 35.09375, "alnum_prop": 0.717720391807658, "repo_name": "chop-dbhi/django-dicom-review", "id": "ab27822b0c87deab703679ddb0a0a141e8b350e3", "size": "1...
ACCOUNT_NAME = 'Tiger Chef'
{ "content_hash": "614ed4f9c511416784e0d5f5882bcb0b", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 27, "avg_line_length": 28, "alnum_prop": 0.7142857142857143, "repo_name": "ddy88958620/lib", "id": "bce8a752bfe891fa1e65e33d66059ae52125e0aa", "size": "28", "binary": fals...
"""Global Registry for the task adaptation framework. """ import ast import functools import logging def partialclass(cls, *base_args, **base_kwargs): """Builds a subclass with partial application of the given args and keywords. Equivalent to functools.partial performance, base_args are preprended to the pos...
{ "content_hash": "0e3441e920bee38e6a743df7a3e4cfb1", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 88, "avg_line_length": 32.10989010989011, "alnum_prop": 0.6652977412731006, "repo_name": "google-research/scenic", "id": "3fa6e59dad169795ccf5d90ec50e512dcf02ee0b", "size"...
from typing import Union # noinspection PyPackageRequirements from discord import Interaction, Member, User, Embed, Color # noinspection PyPackageRequirements from discord.ext.commands import Bot # noinspection PyPackageRequirements from discord import app_commands from minqlx import Plugin @app_commands.context_me...
{ "content_hash": "694b2818d11cd8f108793b93e7f3989e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 80, "avg_line_length": 30.625, "alnum_prop": 0.763265306122449, "repo_name": "mgaertne/minqlx-plugin-tests", "id": "21816212220fed611054c0dee1443478241f582b", "size": "735"...
class Solution: def mostCommonWord(self, paragraph, banned): """ :type paragraph: str :type banned: List[str] :rtype: str """ paragraph = paragraph.strip('!?\',;.').lower() counter = collections.Counter(paragraph.split()) for word in banned: ...
{ "content_hash": "9266d90c00889ba4e3537dbcaab8408a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 56, "avg_line_length": 31.916666666666668, "alnum_prop": 0.5483028720626631, "repo_name": "Mlieou/lXXtcode", "id": "9eab4653cb9247be7abc2588462c78c5e75e4b28", "size": "383"...
""" Django settings for tilebundler_prj project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR,...
{ "content_hash": "9794cbda1e8f0f236a3a65e1cdedf1ba", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 71, "avg_line_length": 23.931818181818183, "alnum_prop": 0.717948717948718, "repo_name": "ROGUE-JCTD/django-tilebundler", "id": "44e912dcd9577ad43fb4e4e739a60d6a83996cf5", ...
import inspect import io import re from contextlib import redirect_stdout from unittest import mock from unittest.mock import MagicMock import pytest from alembic.autogenerate import compare_metadata from alembic.config import Config from alembic.migration import MigrationContext from alembic.runtime.environment impor...
{ "content_hash": "4884c95180768dc64d180b59677467af", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 109, "avg_line_length": 46.49074074074074, "alnum_prop": 0.6385182234614618, "repo_name": "danielvdende/incubator-airflow", "id": "1cba49b4c77efda700ffaa58e845f14ddb182551",...
import zipfile import pytest from ..checker import check from tenable.errors import UnexpectedValueError @pytest.mark.vcr() def test_system_details(unauth): s = unauth.system.details() assert isinstance(s, dict) check(s, 'ACAS', str) check(s, 'PasswordComplexity', str) check(s, 'banner', str) ...
{ "content_hash": "c5cee4207f399a29002aa40105821f64", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 92, "avg_line_length": 28.353448275862068, "alnum_prop": 0.6704165399817573, "repo_name": "tenable/pyTenable", "id": "45abdc2a351b864ce2cc4e411b482f1fbbde2bc7", "size": "3...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest from awx.main.models import NotificationTemplate def compare_with_encrypted(model_config, param_config): '''Given a model_config from the database, assure that this is consistent with the config given in th...
{ "content_hash": "9493a0755be217970779e8ef3379a13f", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 119, "avg_line_length": 38.549549549549546, "alnum_prop": 0.6599672820752512, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "9d916d1dc9ef07645e8ccf388d...
from __future__ import absolute_import from . import imageGradients from . import objectDetection data_extensions = [ # Set show=True if extension should be shown by default # on DIGITS home page. These defaults can be changed by # editing DIGITS config option 'data_extension_list' {'class': imageGrad...
{ "content_hash": "e9ebec5ad95ad9282a02b8b8f79a85b1", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 59, "avg_line_length": 29.125, "alnum_prop": 0.6716738197424893, "repo_name": "jmancewicz/DIGITS", "id": "9e53b9413581d6c556cf3a9d7e2527446c77fbf5", "size": "996", "binar...
import sys import SimpleITK as sitk import os # verify that we have the correct number of arguments if len(sys.argv) != 5: sys.stderr.write( "Usage: prog inputFile outputFile replaceValue upperThreshold\n" ) exit(1) # copy the arguments in to variables inputFileName = sys.argv[1] outputFileName = ...
{ "content_hash": "3f0e055956cf5d51019060a569469dbc", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 78, "avg_line_length": 28.357142857142858, "alnum_prop": 0.7380352644836272, "repo_name": "SimpleITK/SimpleITK", "id": "2f684533933a05610731ec29be4dbda362d28c85", "size": "...
class Solver: pass
{ "content_hash": "2673c6d148574c4eece68f17ab3dec09", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 13, "avg_line_length": 11.5, "alnum_prop": 0.6521739130434783, "repo_name": "wenkaiqiu/petal", "id": "94bab53b306139d1ef2a2e0cb67ba05e8ec23c44", "size": "23", "binary": fa...
import krpc import asyncio import logging from common.autonumber import AutoNumber import common.protocol as protocol class KSPConnection: # TODO: Detect disconnect from krpc-server def __init__(self, config, commander): self.name = config.get('Name', "command center") self.address = config.ge...
{ "content_hash": "dffe482ecc42d5aca9a1cc860cbd258d", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 87, "avg_line_length": 34.6890756302521, "alnum_prop": 0.5869670542635659, "repo_name": "fayoh/KSP-Control", "id": "e58304ffa28106f4e172d5c2653e722e97ae2462", "size": "412...
from setuptools import setup, find_packages requires = [ 'affine', 'appdirs', 'dask', 'gdal', #: Install w/ Conda for best results 'geopandas', 'mapkit>=1.2.6', 'pangaea', 'psycopg2', 'pyyaml', 'rapidpy', 'sqlalchemy', 'timezonefinder', 'utm', 'wrf-python' ] se...
{ "content_hash": "61ae31ea5a9c1ed7bc8c26a348bf4528", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 76, "avg_line_length": 32.3, "alnum_prop": 0.5128998968008256, "repo_name": "CI-WATER/gsshapy", "id": "1aa25be7db313d625ea2932629ca09406971b304", "size": "1938", "binary"...
from django.db import models class Area(models.Model): name = models.CharField( max_length=140 ) def __str__(self): return self.name
{ "content_hash": "6d48c5f2f3cd68f989e17273454dcadc", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 28, "avg_line_length": 16.4, "alnum_prop": 0.6036585365853658, "repo_name": "aniruddha-adhikary/bookit", "id": "a95118209730353550ebf7ebe4ccac7d64d64fed", "size": "164", ...
from . import context # ----------------------------------------------------------------------------- def get_response_meta(): return context.get("response_meta") def update_response_meta(next_meta): if next_meta is None: return meta = get_response_meta() if meta is None: meta = {}...
{ "content_hash": "b8a6b15449f91025da8d718709ce2176", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 79, "avg_line_length": 20.42105263157895, "alnum_prop": 0.49742268041237114, "repo_name": "4Catalyzer/flask-resty", "id": "ff784bbcf21f2bcb713d92e0f59d2bce3222136b", "size"...
"""Scraper for Connecticut Supreme Court CourtID: conn Court Short Name: Conn. Author: Asadullah Baig <asadullahbeg@outlook.com> History: - 2014-07-11: created - 2014-08-08, mlr: updated to fix InsanityError on case_dates - 2014-09-18, mlr: updated XPath to fix InsanityError on docket_numbers - 2015-06-17, mlr: ma...
{ "content_hash": "10099bec65c5766a38b01d77aad0cac0", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 99, "avg_line_length": 36.333333333333336, "alnum_prop": 0.5857798165137614, "repo_name": "m4h7/juriscraper", "id": "0c56b3e53ad15297fe50674684a410d67eda7bf9", "size": "219...
"""Admin classes""" from import_export.resources import ModelResource class InvenTreeResource(ModelResource): """Custom subclass of the ModelResource class provided by django-import-export" Ensures that exported data are escaped to prevent malicious formula injection. Ref: https://owasp.org/www-communit...
{ "content_hash": "d6f43191ff9e9f48d79424c4d1b61403", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 83, "avg_line_length": 32.36363636363637, "alnum_prop": 0.596441947565543, "repo_name": "inventree/InvenTree", "id": "2d5798a9d1eec8e0995782df60ab1f4a2b8cde62", "size": "10...
from share.provider import ProviderAppConfig from .harvester import SpringerHarvester class AppConfig(ProviderAppConfig): name = 'providers.com.springer' version = '0.0.1' title = 'springer' long_title = 'Springer' home_page = 'http://www.springer.com/us/' harvester = SpringerHarvester
{ "content_hash": "d5eb439563ae4a4ce1760ed3256077eb", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 45, "avg_line_length": 28.454545454545453, "alnum_prop": 0.7188498402555911, "repo_name": "zamattiac/SHARE", "id": "5ce0671ba862dbb61098bece979a8348111ec4e9", "size": "313"...
from django.conf.urls.defaults import * from jellyroll.views import tags urlpatterns = patterns('', url(r'^$', tags.tag_list, {}, name='jellyroll_tag_list'), url(r'^(?P<tag>[-\.\'\:\w]+)/$',tags.tag_item_list, {}, name="jellyroll_tag_item_list"), )
{ "content_hash": "d8fdb7fed89ebffbfdc48209edc6f429", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 92, "avg_line_length": 28.88888888888889, "alnum_prop": 0.6230769230769231, "repo_name": "jacobian-archive/jellyroll", "id": "046372801ac8d9100879eac586c983fd6ba696fa", "siz...
import MySQLdb import simplejson as json from django.shortcuts import render from django.http import HttpResponse from django.http import Http404 from django.core.exceptions import ValidationError from mozdns.domain.models import Domain from core.search.compiler.django_compile import search_type from core.utils impor...
{ "content_hash": "9d604de3b1aa1f9b4d33a535d34d4091", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 78, "avg_line_length": 30.889908256880734, "alnum_prop": 0.626967626967627, "repo_name": "rtucker-mozilla/mozilla_inventory", "id": "a5581b88570952f64eee8f4cf3e53e330d20694a...
""" ==================================================== Extracting AFQ tract profiles from segmented bundles ==================================================== In this example, we will extract the values of a statistic from a volume, using the coordinates along the length of a bundle. These are called `tract profil...
{ "content_hash": "b1369fc677fc4abd7cc2bc5d95db2cd3", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 80, "avg_line_length": 32.748538011695906, "alnum_prop": 0.7194642857142857, "repo_name": "FrancoisRheaultUS/dipy", "id": "0eaf66168b0982f68fa635dcb7a59f76750e33f8", "size...
''' Created on 2014-07-16 @summary: Trellis TEA use pure python @author: fiefdx ''' from distutils.core import setup setup(name='pytea', version='1.0.2', author = 'fiefdx', author_email = 'fiefdx@gmail.com', package_dir={'pytea': 'src'}, packages=['pytea'], )
{ "content_hash": "f6a428916f4284709d92cfb49b151df0", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 40, "avg_line_length": 19.8, "alnum_prop": 0.6026936026936027, "repo_name": "fiefdx/pytea", "id": "38bbd6e96323d1dc65e0352cdedb7d3a7f70fe9a", "size": "321", "binary": fal...
""" eaf3D.py This python script performs Algorithm 4 described in C.M. Fonseca et. al., "On the Computation of the Empirical Attainment Function," (2011): Algorithm 4. EAF computation in three dimensions Basic operations defined in article: - top(Q) returns the element at the top of a queue - pop(...
{ "content_hash": "34081a2484bc6675c82d765e979720dd", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 101, "avg_line_length": 37.417582417582416, "alnum_prop": 0.5681350954478708, "repo_name": "kyspencer/3D_Empirical_Attainment_Function", "id": "7c4e878fc985b087dc95cafefbfe4...
import unittest from yar.control import decode_errors, ProgrammerError class ErrorDecodeTest(unittest.TestCase): def test_error_decoding(self): self.assertEqual( decode_errors(0x80C80081), "Error: Programming error Start line not set high Device not blank RAM error RAM end not on ...
{ "content_hash": "ec9ccfc0733a49440f1a84e8165c9109", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 141, "avg_line_length": 30.761904761904763, "alnum_prop": 0.7058823529411765, "repo_name": "ieure/yar", "id": "542ee6159351d54a7d5f8f80d5e1684b41517f4d", "size": "734", "...
"""Fichier contenant le masque <groupe_existant>.""" from primaires.interpreteur.masque.masque import Masque from primaires.interpreteur.masque.fonctions import * from primaires.interpreteur.masque.exceptions.erreur_validation \ import ErreurValidation class GroupeExistant(Masque): """Masque <groupe...
{ "content_hash": "2653bf10a768224a439478135344b61a", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 72, "avg_line_length": 32.42553191489362, "alnum_prop": 0.6213910761154856, "repo_name": "vlegoff/tsunami", "id": "b733ff6e9cc206fdf994577757549510f306add4", "size": "3097"...
import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.orm import exc from neutron.api.v2 import attributes as attrs from neutron.db import db_base_plugin_v2 from neutron.db import model_base from neutron.db import models_v2 from neutron.extensions import portsecurity as psec from neutron.openstack.common ...
{ "content_hash": "e6a779e9b73642f61c1ecfa09eba668d", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 78, "avg_line_length": 41.21951219512195, "alnum_prop": 0.6356508875739645, "repo_name": "oeeagle/quantum", "id": "e5ad6b19d42c551492b7d49ad40f62b96490edce", "size": "7480...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Profile.bio' db.add_column('users_profile', 'bio', self.gf('django.db.models.fields.TextField'...
{ "content_hash": "adf7666fe13f401848c7978b55fce7c5", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 182, "avg_line_length": 59.77333333333333, "alnum_prop": 0.5500780727191613, "repo_name": "mozilla/gameon", "id": "f3e4bf50617c37d679d3355746e554f406519541", "size": "4507"...
def f(): raise AssertionError('Silverlight test for throwing exception.')
{ "content_hash": "8a5257f8fc723cbee1496377c41358f7", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 68, "avg_line_length": 39, "alnum_prop": 0.7435897435897436, "repo_name": "tempbottle/dlr", "id": "36a6f5e7c2e154bf98274769b23871f313f1c535", "size": "79", "binary": false...
class RepresentationMixin(object): def to_react_representation(self, context=None): raise NotImplementedError("Missing property to_react_representation in class")
{ "content_hash": "e6e1701aca530ab3d768249259c1d008", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 86, "avg_line_length": 58.333333333333336, "alnum_prop": 0.7771428571428571, "repo_name": "Frojd/django-react-templatetags", "id": "a1f17dd718bbc0560bbaf7b9e2efd8fa489fa85e", ...
import PythonQt from PythonQt import QtCore, QtGui from ddapp.timercallback import TimerCallback from ddapp.asynctaskqueue import * def startApplication(enableQuitTimer=False): appInstance = QtGui.QApplication.instance() if enableQuitTimer: quitTimer = TimerCallback() quitTimer.callback = appIn...
{ "content_hash": "64e4047a54e72145d715135c3b62ecd6", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 62, "avg_line_length": 22.72972972972973, "alnum_prop": 0.6872770511296076, "repo_name": "empireryan/director", "id": "aba1b5bcb91631bbb9adf67a161a69565c8c7bb7", "size": "8...
class Node(object): def __init__(self, val, next, random): self.val = val self.next = next self.random = random class Solution(object): def copyRandomList(self, head): """ :type head: RandomListNode :rtype: RandomListNode """ if not head: ...
{ "content_hash": "b2abcc16fb4dfd4b39f70ba0cf5b4db1", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 45, "avg_line_length": 23.833333333333332, "alnum_prop": 0.4568764568764569, "repo_name": "Lanceolata/code-problems", "id": "cfb6e565847640d151be16d9124a706b6c30f8fb", "siz...
"""Driver method for server_report. Functions: main -- main method """ import server_report.func as func import sys import getopt import logging helpstring = ("report [-h|--help] [-v|--verbose] " "[-d|--debug] [-l|--list]\n" " [-u|--users] [-j|--jobs] [-a|--active] [-e|--error]\n"...
{ "content_hash": "748d2efacf3e72b3dd2474bc476bb96e", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 77, "avg_line_length": 31.238805970149254, "alnum_prop": 0.5064500716674629, "repo_name": "bsurc/server_report", "id": "e0f97903a77c6d7bd5eca2d3399ed4d17694ee96", "size": "...
from __future__ import absolute_import import sys from thrift.util.Recursive import fix_spec from thrift.Thrift import TType, TMessageType, TPriority, TRequestContext, TProcessorEventHandler, TServerInterface, TProcessor, TException, TApplicationException, UnimplementedTypedef from thrift.protocol.TProtocol import TPro...
{ "content_hash": "15c92702691a771db90e339a399470d1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 184, "avg_line_length": 33.714285714285715, "alnum_prop": 0.8220338983050848, "repo_name": "facebook/fbthrift", "id": "d600b178661d7f9cf397c3a272f789e4f5438e0b", "size": "5...
"""Invocation-side implementation of gRPC Python.""" import sys import threading import time import logging import grpc from grpc import _common from grpc import _grpcio_metadata from grpc._cython import cygrpc from grpc.framework.foundation import callable_util _USER_AGENT = 'Python-gRPC-{}'.format(_grpcio_metadata...
{ "content_hash": "5f619fc985bed15624bf67d4c139d497", "timestamp": "", "source": "github", "line_count": 948, "max_line_length": 86, "avg_line_length": 40.88291139240506, "alnum_prop": 0.5789921820574347, "repo_name": "infinit/grpc", "id": "26d93faf75287e6d91ece853118257a5ad8426a4", "size": "40285",...
""" The purpose of this script is to generate a clean directory for upload to Arxiv. The script has several steps: 1. read the tex file 2. strip the comments (leaving a %) 3. flatten the file for input 4. re-strip the comments 5. find figures 6. make an arxiv directory with a timestamp 7. c...
{ "content_hash": "98c180325b3b78f642aa21b97ce48aca", "timestamp": "", "source": "github", "line_count": 447, "max_line_length": 89, "avg_line_length": 28.427293064876956, "alnum_prop": 0.5474148107342409, "repo_name": "lukeolson/clean-latex-to-arxiv", "id": "7557201e596864b8f514a9d45122e61a5284f834",...
import mock import requests_mock from unittest import TestCase from resello import ReselloClient from resello.managers.domain import DomainManager class ReselloDomainManagerTestCase(TestCase): def setUp(self): self.client = ReselloClient(api_key='test', reseller_reference='test') self.client.BASE...
{ "content_hash": "19995e99cb1cc161f799cd0b1adfd750", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 78, "avg_line_length": 34.088235294117645, "alnum_prop": 0.6712683347713546, "repo_name": "duct-tape/resello", "id": "8b081bcd999c04d961a844156b04916de25b707b", "size": "11...
import sys import cherrypy from cherrypy._cpcompat import ntou from cherrypy._cptree import Application from cherrypy.test import helper script_names = ["", "/foo", "/users/fred/blog", "/corp/blog"] class ObjectMappingTest(helper.CPWebCase): @staticmethod def setup_server(): class Root: ...
{ "content_hash": "d8f05a58a60387b6501a13e83bbf2377", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 79, "avg_line_length": 33.769767441860466, "alnum_prop": 0.5498243922594863, "repo_name": "heytcass/homeassistant-config", "id": "c2b90bdc6d61b0f2d7f9a8a9ea89d4425100f56e", ...
import types from functools import partial import pytest from stp_core.loop.eventually import eventually from plenum.common.messages.node_messages import Commit from stp_core.common.util import adict from plenum.server.suspicion_codes import Suspicions from plenum.test.helper import getNodeSuspicions, whitelistNode f...
{ "content_hash": "93ab4a27af8dd0f3658b8067760a8e70", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 81, "avg_line_length": 40.2463768115942, "alnum_prop": 0.6726683471371984, "repo_name": "evernym/zeno", "id": "b23100c258010ea8abd77254d7b084bfa82e1a1a", "size": "2777", ...
import sys import os from pprint import pformat from six.moves import input import linguistica as lxa from linguistica.util import (ENCODING, PARAMETERS) try: FileNotFoundError except NameError: FileNotFoundError = OSError # no FileNotFoundError in Python 2 lxa_version = lxa.__version__ def determine_us...
{ "content_hash": "b7cf869479bd6c71ae35308902d88d3d", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 80, "avg_line_length": 31.130044843049326, "alnum_prop": 0.5047536732929991, "repo_name": "linguistica-uchicago/lxa5", "id": "63061c4ae9c06e12c622e6e269c6c5f86cb43d09", "s...
from __future__ import absolute_import from google.appengine.ext import ndb from ferris.core.controller import Controller, route, route_with from oauth2client.client import OAuth2WebServerFlow from ferris.core.oauth2.user_credentials import UserCredentials as OAuth2UserCredentials from ferris.core import settings cla...
{ "content_hash": "dde115f8058ef0207a4a0f9f156ac31b", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 88, "avg_line_length": 30.431372549019606, "alnum_prop": 0.6527061855670103, "repo_name": "markEarvin/sl-contest-tracker", "id": "b391e1dcf55a8792f4b2a7b65eefb9b385e989a1", ...
"""Test the Legrand Home+ Control integration.""" from unittest.mock import patch from homeassistant import config_entries, setup from homeassistant.components.home_plus_control.const import ( CONF_SUBSCRIPTION_KEY, DOMAIN, ) from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET from tests.compon...
{ "content_hash": "e8cabc1579a057635e85d1e422a67aeb", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 99, "avg_line_length": 34.653333333333336, "alnum_prop": 0.6448634090034628, "repo_name": "lukas-hetzenecker/home-assistant", "id": "4da913047a212afce5f1304b4e44a20cbd5c8c71"...
""" Main handling code for Amazon Lambda """ from __future__ import print_function import json import random import networking import private import re TRY_AGAIN = "Please try again." def lc_keys(mapping): """Lowercase the keys of a dict""" return {k.lower(): v for k, v in mapping.iteritems()} def lambd...
{ "content_hash": "86d3e292b8f3bd85fbc9b8b0cec37bae", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 545, "avg_line_length": 41.93529411764706, "alnum_prop": 0.6542993407209987, "repo_name": "ktrnka/maester_alexa", "id": "9342cc7198c8506953ecc9ae9cf0d8d89258c443", "size":...
import urllib.request from bs4 import BeautifulSoup headers = { 'User-Agent' : 'Mozilla/5.0' } URL = "given url" page = urllib.request.Request(URL, None, headers) page = urllib.request.urlopen(page) data = page.read() page.close() def parse(data): soup = BeautifulSoup(data, features='xml') entries = soup.find...
{ "content_hash": "eb4166fa01c69d807d8336c8e9c3306f", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 51, "avg_line_length": 28.4375, "alnum_prop": 0.567032967032967, "repo_name": "pragalakis/100-python-projects", "id": "0bf5630f3171f87eeb5120eea76ac713b3632d29", "size": "9...
from direct.distributed.DistributedObject import DistributedObject from direct.interval.IntervalGlobal import * from pandac.PandaModules import * from otp.otpbase import OTPGlobals from toontown.effects import DustCloud class DistributedBankCollectable(DistributedObject): def __init__(self, cr): Distribu...
{ "content_hash": "d0db869c328f2b095fd59f13dd1fa5c8", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 123, "avg_line_length": 34.52447552447553, "alnum_prop": 0.6376341908041321, "repo_name": "linktlh/Toontown-journey", "id": "abd32e8b45602e853af31077cf5f92f11f1855aa", "si...
import sys, os, time, threading, errno from .common import FSEvent, FSMonitorError def get_dir_contents(path): return [(filename, os.stat(os.path.join(path, filename))) for filename in os.listdir(path)] class FSMonitorDirWatch(object): def __init__(self, path, flags, user): self.path = ...
{ "content_hash": "0f5831edf718fe284e8432fd439b1e7c", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 81, "avg_line_length": 29.78846153846154, "alnum_prop": 0.5642349903163331, "repo_name": "shaurz/fsmonitor", "id": "0c873f69a18440e8e7c7b2463204d9290fbcbf4a", "size": "651...
from st2common.models.api.action import ActionAliasAPI from st2tests.fixturesloader import FixturesLoader from tests import FunctionalTest FIXTURES_PACK = 'aliases' TEST_MODELS = { 'aliases': ['alias1.yaml', 'alias2.yaml'] } TEST_LOAD_MODELS = { 'aliases': ['alias3.yaml'] } class TestActionAlias(Functiona...
{ "content_hash": "4d76986d4a3df50a33a2c0f85f6ed265", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 99, "avg_line_length": 37.901408450704224, "alnum_prop": 0.6280193236714976, "repo_name": "grengojbo/st2", "id": "9efda9a384ef89059147ba18a31d0846ebb4f1c7", "size": "3471",...
from tempest_lib.tests import fake_auth_provider from tempest.services.compute.json import aggregates_client from tempest.tests.services.compute import base class TestAggregatesClient(base.BaseComputeServiceTest): FAKE_SHOW_AGGREGATE = { "aggregate": { "name": "hoge", "ava...
{ "content_hash": "70c75f24430733ce7a586439b695a77c", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 65, "avg_line_length": 31.487179487179485, "alnum_prop": 0.5735613463626493, "repo_name": "xbezdick/tempest", "id": "e92b76b12af658addc3520d4523a5047526bdcfc", "size": "43...
import _plotly_utils.basevalidators class DtickrangeValidator(_plotly_utils.basevalidators.InfoArrayValidator): def __init__( self, plotly_name="dtickrange", parent_name="carpet.aaxis.tickformatstop", **kwargs, ): super(DtickrangeValidator, self).__init__( p...
{ "content_hash": "d8de7529191ed620d300920d014c0e65", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 75, "avg_line_length": 30.217391304347824, "alnum_prop": 0.4892086330935252, "repo_name": "plotly/plotly.py", "id": "7d0756cf928a7c7d6f9d27a07ff6b0e97b954cc6", "size": "695...
from django.template import Context from django.template.loader import get_template from django import template register = template.Library() @register.filter def bootstrap(element, options=''): element_type = element.__class__.__name__.lower() if options == 'nolabel': nolabel = True else: ...
{ "content_hash": "970223ca50e72724e9df4283934be087", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 75, "avg_line_length": 26.676470588235293, "alnum_prop": 0.6670341786108048, "repo_name": "Alerion/django-bootstrap-form", "id": "5d90d049e0be204cc6a951b9631b7b8b0a1f125e", ...
from django import test from select2_generic_m2m.test_forms import GenericSelect2TestMixin from .forms import TForm from .models import TModel class GM2MFormTest(GenericSelect2TestMixin, test.TestCase): model = TModel form = TForm url_name = 'select2_gm2m' def assert_relation_equals(self, expected,...
{ "content_hash": "95e66290a6dcc2539eaef6ab234b04d8", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 66, "avg_line_length": 26.27777777777778, "alnum_prop": 0.7103594080338267, "repo_name": "yourlabs/django-autocomplete-light", "id": "a25726b3635a325d8a30e94e3d1626aabd1e0e6d...
import accelerometer.accClassification import accelerometer.accUtils import accelerometer.device import accelerometer.summariseEpoch name = "accelerometer"
{ "content_hash": "a66fec3045d2590fa3bb632d6cdfa2de", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 38, "avg_line_length": 31.2, "alnum_prop": 0.8846153846153846, "repo_name": "computationalEpidemiology/biobankAccelerometerAnalysis", "id": "4e8af9e4f398e87fcf75cadee2755c9059...
import os.path as op import numpy as np import pytest from numpy.testing import assert_allclose, assert_array_equal from mne.datasets import testing from mne.io import read_raw_fif from mne.preprocessing import (regress_artifact, create_eog_epochs, EOGRegression, read_eog_regression) fr...
{ "content_hash": "ae0c3a637df8902e1225b528c2610a18", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 79, "avg_line_length": 40.78947368421053, "alnum_prop": 0.672073732718894, "repo_name": "wmvanvliet/mne-python", "id": "d33f5da95fec312079103cf323ea25dcd852129b", "size": ...
from inspect import signature from typing import Callable, Iterable from typing import Union from hotikeys.core import HotkeyCore from hotikeys.enums import KeyState, Key, EventId from hotikeys.lleventargs import LowLevelKeyboardArgs, LowLevelMouseArgs EventArgs = Union[LowLevelKeyboardArgs, LowLevelMouseArgs] _Handl...
{ "content_hash": "99df98c992312145ac7269e35e86bb16", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 97, "avg_line_length": 34.78225806451613, "alnum_prop": 0.6049153721307674, "repo_name": "appul/HotiKeys", "id": "f16023994e0951d3596882a206db7adaa612b2cc", "size": "4313"...
from dragonfly import (Grammar, AppContext, MappingRule, Dictation, Key, Text) firefox_context = AppContext(executable="firefox") grammar = Grammar("firefox", context=firefox_context) firefox_rules = MappingRule( name = "firefox", mapping = { "jump": Key("f12"), "edit": Key("cs-f4"), }, ...
{ "content_hash": "656c3d0191d48dd280133558588a14bc", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 78, "avg_line_length": 21, "alnum_prop": 0.6329365079365079, "repo_name": "simianhacker/code-by-voice", "id": "db41f4497814de1595d68808a0637a7fa4250241", "size": "504", "...
""" 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"); you may not use this ...
{ "content_hash": "0f25c0079dd645902fcb61af036cfe12", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 98, "avg_line_length": 36.733333333333334, "alnum_prop": 0.7701149425287356, "repo_name": "radicalbit/ambari", "id": "72904c89293a130c6c0e030634f76daf0a81139c", "size": "16...
from keystoneauth1.exceptions import base class AuthPluginException(base.ClientException): """Something went wrong with auth plugins.""" class MissingAuthPlugin(AuthPluginException): """An authenticated request is required but no plugin available.""" class NoMatchingPlugin(AuthPluginException): """The...
{ "content_hash": "5da8a948d0bbb71e0c6eb23457dbc548", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 78, "avg_line_length": 28.25581395348837, "alnum_prop": 0.6806584362139918, "repo_name": "citrix-openstack-build/keystoneauth", "id": "3747c50a03a1e9ad233db7dfdd1c37a52924782...
import enum def keywords(): """ Builds the list of the keywords. :return: the list of the keywords. """ keywords = [] keywords += Type.keywords() keywords += Primitive.keywords() keywords += Statement.keywords() keywords += Accessor.keywords() keywords += WellKnown.keywo...
{ "content_hash": "ab872f3696050e053d31d7ea41e175e9", "timestamp": "", "source": "github", "line_count": 370, "max_line_length": 99, "avg_line_length": 21.92972972972973, "alnum_prop": 0.5612521567660833, "repo_name": "francescoracciatti/aml", "id": "3040c31f4a9c56a1604365c28d7b6fb166271547", "size"...
from __future__ import (unicode_literals, division, absolute_import, print_function) from powerline.renderers.shell import ShellRenderer from powerline.theme import Theme class IPythonRenderer(ShellRenderer): '''Powerline ipython segment renderer.''' def get_segment_info(self, segment_info, mode): r = self.segme...
{ "content_hash": "7871060d3959b0342a45576bdc6f42f1", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 86, "avg_line_length": 29.18918918918919, "alnum_prop": 0.7175925925925926, "repo_name": "wfscheper/powerline", "id": "985e6c34b62ef7cfd4ea044edb9c44d3348d6886", "size": "2...
import datetime import dateutil.parser from tornado import gen, web import base import models class AllRacesHandler(base.BaseHandler): @gen.coroutine @web.asynchronous @base.authorized def get(self, url): self.tf.send({'profile.racelog.views': 1}, lambda x: x) error = self.get_error(...
{ "content_hash": "0dacbbf8bcde2617b9af22253e387a9c", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 169, "avg_line_length": 34.144444444444446, "alnum_prop": 0.5942076147087536, "repo_name": "JsonChiu/openrunlog", "id": "3e5e6baa60677918a89901041d766c8ac91b7c8f", "size": ...
from asyncio.tasks import sleep from collections import deque from typing import Tuple, Callable, Union from hwt.synthesizer.rtlLevel.constants import NOT_SPECIFIED from hwtLib.peripheral.usb.constants import USB_VER, USB_PID from hwtLib.peripheral.usb.descriptors.bundle import UsbDescriptorBundle, \ UsbNoSuchDesc...
{ "content_hash": "ce6d1ff21af4608577e7f2db0b7d9e24", "timestamp": "", "source": "github", "line_count": 338, "max_line_length": 164, "avg_line_length": 34.085798816568044, "alnum_prop": 0.6155715649683188, "repo_name": "Nic30/hwtLib", "id": "04f4de6a0d1c3591d2eb4deca4c0aeff5e0f7240", "size": "11521...
import os.path import re from setuptools import setup, find_packages README = os.path.join(os.path.dirname(__file__), "README.rst") long_description = open(README).read().strip() + "\n\n" def find_version(*file_paths): version_file_path = os.path.join(os.path.dirname(__file__), *file_paths) with open(versi...
{ "content_hash": "f2420ff825f1531896cae79c874746a3", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 88, "avg_line_length": 35.63076923076923, "alnum_prop": 0.6234887737478411, "repo_name": "peterbe/premailer", "id": "86a6cf487025f28a23551202a58f812a91f5f563", "size": "231...
def extractMahouShoujoIkuseiKeikakuWikiaCom(item): ''' DISABLED Parser for 'mahou-shoujo-ikusei-keikaku.wikia.com' ''' return None
{ "content_hash": "6a2915b434fed8113d7ef44a578e1d17", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 51, "avg_line_length": 19.571428571428573, "alnum_prop": 0.7664233576642335, "repo_name": "fake-name/ReadableWebProxy", "id": "857685212194effa485854bdf6ace5cd4bb47d5c", "si...
from decimal import * import getpass import math import os import os.path import platform import sys import time from jsonrpc import ServiceProxy, json BASE_FEE=Decimal("0.001") def check_json_precision(): """Make sure json library being used does not lose precision converting SVC values""" n = Decimal("20000...
{ "content_hash": "28d69a60d3c419f13ee38baa02757584", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 112, "avg_line_length": 39.11507936507937, "alnum_prop": 0.6226032261337121, "repo_name": "cryptocurinfo/sovereigncoin", "id": "e6c88aac6f768fdfead69e4ebba9f44e51d9a491", ...
import sys import os sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import unittest from sample.utils.string.case_converter import toLowerCases, toUpperCases class BasicTestSuite(unittest.TestCase): """ Test sample.utils.string.case_converter """ def testCaseConver...
{ "content_hash": "30568af6090eaa878162302fc2e8c51f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 82, "avg_line_length": 27.25, "alnum_prop": 0.653211009174312, "repo_name": "dqi2018/python-structure", "id": "6913bc629086bf8f1ce914daecd604ac0ba361cd", "size": "569", "...
import pandas as pd from pytrends.request import TrendReq pytrends = TrendReq(tz=0) #tz=0 puts us on UTC from dates import get_start_times, get_end_times, date_to_epoch, get_all_dates from data_generator import get_missing_data_point NUM_TRENDING = 10 # number of trending searches to return def get_updated_daily_d...
{ "content_hash": "8ccfd50d7f50352639cf471464844084", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 117, "avg_line_length": 33.53333333333333, "alnum_prop": 0.6399105367793241, "repo_name": "googleinterns/sgonks", "id": "8109250fac2e3d25af1edb9ea443cd9cc2301be9", "size":...
import unittest import CCSDS.FRAME, testData ############# # test case # ############# class TestFRAME(unittest.TestCase): def test(self): """test the transfer frame data units""" tmFrame0 = CCSDS.FRAME.TMframe() self.assertEqual(tmFrame0.versionNumber, 0) self.assertEqual(tmFrame0.spacecraftId, 0) ...
{ "content_hash": "bcfb6995cf91b2eafed828e37a0764f2", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 70, "avg_line_length": 46.372727272727275, "alnum_prop": 0.6828072926877083, "repo_name": "Stefan-Korner/SpacePyLibrary", "id": "c2f051f4af4eff45fa5073729e61e760fa01a445", ...
__all__ = ['Parser', 'ParserError'] from error import MarkedYAMLError from tokens import * from events import * from scanner import * class ParserError(MarkedYAMLError): pass class Parser: # Since writing a recursive-descendant parser is a straightforward task, we # do not give many comments here. # ...
{ "content_hash": "32520c2bfca25ee1664f1d3336d1b1ef", "timestamp": "", "source": "github", "line_count": 438, "max_line_length": 108, "avg_line_length": 45.10730593607306, "alnum_prop": 0.5266487827099255, "repo_name": "dproc/trex_odp_porting_integration", "id": "2aec0fe33f4cd60b1c0e76e0c73d2620404573...
from .api_key_authenticator import APIKeyAuthenticator from .authenticator import Authenticator from .invited_anonymous_user import InvitedAnonymousUser from .jwt_authenticator import JWTAuthenticator
{ "content_hash": "a80e710c5b9d0d554b55390067eb7445", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 56, "avg_line_length": 50.25, "alnum_prop": 0.8756218905472637, "repo_name": "tetherless-world/graphene", "id": "b6b03135b4d7973413ea7e4e8a2a92582b0a8d1a", "size": "201", ...
from __future__ import absolute_import import six from sentry.models import Activity from sentry.testutils import APITestCase class GroupNoteTest(APITestCase): def test_simple(self): group = self.group activity = Activity.objects.create( group=group, project=group.projec...
{ "content_hash": "8c594982759192a2b19da330e6e63972", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 87, "avg_line_length": 30.716814159292035, "alnum_prop": 0.5669835782195333, "repo_name": "JackDanger/sentry", "id": "870fa771b9e235ad87635792a0c4a958aed5aeae", "size": "3...
from libcloud.dns.types import Provider from libcloud.dns.providers import get_driver cls = get_driver(Provider.GODADDY) driver = cls("customer_id", "api_key", "api_secret") # Get the JSON schema for the domain schema = driver.ex_get_purchase_schema("com") # Use this schema to prepare a purchase request document # ...
{ "content_hash": "6deeff7b16414a865d78191f35d4403a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 62, "avg_line_length": 34.0625, "alnum_prop": 0.7486238532110092, "repo_name": "mistio/libcloud", "id": "de955281f54061796c1c565a54c9405c77380b78", "size": "545", "binary...
import aenum import doctest import sys import unittest from aenum import Enum, IntEnum, AutoNumberEnum, OrderedEnum, UniqueEnum, unique, skip, extend_enum from aenum import EnumMeta, NamedTuple, TupleSize, NamedConstant, constant, NoAlias, AutoNumber, Unique, AutoNumber from collections import OrderedDict from datetime...
{ "content_hash": "ebb7ca86c31c2c40a481df690251d994", "timestamp": "", "source": "github", "line_count": 2407, "max_line_length": 115, "avg_line_length": 37.03323639385127, "alnum_prop": 0.528836984933643, "repo_name": "harshita-gupta/Harvard-FRSEM-Catalog-2016-17", "id": "3c8c47111457fb5bf5efbfd25ff5...
try: from collections import namedtuple except ImportError: print("SKIP") raise SystemExit import skip_if skip_if.no_cpython_compat() _DefragResultBase = namedtuple('DefragResult', [ 'foo', 'bar' ]) class _ResultMixinStr(object): def encode(self): return self._encoded_counterpart(*(x.encode()...
{ "content_hash": "1013b20765c0d1db83b9ed78dc41f45b", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 69, "avg_line_length": 25.319148936170212, "alnum_prop": 0.7260504201680672, "repo_name": "adafruit/micropython", "id": "504f460a7d2e4b81177d6d3ae13da470253f5458", "size": ...
from swgpy.object import * def create(kernel): result = Ship() result.template = "object/ship/shared_star_destroyer.iff" result.attribute_template_id = -1 result.stfName("","xwing swg-sw test") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "8084f8a954e3902a21f53076bef9ff62", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 58, "avg_line_length": 21.76923076923077, "alnum_prop": 0.6749116607773852, "repo_name": "anhstudios/swganh", "id": "98d08fe45bff38f7de10562ac288d59263e59c9c", "size": "428...
import re import six from testtools import matchers from heat.common import exception from heat.common import template_format from heat.engine.resources.openstack.heat import random_string as rs from heat.engine import stack as parser from heat.engine import template from heat.tests import common from heat.tests impo...
{ "content_hash": "39c14db314315a231d9d6d26d9c6ca43", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 77, "avg_line_length": 32.113821138211385, "alnum_prop": 0.5864556962025317, "repo_name": "pshchelo/heat", "id": "cec5b497ec9cf1bceaec16f030abfb0ec184aa21", "size": "8475"...
import mock from oslo_config import cfg from oslo_log import log as logging from mistral.services import periodic from mistral.services import security from mistral.services import triggers from mistral.services import workflows from mistral.tests.unit.engine import base LOG = logging.getLogger(__name__) WORKFLOW_LI...
{ "content_hash": "c9feb10d1ae6100c8c3742c27195654b", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 78, "avg_line_length": 26.89, "alnum_prop": 0.5939010784678319, "repo_name": "dennybaa/mistral", "id": "992dbd073d073c7acb7777f896c26a119aedbb86", "size": "3298", "binar...
from libcloud.common.types import LibcloudError __all__ = [ 'Provider', 'RecordType', 'ZoneError', 'ZoneDoesNotExistError', 'ZoneAlreadyExistsError', 'RecordError', 'RecordDoesNotExistError', 'RecordAlreadyExistsError' ] class Provider(object): DUMMY = 'dummy' LINODE = 'linode...
{ "content_hash": "3ab6dc80d1a267e5fe2e06848f67444e", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 69, "avg_line_length": 22.366071428571427, "alnum_prop": 0.5900199600798404, "repo_name": "carletes/libcloud", "id": "192ae28c1d34b4a156c4036b8db5646e96aa8594", "size": "3...
from sys import exit, argv from os import environ, system environ['KERAS_BACKEND'] = 'tensorflow' import numpy as np from keras.models import Model, load_model from subtlenet import config import subtlenet.generators.gen as gen from paths import basedir from subtlenet.backend.layers import * gen.truncate = int(ar...
{ "content_hash": "629cb94ea2bd89c1989acef668db557a", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 103, "avg_line_length": 33.90243902439025, "alnum_prop": 0.6712230215827338, "repo_name": "sidnarayanan/BAdNet", "id": "f0ab4e674ef6d037089c8fad1bba28a8ac138452", "size": "...