text
stringlengths
4
1.02M
meta
dict
""" During World War I, the German army used a very clever pen and paper cipher called the ADFGVX cipher [http://en.wikipedia.org/wiki/ADFGVX_cipher], and your task today is to implement functions to both encrypt and decrypt messages using this cipher. What follows is a rather lengthy description of how it works (you c...
{ "content_hash": "baa04c1afe717f0fc609bc896652a204", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 120, "avg_line_length": 36.07575757575758, "alnum_prop": 0.6911661766764665, "repo_name": "DayGitH/Python-Challenges", "id": "2e17582ddcc755e29d3a6c53236f0b0df4aefcfa", "s...
import os import sys import setuptools from quantumclient.openstack.common import setup Name = 'python-quantumclient' Url = "https://launchpad.net/quantum" Version = setup.get_post_version('quantumclient') License = 'Apache License 2.0' Author = 'OpenStack Quantum Project' AuthorEmail = 'openstack-dev@lists.launchpad...
{ "content_hash": "64c1df086f52ce1e3b7b6118a926a56a", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 65, "avg_line_length": 26.40625, "alnum_prop": 0.6869822485207101, "repo_name": "redhat-openstack/python-neutronclient", "id": "c3d851cbd7ec31b643056f4890ad1aa542fbdc92", "...
from unittest import TestCase import h5py import numpy as np import pandas as pd from exatomic import Universe from exatomic.base import resource from exatomic.molcas.output import Output, Orb, HDF # TODO : change df.shape[0] == num to len(df.index) == num everywhere class TestOutput(TestCase): """Test the Molcas...
{ "content_hash": "41170424a1063976edf4f1c9d3488f29", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 81, "avg_line_length": 42.05612244897959, "alnum_prop": 0.6418779570544705, "repo_name": "exa-analytics/atomic", "id": "978e5521a6a019d97f3dfa4a885679b36d250c36", "size": ...
""" Django settings for {{cookiecutter.project_slug}} project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/se...
{ "content_hash": "27a4936880275ce84dbdd09afe5b6fff", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 91, "avg_line_length": 26.54973821989529, "alnum_prop": 0.7032143561427726, "repo_name": "oca159/cookiecutter-django", "id": "ae9e55594c4dfa09aab178b5cd097be24ca8efba", "s...
sitesettings = call(settings_manager .get_whitelabel_settings_by_site_id(myuser.site_id))
{ "content_hash": "a4b62f506b315681f018c9113536f242", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 56, "avg_line_length": 46.5, "alnum_prop": 0.7741935483870968, "repo_name": "romankagan/DDBWorkbench", "id": "c4f7e7edfeefb56210dbf6440cc10ae6243d26b0", "size": "93", "bin...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('poll', '0008_option_requested_by'), ] operations = [ migrations.AlterField( model_name='vote', name='email', field=models.EmailField(blank=True, default=...
{ "content_hash": "8c5e5a11d56c390fc9c7d4d1244fd3e3", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 76, "avg_line_length": 22.375, "alnum_prop": 0.5726256983240223, "repo_name": "DrDos0016/z2", "id": "e1a4c5663120fff647bed6f6b6cd3a8f45102759", "size": "407", "binary": f...
import numpy import cPickle import theano import theano.tensor as T from mlp.logistic_sgd import LogisticRegression from dA.AutoEncoder import AutoEncoder from SdA import SdA from numpy.linalg import norm from theano.tensor.shared_randomstreams import RandomStreams from extract_datasets import extract_unlabeled_chu...
{ "content_hash": "332af1f95dca818b02c67ad25c07a113", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 135, "avg_line_length": 43.06299212598425, "alnum_prop": 0.601115377582739, "repo_name": "lzamparo/SdA_reduce", "id": "717f7440074be278de795e8332a4def61faf56ef", "size": "...
""" Words/Ladder Graph ------------------ Generate an undirected graph over the 5757 5-letter words in the datafile words_dat.txt.gz. Two words are connected by an edge if they differ in one letter, resulting in 14,135 edges. This example is described in Section 1.1 in Knuth's book [1]_,[2]_. References ---------- .....
{ "content_hash": "1c2198b1228531d93f15663d01d9eebd", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 76, "avg_line_length": 34.36904761904762, "alnum_prop": 0.5656390717007274, "repo_name": "elawson668/CSCI-2963", "id": "3cf815d5f984d588416bec8174cc496a96126549", "size": "...
"""Tests for GNU Compiler Collection""" def tests_compiler(): """Test Compiler""" import platform import subprocess from compilertools.compilers._core import _get_arch_and_cpu from compilertools.compilers.gcc import Compiler cmd = { "python": "", "--version": "", "-dum...
{ "content_hash": "36868f405b74199f63aff19abf956fa3", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 85, "avg_line_length": 30.752, "alnum_prop": 0.5907908428720083, "repo_name": "JGoutin/compilertools", "id": "32beade2899c094cbe0fcef953e3d2d4edcc81da", "size": "3844", ...
import base64 import logging import os import re import zlib from babelfish import Language, language_converters from guessit import guess_episode_info, guess_movie_info from six.moves.xmlrpc_client import ServerProxy from . import Provider, TimeoutSafeTransport, get_version from .. import __version__ from ..exceptio...
{ "content_hash": "9a89c5ce5f253327c5337f1d367c6af6", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 120, "avg_line_length": 38.980842911877396, "alnum_prop": 0.6370159229408295, "repo_name": "t4lwh/subliminal", "id": "5a06a23b84cdc0f59a175f9e2789b1a1ee06aa28", "size": "1...
""" Numba Extensions #################### The `numba`_ package provides a mechanism for compiling Python code. With appropriate options, compilation can provide massive speedups to standard Python code. This module provides reasonable compilation options as well as a utility for compiling symbolic (or string) functions...
{ "content_hash": "62172de7d860f7cd36c8fea89d116200", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 85, "avg_line_length": 36.108695652173914, "alnum_prop": 0.6709813365442504, "repo_name": "exa-analytics/exatomic", "id": "c4b9daf010306429c9d0bbf0943425fb9bc646b5", "size"...
from sanic import Sanic from sanic.response import text app = Sanic(__name__) @app.route("/") async def hello(request): return text("Hello world!") app.run(host="0.0.0.0", port=8080)
{ "content_hash": "ca61193e78f195ab0041e44dfc7c3087", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 34, "avg_line_length": 17.363636363636363, "alnum_prop": 0.675392670157068, "repo_name": "squeaky-pl/japronto", "id": "d2e8272896a4540263b1056cef14ffc46f9d152a", "size": "1...
from sft.drivers.tcp.driver import TCPDriver
{ "content_hash": "965c9af5b7a1b1da14eea41bde9028f7", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 44, "avg_line_length": 45, "alnum_prop": 0.8444444444444444, "repo_name": "AlexeiBuzuma/LocalComputeNetworks", "id": "2932975897374d3784f1673a45046f0eef005a66", "size": "45"...
import unittest import_error = False try: from ...tables.base import Base except ImportError: import_error = True Base = None class TestCase00(unittest.TestCase): def test_import(self): self.assertFalse(import_error) class TestCase01(unittest.TestCase): def setUp(self): self.bas...
{ "content_hash": "c09b303a0085ca789a42ba5692094642", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 38, "avg_line_length": 17.61904761904762, "alnum_prop": 0.6621621621621622, "repo_name": "AdamGagorik/pydarkstar", "id": "748f150351462b80a0468fee6d82c98c1689d919", "size":...
""" maxminddb.reader ~~~~~~~~~~~~~~~~ This module contains the pure Python database reader and related classes. """ from __future__ import unicode_literals try: import mmap except ImportError: # pylint: disable=invalid-name mmap = None import struct from maxminddb.compat import (byte_from_int, compat_i...
{ "content_hash": "6d9d5d2628caec12d291ce6abd51b436", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 81, "avg_line_length": 32.9126213592233, "alnum_prop": 0.5749262536873156, "repo_name": "m-lab/mlab-ns", "id": "3761b7d7f7ef42b979354927a51c0ab091315926", "size": "10170",...
""" json_print.utils ---------------- Shared utilities and functions for json_print """ from collections import Mapping from json import load def deep_update(base_dictn, update_dictn): """Nested merge of 2 Python dictionaries.""" for k, v in update_dictn.items(): if isinstance(base_dictn, Mapping): ...
{ "content_hash": "5827db4397b7a235bc94147cf4d670ef", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 74, "avg_line_length": 29.785714285714285, "alnum_prop": 0.6019184652278178, "repo_name": "Kilo59/json_printer", "id": "3aba10b4758226712a39f71f3a0a2f29a7eaf480", "size": "...
""" This modules provides functions to calculate correlations between spike trains. :copyright: Copyright 2015-2016 by the Elephant team, see `doc/authors.rst`. :license: Modified BSD, see LICENSE.txt for details. """ from __future__ import division, print_function, unicode_literals import warnings import neo import...
{ "content_hash": "2b6e2f8d2c67bfd5a476f93743679f89", "timestamp": "", "source": "github", "line_count": 1032, "max_line_length": 79, "avg_line_length": 40.007751937984494, "alnum_prop": 0.6117031583026545, "repo_name": "JuliaSprenger/elephant", "id": "4330f88664abea0a21ab5a9935fbb9277e612e62", "siz...
import os import io import codecs import sys import sublime import platform import time import sublime_plugin import subprocess from subprocess import Popen, PIPE, STDOUT from os import path import socket import subprocess import errno from socket import error as socket_error from .utils import * ou...
{ "content_hash": "87ed34efad3c7e2f1191b6b8cd977e32", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 117, "avg_line_length": 34.59075907590759, "alnum_prop": 0.5774258181471233, "repo_name": "oleg-shilo/cs-script-sublime", "id": "eb805f3a7aa944fd62076b54425949944000783c", ...
from __future__ import absolute_import, division, print_function import os import sys import setuptools if sys.version_info[:2] < (2, 6): sys.exit("virtualenv requires Python 2.6 or higher.") base_dir = os.path.dirname(__file__) # Fetch the metadata about = {} with open(os.path.join(base_dir, "virtualenv", "__...
{ "content_hash": "2fd7a36ffca4133141603ab1ef63a320", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 73, "avg_line_length": 25.088607594936708, "alnum_prop": 0.5822401614530777, "repo_name": "ionelmc/virtualenv", "id": "5610a46e1039a5fdb6f4cd147eb86df23043111e", "size": "1...
from django.apps import AppConfig from django.db.models.signals import post_save, post_delete from django.utils.translation import ugettext_lazy as _ class ImprovetextAppConfig(AppConfig): name = "bettertexts" verbose_name = _("Better texts") def ready(self): from .models import UserRating ...
{ "content_hash": "81c066d39d04924a8eb412f51fdcfa66", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 65, "avg_line_length": 32.8, "alnum_prop": 0.7357723577235772, "repo_name": "citizenline/citizenline", "id": "17fb6c33472141ba16850ff39126d4566231a2ed", "size": "492", "b...
from pluginsmanager.model.input import Input from pluginsmanager.model.lv2.lv2_port_mixing import Lv2PortMixing class Lv2Input(Lv2PortMixing, Input): """ Representation of a Lv2 `input audio port`_ instance. For general input use, see :class:`.Input` class documentation. .. _input audio port: http:/...
{ "content_hash": "a4e7ec111725d6e33c56d943f7021912", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 67, "avg_line_length": 28.565217391304348, "alnum_prop": 0.6818873668188736, "repo_name": "PedalPi/PluginsManager", "id": "1875ff37a5ade87de66ceb2328959249383760a5", "size"...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest im...
{ "content_hash": "94faa798c437468966c340150ce76880", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 105, "avg_line_length": 22.714285714285715, "alnum_prop": 0.6939203354297694, "repo_name": "mbohlool/client-python", "id": "f236edf90b1727c6a02f2e5a4dda3a4e5719a251", "size...
import hashlib import redis from django.conf import settings from django.test import TestCase as DjangoTestCase from smsgateway import send from smsgateway.backends.redistore import RedistoreBackend from smsgateway.models import SMS from smsgateway.sms import SMSRequest from smsgateway.utils import check_cell_phone_...
{ "content_hash": "a84f09509dc50f0976ddb7c5fa6ed0fd", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 79, "avg_line_length": 41.875, "alnum_prop": 0.5826865671641791, "repo_name": "peterayeni/django-smsgateway", "id": "18a574ff3a44ac32001a7a8781c1d138db7b152b", "size": "50...
DEBUG = False # # Observation point types # OP_BEFORE = 0 OP_AFTER = 1
{ "content_hash": "f20e3d87a069a2f3bf6040f507f1319e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 25, "avg_line_length": 10.285714285714286, "alnum_prop": 0.6666666666666666, "repo_name": "schieb/angr", "id": "3a0928fc9bef5a2387338ed8884bd54a02911fe2", "size": "72", "b...
''' File created on Aug 7, 2012 @author: jhc02 ''' # Module that provides BWA tools as functions from subprocess import call from subprocess import check_output import os import platform gatk_location = '/usr/local/bio/gatk/GenomeAnalysisTK.jar' java_exec = 'java' def init_java(): global java_exec ...
{ "content_hash": "0bc9c1d6a61fdcd8dadbe1bd159b1ec0", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 174, "avg_line_length": 45.27368421052632, "alnum_prop": 0.649616368286445, "repo_name": "london-escience/libhpc-cf", "id": "d03b599ee3d945e73ad8938a65350754589c44c0", "siz...
import argparse import sys from wd_curator import WikiWorker def arg_parser(args): parser = argparse.ArgumentParser( description='Run a worker for a given wiki') parser.add_argument('--path', '-p', nargs='?', required=True, help='Path to json file of the wiki') parser.add...
{ "content_hash": "622617d165eeb1c26d62af246b005488", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 76, "avg_line_length": 25.225806451612904, "alnum_prop": 0.59846547314578, "repo_name": "Ladsgroup/Wikidata-curator", "id": "353d5b21af06e73dff27dfacf6272ec4630c66af", "siz...
import unittest import sys sys.path.append('LeetCode/_051_100') from _070_ClimbingStairs import Solution class Test_070_ClimbingStairs(unittest.TestCase): def test_climbStairs_1(self): solution = Solution() self.assertEqual(1, solution.climbStairs(1)) def test_climbStairs_2(self): so...
{ "content_hash": "b8901212fa3b1fc52eba3df2b73341b5", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 53, "avg_line_length": 28.142857142857142, "alnum_prop": 0.6639593908629442, "repo_name": "BigEgg/LeetCode", "id": "55a1dac2c47aec70c117e355477f080e5c5590c9", "size": "985"...
''' Created by auto_sdk on 2015.08.20 ''' from top.api.base import RestApi class TopAuthTokenRefreshRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.refresh_token = None def getapiname(self): return 'taobao.top.auth.token.refresh'
{ "content_hash": "7c5035ecc1085cf7bb3fad16b6d78d0f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 55, "avg_line_length": 27.727272727272727, "alnum_prop": 0.7245901639344262, "repo_name": "BillBillBillBill/WishTalk-server", "id": "fa055f8fd9a119e6bb2351a092fabe3523eb9e39"...
import _plotly_utils.basevalidators class MinexponentValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="minexponent", parent_name="scatter3d.line.colorbar", **kwargs ): super(MinexponentValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "04456bf1f4a25cff07350d65c6d7dd64", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 88, "avg_line_length": 34.07142857142857, "alnum_prop": 0.6058700209643606, "repo_name": "plotly/plotly.py", "id": "5a6df8218c995bd85e1fba25c9f0152e082d5368", "size": "477"...
from octo.plugin import OctoPlugin class PluginTwo(OctoPlugin): pass
{ "content_hash": "2d96333af4996e94af80d961f43218eb", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 34, "avg_line_length": 17.75, "alnum_prop": 0.8169014084507042, "repo_name": "zoni/octo", "id": "93a26e40ca6a35b864578bafb3e63d75c619444d", "size": "71", "binary": false, ...
""" Histogram with a Global Mean Overlay ------------------------------------ This example shows a histogram with a global mean overlay. """ # category: histograms import altair as alt from vega_datasets import data source = data.movies.url bar = alt.Chart(source).mark_bar().encode( alt.X('IMDB_Rating:Q', bin=Tru...
{ "content_hash": "121198bd06be1a671578368d1801f424", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 58, "avg_line_length": 21.818181818181817, "alnum_prop": 0.6333333333333333, "repo_name": "ellisonbg/altair", "id": "cbff9ef036c4ba4fd3667387bb7d937a2dde9638", "size": "480...
""" A very quick and dirty DHCP server This is currently missing lots of features and sort of limited with respect to subnets and so on, but it's a start. """ from pox.core import core import pox.openflow.libopenflow_01 as of import pox.lib.packet as pkt from pox.lib.addresses import IPAddr,EthAddr,parse_cidr from p...
{ "content_hash": "d6aa2f31269e2eb96a8a201add152b85", "timestamp": "", "source": "github", "line_count": 665, "max_line_length": 91, "avg_line_length": 29.043609022556392, "alnum_prop": 0.6094542818680749, "repo_name": "MurphyMc/pox", "id": "61ec636173c049841d7456178a7a2943fa76eae8", "size": "19894"...
import unittest import parlai.utils.testing as testing_utils MODEL_OPTS = { 'n_layers': 4, 'embedding_size': 16, 'ffn_size': 32, 'n_heads': 2, 'num_epochs': 0.1, 'batchsize': 32, 'truncate': 8, } @testing_utils.skipUnlessGPU class TestModelParallel(unittest.TestCase): def test_polyenc...
{ "content_hash": "1db42ddaf2bc72c1079e93f89cb9264b", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 59, "avg_line_length": 29.265151515151516, "alnum_prop": 0.43308309603934764, "repo_name": "facebookresearch/ParlAI", "id": "ed4a8f31a4eab0e65c74ce82d4312f06430a8544", "si...
from __future__ import unicode_literals from django.db import migrations, models from django.core.management import call_command def forwards_func(apps, schema_editor): call_command("loaddata", "0001_init.json", "--app=blog") def reverse_func(apps, schema_editor): pass class Migration(migrations.Migratio...
{ "content_hash": "4654826206bbf9fb3fca49980d6099a8", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 60, "avg_line_length": 22.285714285714285, "alnum_prop": 0.7051282051282052, "repo_name": "andersonjonathan/Navitas", "id": "0e26f22741e819866ff89aa5d9bd1fb4e26ecbb9", "siz...
import pyblish.api class ValidateCurrentSaveFile(pyblish.api.ContextPlugin): """File must be saved before publishing""" label = "Validate File Saved" order = pyblish.api.ValidatorOrder - 0.1 hosts = ["maya", "houdini"] def process(self, context): current_file = context.data["currentFile"...
{ "content_hash": "db231099a7878181cf2e63cb2d5d9cca", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 57, "avg_line_length": 28.571428571428573, "alnum_prop": 0.665, "repo_name": "mindbender-studio/config", "id": "552b8b81e859ee72faf2406258a7160507bb06b3", "size": "400", ...
import select from . import * class SenserPlatformBackend(ShellPlatformBackend, FilePlatformBackend, MemoryPlatformBackend, BackupPlatformBackend): def __init__(self, dev): self.dev = dev def start(self): self.dev.readHasp() def interactiveShell(self, conn): self.dev.setTerminalEnable(False) self.dev.set...
{ "content_hash": "ef79a17e649fb54d54f7970ff37c10d0", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 117, "avg_line_length": 22.52173913043478, "alnum_prop": 0.7091377091377091, "repo_name": "ma1co/Sony-PMCA-RE", "id": "521f5a2e879c0f7c6d479633d8733d0231c3e12d", "size": "1...
""" Serializer definition.""" import json import datetime import decimal from django.db import models class DatetimeDecimalEncoder(json.JSONEncoder): """ Encoder for datetime and decimal serialization. Usage: json.dumps(object, cls=DatetimeDecimalEncoder) NOTE: _iterencode does not work """ de...
{ "content_hash": "a7403e87e629ead2c138e7865f085587", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 80, "avg_line_length": 36.44285714285714, "alnum_prop": 0.579641970469097, "repo_name": "pavlov99/jsonapi", "id": "9c152041c9216f43e4b8e36b09e1d7f018396441", "size": "7653...
from unittest import TestCase from tests.unit_tests.utils.test_handlers import HandlerClassInInit from tests.unit_tests.utils.test_handlers.another_handler import AnotherHandlerClass from responsebot.utils.handler_utils import discover_handler_classes from tests.unit_tests.utils.test_handlers.handler import HandlerCl...
{ "content_hash": "24d0076d321625a8155f590e846d0aed", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 111, "avg_line_length": 44.25806451612903, "alnum_prop": 0.7682215743440233, "repo_name": "invinst/ResponseBot", "id": "d30222d2dee9440f1c0476dc0c0fafdb5bb211a4", "size": "...
from __future__ import unicode_literals import frappe, json from frappe.oauth import OAuthWebRequestValidator, WebApplicationServer from oauthlib.oauth2 import FatalClientError, OAuth2Error from werkzeug import url_fix from six.moves.urllib.parse import quote, urlencode, urlparse from frappe.integrations.doctype.oauth_...
{ "content_hash": "c78c22c58ca864989170f384fd7bc7a1", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 158, "avg_line_length": 35.41361256544503, "alnum_prop": 0.7056475458308693, "repo_name": "vjFaLk/frappe", "id": "1e4b1fb142be0ad4e1ddc11dd38efa1308d5485f", "size": "6764"...
import time import unittest from selenium import webdriver import settings class DisableEnableTeacher(unittest.TestCase): def setUp(self): self.driver = None self.base_url = settings.test_parameters.get("education_base_url") def test_E89_disable_enable_teacher(self): w...
{ "content_hash": "0444c227b84d9aac279299a97e0bbd22", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 113, "avg_line_length": 51.28387096774193, "alnum_prop": 0.5360422694678576, "repo_name": "sysuwuhaibin/vatus", "id": "876cc8ff6c83c315fcb9443ae927ce43310b6e78", "size": "...
""" Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix) Copyright (C) 2020 Stefano Gottardo (original implementation module) Miscellaneous utility functions for directory builder SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ from __future__ import absolute_impor...
{ "content_hash": "eec9f9f89cd34dff31cda82448ff20a2", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 116, "avg_line_length": 45.55555555555556, "alnum_prop": 0.651219512195122, "repo_name": "hawkeyexp/plugin.video.netflix", "id": "e936a6e41f911d12de52d7bbdd73ccfd6b200292", ...
from chess.pieces.color import Color from chess.pieces.piece import Piece from chess.point import Point class Bishop(Piece): def render(self): if self.color == Color.white: return 'B' else: return 'b' def valid_move(self, board, position): # Check for non-diagon...
{ "content_hash": "673cd6c8a583d5dd50321cd0a1e5fff2", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 90, "avg_line_length": 35.303030303030305, "alnum_prop": 0.5939914163090129, "repo_name": "fredojones/chess", "id": "4e5be5eb26905266c2a1fa6d57217a6eda0c7d3c", "size": "116...
def azureml_main(frame1): ## import libraries import matplotlib matplotlib.use('agg') # Set backend from pandas.tools.plotting import scatter_matrix import pandas.tools.rplot as rplot import matplotlib.pyplot as plt import numpy as np ## Create a pair-wise scatter plot ...
{ "content_hash": "545d0ed2889134ebe4d39f5b5fe18430", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 101, "avg_line_length": 35.27906976744186, "alnum_prop": 0.5154911008569545, "repo_name": "applecool/DataScience", "id": "5fe5b4c2049be5858598e8e4c2f14fbdd4b126a7", "size":...
import unittest import socket import threading from nose.plugins.skip import SkipTest from dummyserver.server import ( TornadoServerThread, SocketServerThread, DEFAULT_CERTS, ProxyServerThread, ) has_ipv6 = hasattr(socket, 'has_ipv6') class SocketDummyServerTestCase(unittest.TestCase): """ A simp...
{ "content_hash": "f3cb9ca76c1fabbbe66d2e487e77239f", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 77, "avg_line_length": 28.3, "alnum_prop": 0.5977620730270907, "repo_name": "katakumpo/urllib3", "id": "99a7c8cd173c603d49491cc7242cebefcbe96df1", "size": "3396", "binar...
from django.contrib.auth import get_user_model from django.core.exceptions import ValidationError from django.test import TestCase from django.urls import reverse from rest_framework.authtoken.models import Token from rest_framework import status from rest_framework.test import APITestCase from .models import Farmer ...
{ "content_hash": "ab0abb17168345e4921528de66622424", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 79, "avg_line_length": 35.54320987654321, "alnum_prop": 0.6490100729419938, "repo_name": "tm-kn/farmers-api", "id": "187d84c16c2d44747e96dac45d9216ba1539ea49", "size": "57...
import glob import io import os import platform import sys import pytest import numpy as np from ..verify import VerifyError from ....extern.six.moves import range from ....extern import six from ....io import fits from ....tests.helper import raises, catch_warnings, ignore_warnings from ....utils.exceptions import A...
{ "content_hash": "cd85c990c33cef0bd623ee918704d3d3", "timestamp": "", "source": "github", "line_count": 962, "max_line_length": 81, "avg_line_length": 36.71101871101871, "alnum_prop": 0.5650979725903273, "repo_name": "AustereCuriosity/astropy", "id": "04a0e07bbf3f0892955817d65ba5daa16cd1ebbf", "siz...
from __future__ import unicode_literals from django.db import models, migrations import django.core.validators import django.utils.timezone import django.contrib.auth.models class Migration(migrations.Migration): dependencies = [ ('auth', '0006_require_contenttypes_0002'), ] operations = [ ...
{ "content_hash": "2209aa662017366f22fc56cf17a699da", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 432, "avg_line_length": 69.71428571428571, "alnum_prop": 0.64275956284153, "repo_name": "LABETE/TestYourProject", "id": "56f5e97cab50b52fb9621b4ea789e370667996b3", "size": ...
""" Support for EBox. Get data from 'My Usage Page' page: https://client.ebox.ca/myusage """ from __future__ import annotations from datetime import timedelta import logging from pyebox import EboxClient from pyebox.client import PyEboxError import voluptuous as vol from homeassistant.components.sensor import ( ...
{ "content_hash": "7d1237a6432164f9b95ca4c9a835ddfe", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 86, "avg_line_length": 27.691176470588236, "alnum_prop": 0.6328553726323243, "repo_name": "FreekingDean/home-assistant", "id": "3c43dd3613098ce91e2154fe22c38c4d5394a843", ...
from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('account', '0020_auto_20150610_0943'), ] operations = [ migrations.AlterField( mode...
{ "content_hash": "8d5738aca6b140d05c85f74a872f1ffa", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 111, "avg_line_length": 24.8, "alnum_prop": 0.6350806451612904, "repo_name": "NTsystems/NoTes-API", "id": "7614c4c2f1213d3c1e8ef29cf51a68e84875c01e", "size": "520", "bina...
import setuptools setuptools.setup( setup_requires = ['pbr',], pbr=True )
{ "content_hash": "bb7ad162ca0b0e3afc556a99ddde2b04", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 34, "avg_line_length": 14.285714285714286, "alnum_prop": 0.54, "repo_name": "chrigl/bobtemplates.pypbr", "id": "5939355fc5b5845502b32f7471101b1a6e31b541", "size": "703", "...
# Permission is hereby granted, free of charge, to any person obtaining a # copy of this data, including any software or models in source or binary # form, as well as any drawings, specifications, and documentation # (collectively "the Data"), to deal in the Data without restriction, # including without limitatio...
{ "content_hash": "ee1567554577530b9e94a0883b17bb1b", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 139, "avg_line_length": 38.06956521739131, "alnum_prop": 0.6156920968478757, "repo_name": "pombredanne/metamorphosys-desktop", "id": "1eac4b54c73c51f05a1013b86337ca6ca38147b...
""" author: sljeff email: kindjeff.com@gmail.com """ from . import db from ..pocket import PocketSession from ..qqbot import qqpush live_subscription = {} daily_subscription = {} daily_sessions = {} live_members = {} def update_subscription(): """ 从数据库里更新订阅信息。应该在每次数据库更改时调用。 """ global live_subscript...
{ "content_hash": "52463b0e38ee52e652739622b32ec340", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 79, "avg_line_length": 25.38095238095238, "alnum_prop": 0.6466541588492808, "repo_name": "zyf-website/pocket48-tools", "id": "d341a778e8a928e2ad53c426f44dd959b0571489", "si...
from django.conf.urls.defaults import patterns, url, include from django.contrib import admin from techism2.rss.feeds import UpcommingEventsRssFeed, UpcommingEventsAtomFeed admin.autodiscover() urlpatterns = patterns('', # web (r'^$', 'techism2.web.views.index'), (r'^events/$', 'techism2.web.views.index')...
{ "content_hash": "f63e68ecffd87271810fee6f2c7489aa", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 102, "avg_line_length": 37.4, "alnum_prop": 0.6423054070112894, "repo_name": "gimler/techism2", "id": "37a46dcd8fdbf289dd762dc16591d558790573af", "size": "1683", "binary"...
from typing import Any, Callable def func1(callback: Callable[[Any, Any], None], *args: Any, **kwargs: Any): callback(*args, **kwargs) # mypy complains with too many arguments error def func2(callback: Callable[..., None], *args: Any, **kwargs: Any): callback(*args, **kwargs) def cb(*args: Any, **kwargs:...
{ "content_hash": "a237af97c781d0c53b07d8a856daac8b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 77, "avg_line_length": 24.27777777777778, "alnum_prop": 0.6407322654462243, "repo_name": "viblo/pymunk", "id": "183aba921df72b6a0d8a2aa48ee0eecba388c4f5", "size": "437", ...
""" Copyright 2016 ElasticBox All rights reserved. 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 ...
{ "content_hash": "52127eddae7e2f1d3e5b2d43b939baba", "timestamp": "", "source": "github", "line_count": 623, "max_line_length": 117, "avg_line_length": 38.831460674157306, "alnum_prop": 0.6004050925925926, "repo_name": "ElasticBox/elastickube", "id": "c9c55d9d2facfc38c93725b023d1ac7fafea97bb", "siz...
from django.conf import settings from django.core.paginator import Paginator, EmptyPage def paginate(request, items, per_page=settings.DEFAULT_PER_PAGE, page_key='page'): paginator = Paginator(items, per_page) try: page_number = int(request.GET[page_key]) page = paginator.page(pa...
{ "content_hash": "e76df5809564c5bf1ef2578b663cbfc7", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 64, "avg_line_length": 29.133333333333333, "alnum_prop": 0.6819221967963387, "repo_name": "SableWalnut/wagtailinvoices", "id": "0df884a54123a54ca9ba3f54427eaa1fac4aebcb", "...
""" Support for Tellstick covers using Tellstick Net. This platform uses the Telldus Live online service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/cover.tellduslive/ """ import logging from homeassistant.components.cover import CoverDevice from h...
{ "content_hash": "92da46e966f9e5aa9dd3e3ca1cb2e425", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 75, "avg_line_length": 26.804347826086957, "alnum_prop": 0.6763990267639902, "repo_name": "persandstrom/home-assistant", "id": "9d292d9e8b5bb340ad49fc1cf5cda421d8462ea5", "...
from __future__ import unicode_literals from flask.ext import restful class Resource(restful.Resource): pass
{ "content_hash": "ea4c65e65a40bce20f975afd8d12ba84", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 16.571428571428573, "alnum_prop": 0.7586206896551724, "repo_name": "patrikpettersson/rest-engine", "id": "7be55471cf66011ef60a7a00e2bcd49ad259c04c", "...
""" Basic request class """ ## MIT License ## ## Copyright (c) 2017, krishna bhogaonker ## Permission is hereby granted, free of charge, to any person obtaining a ## copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation th...
{ "content_hash": "f57b3455946ca03eee98970deea38fbf", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 463, "avg_line_length": 31.886363636363637, "alnum_prop": 0.6856735566642908, "repo_name": "krishnab-datakind/mining-data-acquisition", "id": "c784da7e9f9a7d856ffbcd7e7f78e9a...
formatter = "%r %r %r %r" print formatter % (1, 2, 3, 4) print formatter % ("one", "two", "three", "four") print formatter % (True, False ,True ,False) print formatter % (formatter, formatter, formatter, formatter) print formatter % ( "I had this." , "You could type up right.", "But it...
{ "content_hash": "e3809aab5ee4595839686754b4298878", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 62, "avg_line_length": 22.75, "alnum_prop": 0.5686813186813187, "repo_name": "Vayne-Lover/Effective", "id": "0f6fd0078cf404bd14d2eeab05e3b8b330ebbca0", "size": "389", "bi...
import sys import threading import logging from logging.handlers import ( TimedRotatingFileHandler, SocketHandler, DatagramHandler, SysLogHandler, SMTPHandler, HTTPHandler, ) from logging import LoggerAdapter try: from six import with_metaclass except: def with_metaclass(meta, *bases):...
{ "content_hash": "243aab05d26265f5aa88003738f415f3", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 120, "avg_line_length": 31.75862068965517, "alnum_prop": 0.6000271444082519, "repo_name": "kaka19ace/kklogger", "id": "066594d6c39017fa2cfd933109858a543c5fd4d9", "size": "...
from .exceptions import EncodingError def to_long(base, lookup_f, s): """ Convert an array to a (possibly bignum) integer, along with a prefix value of how many prefixed zeros there are. base: the source base lookup_f: a function to convert an element of s to a value between 0 and...
{ "content_hash": "91e5aa2fe809d951a0f7cd51bb02dee9", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 87, "avg_line_length": 33.183098591549296, "alnum_prop": 0.6842105263157895, "repo_name": "richardkiss/pycoin", "id": "d388c092c05e0224b8227629222d3c31617cd740", "size": "2...
""" Randomly sample and print out instructions from a level. """ import argparse import babyai import gym parser = argparse.ArgumentParser("Show level instructions") parser.add_argument("--n-episodes", type=int, default=10000, help="Collect instructions from this many episodes") parser.add_argum...
{ "content_hash": "a62494b441d1c061f0df80757b645daf", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 74, "avg_line_length": 26.904761904761905, "alnum_prop": 0.695575221238938, "repo_name": "mila-iqia/babyai", "id": "1ed0ee50c8c2fc36de0f82ab330b10dffc04625a", "size": "565"...
from __future__ import unicode_literals from pybooru import Moebooru client = Moebooru('Konachan') posts = client.post_list(tags='blue_eyes', limit=10) for post in posts: print("URL image: {0}".format(post['file_url']))
{ "content_hash": "329ae8fb008f5b84b5660644ebe23781", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 52, "avg_line_length": 28.25, "alnum_prop": 0.7123893805309734, "repo_name": "LuqueDaniel/pybooru", "id": "d708c35e6cb6bd5cd0b3c483f2fa3a0e10d9d989", "size": "250", "binar...
print('Welcome to Moustacheminer Server Services Music Bot') import json import traceback import discord from os import path from discord.ext import commands from discord.ext.commands import errors as commands_errors with open(path.abspath(path.join(path.dirname(__file__), '..', 'config', 'default.json'))) as f: ...
{ "content_hash": "ee0d7d0984d8d9bc87c376738e21dd0b", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 108, "avg_line_length": 34.646153846153844, "alnum_prop": 0.63898756660746, "repo_name": "moustacheminer/MSS-Discord", "id": "52b59e80ebbc88dc7d9f7081b2c29fd7432dcf12", "si...
from tests.src.event.TestEvent import TestEvent from tests.src.TestSynergyObject import TestSynergyObject class MakeBeansProfitEvent(TestEvent): def _prepare(self, object_id, context, parameters={}): return parameters
{ "content_hash": "b9bd3752fff5d06e3a5ef6f2dab0b2ea", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 58, "avg_line_length": 29, "alnum_prop": 0.7844827586206896, "repo_name": "buxx/synergine", "id": "06350a8843655b3b21df11747f98205409c96e13", "size": "232", "binary": fals...
import os import sys import errno import subprocess as sp # Define some constants AUDIO, VIDEO, SCREEN = 0, 1, 2 LINUX, MAC, WINDOWS = 0, 1, 2 # src: http://stackoverflow.com/a/377028/1044366 def which(program): def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) fpath, fnam...
{ "content_hash": "0279acf377a6cabd4c1d5719d5a15828", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 74, "avg_line_length": 27.158730158730158, "alnum_prop": 0.6066627703097603, "repo_name": "sandeepraju/git-talk", "id": "bf41bfc2e771147bddb9f0620da1a92219dfdeb0", "size": ...
import os from unittest import mock from click.testing import CliRunner from great_expectations.cli import cli from tests.cli.utils import assert_no_logging_messages_or_tracebacks @mock.patch( "great_expectations.core.usage_statistics.usage_statistics.UsageStatisticsHandler.emit" ) def test_store_list_stores( ...
{ "content_hash": "842b7027df44f990288617b6cced42a0", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 91, "avg_line_length": 28.803571428571427, "alnum_prop": 0.5827650340979541, "repo_name": "great-expectations/great_expectations", "id": "0b70773295d34006707257d3333d0804b044...
""" byceps.services.shop.order.transfer.action ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2014-2022 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from dataclasses import dataclass from typing import Any, Dict from uuid import UUID from ...article.transfer.models import A...
{ "content_hash": "2d4f50061241f2dfb8f026497650c118", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 54, "avg_line_length": 21.40740740740741, "alnum_prop": 0.7093425605536332, "repo_name": "homeworkprod/byceps", "id": "68aa751997611e87699dc74ce938343b6042a16e", "size": "5...
import tweepy import networkx as nx import json import numpy as np import matplotlib.mlab as mlab import matplotlib.pyplot as plt total = [] ''' with open('Relation.txt') as r: graph = nx.Graph() a = r.readline() e = json.loads(a) retweeters = [w[0] for w in e] friends = [x for x in [w[1] for w i...
{ "content_hash": "523a29dc47c5f19f54697bd0afe62e21", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 116, "avg_line_length": 25.493055555555557, "alnum_prop": 0.5979297194225007, "repo_name": "tapilab/is-prefixlt", "id": "263620cdab06a48d65ebe4b21ad9e532ae28c744", "size":...
""" A webdriver/selenium based scraper for San Francisco Board of Supervisors voting data. - Troy Deck (troy.deque@gmail.com) """ from selenium import webdriver from datetime import date import argparse import time import db ############# # Constants # ############# PATIENCE = 2 # Seconds to wait after executing a...
{ "content_hash": "fec6b94565abdba6f9c960f94839b6f7", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 80, "avg_line_length": 31.30921052631579, "alnum_prop": 0.6269174196259718, "repo_name": "tdeck/grab-sf-votes", "id": "fe433cb9fbba567df110e5bffd46a0b4237b01e0", "size": "...
""" INFINIDAT InfiniBox Volume Driver """ from contextlib import contextmanager import mock from oslo_config import cfg from oslo_log import log as logging from oslo_utils import units import requests import six from cinder import exception from cinder.i18n import _ from cinder import interface from cinder import ut...
{ "content_hash": "308457792c89023852d85c66ed0a5118", "timestamp": "", "source": "github", "line_count": 418, "max_line_length": 79, "avg_line_length": 41.5622009569378, "alnum_prop": 0.5658780866862373, "repo_name": "ge0rgi/cinder", "id": "067030f05fbfb40b1728822ae4520e04c033a783", "size": "18002",...
import pyparsing import unittest from monasca_api.expression_parser import alarm_expr_parser class TestAlarmExpression(unittest.TestCase): good_simple_expression = "max(cpu.idle_perc{hostname=fred}, 60) > 10 times 4" def test_good_expression(self): expression = self.good_simple_expression s...
{ "content_hash": "aedbe4aa10107e07a33e6f2b416297c7", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 81, "avg_line_length": 36.111111111111114, "alnum_prop": 0.676923076923077, "repo_name": "sapcc/monasca-api", "id": "0a8848c18bd1d87db2abed2439f8379638e643f4", "size": "224...
from distutils.core import setup setup( name = 'emitter.py', packages = ['emitter'], version = '7.0.2', description = 'A minimalist event emitter for Python 3.', author = 'titouandk', author_email = 'dk.titouan@gmail.com', url = 'https://github.com/titouandk/emitter.py', download_url = 'https://github.c...
{ "content_hash": "f4a53bdf63046f85824aba960a7c31f5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 88, "avg_line_length": 39.07692307692308, "alnum_prop": 0.6653543307086615, "repo_name": "titouandk/emitter.py", "id": "db4a08d726ec9280f0f82088bd66ec2550032e37", "size": "...
from django.db import models from django.core.cache import cache from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.contrib.comments.models import Comment from courant.core.gettag import gettag class CommentOptions(models.Model): """...
{ "content_hash": "f8636b6f785645998f53b718e8c94066", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 190, "avg_line_length": 42.06818181818182, "alnum_prop": 0.6985413290113452, "repo_name": "maxcutler/Courant-News", "id": "d2b30676458a73662a360c0953f70362192f1f63", "size"...
from collections import OrderedDict, Counter import csv from datetime import datetime, timedelta import hashlib import json import os import platform import plistlib import re import shutil import sqlite3 from subprocess import call import sys import time import urllib import uuid import webbrowser f...
{ "content_hash": "5fdce0d6ca23a5b3f8734f027bd63904", "timestamp": "", "source": "github", "line_count": 1058, "max_line_length": 273, "avg_line_length": 42.291115311909266, "alnum_prop": 0.5147058823529411, "repo_name": "grwllrnc/BrowsingHistoryEditor", "id": "9657f4d4240ba08fd015f17d8facc14e1e819a80...
from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
{ "content_hash": "f59291213b6dc93ae59722b4b8811150", "timestamp": "", "source": "github", "line_count": 400, "max_line_length": 158, "avg_line_length": 34.43, "alnum_prop": 0.5650595410978797, "repo_name": "thaim/ansible", "id": "43134ff3322fef92d0a5dcda448321acefbf9b44", "size": "13790", "binary...
from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User from friends.models import FriendshipRequest, Friendship, UserBlocks from friends.templatetags import friends_tags class BaseTestCase(TestCase): fixtures = ['test_data.json'] def setUp(se...
{ "content_hash": "229e0fb23e731819ad20517fa4ff3f70", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 79, "avg_line_length": 49.38150289017341, "alnum_prop": 0.5890202504974833, "repo_name": "muhuk/django-simple-friends", "id": "8728cb15aa382a53713a9f03303783cba920e6c1", "...
r""" Sparse distributed elements of free modules over multivariate (generalized) polynomial rings. This code and its data structures are very much like the distributed polynomials, except that the first "exponent" of the monomial is a module generator index. That is, the multi-exponent ``(i, e_1, ..., e_n)`` represent...
{ "content_hash": "e5eb6f1a3518d3761a2ad1910c727f47", "timestamp": "", "source": "github", "line_count": 740, "max_line_length": 82, "avg_line_length": 29.56756756756757, "alnum_prop": 0.5593692870201097, "repo_name": "kaushik94/sympy", "id": "249bf57b83f51f6600f23cd4b108ef3eafff5e63", "size": "2188...
import os import platform import re import subprocess import sys from distutils.core import Command from distutils.command.build import build from distutils.ccompiler import new_compiler # Don't force people to install setuptools unless # we have to. try: from setuptools import setup except ImportError: from e...
{ "content_hash": "b0e50196c3f3976d1b0ecefd41522189", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 104, "avg_line_length": 35.172413793103445, "alnum_prop": 0.5841176470588235, "repo_name": "ksuarz/monary", "id": "d5ca14c34038b30da3214386908f39f06dfbc6a7", "size": "5230...
"""Test cltk.corpus.""" from unicodedata import normalize import os import unittest from unittest.mock import patch import nltk from cltk.corpus.greek.alphabet import expand_iota_subscript from cltk.corpus.greek.alphabet import filter_non_greek from cltk.corpus.greek.beta_to_unicode import Replacer from cltk.corpus.g...
{ "content_hash": "8e38b40618ea89cbc1af17dd16a5f7bf", "timestamp": "", "source": "github", "line_count": 982, "max_line_length": 195, "avg_line_length": 43.32892057026476, "alnum_prop": 0.6335049002326729, "repo_name": "TylerKirby/cltk", "id": "a9147fe8d93c72fbf62b122545f479ad20e146e0", "size": "440...
from django.core.exceptions import ImproperlyConfigured from django.contrib.gis.db.models.fields import GeometryField as django_GeometryField from django.contrib.gis.geos import Polygon from rest_framework.serializers import ModelSerializer, ListSerializer, LIST_SERIALIZER_KWARGS from rest_framework.utils.field_mappin...
{ "content_hash": "679dd10bcd8dc9d88682493c2b085af9", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 101, "avg_line_length": 38.40462427745665, "alnum_prop": 0.6055087296809151, "repo_name": "pglotov/django-rest-framework-gis", "id": "9e463c2130f9f43b0efe4dd0f2841840c43c74b...
import psycopg2 import time from catdb.postgres import Postgres from boto.s3.connection import S3Connection class Redshift(Postgres): def __init__(self, params): super(Redshift, self).__init__(params) def export_to_file(self, filename, table=None, schema=None, delimiter='|', null_value='\\N'): ...
{ "content_hash": "2116bcd0c3ee34deaf209fcdf7c58294", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 116, "avg_line_length": 36.326530612244895, "alnum_prop": 0.5657303370786517, "repo_name": "chimpler/catdb", "id": "34ec53c27601d50e506dbff7c56326cdeb15a50c", "size": "1780...
""" Revision ID: 0234_ft_billing_postage Revises: 0233_updated_first_class_dates Create Date: 2018-09-28 14:43:26.100884 """ import sqlalchemy as sa from alembic import op revision = "0234_ft_billing_postage" down_revision = "0233_updated_first_class_dates" def upgrade(): op.add_column("ft_billing", sa.Column(...
{ "content_hash": "e743cea65e346c71367724883d57540f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 120, "avg_line_length": 25.904761904761905, "alnum_prop": 0.7132352941176471, "repo_name": "alphagov/notifications-api", "id": "447c39a0463a6f4754608e712aa7a52f029a84f3", "...
from CIM15.IEC61970.LoadModel.SeasonDayTypeSchedule import SeasonDayTypeSchedule class ConformLoadSchedule(SeasonDayTypeSchedule): """A curve of load versus time (X-axis) showing the active power values (Y1-axis) and reactive power (Y2-axis) for each unit of the period covered. This curve represents a typical pat...
{ "content_hash": "537a28460763169e3ff54b0911c02585", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 501, "avg_line_length": 46.85, "alnum_prop": 0.7017075773745998, "repo_name": "rwl/PyCIM", "id": "e9773f039c45c24b300c6069ff849b46a2604b7a", "size": "2974", "binary": fal...
from lxml import etree import webob from nova.api.openstack.compute.contrib import quota_classes from nova.api.openstack import wsgi from nova import test from nova.tests.api.openstack import fakes def quota_set(class_name): return {'quota_class_set': {'id': class_name, 'metadata_items': 128, 'volume...
{ "content_hash": "724cec3ce031bbe8ed8efdb11cc174aa", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 79, "avg_line_length": 40.62903225806452, "alnum_prop": 0.5028450443297605, "repo_name": "paulmathews/nova", "id": "f0ade4f90c726e4d6dd27095457fda2f0aee4f1b", "size": "818...
""" The FilterScheduler is for creating instances locally. You can customize this scheduler by specifying your own Host Filters and Weighing Functions. """ import random from oslo_config import cfg from oslo_log import log as logging from six.moves import range from nova import exception from nova.i18n import _ from...
{ "content_hash": "4b6cc43c5922d69dc700889e963e11e3", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 95, "avg_line_length": 43.41489361702128, "alnum_prop": 0.5891938250428816, "repo_name": "Francis-Liu/animated-broccoli", "id": "4f833cd07108fad99f3f9d3e44a962f3c2edad46", ...
""" Django settings for test_project project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, .....
{ "content_hash": "dd33c0a36997d32a171ab8f69cce95cb", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 71, "avg_line_length": 20.442857142857143, "alnum_prop": 0.7148846960167715, "repo_name": "ionelmc/django-uwsgi-cache", "id": "d86cc74e7ac1ed2392c31d4c416ae200c64a9969", "s...
import os import os.path import re import codecs from setuptools import setup, find_packages NAME = "versioned" DESCRIPTION = "Versioned data format with CRDT capabilities " CLASSIFIERS = """ Programming Language :: Python """.strip().split("\n") AUTHOR = "Eugene Chernyshov" EMAIL = "chernyshov.eugene@gmail.com" UR...
{ "content_hash": "d1056d24da7a1cf69d03c3ea9af294c2", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 78, "avg_line_length": 28.46, "alnum_prop": 0.6535488404778637, "repo_name": "Evgenus/versioned-data", "id": "873e12b5c19171f7f9c0cc99ec1796c6a2599132", "size": "1423", "...
import os APPLICATION_MODE_TEST = "test" APPLICATION_MODE_DEVELOPMENT = "development" APPLICATION_MODE_PRODUCTION = "production" APPLICATION_MODE = None def application_mode(): global APPLICATION_MODE if APPLICATION_MODE is None: server_software = os.environ.get("SERVER_SOFTWARE") if serv...
{ "content_hash": "1be3e9eb16b29e5b292084f9c6ba27bb", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 59, "avg_line_length": 26.16, "alnum_prop": 0.6957186544342507, "repo_name": "augment00/a00_registry", "id": "064bd229b1f9e1b548776058d2771d8e7e69639d", "size": "654", "b...
""" Simple command line interface (CLI) for working with Redmine. Relies heavily on the python-redmine package (http://python-redmine.readthedocs.org/). """ import os,sys import logging import argparse from wikitools import DESRedmine from wikitools import __version__ description = __doc__ parser = argparse.Argument...
{ "content_hash": "e9e4fb53075188af55e943c418d6c217", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 93, "avg_line_length": 38.763888888888886, "alnum_prop": 0.6804012898602652, "repo_name": "kadrlica/wikitools", "id": "a40441ccc6e4a0e336b5aa42a14d888c69128475", "size": "2...
class Build(object): def __init__(self, datetime, commit): self.datetime = datetime self.commit = commit def __repr__(self): return '--datetime=%s --commit=%s' % (repr(self.datetime), repr(self.commit)) def tuple(self): return (self.datetime, self.commit)
{ "content_hash": "bda7018caebb045d192ae37058665995", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 81, "avg_line_length": 28, "alnum_prop": 0.6428571428571429, "repo_name": "alancutter/web-animations-perf-bot", "id": "a959f3a2b1a89771245228ae9dd71f6f9c45bc82", "size": "8...
import urllib,urllib2 from bs4 import BeautifulSoup import os, time url = 'http://ematch.scatt.com/download/' file_name_source = 'ematch_web.txt' out_folder = 'ematch/' time_delay_sec = 1 file(file_name_source, "w").write(urllib2.urlopen(url).read()) conn = urllib2.urlopen(url) html = conn.read() soup = Beautiful...
{ "content_hash": "48dc6294299e523c50426324375194db", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 62, "avg_line_length": 20.88235294117647, "alnum_prop": 0.6929577464788732, "repo_name": "zliobaite/Scatt-analysis", "id": "7ca3dfa74448524b06d5ff73025e0d16234dc1ab", "size...
import os import sys import webbrowser from subprocess import Popen, PIPE import json # MacOS Chrome path chrome_path = 'open -a /Applications/Google\ Chrome.app %s' def run_this_scpt(scpt, args=[]): p = Popen(['osascript', '-'] + args, stdin=PIPE, stdout=PIPE, stderr=PIPE) stdout, stderr = p.communicate(sc...
{ "content_hash": "6ad00f3c428e35518372d1c8ecd108ef", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 79, "avg_line_length": 23.276785714285715, "alnum_prop": 0.5247410817031071, "repo_name": "jhvictoria/chrometabs", "id": "ac80d5080f269ef2815c7b3a8c7b2b81e0e35292", "size"...
from . import views from django.conf.urls import url urlpatterns = [ url(r"^$". views.rdp, name="RDP") ]
{ "content_hash": "d77e072b7ad3a61da82db5dbaf7bb190", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 37, "avg_line_length": 18.333333333333332, "alnum_prop": 0.6545454545454545, "repo_name": "cuckoobox/cuckoo", "id": "0aed796d38270301b1c1e4555d1e71c4ca461a32", "size": "279"...
"""Functional tests using WebTest. See: http://webtest.readthedocs.org/ """ from innovator.public.models import News class TestNews: def test_add_news(self, admin, testapp): # Goes to homepage res = testapp.get('/') # Fills out login form in navbar form = res.forms['loginForm'] ...
{ "content_hash": "0bec89b6ce7c512131259a4abecb282f", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 70, "avg_line_length": 35.53086419753087, "alnum_prop": 0.5687977762334955, "repo_name": "B-O-P/innovator", "id": "686b9e0dc91adb9c39c00827eedd91dd92dd20e4", "size": "2902"...
"""Services API Tests for Version 1.0. This is a testing template for the generated ServicesAPI Class. """ import unittest import requests import secrets from py3canvas.apis.services import ServicesAPI class TestServicesAPI(unittest.TestCase): """Tests for the ServicesAPI.""" def setUp(self): self.c...
{ "content_hash": "0c568b9336ad50de3565406869164cf1", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 126, "avg_line_length": 32.64, "alnum_prop": 0.7242647058823529, "repo_name": "tylerclair/py3canvas", "id": "2218ba28eb7dc3cad27039e78ec7eb8d768bd4de", "size": "816", "bi...
from selenium import webdriver from lxml.cssselect import CSSSelector import selenium.webdriver.support.ui as ui import MySQLdb import time class MyDatabase: host = '' user = '' password = '' db = '' def __init__(self): self.connection = MySQLdb.connect(self.host, self.user, self.password, self.db,use_unicod...
{ "content_hash": "34298554c1a8529779a66f01312f1d1c", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 110, "avg_line_length": 24.724719101123597, "alnum_prop": 0.6846171324698932, "repo_name": "pablocastelo/tripadvisor_scraping", "id": "2fe74c8eb19e53b449dfb0f2ae824470231665...
from __future__ import unicode_literals from django.shortcuts import render from rest_framework.response import Response from rest_framework.views import APIView from todo.serializers import TodoSerializer from todo.models import Todo # Create your views here. class TodoView(APIView): """ TodoView: used to h...
{ "content_hash": "897ef1430931425c9acb6300f5d72766", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 75, "avg_line_length": 32.964285714285715, "alnum_prop": 0.6923076923076923, "repo_name": "GunnerJnr/_CodeInstitute", "id": "f79744a2bc2b32f9331530f531e9a4543b000663", "siz...
__author__ = 'Miguel Ángel García Calderón - tonsquemike@outlook.com' import re import sys, getopt # Store input and output file names ifile='' ofile='' # Read command line args myopts, args = getopt.getopt(sys.argv[1:],"i:o:") ############################### # o == option # a == argument passed to the o ##########...
{ "content_hash": "b396c9606ceced4fee558e308afb595f", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 86, "avg_line_length": 24.41176470588235, "alnum_prop": 0.5566265060240964, "repo_name": "tonsquemike/match-statements", "id": "fb8a21a0423d67570bb1b87604a5d29997b89027", "...