text
stringlengths
4
1.02M
meta
dict
import dlib import cv2 import numpy as np import models import NonLinearLeastSquares import ImageProcessing from drawing import * import FaceRendering import utils print "Press T to draw the keypoints and the 3D model" print "Press R to start recording to a video file" #you need to download shape_predictor_68_face...
{ "content_hash": "1fb9bce2aeb54a566c80456606b46b53", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 210, "avg_line_length": 37.234042553191486, "alnum_prop": 0.6902857142857143, "repo_name": "TH4NOS/FaceSwap-Halloween", "id": "f2ab263f057952c807bb92bfd6c8d15b6fc5a888", "s...
DEFAULT_REFRESH_OFFSET = 300 DEFAULT_TOKEN_REFRESH_RETRY_DELAY = 30
{ "content_hash": "cf808a56cda85846180859ee07f1dcd7", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 38, "avg_line_length": 34, "alnum_prop": 0.7941176470588235, "repo_name": "Azure/azure-sdk-for-python", "id": "8ca26c01752aa04e73401641974ada1d45db1f58", "size": "250", "b...
from devilry.simplified import (simplified_modelapi, SimplifiedModelApi, PermissionDenied, FieldSpec, FilterSpecs, FilterSpec) from devilry.apps.core import models from devilry.coreutils.simplified.metabases import SimplifiedAbstractApplicationKeyValueMixi...
{ "content_hash": "92e80de8b0e199c284b1fe89646dcee1", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 147, "avg_line_length": 50.88, "alnum_prop": 0.7295597484276729, "repo_name": "vegarang/devilry-django", "id": "43a6154b6797da389f324371e9661fb564846d57", "size": "1272", ...
r""" This model calculates a simple power law with a flat background. Definition ---------- .. math:: I(q) = \text{scale} \cdot q^{-\text{power}} + \text{background} Note the minus sign in front of the exponent. The exponent *power* should therefore be entered as a **positive** number for fitting. Also note th...
{ "content_hash": "3fdbbeb67864e001a4499778de6dcfaa", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 80, "avg_line_length": 24.764705882352942, "alnum_prop": 0.6306413301662708, "repo_name": "SasView/sasmodels", "id": "b2588139ae35ef1fd844f499e017f7f414f8a51b", "size": "17...
import os from . import gen class Error(Exception): def __init__(self, msg, e=None): self.msg = msg self.e = e def __str__(self): if self.e is not None: return os.linesep.join([self.msg, gen.exnToString(self.e)]) else: return self.msg # vim:set shiftwi...
{ "content_hash": "07d12b1590fa40a51fd74365774e581c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 71, "avg_line_length": 22.75, "alnum_prop": 0.5824175824175825, "repo_name": "Ban3/Limnoria", "id": "2373bb5c5e0995dff88152806263025ef67cdaec", "size": "1948", "binary": ...
from unittest.mock import patch, Mock from usb.tests.base import APITestCase from usb.models import db, DesktopRedirect, TabletRedirect, MobileRedirect class RedirectFromShortURLTestCase(APITestCase): def setUp(self): super(RedirectFromShortURLTestCase, self).setUp() redirects = ( D...
{ "content_hash": "877558f33af8bb22f070c2f6b808b19f", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 92, "avg_line_length": 40.06849315068493, "alnum_prop": 0.6512820512820513, "repo_name": "dizpers/usb", "id": "bfb9e8cc9ea39f995a74149e9089da782a48bcb9", "size": "2925", ...
import sys import os from PIL import Image project_root = '../ISeeNN' sys.path.append('../') sys.path.append(os.path.join(project_root, 'search_web')) sys.path.append(os.path.join(project_root, 'ISeeNN')) import personal_settings as ps from feature_extractor import ResizeExtractor, RootNormalizer from ISeeNN.image_se...
{ "content_hash": "8d44811c13659ca4d64f06b311e8c1ce", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 90, "avg_line_length": 32.43103448275862, "alnum_prop": 0.5443912812333865, "repo_name": "sunshaoyan/ISeeNN", "id": "503b913be7a5021b736b2bb1a1788fb97c0c7ae7", "size": "37...
""" Unit tests for the Neutron HNV L2 Agent. """ import sys from unittest import mock from networking_hyperv.neutron.agent import hnv_neutron_agent as hnv_agent from networking_hyperv.neutron import constants from networking_hyperv.tests import base as test_base class TestHNVAgent(test_base.HyperVBaseTestCase): ...
{ "content_hash": "5fc9378eb08432396aa89a8080aa735b", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 79, "avg_line_length": 43.559633027522935, "alnum_prop": 0.6381634372367313, "repo_name": "openstack/networking-hyperv", "id": "dfbf8e368e965988927190de182b8c630560fc68", ...
"""Test the hunt_view interface.""" from unittest import mock from absl import app from grr_response_core.lib import utils from grr_response_core.lib.rdfvalues import client as rdf_client from grr_response_core.lib.rdfvalues import client_fs as rdf_client_fs from grr_response_core.lib.rdfvalues import file_finder as...
{ "content_hash": "7eca988e6154a68969b38f4fafc31bd7", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 80, "avg_line_length": 38.532467532467535, "alnum_prop": 0.6987698011459387, "repo_name": "google/grr", "id": "9028d11bde91b12d5e8f8f72d0676f6aeffd3171", "size": "11916", ...
import re import os # Where module is on filesystem. FORGE_HOME = os.path.abspath(os.path.realpath(os.path.dirname(__file__))) MODULE_REGEX = re.compile(r'^(?P<author>\w+)[/\-](?P<module>\w+)$') TARBALL_REGEX = re.compile(r'^(?P<author>\w+)-(?P<module>\w+)-(?P<version>[\w\.]+)\.tar\.gz$') PUPPETLABS_FORGE_URL = 'htt...
{ "content_hash": "f61594994a72d7d76dee79ea7360a6c1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 94, "avg_line_length": 36.714285714285715, "alnum_prop": 0.6750972762645915, "repo_name": "jbronn/django-forge", "id": "a1d134655aad4f89a3e5c21df09ac583f9b21b61", "size": "...
import numpy as np from BDSpace.Figure import Figure from BDSpace.Figure.Sphere import SphericalShape, SphericalWedge, SphericalSegmentWedge from BDSpace.Figure.Cylinder import CylindricalWedge from BDSpace.Figure.Cone import ConicalWedge from BDSpace.Figure.Torus import ToricWedge from BDSpace.Figure.Cube import Para...
{ "content_hash": "47196a7c0b92440f1c4178194e55d7b6", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 120, "avg_line_length": 49.81578947368421, "alnum_prop": 0.6539883782356049, "repo_name": "bond-anton/Space_visualization", "id": "208f0117bde234c0d79c0a737375675f16349b61", ...
import time from coinbase.wallet.client import Client class Coinbase(object): def __init__(self, api_key, secret_key): self.client = Client(api_key, secret_key) self._portfolio_cache = {} self._last_retrieved = 0.0 self._update_limit = 10 #seconds def portfolio(self): ...
{ "content_hash": "1457b1078fd546db06044a88414b5fa9", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 74, "avg_line_length": 30.11904761904762, "alnum_prop": 0.5470355731225296, "repo_name": "mattmolo/cryptocurreny-viewer", "id": "65dffcb9e32b699ddc608b5a008e94ac6569a4f6", ...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zzz.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "b29d87efbf24f6da9fc23e9518c9742f", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 67, "avg_line_length": 24.88888888888889, "alnum_prop": 0.7053571428571429, "repo_name": "yetizzz/zzz", "id": "81aff7216e5547c6be081c2fb31f028b7d1589d2", "size": "246", "b...
from collections import namedtuple import uuid import datetime from django.test import SimpleTestCase from corehq.util.es.elasticsearch import ConnectionError from corehq.apps.es import FormES from corehq.apps.es.tests.utils import es_test from corehq.elastic import get_es_new, send_to_elasticsearch, doc_exists_in_es ...
{ "content_hash": "4bb30267a5d0296bdde670dffc66c23c", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 106, "avg_line_length": 45.32142857142857, "alnum_prop": 0.6548463356973995, "repo_name": "dimagi/commcare-hq", "id": "8dae284dc5f07bc0ce725ff759bee125a9c2e604", "size": "...
import os.path from reportlab.lib.units import mm from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont from reportlab.pdfgen import canvas from laboratory.settings import FONTS_FOLDER class PageNumCanvas(canvas.Canvas): """ Adding a Page Number of Total """ # ------...
{ "content_hash": "bc130f555f331cbe3264523eac5220df", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 114, "avg_line_length": 31.864583333333332, "alnum_prop": 0.4645308924485126, "repo_name": "moodpulse/l2", "id": "7e5fad7bb1a98ad6c99514ec5d2869aceafa4ab5", "size": "3069",...
from rope.base import ast from rope.base import pynames from rope.base import utils from rope.refactor.importutils import actions from rope.refactor.importutils import importinfo class ModuleImports(object): def __init__(self, project, pymodule, import_filter=None): self.project = project self.py...
{ "content_hash": "565a1c5d66fd04ccd3dcf128ac84119b", "timestamp": "", "source": "github", "line_count": 492, "max_line_length": 79, "avg_line_length": 36.86991869918699, "alnum_prop": 0.5790518191841235, "repo_name": "JetChars/vim", "id": "b96eebc4647f02da3f37bb7f0a888c01d9c441b0", "size": "18140",...
from django import template register = template.Library() class StreamItemNode(template.Node): def __init__(self, entry_var): self.entry_var = template.Variable(entry_var) def render(self, context): entry = self.entry_var.resolve(context) template_name = 'stream/%s.html' % (entry.item...
{ "content_hash": "a5a476c6facf2f9dde12b6a9d11e7983", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 85, "avg_line_length": 27.058823529411764, "alnum_prop": 0.6434782608695652, "repo_name": "bhrutledge/debugged-django", "id": "f7962eb9b619f81957050e1f0f2b2e0140df22a3", "s...
import sys #Only really old versions of Python don't have sys.hexversion. We don't support #them. The logging module was introduced in Python 2.3 if not hasattr(sys, 'hexversion') or sys.hexversion < 0x20300F0: sys.stdout.write('Python version: ' + sys.version) sys.stdout.write('PyBitmessage requires Python 2....
{ "content_hash": "d919cd1c896c73c502365004f3cad633", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 223, "avg_line_length": 41.11059907834101, "alnum_prop": 0.6532899899114449, "repo_name": "debguy0x/PyBitmessage", "id": "294c6a2231cc032ea1eec9a3145ac42463960420", "size"...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) # -- General con...
{ "content_hash": "9a47d4bf00732aabb34ba2ffdb0520f6", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 79, "avg_line_length": 32.26229508196721, "alnum_prop": 0.6991869918699187, "repo_name": "apfeiffer85/aws-overlord", "id": "3561e8d0d82ecdc20a1687638e206c9994c64c2b", "siz...
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Builder class, a minimal prototype class to build more chart types on top of it. """ #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Contin...
{ "content_hash": "1de8f036b10d60b15d4daed7ae7fe150", "timestamp": "", "source": "github", "line_count": 716, "max_line_length": 124, "avg_line_length": 38.279329608938546, "alnum_prop": 0.6007005253940455, "repo_name": "ptitjano/bokeh", "id": "4bb1a7ee5a4a37d12b5eba1a25d51d6dc11e26aa", "size": "274...
from telemetry.page import shared_page_state from page_sets.rendering import rendering_story from page_sets.rendering import story_tags from page_sets.system_health import platforms from page_sets.login_helpers import linkedin_login class ToughPinchZoomMobilePage(rendering_story.RenderingStory): ABSTRACT_STORY = T...
{ "content_hash": "b7cddf362fad5dcc0e845dce952def2b", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 92, "avg_line_length": 37.83870967741935, "alnum_prop": 0.7101449275362319, "repo_name": "scheib/chromium", "id": "0c6b25aeff3359d3bb74c6b1e2cf872abedb7ee9", "size": "3681"...
import itertools, operator from .data import * from .manager import * import PIL.Image, PIL.ImageMath, PIL.ImageStat, PIL.ImageChops ##def position_raster(raster, width, height, coordspace_bbox): ## # GET COORDS OF ALL 4 VIEW SCREEN CORNERS ## xleft,ytop,xright,ybottom = coordspace_bbox ## viewcorners = [(...
{ "content_hash": "ddb1bff9c3584ba19cfb20f0004cb280", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 121, "avg_line_length": 39.10382513661202, "alnum_prop": 0.6446338736724427, "repo_name": "karimbahgat/PythonGis", "id": "4388713d59f1dab795cc19ec7c0d1bbcf793fc57", "size"...
"""Widgets for Zinnia admin""" import json from itertools import chain from django.contrib.admin import widgets from django.contrib.staticfiles.storage import staticfiles_storage from django.forms import Media from django.utils.encoding import force_str from django.utils.safestring import mark_safe from tagging.model...
{ "content_hash": "1e6caa3aef29aed4f4562f0f4b34b704", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 79, "avg_line_length": 32.03174603174603, "alnum_prop": 0.5698711595639246, "repo_name": "Fantomas42/django-blog-zinnia", "id": "25a0a0aaef90b480d43fd4e7a89e5900834a0204", ...
from django.contrib.sitemaps import Sitemap from django.contrib.sites.models import Site from django.db.models import Q from django.utils import translation from cms.models import Title from cms.utils.i18n import get_public_languages def from_iterable(iterables): """ Backport of itertools.chain.from_iterable...
{ "content_hash": "59b929228d8b8c2c0d899f5e4a4f08af", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 92, "avg_line_length": 39.20289855072464, "alnum_prop": 0.6395563770794824, "repo_name": "FinalAngel/django-cms", "id": "c0bf891f7b4cfdf141b8b400de46649fbdb76752", "size": ...
""" WSGI config for InfragramOnline project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "InfragramOnline.settings") f...
{ "content_hash": "a39b9dcd7ddab0783e94eed90d5ffac2", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 27.61111111111111, "alnum_prop": 0.7987927565392354, "repo_name": "smarani/InfraShareMobile", "id": "749d09526c13514339ba15ce83875abb27b9cfe7", "size...
import os import sys from termcolor import colored GREP_COMMAND_FORMAT = 'xargs -n {0} {1} < {2}' DEFAULT_GREP_COMMAND = 'grep --color=always \'{0}\'' def grep_files(args, all_logs): if args.grep: greplist_filename = '{0}/.greplist'.format(args.dest) create_greplist(args, all_logs, greplist_filename) co...
{ "content_hash": "6d675bafb7167e4725a06fd762a33c84", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 111, "avg_line_length": 38.6875, "alnum_prop": 0.7051696284329564, "repo_name": "mjball/Singularity", "id": "7f0356cc85e28d2169552e77d76acfda5f316aef", "size": "1238", "b...
"""Word completion for GNU readline. The completer completes keywords, built-ins and globals in a selectable namespace (which defaults to __main__); when completing NAME.NAME..., it evaluates (!) the expression up to the last dot and completes its attributes. It's very cool to do "import sys" type "sys.", hit the com...
{ "content_hash": "82ad61d07edea1e20fc282dc3e20ccd3", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 80, "avg_line_length": 34.35057471264368, "alnum_prop": 0.6063242429312364, "repo_name": "sharhar/USB-Thing", "id": "be8aee0f7e904f336e01bb294cbeed9cef07071a", "size": "59...
import sys import numpy as np import pytest import scipy as sp from pygam import * def test_LinearGAM_prediction(mcycle_X_y, mcycle_gam): """ check that we the predictions we get are correct shape """ X, y = mcycle_X_y preds = mcycle_gam.predict(X) assert(preds.shape == y.shape) def test_Lo...
{ "content_hash": "bb3641e1fa417d11778fdcaeda36adfe", "timestamp": "", "source": "github", "line_count": 542, "max_line_length": 110, "avg_line_length": 34.190036900369, "alnum_prop": 0.5841023150396633, "repo_name": "dswah/pyGAM", "id": "f74999d52b2382a3834e09180ab26767c330e0dd", "size": "18556", ...
from django.test import TestCase from unittest import mock from .. import factories from .. import models from .. import utils @mock.patch.object(utils, 'operate') class UndoOperateTests(TestCase): def setUp(self): self.game = factories.GameFactory(cash=1000) self.start_entry = models.LogEntry.obj...
{ "content_hash": "98604dfc1c69b9d22280e09caf950b9f", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 79, "avg_line_length": 45.839416058394164, "alnum_prop": 0.6756369426751593, "repo_name": "XeryusTC/18xx-accountant", "id": "ec05e33be24f5fb392e36d06a6ee635808ec505d", "si...
"""empty message Revision ID: c31f38f66b40 Revises: Create Date: 2018-03-08 11:24:16.886091 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'c31f38f66b40' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
{ "content_hash": "507d758b4977785fff79620c4a11b64e", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 71, "avg_line_length": 41.60283687943262, "alnum_prop": 0.6462666212069553, "repo_name": "jerkos/hozons", "id": "6a44f71a4daa46d1d9e30313c8861195a4a1fe4b", "size": "5866",...
import datetime import iso8601 from oslo_utils import timeutils import six import six.moves.urllib.parse as urlparse from webob import exc from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import exception from nova.i18n import _ from nova import objects ALIAS = "os-simple-tenan...
{ "content_hash": "39b93284b77f20e5121b3443955adeda", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 79, "avg_line_length": 37.25182481751825, "alnum_prop": 0.543842461056138, "repo_name": "apporc/nova", "id": "e9a35ee28dfd1d4140061545cf05357c0ab6934c", "size": "10843", ...
import numpy as np import onnx from onnx import AttributeProto, GraphProto, OperatorSetIdProto, TensorProto, helper, numpy_helper hidden_size = 4 weight_dim_to_split = 16 X = helper.make_tensor_value_info("input", TensorProto.FLOAT, ["batch", "seqlen", hidden_size]) Y = helper.make_tensor_value_info("output", TensorP...
{ "content_hash": "f7b5b20f5bbfab6b1811ab789e9dbf07", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 148, "avg_line_length": 28.430555555555557, "alnum_prop": 0.6629213483146067, "repo_name": "microsoft/onnxruntime", "id": "8f8798750f56fe1861e406f9eb1a6e9d1311a26e", "size...
"""Upgrader for Python scripts from 1.x TensorFlow to 2.0 TensorFlow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import six from tensorflow.tools.compatibility import ast_edits from tensorflow.tools.compatibility import ipynb from ...
{ "content_hash": "ba14af12635656e33a79203b4638f0b2", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 80, "avg_line_length": 35.545, "alnum_prop": 0.6363764242509495, "repo_name": "aldian/tensorflow", "id": "7c7461c19da5b8067181df0218fb4e5075895694", "size": "7826", "bin...
from __future__ import absolute_import, division, print_function, unicode_literals import os import re import sys from setuptools import find_packages, setup def get_version(package): """ Return package version as listed in `__version__` in `init.py`. """ init_py = open(os.path.join(package, '__init...
{ "content_hash": "b6d485de680302bb9e456ae428c24e8e", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 82, "avg_line_length": 30.658227848101266, "alnum_prop": 0.5912469033856317, "repo_name": "moumoutte/django-perf-rec", "id": "48a3967c3930cf0d8b204731b2ad2d0fc6b620d4", "si...
import json import mock import six from heat.common import exception from heat.common import grouputils from heat.common import template_format from heat.engine import function from heat.engine import rsrc_defn from heat.tests.autoscaling import inline_templates from heat.tests import common from heat.tests import ut...
{ "content_hash": "45ce32c72a97cd796f7a57b65699b83a", "timestamp": "", "source": "github", "line_count": 634, "max_line_length": 79, "avg_line_length": 41.0583596214511, "alnum_prop": 0.5984403211555454, "repo_name": "jasondunsmore/heat", "id": "0e8900212edb966b6d6adb3b3bcd1a95a58dca98", "size": "26...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath(os.path.join(os.path.di...
{ "content_hash": "2b75c167fcca31a637a4e60302d7343a", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 79, "avg_line_length": 31.96078431372549, "alnum_prop": 0.7076073619631902, "repo_name": "idmillington/papersizes", "id": "4866fdd22eafad99d1d2ba60d743ed95eed57739", "size...
""" This is a script written to add the template "orphan" to pages. These command line parameters can be used to specify which pages to work on: &params; -xml Retrieve information from a local XML dump (pages-articles or pages-meta-current, see https://download.wikimedia.org). ...
{ "content_hash": "8bbd9514fd1660221a3d7149217c01b5", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 90, "avg_line_length": 37.164556962025316, "alnum_prop": 0.5557447774750227, "repo_name": "trishnaguha/pywikibot-core", "id": "de4e7cabc7cd3dd2c66f34af58f94bc6b52357da", "...
''' Utility module that converts a reStructuredText file into XHTML. Based on the rst2html script provided by docutils with some hard-coded options that are suitable for restblog. :copyright: Copyright 2010 Luis Artola. :license: BSD, see LICENSE.txt for details. ''' import os import sys from docutils.core import d...
{ "content_hash": "480fbb1fa8b4e3daf247f3fcc8ddc856", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 91, "avg_line_length": 27.70149253731343, "alnum_prop": 0.6831896551724138, "repo_name": "MadanThangavelu/restblog", "id": "82130ee4b6db040f2ea999826f5cf0392db4af2c", "size...
from bamboo_boy.utils import with_canopy import json from django.test import TestCase from builds.constants import LATEST from projects.models import Project from rtd_tests.factories.projects_factories import OneProjectWithTranslationsOneWithout,\ ProjectFactory from rest_framework.reverse import reverse from resta...
{ "content_hash": "299ddc2cf6ce463c85c5208b2ce25d56", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 89, "avg_line_length": 38.773809523809526, "alnum_prop": 0.632483880871968, "repo_name": "raven47git/readthedocs.org", "id": "30b9f527295d605a4e87f5666e0e24837af6f04a", "si...
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QLineEdit, QPushButton class MyMainWindow(QMainWindow): def __init__(self): super(QMainWindow, self).__init__() self.title = 'PyQt5 textbox example' self.left = 100 self.top = 100 self.width = 640 ...
{ "content_hash": "1d5741bef0ce8efb14c05e2f6ccec56c", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 130, "avg_line_length": 28.75, "alnum_prop": 0.6134387351778656, "repo_name": "nnaabbcc/exercise", "id": "d1c2bd64b9d58dc9ae697f47499d417cdc9f3e50", "size": "1266", "bina...
number = 10
{ "content_hash": "c5f3657a6f859b58f15ddd97571f53b7", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 11, "avg_line_length": 12, "alnum_prop": 0.6666666666666666, "repo_name": "FelicityN/hello_world", "id": "88d97b6bb1dcdc69493d49f808a3bb089ab5101d", "size": "12", "binary"...
from rest_framework.pagination import PageNumberPagination class StandardResultsSetPagination(PageNumberPagination): page_size = 20 page_size_query_param = 'page_size' max_page_size = 1000
{ "content_hash": "ca5a48edb9193b6cb2bf8682942d359f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 58, "avg_line_length": 29, "alnum_prop": 0.7733990147783252, "repo_name": "larryhq/railguns", "id": "46ad06ea1167e546a1709660877d66a719a4a0ca", "size": "203", "binary": fa...
from django.conf.urls import patterns, url from helloworld import views urlpatterns = patterns('', url(r'^$', views.index, name='index'), )
{ "content_hash": "1d84ee1d7eaa4aca900c4fb9684f32da", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 24.166666666666668, "alnum_prop": 0.7034482758620689, "repo_name": "samuraitaiga/django-sample", "id": "63e8065847fe042aa305cc04f98529a2d0f181c0", "si...
from __future__ import unicode_literals import sandboxie import subprocess import time import unittest class SandboxieIntegrationTests(unittest.TestCase): def setUp(self): self.sbie = sandboxie.Sandboxie() self.sbie.create_sandbox(box='foo', options={'Enabled': 'yes'}) def tearDown(self): ...
{ "content_hash": "ca3fb1f962988a4f2d0ff08b7448a5bd", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 76, "avg_line_length": 28.878048780487806, "alnum_prop": 0.625, "repo_name": "gg/sandboxie-py", "id": "f62ede2b19522e074f92ed10b0df15f4e6c6c1f4", "size": "1201", "binary"...
import rospy import os import pyinotify import sys import collections class _QueryDeleteProcessor(pyinotify.ProcessEvent): def process_IN_DELETE(self, event): self.__class__.handle_delete(event) def process_default(self, event): pass class QueryNotifier(): def __init__(self, query_path)...
{ "content_hash": "65878466d08bc28a6cf2886890865951", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 70, "avg_line_length": 28.1875, "alnum_prop": 0.6267553584626755, "repo_name": "EndPointCorp/lg_ros_nodes", "id": "75d63f6e41affb4b46c32246d1361949aa911737", "size": "1353"...
from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig, _encoding) ex...
{ "content_hash": "02d47ce3e802310bc1324091adc24272", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 96, "avg_line_length": 45.048, "alnum_prop": 0.6876220919907654, "repo_name": "tropp/acq4", "id": "69e9063dbdc647bd091e99ba8cf210b52fbf7160", "size": "5870", "binary": f...
import sys from abc import ABCMeta from py4j.java_gateway import get_java_class from pyflink.java_gateway import get_gateway from pyflink.util.utils import load_java_class __all__ = [ 'StateBackend', 'MemoryStateBackend', 'FsStateBackend', 'RocksDBStateBackend', 'CustomStateBackend', 'Predefi...
{ "content_hash": "325e8cb5e951aa873035a5a21abee626", "timestamp": "", "source": "github", "line_count": 781, "max_line_length": 99, "avg_line_length": 47.64276568501921, "alnum_prop": 0.6731167190733425, "repo_name": "fhueske/flink", "id": "6d23850c0bce11bfc1c44f78bd55e85b6d7cdc12", "size": "38167"...
import argparse, os, ConfigParser, sys, re from pysandesh.sandesh_base import * from pysandesh.gen_py.sandesh.ttypes import SandeshLevel from device_config import DeviceConfig import discoveryclient.client as client from sandesh_common.vns.ttypes import Module from sandesh_common.vns.constants import ModuleNames, \ ...
{ "content_hash": "7fd7f74fb4f82ac27f7d3b6ebead9ac4", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 79, "avg_line_length": 36.51131221719457, "alnum_prop": 0.5751642086999629, "repo_name": "srajag/contrail-controller", "id": "fceb15241b00614abf4a001821d007b377fd4ee9", "s...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from flexget import options from flexget.event import event from flexget.manager import Session from flexget.terminal import TerminalTable, TerminalTableError, table_parse...
{ "content_hash": "476730e9c5b61c58fb60630c55e1ae1a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 99, "avg_line_length": 35.906976744186046, "alnum_prop": 0.6321243523316062, "repo_name": "tobinjt/Flexget", "id": "7d2fa9b8a83e49aff89491891d7edcce7d1352ba", "size": "1544...
from __future__ import unicode_literals # import frappe from frappe.model.document import Document class TwilioNumberGroup(Document): pass
{ "content_hash": "03f16d77db26df08e01198aa7d543bfe", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 23.5, "alnum_prop": 0.8085106382978723, "repo_name": "adityahase/frappe", "id": "04cb9ae146052b65bdd13330077823882f9553fc", "size": "275", "binary":...
import logging import os import sys import yaml from pushmanager.core.util import dict_copy_keys configuration_file = os.environ.get('SERVICE_ENV_CONFIG_PATH') Settings = {} try: with open(configuration_file) as settings_yaml: Settings = yaml.safe_load(settings_yaml) except: logging.error("Can not l...
{ "content_hash": "3386300df3150c37d71179042688537b", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 79, "avg_line_length": 23.711111111111112, "alnum_prop": 0.6401124648547329, "repo_name": "asottile/pushmanager", "id": "c35c56e9e17f9d18dce48f868ef87de04f2e70ac", "size": ...
import json from .util import create_url, normalize_connector_config class ConnectorAPI: """Access Data Connector API which handles Data Connector. This class is inherited by :class:`tdclient.api.API`. """ def connector_guess(self, job): """Guess the Data Connector configuration Ar...
{ "content_hash": "2d450b6b26dbb1dd2d132a09b6494a80", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 121, "avg_line_length": 39.439597315436245, "alnum_prop": 0.5020845741512805, "repo_name": "treasure-data/td-client-python", "id": "bf5b5d4440fd564aa0671fa5c1951e6f48836797"...
TEMPLATE_PATH = 'app/'
{ "content_hash": "3a8eeef0807ddf00efb6c3f87c597f62", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 22, "avg_line_length": 22, "alnum_prop": 0.6818181818181818, "repo_name": "tao12345666333/app-turbo", "id": "99b11a593592033707c4369e86eb180b14ba7f6f", "size": "104", "bin...
""" Homepage Admin """ from django.contrib import admin from django.db import models from .models import HomePageHeader, HomePageButton, TextBlurb, SemesterModule class ModuleAdmin(admin.ModelAdmin): """ Homepage Admin """ list_display = ('module_title',) admin.site.register(SemesterModule, ModuleAd...
{ "content_hash": "42095b5edd646e329fe83135efdd1e85", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 77, "avg_line_length": 22.473684210526315, "alnum_prop": 0.7681498829039812, "repo_name": "gatortechuf/gatortechuf.com", "id": "4ff6f0b48fdf3986ba00ee8f06975c42921da0a8", "...
import os import sys import json import fnmatch import glob2 from flask import Flask from flask import request from flask.ext import restful from flask.ext.restful import Resource from flask import jsonify from monitor.resource import ResourceMonitor from monitor import file_cache import log as logging from config im...
{ "content_hash": "b506131751b8fc476b9c487b364e0d56", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 84, "avg_line_length": 33.14383561643836, "alnum_prop": 0.597024178549287, "repo_name": "cmusatyalab/elijah-discovery-basic", "id": "5af28bc1bf6992c168c8be2298323af33b80ef40...
""" This module tests twisted.conch.ssh.connection. """ import struct from twisted.conch import error from twisted.conch.ssh import channel, common, connection from twisted.trial import unittest from twisted.conch.test import test_userauth class TestChannel(channel.SSHChannel): """ A mocked-up version of tw...
{ "content_hash": "cc08247b166cc2561bfa7ccd3f7e0d71", "timestamp": "", "source": "github", "line_count": 620, "max_line_length": 79, "avg_line_length": 37.79677419354839, "alnum_prop": 0.6019032175471537, "repo_name": "sorenh/cc", "id": "22f38c261643417df3e4f67502543e43f56ba23c", "size": "23511", ...
import inspect import sys try: from SimpleXMLRPCServer import SimpleXMLRPCServer except ImportError: from xmlrpc.server import SimpleXMLRPCServer class RemoteServer(SimpleXMLRPCServer): def __init__(self, library, port=8270, port_file=None): SimpleXMLRPCServer.__init__(self, ('127.0.0.1', int(por...
{ "content_hash": "55af17e85a6bb291724acc3dc1c98095", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 73, "avg_line_length": 33.149253731343286, "alnum_prop": 0.5943268797838811, "repo_name": "synsun/robotframework", "id": "42096756652c70613e6a7ef2802c03b5c43460ff", "size":...
from datetime import datetime from loguru import logger from flexget import plugin from flexget.event import event logger = logger.bind(name='est_movies') class EstimatesReleasedMovies: @plugin.priority(0) def estimate(self, entry): if 'tmdb_released' in entry: logger.verbose('Querying ...
{ "content_hash": "ef87a15aa478264e3358d0975ed433cb", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 98, "avg_line_length": 29.875, "alnum_prop": 0.6317991631799164, "repo_name": "ianstalk/Flexget", "id": "e3329856883ad36cbd28b84696c545a76eab1adf", "size": "956", "binary...
import os import shutil import xml.etree.ElementTree as ET from string import Template from PIL import Image from StringIO import StringIO import zipfile import urllib from osgeo import ogr import auxiliary_functions def tab_template(sensor, file_name, map_coords1, map_coords2, map_coords3, map_coords4, img_hight, im...
{ "content_hash": "8ad9be40b40df2a7992106124fa018a6", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 127, "avg_line_length": 58.05166051660517, "alnum_prop": 0.5018433765573354, "repo_name": "bazzile/helper", "id": "d72ea347d56fa886e33b29dd47aeee56a0e8580f", "size": "1646...
""" Audio Interchange File Format (AIFF) parser. Author: Victor Stinner Creation: 27 december 2006 """ from lib.hachoir_parser import Parser from lib.hachoir_core.field import (FieldSet, UInt16, UInt32, Float80, TimestampMac32, RawBytes, NullBytes, String, Enum, PascalString32) from lib.hachoir_core.endia...
{ "content_hash": "16cf2d71388d53f18b16e164469f5b81", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 82, "avg_line_length": 31.341269841269842, "alnum_prop": 0.592301848569258, "repo_name": "Branlala/docker-sickbeardfr", "id": "16d0f7030178e9e13234900ee16db3e31c67fef6", "...
def configuration(parent_package='io',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('arff', parent_package, top_path) config.add_data_dir('tests') return config if __name__ == '__main__': from numpy.distutils.core import setup setup(**configuration(...
{ "content_hash": "35603c2c94e36e2865a3c6c05e2958b1", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 60, "avg_line_length": 34.3, "alnum_prop": 0.6909620991253644, "repo_name": "zerothi/scipy", "id": "0b2417a2fa982d89ce60f27ce9d6c7785fe7d9af", "size": "344", "binary": fa...
import logging from os import makedirs, listdir from os.path import abspath, dirname, join from shutil import copy, copytree class Installer(object): """Initialize default rant source files in given directory""" def __init__(self, dest_dir): self._dest_dir = dest_dir self._rant_path = abspath...
{ "content_hash": "a008acdc5a55a336056d0144a9311bc4", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 86, "avg_line_length": 34.58974358974359, "alnum_prop": 0.5796886582653817, "repo_name": "lrvick/rant", "id": "51f67eeef9ac6ff8c0e31933996f809ef387b3a4", "size": "1349", ...
"""Pyauric Documentation Pyauric is an interface for the AURIC airglow modelling software. The AURICManager class keeps track of environment variables and the working directory to facilitate AURIC use in python scripts, jupyter notebooks, interactive ipython sessions, etc. If AURIC is set up so that you can use the s...
{ "content_hash": "5097180a507964216b22d8c00772a77b", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 248, "avg_line_length": 41.326530612244895, "alnum_prop": 0.5807407407407408, "repo_name": "georgegeddes/pyauric", "id": "108b25add3e7a27906d30514c2ef760cd8ff2f3d", "size":...
from Axon.AxonExceptions import AxonException as _AxonException class socketSendFailure(_AxonException): pass class connectionClosedown(_AxonException): pass class connectionDied(connectionClosedown): pass class connectionDiedSending(connectionDied): pass class connectionDiedReceiving(connectionDied): pass class conne...
{ "content_hash": "1ccfa3617a246553c01a80b9f0c317e4", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 63, "avg_line_length": 39.857142857142854, "alnum_prop": 0.8154121863799283, "repo_name": "sparkslabs/kamaelia", "id": "5908b40d1fa02491e2aa887f096c2b6d64d9afa5", "size": "...
"""Module for wrapper cyber record.""" import collections import importlib import os import sys from google.protobuf.descriptor_pb2 import FileDescriptorProto # Refer to the _cyber_record_wrapper.so with relative path so that it can be # always addressed as a part of the runfiles. wrapper_lib_path = os.path.abspath(...
{ "content_hash": "a1e93f5124b00adf5bb12cdd33edbfca", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 100, "avg_line_length": 32.586046511627906, "alnum_prop": 0.6251784184984299, "repo_name": "ycool/apollo", "id": "664ab405121d9ca0ab25e39c48e0b81b85e1b94a", "size": "7813"...
"""Ragged operations for working with string Tensors.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tens...
{ "content_hash": "59dab23fd7cb17c72f1af8ad7bcb849a", "timestamp": "", "source": "github", "line_count": 914, "max_line_length": 98, "avg_line_length": 42.82494529540482, "alnum_prop": 0.6533391242143989, "repo_name": "sarvex/tensorflow", "id": "85735c39a868ece873ccc0bae2ee4622d0502eaf", "size": "39...
import argparse import os import sys #-------------------------------------------------------------------------------------------------- # Utility functions. #-------------------------------------------------------------------------------------------------- def walk(directory, recursive): if recursive: f...
{ "content_hash": "4caa299dc1393e6ce57d0de834d58a4b", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 104, "avg_line_length": 35.541666666666664, "alnum_prop": 0.4630715123094959, "repo_name": "aytekaman/appleseed", "id": "0bc8086013a1af01a9e00deed24ac56f2132bb7f", "size": ...
""" A classifier based on the Naive Bayes algorithm. In order to find the probability for a label, this algorithm first uses the Bayes rule to express P(label|features) in terms of P(label) and P(features|label): | P(label) * P(features|label) | P(label|features) = -----------------------------...
{ "content_hash": "a47ba8550bb27f0ef88f01e9a944e15a", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 80, "avg_line_length": 41.646288209606986, "alnum_prop": 0.5691517248610675, "repo_name": "haya14busa/alc-etm-searcher", "id": "2f6c5c02d57b488778eba8fdca246b46a4c98a47", ...
''' Test cases for the isoduration module. ''' import unittest import operator from datetime import timedelta, date, datetime from isodate import Duration, parse_duration, ISO8601Error from isodate import D_DEFAULT, D_WEEK, D_ALT_EXT, duration_isoformat # the following list contains tuples of ISO duration strings and...
{ "content_hash": "f5b370dfea7044e16e7a69e56c1d0b5f", "timestamp": "", "source": "github", "line_count": 453, "max_line_length": 82, "avg_line_length": 42.33112582781457, "alnum_prop": 0.5066750104297038, "repo_name": "unor/schemaorg", "id": "d8b4cf28c6165487a9c8e50f8fa45abe83bc982c", "size": "20722...
import os import sys import time import threading sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # not required after 'pip install uiautomation' import uiautomation as auto def threadFunc(uselessRoot): """ If you want to use UI Controls in a new thread, create an UIAutomationIn...
{ "content_hash": "2d6eb91507f2a9795fbeb62d23973039", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 125, "avg_line_length": 42.42857142857143, "alnum_prop": 0.7081930415263749, "repo_name": "yinkaisheng/Python-UIAutomation-for-Windows", "id": "4bd02a5ac737e014e30dd5bc522cf4...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 0, ar_order = 0);
{ "content_hash": "22e1ca26cf73915570cbe97b7436f78e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 163, "avg_line_length": 37.57142857142857, "alnum_prop": 0.7034220532319392, "repo_name": "antoinecarme/pyaf", "id": "078bc8ef8600ecd68d560e81eef9d54a0860ea96", "size": "263...
from unittest import mock from nose.plugins.attrib import attr from tests.base_testcase import BoilerTestCase from faker import Factory from boiler.collections import PaginatedCollection from tests.boiler_test_app.models import User from boiler.feature.orm import db from pprint import pprint as pp @attr('kernel', 'c...
{ "content_hash": "9869c42002f66af2155588619b997158", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 80, "avg_line_length": 38.52795031055901, "alnum_prop": 0.6377559245526359, "repo_name": "projectshift/shift-boiler", "id": "ca50160aee1e2b29b05bc78bbec5d38404063e6a", "si...
import os import pdb import sys import tempfile sys.path.append("/opt/tosca") from translator.toscalib.tosca_template import ToscaTemplate from core.models import User,Site,Deployment,Controller,SiteDeployment from xosresource import XOSResource class XOSSite(XOSResource): provides = "tosca.nodes.Site" xos_m...
{ "content_hash": "3143092ed9da8a9a9e9edf1497b640ef", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 118, "avg_line_length": 37.56382978723404, "alnum_prop": 0.5581988105352591, "repo_name": "xmaruto/mcord", "id": "0db2705dfa9d133be56d2cb49ab9d116798705cb", "size": "3641",...
""" Server API Reference for Server API (REST/Json) OpenAPI spec version: 2.0.21 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest import kinow_client from kinow_client.rest import ApiException from...
{ "content_hash": "43b9d3f2651818ff08d1506b55a5cff1", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 73, "avg_line_length": 19.125, "alnum_prop": 0.6718954248366014, "repo_name": "kinow-io/kinow-python-sdk", "id": "18c070b7e1a62fa304a8c52bdf9bc2c8c95c39ec", "size": "782", ...
import logging import os import sys from mimetypes import guess_type from ipypublish.frontend.shared import parse_options from ipypublish.convert.main import IpyPubMain from ipypublish.postprocessors.reveal_serve import RevealServer logger = logging.getLogger("nbpresent") def nbpresent( inpath, outformat="s...
{ "content_hash": "10ab362153b3d4ee0cdfb448d5aa30e2", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 79, "avg_line_length": 28.41176470588235, "alnum_prop": 0.5886818495514148, "repo_name": "chrisjsewell/ipypublish", "id": "d5019a906561397d4679547285aad0014dcee84d", "size...
import time import random def countingSort2(data, smallest, largest): counters = [0 for x in range(smallest, largest + 1)] for i in data: counters[i - smallest] += 1 del data[:] for i, c in enumerate(counters): data.extend([smallest + i] * c) def countingSort(data, smallest, largest)...
{ "content_hash": "176613014ef8d440fb680e1c3bb2ed6a", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 60, "avg_line_length": 29.97222222222222, "alnum_prop": 0.58758109360519, "repo_name": "yubinbai/python_practice", "id": "578934dbc99304211e4c6411095e82f33f96a404", "size":...
"""Read in model results and plot results """ import os import logging import numpy as np import time from energy_demand.read_write import data_loader, read_data from energy_demand.technologies import tech_related def read_in_weather_results( path_result, seasons, model_yeardays_daytype, ...
{ "content_hash": "91aebabfe6663a11f66dab160fa83b1f", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 134, "avg_line_length": 39.797872340425535, "alnum_prop": 0.6562416466185512, "repo_name": "nismod/energy_demand", "id": "e883bd30fb4967bfa584794420926f6a142c17e0", "size":...
""" Picarto.TV API Documentation The Picarto.TV API documentation Note, for fixed access tokens, the header that needs to be sent is of the format: `Authorization: Bearer yourTokenHere` This can be generated at https://oauth.picarto.tv/ For chat API, see https://docs.picarto.tv/chat/chat.proto - contact via...
{ "content_hash": "10e183f88a64b0f7e7ba53306a728f63", "timestamp": "", "source": "github", "line_count": 741, "max_line_length": 382, "avg_line_length": 26.989203778677464, "alnum_prop": 0.5731286564328216, "repo_name": "Sythelux/Picarto.bundle", "id": "eec58cfb75a03e78b3849ca18b1b81c8fc618179", "si...
from random import randint def encrypt(text, key): if key == "": for char in range(16): key += chr(randint(0, 127)) print("Your key is " + key) if len(text) != len(key): oldKey = key key = "" for char in range(len(text)): key += oldKey[...
{ "content_hash": "51d5c2808a7981e6d883dda1368619a2", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 171, "avg_line_length": 38.65979381443299, "alnum_prop": 0.5141333333333333, "repo_name": "ngmhprogramming/dailyprogrammer", "id": "674bd1cb2f2ec249b1113e412aa767c12a43c828",...
from ghost import GhostBoard # noqa
{ "content_hash": "a3c7aba22572e719aa3795947eb3bd07", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 36, "avg_line_length": 37, "alnum_prop": 0.7837837837837838, "repo_name": "tylerdave/pingo-py", "id": "220e2583ca7e928a867e3152b957352beb4af0f9", "size": "37", "binary": f...
import httpretty from paystackapi.tests.base_test_case import BaseTestCase from paystackapi.refund import Refund class TestRefund(BaseTestCase): @httpretty.activate def test_valid_create(self): """Test Refund Create.""" httpretty.register_uri( httpretty.POST, self.endpoint_url("refund"), content_type...
{ "content_hash": "5c67d0263e08e8a90b8fe8a1dff6806a", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 166, "avg_line_length": 29.080645161290324, "alnum_prop": 0.6838602329450915, "repo_name": "andela-sjames/paystack-python", "id": "4b48172b1e010e75bbb0f3e36c9b76394e8f61d4", ...
import sys import os import sphinx_rtd_theme from datetime import datetime import chatterbot # Insert the project root dir as the first element in the PYTHONPATH. # This lets us ensure that the source package is imported, and that its version is used. current_directory = os.path.dirname(os.path.abspath(__file__)) pa...
{ "content_hash": "ac05be0daa95505a6852726cca5b0e59", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 88, "avg_line_length": 31.670157068062828, "alnum_prop": 0.6939990081005125, "repo_name": "Reinaesaya/OUIRL-ChatBot", "id": "71bca1ae274d9aa16fbadb06ec95e2561f32438f", "si...
"""filter""" import re from sqlparse import lexer, SQLParseError from sqlparse.engine import grouping from sqlparse.engine.filter import StatementFilter # XXX remove this when cleanup is complete Filter = object class FilterStack(object): def __init__(self): self.preprocess = [] self.stmtproce...
{ "content_hash": "7a60623d52b00bbb9a80f605329acf12", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 73, "avg_line_length": 27.76, "alnum_prop": 0.5240153698366955, "repo_name": "dbbhattacharya/kitsune", "id": "6852f7d1b7cd112a08af06df16e22531255e8424", "size": "2279", "...
import logging from django.db import models from person.models import Person from parliament.models import ParliamentMember from parliament.models import PoliticalParty, PartyMember logger = logging.getLogger(__name__) class PersonPosition(models.Model): person = models.ForeignKey(Person, on_delete=models.CASC...
{ "content_hash": "536c47dc132c33554cc260d3e8e7b933", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 108, "avg_line_length": 36.59090909090909, "alnum_prop": 0.6612836438923395, "repo_name": "openkamer/openkamer", "id": "1c8fa59b2751a0f2cb66df5a040884086d5cf4d4", "size": "...
import rodeo import os def staticpath(): return os.path.join(os.path.dirname(rodeo.__file__), 'static') if __name__ == '__main__': print(staticpath())
{ "content_hash": "e5fe6b5748ec021fc3b0b6d3c3ec01bd", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 66, "avg_line_length": 20.125, "alnum_prop": 0.6273291925465838, "repo_name": "rectangletangle/dataquest-test-project", "id": "f1e99403682ef957f68116514287e32d9bf25297", "si...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ThirdPartyProvider' db.create_table('monocle_thirdpartyprovider', ( ('id', self.gf('django.db.models.fie...
{ "content_hash": "4a2282eebf5ae1c0d51876610dd2ff37", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 150, "avg_line_length": 50.964285714285715, "alnum_prop": 0.5998598458304134, "repo_name": "shaunduncan/django-monocle", "id": "d71d90208c8c7c580aa01175bac4ce619c04e348", "...
import wordtools from forms.form import Form class TankaForm(Form): syllables = "syllableCount" text = "text" def __init__(self): self.data={} self.data[5]=[] self.data[7]=[] def validate(self,tweet): clean = wordtools.clean(tweet) syllableCount = wordtools.syllableCount(clean) if syllableCount==7 or...
{ "content_hash": "2dff5d9143961450119b7ff3f5998a59", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 63, "avg_line_length": 24.09090909090909, "alnum_prop": 0.6566037735849056, "repo_name": "mlesicko/automaticpoetry", "id": "f1507b0e019aac31127869971643d62370fa0cc0", "size...
__author__ = 'RemiZOffAlex' __copyright__ = '(c) RemiZOffAlex' __license__ = 'MIT' __email__ = 'remizoffalex@mail.ru' __url__ = 'http://remizoffalex.ru' from pycertauth import app as application
{ "content_hash": "59fdbf9fa42ddead734d1a7118df8565", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 41, "avg_line_length": 28, "alnum_prop": 0.6632653061224489, "repo_name": "RemiZOffAlex/pycertauth", "id": "e9e2740b0a45a8bfa49844dc2e847f0e8d7696f4", "size": "244", "bina...
import argparse import contextlib import time import cupy import numpy # This sample computes call and put prices for European options with # Black-Scholes equation. It was based on a sample of the financial package # in CUDA toolkit. For details, please see the corresponding whitepaper. # # The following code shows ...
{ "content_hash": "05f2b79e1b5f32db9578794c6eac2fbc", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 77, "avg_line_length": 34.47222222222222, "alnum_prop": 0.6021353746978243, "repo_name": "cupy/cupy", "id": "d9863ffdc0aab23e8cdee5e38f0555aadea6d98d", "size": "4964", "...
from __future__ import absolute_import import logging __all__ = [ 'reopen_log_files', 'set_log_level_for_all_loggers' ] LOG = logging.getLogger(__name__) def reopen_log_files(handlers): """ This method iterates through all of the providers handlers looking for the FileHandler types. A lock is ...
{ "content_hash": "0b4c8777b54e9335bbd37991fad2359e", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 97, "avg_line_length": 27.9811320754717, "alnum_prop": 0.641267700606878, "repo_name": "grengojbo/st2", "id": "b04834a58230c7cbc0f964838b6549c9c32ae20d", "size": "2263", ...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/lair/gubbur/shared_lair_gubbur_underwater.iff" result.attribute_template_id = -1 result.stfName("lair_n","gubbur_underwater") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "22f7e56c6743b51a6c8dfd2f385f345b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 82, "avg_line_length": 24.384615384615383, "alnum_prop": 0.7034700315457413, "repo_name": "anhstudios/swganh", "id": "900e1074fab440f4272adfcd81adb26d373eea0b", "size": "46...
from pathlib import Path import pytest import testing.postgresql from sqlalchemy import create_engine, text from sqlalchemy.engine.url import make_url from testcontainers.postgres import PostgresContainer as _PostgresContainer tests_dir = Path(__file__).parents[0].resolve() test_schema_file = Path(tests_dir, 'data', ...
{ "content_hash": "d1d219cbaacc015e69b4ca91a7f6e968", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 86, "avg_line_length": 29.11764705882353, "alnum_prop": 0.6577777777777778, "repo_name": "RazerM/pg_grant", "id": "12048142fde84a84667119199a1ea22673655766", "size": "2475"...
from security_monkey.cloudaux_batched_watcher import CloudAuxBatchedWatcher from cloudaux.aws.iam import list_roles from cloudaux.orchestration.aws.iam.role import get_role from security_monkey import AWS_DEFAULT_REGION class IAMRole(CloudAuxBatchedWatcher): index = 'iamrole' i_am_singular = 'IAM Role' i_...
{ "content_hash": "246c3097f546cbdd12477a2fef1b4485", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 75, "avg_line_length": 29, "alnum_prop": 0.6279491833030852, "repo_name": "markofu/security_monkey", "id": "0f9cfbd951e8f4508cae0edf77f99244964df8c3", "size": "1102", "bi...
def is_group_member(user, group): return user.groups.filter(name=group).exists()
{ "content_hash": "5c054b4b5b2f2a605ff57fb522b82ab5", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 50, "avg_line_length": 42, "alnum_prop": 0.7380952380952381, "repo_name": "CSchool/SchoolSite", "id": "51adf7684798bdd383d1f16bd5133bb7a21e4dc7", "size": "84", "binary": f...
""" Copyright 2016-present Nike, Inc. 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 in writing, so...
{ "content_hash": "e2c06f1f4779557204a7b0f6956dec1d", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 78, "avg_line_length": 33.89051094890511, "alnum_prop": 0.6144734008184364, "repo_name": "Nike-Inc/cerberus-python-client", "id": "7522d6e93c64de505f5f1efdc5e4fa5928ff4d73",...
""" eve.io.mongo.geo ~~~~~~~~~~~~~~~~~~~ Geospatial functions and classes for mongo IO layer :copyright: (c) 2017 by Nicola Iarocci. :license: BSD, see LICENSE for more details. """ class GeoJSON(dict): def __init__(self, json): try: self['type'] = json['type'] ex...
{ "content_hash": "2851a1fdddabb3ff99cd688a33edfeb8", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 69, "avg_line_length": 31.38679245283019, "alnum_prop": 0.5677787796813947, "repo_name": "bcrochet/eve", "id": "665025abba2844f870a19511d854774b74b82e2b", "size": "3352", ...
from __future__ import unicode_literals import os from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.utils.html import format_html from django.utils.translation import ugettext_l...
{ "content_hash": "660f64613b0076e2865242f097f856c5", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 74, "avg_line_length": 33.00917431192661, "alnum_prop": 0.5839355197331851, "repo_name": "chipx86/reviewboard", "id": "0d06ebdec1c24c7de1f5c646faca79660666b77a", "size": "...
from cms.cache.permissions import clear_permission_cache from cms.signals.apphook import apphook_post_delete_page_checker from cms.signals.title import update_title_paths from menus.menu_pool import menu_pool def pre_save_page(instance, **kwargs): menu_pool.clear(instance.site_id) clear_permission_cache() d...
{ "content_hash": "b0590e061fc499ab8803da1be45fbc2b", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 67, "avg_line_length": 29.551724137931036, "alnum_prop": 0.7141190198366394, "repo_name": "timgraham/django-cms", "id": "8f4bc9be0e01da3eb317645073b387c1750e030e", "size": ...
"""Benchmark comparing dynamic_rnn implementations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from pyctr.api import conversion from pyctr.examples.models import dynamic_rnn_minimal from pyctr.examples.numpy import numpy_to_tf fro...
{ "content_hash": "7a8750b403948ca9b524d55f267b5f78", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 81, "avg_line_length": 38.523415977961434, "alnum_prop": 0.5610697940503433, "repo_name": "google/pyctr", "id": "9396f1fcbffcf998f3a3bd5e4532445051bb7773", "size": "14639"...
from PyOpenWorm import * class PatchClampExperiment(Experiment): def __init__(self, reference=False, **kwargs): Experiment.__init__(self, reference) # enumerate conditions patch-clamp experiments should have patch_clamp_conditions = [ 'type', 'duration', ...
{ "content_hash": "9ab1a67361e577cf5dd6bde975ff29b3", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 80, "avg_line_length": 30.930232558139537, "alnum_prop": 0.5824561403508772, "repo_name": "travs/PyOpenWorm", "id": "a1ae56c84bf65d03af466688a2ef123c0814a948", "size": "39...