text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('container', '0002_auto_20160613_0114'),
]
operations = [
migrations.RemoveField(
model_name='trip',
name='name',
),
]
| {
"content_hash": "5427ff0ca3390bad43d1f7df21b7fdae",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 49,
"avg_line_length": 18.705882352941178,
"alnum_prop": 0.5817610062893082,
"repo_name": "jonaqp/heroku",
"id": "3cec5cd598a46b71062a47df78bcc1a430abb1d3",
"size": "390",
... |
from django.apps.registry import Apps
from django.contrib.contenttypes.fields import GenericForeignKey
from django.db import models
from django.db.migrations.exceptions import InvalidBasesError
from django.db.migrations.operations import (
AddField, AlterField, DeleteModel, RemoveField,
)
from django.db.migrations.... | {
"content_hash": "37e787522a968755f9a46fd0ce6958b9",
"timestamp": "",
"source": "github",
"line_count": 1383,
"max_line_length": 113,
"avg_line_length": 38.89877078814172,
"alnum_prop": 0.5832853133074335,
"repo_name": "zsiciarz/django",
"id": "ee6a9544d9284d6e6ee2156cf5e34d090bdd27c9",
"size": "53... |
from __future__ import absolute_import, print_function, unicode_literals, division
import json
import pkgutil
try:
from collections import OrderedDict
except ImportError as e:
from ordereddict import OrderedDict
from sc2reader.log_utils import loggable
try:
cmp # Python 2
except NameError:
cmp = la... | {
"content_hash": "9e0551bf8e0e9f2b322f265a0abfa672",
"timestamp": "",
"source": "github",
"line_count": 486,
"max_line_length": 123,
"avg_line_length": 31.62962962962963,
"alnum_prop": 0.5813817330210773,
"repo_name": "StoicLoofah/sc2reader",
"id": "6cbb942592268fe65bece83eaf26169b5505a75d",
"size"... |
from charms.reactive import (
hook,
when,
only_once,
is_state
)
import os.path as path
from charmhelpers.core import hookenv
from charmhelpers.core.host import service_restart
from charmhelpers.core.templating import render
from subprocess import call
from charms.layer import nginx, dokuwiki, php
conf... | {
"content_hash": "d449d0b680072554dd97844db8eb5b4b",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 79,
"avg_line_length": 28.844155844155843,
"alnum_prop": 0.6078343088698784,
"repo_name": "battlemidget/juju-charm-dokuwiki",
"id": "c485f48176dcfecf7571f1bbea0cef6a36a5a6df"... |
import pyarrow
import six
from six.moves.urllib.parse import urlparse
from petastorm.hdfs.namenode import HdfsNamenodeResolver, HdfsConnector
class CarbonFilesystemResolver(object):
"""Resolves a dataset URL, makes a connection via pyarrow, and provides a filesystem object."""
def __init__(self, dataset_url, ke... | {
"content_hash": "653ebf86db0d7c6fa4db55f9bc5b06e2",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 114,
"avg_line_length": 43.852348993288594,
"alnum_prop": 0.6603917967554331,
"repo_name": "zzcclp/carbondata",
"id": "7824b4bea79a6f6d67312d3934c2ed7c86775c0f",
"size": "... |
from jawaf.server import get_jawaf
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def _address_string(addr):
"""Convenience method to treat a given address field as a string or tuple/list
:param addr: String or List/Tuple. Single address or addresses."""
if isinstance(... | {
"content_hash": "2fcdc32938c79cca64b47b995a44206b",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 84,
"avg_line_length": 34.627906976744185,
"alnum_prop": 0.6501007387508395,
"repo_name": "danpozmanter/jawaf",
"id": "9cb3608887a9ac912cc8d912c1fc22b97bdd73a9",
"size": "1... |
import os, sys, config
# Set the help menu
def getSyntax():
return "Usage: pyvmrun-getip <vm_name>"
# Parsing arguments
if len(sys.argv) == 1:
print getSyntax()
exit(1)
else:
conf = config.Config()
vm_start_dest = conf.getVmsPathDir() + "/" + sys.argv[1] + ".vmwarevm/" + sys.argv[1] + ".vmx"
... | {
"content_hash": "2456e79e705a5ba3ddafc9d487571f9a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 100,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.606425702811245,
"repo_name": "slariviere/py-vmrum",
"id": "87e33ced8c50b6ca4ddaee21e8bb47c8546c3281",
"size": "... |
import logging
from ..requests import requests
from itchatmp.config import COROUTINE
from itchatmp.returnvalues import ReturnValue
from itchatmp.utils import retry, encode_send_dict
logger = logging.getLogger('itchatmp')
def create_producer(serverUrl):
def _create(menuDict, agentId=None, accessToken=No... | {
"content_hash": "c9cb702fef27e770807ead3dc02d1962",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 81,
"avg_line_length": 37.30434782608695,
"alnum_prop": 0.6101398601398601,
"repo_name": "littlecodersh/itchatmp",
"id": "1a8c70ae20d10eaa09eb7f476ab9b7ab046f61c8",
"size":... |
from skimage import transform
from fylm.service.utilities import ImageUtilities, timer
from fylm.service.base import BaseSetService
from skimage.morphology import skeletonize
from fylm.model.constants import Constants
import nd2reader
import numpy as np
import math
import logging
log = logging.getLogger(__name__)
c... | {
"content_hash": "5acc881b26805cd04b1e768e749c71fd",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 115,
"avg_line_length": 45.78378378378378,
"alnum_prop": 0.654073199527745,
"repo_name": "jimrybarski/fylm",
"id": "67ed10576c13554df7c0167d9e6c31ebb41a7466",
"size": "3388... |
IVERSION = (0, 12, 2)
VERSION = ".".join(str(i) for i in IVERSION)
MINORVERSION = ".".join(str(i) for i in IVERSION[:2])
NAME = "mitmproxy"
NAMEVERSION = NAME + " " + VERSION
NEXT_MINORVERSION = list(IVERSION)
NEXT_MINORVERSION[1] += 1
NEXT_MINORVERSION = ".".join(str(i) for i in NEXT_MINORVERSION[:2])
| {
"content_hash": "33b1063e5ef025ae0ac36eba38e17415",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 67,
"avg_line_length": 33.888888888888886,
"alnum_prop": 0.6688524590163935,
"repo_name": "Fuzion24/mitmproxy",
"id": "7836c84981334d51b68ce8455fa2931f8f7aed9f",
"size": "30... |
from django.core.management.base import NoArgsCommand
from flows.statestore.django_store import StateModel
class Command(NoArgsCommand):
help = "Removes expired flow state from the database (only valid if using the Django state store)"
def handle_noargs(self, **options):
count = StateModel.objects.rem... | {
"content_hash": "5d2e7564071aea2d3bcc7f20d18ed707",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 102,
"avg_line_length": 44,
"alnum_prop": 0.7474747474747475,
"repo_name": "laterpay/django-flows",
"id": "83db8abdf83ced83ddcb0a471f679838a42fa79d",
"size": "396",
"binar... |
from zerver.lib.test_classes import WebhookTestCase
class BasecampHookTests(WebhookTestCase):
STREAM_NAME = 'basecamp'
URL_TEMPLATE = u"/api/v1/external/basecamp?stream={stream}&api_key={api_key}"
FIXTURE_DIR_NAME = 'basecamp'
EXPECTED_TOPIC = "Zulip HQ"
def test_basecamp_makes_doc_active(self) ->... | {
"content_hash": "67820194f1109bb0eff9ee8d11d3d5f5",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 272,
"avg_line_length": 73.85384615384615,
"alnum_prop": 0.7352359129257369,
"repo_name": "dhcrzf/zulip",
"id": "2b1ecc919362e1c470a4f2851a8badcdb149d202",
"size": "9626",... |
import base64
import bz2
import collections
import datetime
import io
import os
import threading
import time
import sys
from xml.dom import minidom
from xml.etree import ElementTree
import zipfile
import benchexec
from benchexec.model import MEMLIMIT, TIMELIMIT, CORELIMIT
from benchexec import filewriter
from benchexe... | {
"content_hash": "a5e8a6c89375c8a1d06b4063a295f948",
"timestamp": "",
"source": "github",
"line_count": 969,
"max_line_length": 126,
"avg_line_length": 37.539731682146545,
"alnum_prop": 0.5604794369914229,
"repo_name": "ultimate-pa/benchexec",
"id": "cded46e98475c82b36d03c9604a322c3f801696b",
"size... |
from nose.tools import assert_equal
import numpy as np
from scipy import linalg
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_less
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import ass... | {
"content_hash": "9bebdf3cf4a6e71e35a1adbfff49f972",
"timestamp": "",
"source": "github",
"line_count": 478,
"max_line_length": 79,
"avg_line_length": 35.54602510460251,
"alnum_prop": 0.5798363839679831,
"repo_name": "chaluemwut/fbserver",
"id": "02a0ac99bd164e922cf6c7f444b36ec4fcf298fb",
"size": "... |
"""Test spending coinbase transactions.
The coinbase transaction in block N can appear in block
N+100... so is valid in the mempool when the best block
height is N+99.
This test makes sure coinbase spends that will be mature
in the next block are accepted into the memory pool,
but less mature coinbase spends are NOT.
... | {
"content_hash": "18243a71c4e51b2dd3798b3674c0134a",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 124,
"avg_line_length": 41.02040816326531,
"alnum_prop": 0.673134328358209,
"repo_name": "vergecurrency/VERGE",
"id": "4ffc6b8ef7fdb7a98d19eda9298316f5477462da",
"size": "2... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) | {
"content_hash": "f284d64f3a80636ca0c5138c2f4fa616",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 70,
"avg_line_length": 26,
"alnum_prop": 0.688034188034188,
"repo_name": "dresl/django_choice_and_question",
"id": "b0cd5b738d2348c695a542014697ef9b642c2538",
"size": "257",... |
from django.conf.urls import patterns
from django.conf.urls import url
from trove_dashboard.content.databases.upgrade import views
VIEWS_MOD = ('trove_dashboard.content.databases.upgrade.views')
urlpatterns = patterns(
VIEWS_MOD,
url(r'^upgrade_instance$', views.UpgradeInstanceView.as_view(),
name='... | {
"content_hash": "2cb824ffb3a220f5427adf70b3b1b73c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 67,
"avg_line_length": 26.307692307692307,
"alnum_prop": 0.7485380116959064,
"repo_name": "Tesora-Release/tesora-trove-dashboard",
"id": "830adc2344089445a8a6c9baeb059a7820c0... |
"""
Second quantization operators and states for bosons.
This follow the formulation of Fetter and Welecka, "Quantum Theory
of Many-Particle Systems."
"""
from sympy import (
Basic, Function, var, Mul, sympify, Integer, Add, sqrt,
Number, Matrix, zeros, Pow, I, S,Symbol, latex, cache
)
from sympy.utilities i... | {
"content_hash": "009e7990782ba3149dbe8ae2427ffb04",
"timestamp": "",
"source": "github",
"line_count": 2968,
"max_line_length": 120,
"avg_line_length": 28.86185983827493,
"alnum_prop": 0.5437416824262801,
"repo_name": "fperez/sympy",
"id": "edc9987e65642c872cdaf0cbb7b909c43f16400b",
"size": "85662... |
"""
Corruptor classes: classes that encapsulate the noise process for the DAE
training criterion.
"""
# Third-party imports
import numpy
import theano
from theano import tensor
T = tensor
from pylearn2.utils.rng import make_np_rng
# Shortcuts
theano.config.warn.sum_div_dimshuffle_bug = False
if 0:
print 'WARNING:... | {
"content_hash": "cb81fafe0a140a598c02700ebdf75d96",
"timestamp": "",
"source": "github",
"line_count": 459,
"max_line_length": 83,
"avg_line_length": 27.838779956427015,
"alnum_prop": 0.5727813429331664,
"repo_name": "kastnerkyle/pylearn2",
"id": "2eec1b9159bfc3ed2fbbcbdaa135fdd069d8f945",
"size":... |
from typing import Iterator, Tuple, Set, List, Dict, Any, Optional, Type
from uuid import UUID, uuid4
import concurrent.futures
import argparse
import functools
import contextlib
import attr
import logging
import json
import sys
import os
import signal
import psutil
import time
import hashlib
from ruamel.yaml import Y... | {
"content_hash": "131bedc0f578d0cd5731dee9d4bea37e",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 96,
"avg_line_length": 38.44584382871537,
"alnum_prop": 0.5752473301447946,
"repo_name": "squaresLab/Houston",
"id": "4df3d5240f47018838e4d621ebecac21deb16510",
"size": "1... |
import unittest
import uuid
import pytest
import azure.cosmos.documents as documents
import azure.cosmos.cosmos_client as cosmos_client
from azure.cosmos import query_iterable
import azure.cosmos.base as base
import test.test_config as test_config
# IMPORTANT NOTES:
# Most test cases in this file create collec... | {
"content_hash": "80d018f1c49aef588e44eef79d13d58e",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 114,
"avg_line_length": 37.18032786885246,
"alnum_prop": 0.6399911816578483,
"repo_name": "Azure/azure-documentdb-python",
"id": "0fbe659ec40e1b462a5be9342cdf1f0cd13599e7",
... |
"""Automx related tasks."""
import os
import pwd
import shutil
import stat
from .. import python
from .. import system
from .. import utils
from . import base
class Automx(base.Installer):
"""Automx installation."""
appname = "automx"
config_files = ["automx.conf"]
no_daemon = True
packages = ... | {
"content_hash": "8caf563c3a1655e232e7ba2646c5163e",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 78,
"avg_line_length": 36.372549019607845,
"alnum_prop": 0.5493261455525607,
"repo_name": "modoboa/modoboa-installer",
"id": "7b9ed56f142efc0ccbfb4b4791a75c53f8586047",
"s... |
from rhizo.main import c
#
# Create the git base command with default options
#
def git_base_command():
git_flow_dir = c.config.get('git_flow_dir', '/home/pi/flow')
return [ 'git',
'--git-dir=%s/.git' % (git_flow_dir),
'--work-tree=%s' % (git_flow_dir) ]
| {
"content_hash": "780d6736a8e63bea0181dcc87994392d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 64,
"avg_line_length": 28,
"alnum_prop": 0.538961038961039,
"repo_name": "manylabs/flow",
"id": "110df20daedd0aa7715937a9cf4ab01f2a2c64c1",
"size": "308",
"binary": false... |
"""
Test SBValue API linked_list_iter which treats the SBValue as a linked list and
supports iteration till the end of list is reached.
"""
from __future__ import print_function
import os
import time
import re
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.te... | {
"content_hash": "860000b95dc40c6d5c69a48bc4a6fd7c",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 79,
"avg_line_length": 37.423611111111114,
"alnum_prop": 0.6034514752273149,
"repo_name": "youtube/cobalt",
"id": "1b009521d253ad63b59067b92ecab9490a468bb0",
"size": "5389... |
import formless
from zope.interface import implements
class IBar(formless.TypedInterface):
bar = formless.String()
class Bar:
implements(IBar)
def __init__(self, bar):
self.bar = bar
def __str__(self):
return "A Bar: %s" % self.bar
class IFrob(formless.TypedInterface):
integer... | {
"content_hash": "9156248f0ebb54a4a79a83762a559231",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 111,
"avg_line_length": 30.387254901960784,
"alnum_prop": 0.6186481690595257,
"repo_name": "perkinslr/pypyjs",
"id": "a7a8e956a62621796fec64af4137e680c185daeb",
"size": "6... |
"""
Enomaly ECP driver
"""
import time
import base64
import os
import socket
import binascii
from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import b
from libcloud.utils.py3 import u
# JSON is included in the standard library starting with Python 2.6. For 2.5
# and 2.4, there's a simplejson egg at: ht... | {
"content_hash": "bf8a65da35c4d7d7526549a69e761598",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 78,
"avg_line_length": 29.242587601078167,
"alnum_prop": 0.5377454143239008,
"repo_name": "ConPaaS-team/conpaas",
"id": "dff49c07d326921ede1dbac87965fa99423a78be",
"size":... |
"""
Neighborhood Component Analysis
"""
# Authors: William de Vazelhes <wdevazelhes@gmail.com>
# John Chiotellis <ioannis.chiotellis@in.tum.de>
# License: BSD 3 clause
from __future__ import print_function
from warnings import warn
import numpy as np
import sys
import time
import numbers
from scipy.optimize... | {
"content_hash": "b7da05502c7551c0623538e850615623",
"timestamp": "",
"source": "github",
"line_count": 526,
"max_line_length": 79,
"avg_line_length": 39.31558935361217,
"alnum_prop": 0.5636363636363636,
"repo_name": "ryfeus/lambda-packs",
"id": "8920b2d99ed02817aaf3505bf7e2ac0027962db8",
"size": "... |
"""Module for testing the show campus command.
Most of the location show commands are tested in their add/del
counterparts. However, we have chosen (so far) to not implement
those commands for campus.
"""
import unittest
if __name__ == "__main__":
import utils
utils.import_depends()
from brokertest import... | {
"content_hash": "f41c3ae0cfa944846078b107af6c467c",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 71,
"avg_line_length": 30.394736842105264,
"alnum_prop": 0.6744588744588744,
"repo_name": "stdweird/aquilon",
"id": "4cb9daedbf5321cab6ae36c12e7296ee375181e3",
"size": "187... |
import logging
import os
import sys
from argparse import Namespace
from pathlib import Path
from uuid import uuid4
import pytest
from virtualenv.discovery.builtin import Builtin, get_interpreter
from virtualenv.discovery.py_info import PythonInfo
from virtualenv.info import fs_supports_symlink
@pytest.mark.skipif(n... | {
"content_hash": "f918d84be9f01481d24e18b78794ad2d",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 117,
"avg_line_length": 35.87179487179487,
"alnum_prop": 0.7015725518227305,
"repo_name": "pypa/virtualenv",
"id": "458bee689fc0cd3c61e83601235c572661ef60b6",
"size": "2798... |
from __future__ import print_function
import sys
import argparse
import urllib2
import pylid
from pylid.langs import bg, cs, da, de, el, en,\
es, et, fi, fr, hu, it, lv, nl, pl, pt, ro, sk, sl
from bs4 import BeautifulSoup as BS
__author__ = 'David R. Mortensen'
__email__ = 'davidmortensen@gmail.com'
def identi... | {
"content_hash": "929fff4813bc8041981b79f4e252f50f",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 78,
"avg_line_length": 20.760563380281692,
"alnum_prop": 0.5800542740841248,
"repo_name": "dmort27/pylid",
"id": "b8d3631a3ab508da65f9d73bcf97850c3e408cfc",
"size": "1521",... |
'''Download, merge and summarize known logs for Certificate Transparency (CT).
Print output to stdout, warnings and errors to stderr.
The source of information is:
https://www.gstatic.com/ct/log_list/v2/all_logs_list.json
from page https://www.certificate-transparency.org/known-logs
'''
import argparse
import datet... | {
"content_hash": "8432841c8f1833aae35999944c570fcf",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 87,
"avg_line_length": 29.943298969072163,
"alnum_prop": 0.5630917541745567,
"repo_name": "theno/ctutlz",
"id": "ed6afd6881c471e14e8fc5cbcd70921a6f121ab8",
"size": "5809",... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ManageSnippetApp.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# iss... | {
"content_hash": "d9437b068d726abdbe59c3df41ac1c78",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 80,
"avg_line_length": 37.714285714285715,
"alnum_prop": 0.625,
"repo_name": "mitalimn/PythonDjangoApp",
"id": "bc046cf120f1b620102f4055806b7010dbd27b4a",
"size": "814",
... |
import os
import sys
if __name__ == "__main__":
os.environ["DJANGO_SETTINGS_MODULE"] = "lino_book.projects.diamond2.settings"
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "e8a883dfb14ce428c30fb6261e7143ef",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 81,
"avg_line_length": 29.625,
"alnum_prop": 0.7130801687763713,
"repo_name": "khchine5/book",
"id": "214eddbb26e199f60b7e0eeaaa8ce9ffa90d299d",
"size": "259",
"binary": f... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0003_user_only_external_receipts'),
]
operations = [
migrations.AlterField(
model_name='user',
name='email',
... | {
"content_hash": "87ec50145db9271b50f536b6011646aa",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 256,
"avg_line_length": 33.82142857142857,
"alnum_prop": 0.6061246040126715,
"repo_name": "mayapurmedia/tovp",
"id": "6f49bca28a4a6541d35ab405ba2be95a22e753c9",
"size": "97... |
"""host_registry package.
Host registry is used to store all host tests (by id) which can be called from the test
framework.
"""
from .host_registry import HostRegistry
| {
"content_hash": "594c058171c8f12b4f3dad8e6fb389ef",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 87,
"avg_line_length": 24.428571428571427,
"alnum_prop": 0.7602339181286549,
"repo_name": "ARMmbed/greentea",
"id": "4abdd7d7b82f4e4d851f7a6083909a55d4a1cac1",
"size": "286"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.contrib import rnn
class BidirectionalRNN:
def __init__(self, name, rnn_size, data_type=tf.float32):
self.data_type = data_type
self.name = name
... | {
"content_hash": "3140fcaca2b668f9cff192d4cb366afe",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 141,
"avg_line_length": 50.31578947368421,
"alnum_prop": 0.6161087866108786,
"repo_name": "ruiann/SignatureVerification",
"id": "22e8a2903c2f9ec7e5d5bcd8bd2f64c078a0735c",
... |
import time
from functools import wraps
def print_timing(func):
@wraps(func)
def wrapper(*arg,**kwargs):
t1 = time.time()
res = func(*arg,**kwargs)
t2 = time.time()
print '%s took %0.5g s' % (func.func_name, (t2-t1))
return res
return wrapper
| {
"content_hash": "7c31d365286ee8ca0d308fae01a36853",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 22.846153846153847,
"alnum_prop": 0.5656565656565656,
"repo_name": "ufoym/agpy",
"id": "36b77fb9e9ffc6097cfbef390a5c0749018d3db2",
"size": "297",
"... |
"""Nova common internal object model"""
import contextlib
import datetime
import functools
import traceback
import netaddr
import oslo_messaging as messaging
from oslo_utils import versionutils
from oslo_versionedobjects import base as ovoo_base
from oslo_versionedobjects import exception as ovoo_exc
import six
from... | {
"content_hash": "4e82acd9601680c5514ac808a4d9f79a",
"timestamp": "",
"source": "github",
"line_count": 431,
"max_line_length": 79,
"avg_line_length": 36.932714617169374,
"alnum_prop": 0.6228797587636637,
"repo_name": "xuweiliang/Codelibrary",
"id": "7ac9510e914dea9b23720cedd925255cd795b156",
"size... |
from urllib.parse import quote
from dulwich.porcelain import open_repo
import os.path
import csv
import datetime
onaji = None
class LoggerPlugin(object):
def __init__(self, serializer=None):
self._path = os.getenv('REPO_HOME', '.')
self._home = os.path.join(self._path, ".onaji")
self._nu... | {
"content_hash": "8866a1f364a41322b866a09b3d0d0ae4",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 114,
"avg_line_length": 29.322033898305083,
"alnum_prop": 0.5416184971098266,
"repo_name": "jheard-tw/onaji",
"id": "2a7a3d27834e190ec1dac0003a2b3690f8dc80e9",
"size": "173... |
import time
import logging
import weakref
from botocore import xform_name
from botocore.exceptions import BotoCoreError, HTTPClientError, ConnectionError
from botocore.model import OperationNotFoundError
from botocore.utils import CachedProperty
logger = logging.getLogger(__name__)
class EndpointDiscoveryException(... | {
"content_hash": "14b16534521c91cb8c393ff8c8d83e5a",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 84,
"avg_line_length": 39.961832061068705,
"alnum_prop": 0.6410697230181471,
"repo_name": "pplu/botocore",
"id": "68ee6bea684d00a0ad8ce3b74780bc9c16120cf4",
"size": "11031... |
import time
import info.v1.metric as v1
class Config(object):
def __init__(self, endpoint=None, MetricsConfig=None):
self.Endpoint = endpoint
self.MetricsConfig = MetricsConfig
class MetricConfig(object):
def __init__(self, Name = None, MetricType = None,
Units=None, DataType ... | {
"content_hash": "8b3fbc5b14c56cd6ebeecccb04ca261f",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 58,
"avg_line_length": 29.275862068965516,
"alnum_prop": 0.6266195524146054,
"repo_name": "knightXun/BabyCare",
"id": "197b40ce435117e21ca596a986fab3ac55f43019",
"size": "8... |
"""
Simulates the overhead of a system with 10000 actors that do nothing
Each processing 1000 messages and then shutting down.
Run with command:
python -m cProfile -s time profile.py
"""
AMOUNT_PROCESSORS = 10000
AMOUNT_MESSAGES = 1000
import unittest
from mock import create_autospec, Mock
from jobber.constants imp... | {
"content_hash": "069aaf1152c04093ad5ecbb4c15e48ec",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 81,
"avg_line_length": 29.872340425531913,
"alnum_prop": 0.7571225071225072,
"repo_name": "thomasquintana/jobber",
"id": "3397dbde6723ab45da1a0fb93b115bf2b45f4943",
"size":... |
import requests
import json
from calculate_credit_score import *
def get_account_number(customer):
account_url="http://api.reimaginebanking.com/customers/{}/accounts?key=dcd6272d8dab8b826b5c1376ac90af1b".format(customer["_id"])
response=requests.get(account_url)
response=json.loads(response.text)
respo... | {
"content_hash": "2e4ae8d73e9504f44b8f2d77244dfb24",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 132,
"avg_line_length": 42.43421052631579,
"alnum_prop": 0.7032558139534884,
"repo_name": "Shashank-Ojha/MakeBank",
"id": "57555059d127d423de8c94fb61c6a95741449a1e",
"size"... |
import datetime
from argparse import ArgumentParser
from typing import Any, List
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from django.utils.timezone import now as timezone_now
from zerver.models import Message, Realm, Recipient, Stream, \
Subscription, U... | {
"content_hash": "676c9baa4b35dbbb7e48b71ad0538909",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 104,
"avg_line_length": 52.70860927152318,
"alnum_prop": 0.6043472798090213,
"repo_name": "tommyip/zulip",
"id": "365f8dd6de9e22b5be2b6e8fb2ee08bf69a3abfb",
"size": "7959"... |
import sys
import multiprocessing as mp
from threading import Thread
from collections import namedtuple
import pickle
import warnings
import numpy as np
import joblib
import sklearn.cross_validation as skl_cross_validation
from Orange.util import OrangeWarning
from Orange.data import Table, Domain, ContinuousVariabl... | {
"content_hash": "6b22c1c4ae61f600a17c72cd56640c7c",
"timestamp": "",
"source": "github",
"line_count": 676,
"max_line_length": 120,
"avg_line_length": 40.28550295857988,
"alnum_prop": 0.5933977160063159,
"repo_name": "cheral/orange3",
"id": "fe9c3406ec31734e5a43e9322fd6d5f3567112c1",
"size": "2723... |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='pyvidia',
version='1.0.1',
description='Nvidia driver version detec... | {
"content_hash": "714440b4cf86ef7cb9dc62bbe9d522e1",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 60,
"avg_line_length": 26.127659574468087,
"alnum_prop": 0.5993485342019544,
"repo_name": "ntpeters/pyvidia",
"id": "c6cbffc8a057198431bb80ed50ffdff6c5369f4d",
"size": "122... |
import unittest, time, sys, random, math, getpass
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
import h2o_summ
DO_MEDIAN = True
def write_syn_dataset(csvPathname, rowCount, colCount, expectedMin, expectedMax, SEED):
r1 = random.Random(SEED)
dsf = open(csvPathname, "w+")
... | {
"content_hash": "58b4c59cbe16d18ed98a186fa10b3fa8",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 124,
"avg_line_length": 37.13548387096774,
"alnum_prop": 0.5187630298818624,
"repo_name": "woobe/h2o",
"id": "35b9fd6e46701d995de6d6563447837a7b3a4bb7",
"size": "5756",
... |
'''
The main source for testlib. Ties together the default test runners and
loaders.
Discovers and runs all tests from a given root directory.
'''
from __future__ import print_function
import sys
import os
base_dir = os.path.dirname(os.path.abspath(__name__))
ext_path = os.path.join(base_dir, os.pardir, 'ext')
sys.... | {
"content_hash": "ddaf3a46401a6d9d53f9adcc9d5f23cd",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 71,
"avg_line_length": 22.869565217391305,
"alnum_prop": 0.747148288973384,
"repo_name": "TUD-OS/gem5-dtu",
"id": "c8dc9b9613faf7a3aeb049a096aa26f611177515",
"size": "549",... |
from django.db import models
# Create your models here.
class File(models.Model):
file_name = models.CharField(max_length=500)
upload = models.FileField(upload_to='uploads/')
| {
"content_hash": "8ce4ce8bd9d9192c3cc351cf54622693",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 51,
"avg_line_length": 23.25,
"alnum_prop": 0.7258064516129032,
"repo_name": "torchmed/biocloud",
"id": "b55f6448fd47c08aba4729d94f6f08b12a9e2b5b",
"size": "186",
"binary"... |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
MULTI_TENANT = True
AUTH_USER_MODEL = 'account.EWSUser'
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
# import Celery config
import djcelery
djcelery.setup_loader()
BROKER_URL = 'amqp://guest:guest@localhost:5672/'
ALLOWED_HOSTS = ['*',]
from datetime import timed... | {
"content_hash": "abefc068a19c5f1ef8000b2d013da992",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 143,
"avg_line_length": 34.207317073170735,
"alnum_prop": 0.6033273915626857,
"repo_name": "Zumochi/eve-wspace",
"id": "5a6558196145c07bfc3be3098d3055080e1e4a07",
"size": ... |
from virtool.fake.wrapper import FakerWrapper
from virtool.otus.fake import create_fake_otus
async def test_create_fake_otus(mongo, config, fake2, snapshot, tmp_path):
app = {"db": mongo, "data_path": tmp_path, "fake": FakerWrapper(), "config": config}
user = await fake2.users.create()
await create_fake... | {
"content_hash": "78d655e44311662d55f0edba7042458c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 88,
"avg_line_length": 37.15384615384615,
"alnum_prop": 0.7060041407867494,
"repo_name": "igboyes/virtool",
"id": "a77fc434551daa1e453c31f4577af5720feb7a22",
"size": "483",... |
import re
#PROJECT
from odds import Odds
class Outcome:
def __init__(
self,
name,
odds
):
self.name = re.sub(r'[^\w -]', '', name).lower().capitalize()
self.odds = odds
def win_amount(
self,
amount
):
return amount * self.odds
def ... | {
"content_hash": "da8b8d0f1eee74456728697917de31c5",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 69,
"avg_line_length": 17.904761904761905,
"alnum_prop": 0.4734042553191489,
"repo_name": "ddenhartog/itmaybeahack-roulette",
"id": "a401788173071ffa200fae1762c89a5ad4e7000a"... |
from __future__ import absolute_import
# Set default logging handler to avoid "No handler found" warnings.
import logging
try: # Python 2.7+
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
logging.getLogger(__name__).ad... | {
"content_hash": "bb36f28fd5ce07d694f89bb3db1bc8d6",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 67,
"avg_line_length": 24.466666666666665,
"alnum_prop": 0.6920980926430518,
"repo_name": "EUDAT-B2ACCESS/b2access-deprovisioning",
"id": "830023d7f021c4e30a5fb10f1c9a54e4aff... |
"""Generates and prints out imports and constants for new TensorFlow python api.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import collections
import importlib
import os
import sys
from tensorflow.python.tools.api.generator import d... | {
"content_hash": "e6daa668874a7ffbc09452b7086b3007",
"timestamp": "",
"source": "github",
"line_count": 601,
"max_line_length": 84,
"avg_line_length": 38.55740432612313,
"alnum_prop": 0.6690976567557071,
"repo_name": "kevin-coder/tensorflow-fork",
"id": "c11900d397b76dd52ac380501e49b558ee7859bc",
"... |
from docx.api import Document # noqa
__version__ = '0.8.6'
# register custom Part classes with opc package reader
from docx.opc.constants import CONTENT_TYPE as CT, RELATIONSHIP_TYPE as RT
from docx.opc.part import PartFactory
from docx.opc.parts.coreprops import CorePropertiesPart
from docx.parts.document import... | {
"content_hash": "584d14ea96f12e182dfd8dd9092599b5",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 74,
"avg_line_length": 31.485714285714284,
"alnum_prop": 0.7912885662431942,
"repo_name": "thebongy/MakeMyOutputs",
"id": "cfa48729d129f511b147ae1470e094150be96489",
"size"... |
"""The tests for the MQTT component."""
import asyncio
import ssl
import unittest
from unittest import mock
import pytest
import voluptuous as vol
from homeassistant.components import mqtt
from homeassistant.const import (
ATTR_DOMAIN, ATTR_SERVICE, EVENT_CALL_SERVICE, EVENT_HOMEASSISTANT_STOP)
from homeassistant... | {
"content_hash": "364fb6694a2590565f0ebadb7cb508f2",
"timestamp": "",
"source": "github",
"line_count": 803,
"max_line_length": 79,
"avg_line_length": 36.906600249066,
"alnum_prop": 0.614387906600081,
"repo_name": "nugget/home-assistant",
"id": "81941173d684aa44881b85d3bdad322643fad573",
"size": "2... |
import requests
import time
while True:
response = requests.get('http://ssmale.ddns.net')
if response.status_code == requests.codes.ok:
print('Server Up')
else:
print('Server Down')
time.sleep(10) | {
"content_hash": "9e10ad9375c8ffe0531240fe7d6af74d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 53,
"avg_line_length": 22.9,
"alnum_prop": 0.6419213973799127,
"repo_name": "SSmale/StatusPi",
"id": "f2aed8a2383d94012620b207dba1dfd1a2240eca",
"size": "310",
"binary": ... |
import numpy as np
from ._base import _BaseImputer
from ..utils.validation import FLOAT_DTYPES
from ..metrics import pairwise_distances_chunked
from ..metrics.pairwise import _NAN_METRICS
from ..neighbors._base import _get_weights
from ..neighbors._base import _check_weights
from ..utils import is_scalar_nan
from ..ut... | {
"content_hash": "7ea4da2facbcf9b86f974d910a2e2b14",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 78,
"avg_line_length": 38.861952861952865,
"alnum_prop": 0.5810951308265465,
"repo_name": "glemaitre/scikit-learn",
"id": "c4b407fdd66e7d694043d8f436cd066d8248f248",
"size... |
"""Tests for the WLED switch platform."""
from unittest.mock import MagicMock
import pytest
from wled import WLEDConnectionError, WLEDError
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.components.wled.const import (
ATTR_DURATION,
ATTR_FADE,
ATTR_TARGET_BRIGHTNESS... | {
"content_hash": "adfdd0e59282314c7db94256e40f68cf",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 80,
"avg_line_length": 31.543478260869566,
"alnum_prop": 0.6857339765678843,
"repo_name": "lukas-hetzenecker/home-assistant",
"id": "7ba86960d2b6260db6e8eaa868013e9d0c95d483... |
"""
Summary measures for ergodic Markov chains
"""
__author__ = "Sergio J. Rey <srey@asu.edu>"
__all__ = ['steady_state', 'fmpt', 'var_fmpt']
import numpy as np
import numpy.linalg as la
def steady_state(P):
"""
Calculates the steady state probability vector for a regular Markov
transition matrix P.
... | {
"content_hash": "c4b93781a8bd972bcaa94b7665b8b290",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 80,
"avg_line_length": 27.70909090909091,
"alnum_prop": 0.5503062117235346,
"repo_name": "spreg-git/pysal",
"id": "56cca9a23eb2f4f5b4d2bf3b70d01b0cf8201556",
"size": "4572... |
DEBUG = False
TEMPLATE_DEBUG = DEBUG
import os
BASE_PATH = os.path.dirname(__file__)
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_PATH + '/tracked.db'
}
}
# Local time zone for th... | {
"content_hash": "46311a1f74668811c01feda1ebc94da0",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 94,
"avg_line_length": 31.46875,
"alnum_prop": 0.7067196292618338,
"repo_name": "richbs/tracked",
"id": "44d6ce8f1674bee54cc019e8ca4ee49bbefb2fac",
"size": "3021",
"binar... |
from django.conf import settings
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class ShopifyAccount(ProviderAccount):
pass
class ShopifyProvider(OAuth2Provider):
id = 'shopify'
name = 'Shopify'
account_cla... | {
"content_hash": "b29cee2410a7f33728389716d8bb3e13",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 77,
"avg_line_length": 32.23076923076923,
"alnum_prop": 0.6073985680190931,
"repo_name": "okwow123/djangol2",
"id": "bc34908325ff8daed43f79d439a5d1d1e6b7f0c4",
"size": "167... |
import time
import phenox as px
def main():
duration = 3.0
filename = "testsound.raw"
print("sound record({0} sec) starts after press ENTER".format(duration))
raw_input()
print("now recording...")
started = px.set_sound_recordquery(3.0)
if not started:
print("some problem occurr... | {
"content_hash": "a48e286b10bc32fcfb9b757ef8cae7b1",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 76,
"avg_line_length": 24.966666666666665,
"alnum_prop": 0.5994659546061415,
"repo_name": "atsushisugiyama/phenox_python",
"id": "b0c6aa426002931dbb2c87f4b28c291c627a0d4d",
... |
import os
import sys
import imp
BASEDIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
os.environ['DJANGO_SETTINGS_MODULE'] = 'project.development'
imp.load_source('django_binary', os.path.join(BASEDIR, 'bin', 'django'))
extensions = ['sphinx.ext.autodoc']
#templates_path = ['_templates']
#html_the... | {
"content_hash": "beb54e9062881b7e2e3d95071a82d973",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 72,
"avg_line_length": 23.973684210526315,
"alnum_prop": 0.6805708013172338,
"repo_name": "haltu/eca-eops",
"id": "26fa333a5d089b29e99584153258b92cc9100154",
"size": "937",... |
class Person(object):
def __init__(self, name):
self.name = name
class Employee(Person):
def __init__(self, name, salary):
super(Employee, self).__init__(name)
self.salary = salary
e1 = Employee('Mighty', 10000000)
# it seems the super function only works for new style classes | {
"content_hash": "b918ef556e0ce607d1a78ffde0abd5f3",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 62,
"avg_line_length": 20.714285714285715,
"alnum_prop": 0.6862068965517242,
"repo_name": "cohadar/learn-python-the-hard-way",
"id": "e076843787cd474002bb04b7c94906bf324aa3f1... |
""" Enforce the nocase collation on the email table
Revision ID: 049fed905da7
Revises: 49d77a93118e
Create Date: 2018-04-21 13:23:56.571524
"""
# revision identifiers, used by Alembic.
revision = '049fed905da7'
down_revision = '49d77a93118e'
from alembic import op
import sqlalchemy as sa
def upgrade():
with o... | {
"content_hash": "498a728b6daeaeeb30e6ab71ed32cd48",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 80,
"avg_line_length": 23.52,
"alnum_prop": 0.717687074829932,
"repo_name": "kaiyou/freeposte.io",
"id": "d8af41d3939450c7b44b83c1077a10d69a1c0872",
"size": "588",
"binar... |
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno... | {
"content_hash": "b18b45647337006ceb21c0f23804bf1e",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 72,
"avg_line_length": 29.096153846153847,
"alnum_prop": 0.6133509583608724,
"repo_name": "bitly/pynsq",
"id": "5d1109c82d793e53a9cb9907cc3fd479a48f0f3b",
"size": "1513",
... |
import logging
import log
from log import DispatchingFormatter, \
TaskFormatter, \
DefaultFormatter, \
TaskHandler, \
TaskLoggerAdapter
if __name__ == "__main__":
logger = log.getLogger('main')
logger.setLevel(loggi... | {
"content_hash": "550aa4196d92b4fdbe7af34e186e6a34",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 87,
"avg_line_length": 25.6,
"alnum_prop": 0.56640625,
"repo_name": "srluge/DelugeSickbeardPlugin",
"id": "986b88fccab377e40aba7610a37cc446d04aaa9a",
"size": "2105",
"bin... |
"""
A SearchSource is a TroveSource + information about how to search it
(using findTroves). This allows the user to abstract away information
about whether the trove source will work without an installLabelPath
or not, what flavor to use, etc.
It also makes it easier to stack sources (see TroveSo... | {
"content_hash": "18a5efe1f652fe79b7c4ce432223490b",
"timestamp": "",
"source": "github",
"line_count": 469,
"max_line_length": 105,
"avg_line_length": 42.05756929637526,
"alnum_prop": 0.5932065906210393,
"repo_name": "fedora-conary/conary",
"id": "aecf2ba4ceb2fc0657e40eba67024cff08f971a3",
"size":... |
from conans import CMake, ConanFile, AutoToolsBuildEnvironment, tools
import os
import shutil
class JpegConan(ConanFile):
name = "jpeg"
src_version = "9b"
version = "9.2" # same as 9b
ZIP_FOLDER_NAME = name + "-" + src_version
generators = "cmake"
settings = "os", "arch", "compiler", "build_typ... | {
"content_hash": "521b4fa7ba17adafddddc9fa6dfb628a",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 135,
"avg_line_length": 45.917808219178085,
"alnum_prop": 0.5817422434367542,
"repo_name": "GatorQue/conan-jpeg",
"id": "bad34c403ee371ce421fad479792e747069038fd",
"size": ... |
"""
gen_dates.py -- generate dates for inclusion in VIVO
"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2016 (c) Michael Conlon"
__license__ = "New BSD License"
__version__ = "0.01"
from datetime import datetime
from dateutil.relativedelta import relativedelta
out_file = open('dates.txt', "w")
prin... | {
"content_hash": "d0054536a43286efffcb1a1e5c961855",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 56,
"avg_line_length": 26.58139534883721,
"alnum_prop": 0.6535433070866141,
"repo_name": "ctsit/vivo-pump",
"id": "80d7cc641dd691aa87147ff4607c1aa97d1bee39",
"size": "1166"... |
import demistomock as demisto # noqa: F401
from bs4 import BeautifulSoup
from CommonServerPython import * # noqa: F401
def extract_html_table(html, indexes):
soup = BeautifulSoup(html, 'html.parser')
tables = []
for index, tab in enumerate(soup.find_all('table')):
if len(indexes) > 0 and index n... | {
"content_hash": "d09a1f123cc1297b20895c525a870fac",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 127,
"avg_line_length": 38.224137931034484,
"alnum_prop": 0.5083446098331078,
"repo_name": "demisto/content",
"id": "992e12ef7d173e3f43d201634fe78157ba9c1345",
"size": "221... |
from oslo_log import log as logging
from oslo_serialization import jsonutils
import six
import webob.exc
from wsme.rest import json
from glance.api import policy
from glance.api.v2.model.metadef_resource_type import ResourceType
from glance.api.v2.model.metadef_resource_type import ResourceTypeAssociation
from glance.... | {
"content_hash": "b89e695966d808ca83f4aac72ff3e547",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 79,
"avg_line_length": 41.84375,
"alnum_prop": 0.6046489917849142,
"repo_name": "kfwang/Glance-OVA-OVF",
"id": "8ddf76bb199810c03123dd54a10f6ed74d755b3a",
"size": "11323",... |
"""
WSGI config for elitegamez 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.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "elitegamez.settings")
from django.... | {
"content_hash": "0c5ae8fe33478239f1d64587fc28d1ac",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 28.214285714285715,
"alnum_prop": 0.7772151898734178,
"repo_name": "vlameiras/cdkeyswholesale",
"id": "de9012ff52f9f4f6c342da12ae133cb7cd7e3c45",
"si... |
'''
PyEarthScience: read_GRIB_with_PyNIO.py
Description:
Demonstrate the use of PyNIO to open and read the content of
a GRIB file.
- PyNIO
- GRIB
2019-01-22 kmf
'''
from __future__ import print_function
import Ngl,Nio
import numpy as np
#-- data directory and file name, we use an example GR... | {
"content_hash": "8fd2e789cb7b726ca650fb6b9efa28c9",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 89,
"avg_line_length": 28.316091954022987,
"alnum_prop": 0.5177592855693119,
"repo_name": "KMFleischer/PyEarthScience",
"id": "5ce2943d8507fde98e098da1f8f8b1ae2a9fa926",
"... |
'''
The Inline classes used in the editor.
'''
from django.forms import ModelForm
from django.forms.models import BaseModelFormSet, modelformset_factory
from django.utils.functional import curry
from django.contrib.admin.util import flatten_fieldsets
from django.utils.encoding import force_unicode
from metashare.repos... | {
"content_hash": "bcc9c284e18ea63e93293e2d49c02a12",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 92,
"avg_line_length": 38.88559322033898,
"alnum_prop": 0.5980167810831426,
"repo_name": "zeehio/META-SHARE",
"id": "fe661f309d42cc29708c0ecab2abea9b003de2c3",
"size": "91... |
from django.test import LiveServerTestCase
from selenium import webdriver
class NewVisitorTest(LiveServerTestCase):
def setUp(self):
self.browser = webdriver.Firefox()
def tearDown(self):
self.browser.quit()
def test_can_visit_homepage(self):
# She goes to check out its homepage
... | {
"content_hash": "fc4185a6268951b3b7181fff22497d42",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 67,
"avg_line_length": 30,
"alnum_prop": 0.6888888888888889,
"repo_name": "DeppSRL/depp-tracking",
"id": "a352bc9176a53ba9ea75d1c78317c2d2ef21b36e",
"size": "540",
"binar... |
"""
Tests for the text Label class.
"""
from reportlab.lib.testutils import setOutDir,setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import os, sys, copy
from os.path import join, basename, splitext
import unittest
from reportlab.lib import colors
from reportlab.lib.units import cm
from r... | {
"content_hash": "99441c324f6e245c34eef2c9a54f1332",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 102,
"avg_line_length": 32.9963768115942,
"alnum_prop": 0.6222685846052487,
"repo_name": "malexandre/python-xhtml2pdf-demo",
"id": "dfe462229d91735d6295a289d7986c87a192d2f8"... |
from __future__ import absolute_import
import base64
import os
import sys
if sys.version_info >= (3, 0):
from urllib.parse import quote
from io import BytesIO as IOClass
else:
from urllib import quote
try:
from cStringIO import StringIO as IOClass
except ImportError:
from StringIO ... | {
"content_hash": "499601b48739aead0f244e3d092e5c6d",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 91,
"avg_line_length": 32.888888888888886,
"alnum_prop": 0.6516891891891892,
"repo_name": "bfirsh/needle",
"id": "cd10b49d660d6ad94c44690ffe2e85d1490ea6dc",
"size": "5938"... |
from nose import SkipTest
from nose.tools import raises
from dxr.testing import DxrInstanceTestCase
class PathAndFileFilterTests(DxrInstanceTestCase):
"""Basic tests for functionality of the 'path:' and 'file:' filters"""
def test_basic_path_results(self):
"""Check that a 'path:' result includes bot... | {
"content_hash": "842d68ca0f5eff0b43926ac2508c58d3",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 80,
"avg_line_length": 45.592592592592595,
"alnum_prop": 0.6141348497156783,
"repo_name": "pelmers/dxr",
"id": "3ebf626b0a3756f7abaa0acf5a506851cc6636da",
"size": "2490",
... |
class InstallationContext(object):
def __init__(self):
super(InstallationContext, self).__init__()
self.installed = set()
| {
"content_hash": "0b06f314437ac5508655f1a05129e86d",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 51,
"avg_line_length": 35.5,
"alnum_prop": 0.6267605633802817,
"repo_name": "vmalloc/pydeploy",
"id": "8f1256543a5c87bf22c5dd235222b9ae0922ec71",
"size": "142",
"binary": ... |
import codecs
import datetime
import locale
from decimal import Decimal
from urllib.parse import quote
from django.utils.functional import Promise
class DjangoUnicodeDecodeError(UnicodeDecodeError):
def __init__(self, obj, *args):
self.obj = obj
super().__init__(*args)
def __str__(self):
... | {
"content_hash": "ee072910b03ea6db6173309aaf8938bc",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 82,
"avg_line_length": 33.30798479087453,
"alnum_prop": 0.6106164383561644,
"repo_name": "django/django",
"id": "43847b5385101f64d1393bde7aed1d7e3ec01380",
"size": "8766",... |
from model.group import Group
import random
import string
import os.path
import jsonpickle
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 1
f = "data/groups.json"
for o, a in op... | {
"content_hash": "12dce170e0d3a2dfbbe4ec76fe40696f",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 94,
"avg_line_length": 24.533333333333335,
"alnum_prop": 0.625,
"repo_name": "esemin83/python_training",
"id": "a7f951a2672394d2ae435c9da6a2f94bb81701a6",
"size": "1104",
... |
__all__ = [
'Route53DNSDriver'
]
import base64
import hmac
import datetime
import uuid
from libcloud.utils.py3 import httplib
from hashlib import sha1
from xml.etree import ElementTree as ET
from libcloud.utils.py3 import b, urlencode
from libcloud.utils.xml import findtext, findall, fixxpath
from libcloud.dns.... | {
"content_hash": "3c692f3cd2bc28036d093b4a9085167f",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 79,
"avg_line_length": 35.840677966101694,
"alnum_prop": 0.5863047384848198,
"repo_name": "IsCoolEntertainment/debpkg_libcloud",
"id": "64918ade6f8473a93ff1e9c683e183ca67613... |
import os
import sys
import install_venv_common as install_venv
def print_help(venv, root):
help = """
Heat development environment setup is complete.
Heat development uses virtualenv to track and manage Python dependencies
while in development and testing.
To activate the Heat virtualenv for t... | {
"content_hash": "cd8f68a336a79f281fda2fa1e02174ce",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 79,
"avg_line_length": 30.0188679245283,
"alnum_prop": 0.6643620364550598,
"repo_name": "JioCloud/heat",
"id": "d4cf4d6a9447d0b1d6342640e4a9e2767038f05a",
"size": "2435",
... |
from ._cirq_to_stim import cirq_circuit_to_stim_circuit
from ._det_annotation import DetAnnotation
from ._obs_annotation import CumulativeObservableAnnotation
from ._shift_coords_annotation import ShiftCoordsAnnotation
from ._stim_sampler import StimSampler
from ._stim_to_cirq import (
MeasureAndOrResetGate,
st... | {
"content_hash": "39266db434fdb0d243f78479a2baae79",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 83,
"avg_line_length": 39.095238095238095,
"alnum_prop": 0.8063337393422655,
"repo_name": "quantumlib/Stim",
"id": "6549429eb9cd918ead7c61eb96446d91fce0c2a0",
"size": "821"... |
"""
:mod:`nova` -- Cloud IaaS Platform
===================================
.. automodule:: nova
:platform: Unix
:synopsis: Infrastructure-as-a-Service Cloud platform.
.. moduleauthor:: Jesse Andrews <jesse@ansolabs.com>
.. moduleauthor:: Devin Carlen <devin.carlen@gmail.com>
.. moduleauthor:: Vishvananda Ishaya ... | {
"content_hash": "408690b859cb542207ab5365ff1fb2d9",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 60,
"avg_line_length": 29.157894736842106,
"alnum_prop": 0.6823104693140795,
"repo_name": "salv-orlando/MyRepo",
"id": "884c4a71309f31edcf5e6de56aaaecef914c95f2",
"size": "... |
"""Starter script for Cinder Volume Backup."""
import logging as python_logging
import shlex
import sys
# NOTE(geguileo): Monkey patching must go before OSLO.log import, otherwise
# OSLO.context will not use greenthread thread local and all greenthreads will
# share the same context.
import eventlet
eventlet.monkey_p... | {
"content_hash": "5ef7ae89b91c0e1328f62274cbb201ef",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 78,
"avg_line_length": 33.78350515463917,
"alnum_prop": 0.6847726579188282,
"repo_name": "j-griffith/cinder",
"id": "ffe7cb9460af1a6ded5afbad92c05f85f0564626",
"size": "396... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0012_mediafile_feedback'),
]
operations = [
migrations.AddField(
model_name='mediafile',
name='original_filename',
... | {
"content_hash": "8feae4e70f717eaee20cc71cd5b1c57a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 63,
"avg_line_length": 22.166666666666668,
"alnum_prop": 0.6040100250626567,
"repo_name": "hep7agon/city-feedback-hub",
"id": "c28cd7166300d92c45f8a93a3aec634a3f9e2421",
"s... |
"""
.. module:: app
:platform: linux
:synopsis: The module containing the planet alignment application.
.. moduleauthor:: Paul Fanelli <paul.fanelli@gmail.com>
.. modulecreated:: 6/27/15
"""
from zope.interface import implements
from planet_alignment.app.interface import IApp
class App(object):
"""This c... | {
"content_hash": "9d4f432b26f9c229b3c1297ee20b217d",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 88,
"avg_line_length": 34.00990099009901,
"alnum_prop": 0.5327510917030568,
"repo_name": "paulfanelli/planet_alignment",
"id": "27e1cf0bdc4c0c3e39cb1f36c690d0d120ec6e64",
... |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure link_settings containing -lblah.lib is remapped to just blah.lib.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test ... | {
"content_hash": "54b99c70e8f34c7f63b582d22eed602f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 75,
"avg_line_length": 25.8,
"alnum_prop": 0.686046511627907,
"repo_name": "Jet-Streaming/gyp",
"id": "4ef1fe394e8db659f6c85beed7fde827e0fb4652",
"size": "539",
"binary":... |
"""Various Statistical Tests
Author: josef-pktd
License: BSD-3
Notes
-----
Almost fully verified against R or Gretl, not all options are the same.
In many cases of Lagrange multiplier tests both the LM test and the F test is
returned. In some but not all cases, R has the option to choose the test
statistic. Some alt... | {
"content_hash": "ae0938b2115c3ff0e000ae21166cf780",
"timestamp": "",
"source": "github",
"line_count": 1627,
"max_line_length": 149,
"avg_line_length": 32.85863552550707,
"alnum_prop": 0.6146349675464358,
"repo_name": "yl565/statsmodels",
"id": "95c9dddcdbbba51bcb39889908dbb7cb2d79d028",
"size": "... |
__author__ = "EUL Systems"
__copyright__ = "Copyright 2010, 2016. Emory University Library and IT Services"
__credits__ = ["Rebecca Koeser", "Ben Ranker", "Alex Thomas", "Scott Turnbull",
"Alex Zotov"]
__email__ = "libsys-dev@listserv.cc.emory.edu"
# Version Info, parsed below for actual version number.... | {
"content_hash": "2edc4fd04724080e728e2535a937a879",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 80,
"avg_line_length": 45.53846153846154,
"alnum_prop": 0.6199324324324325,
"repo_name": "emory-libraries/pidman",
"id": "d9b283bc9b1107bd866cf8f2d2ac795eadc99374",
"size":... |
from .resource import Resource
class RouteFilter(Resource):
"""Route Filter Resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.... | {
"content_hash": "3d5db9442e51efa0131006c776482cb2",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 101,
"avg_line_length": 37.5,
"alnum_prop": 0.6097777777777778,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "da9f427e597de978a4c8aa8f84b70d737df2cfc1",
"size": "2724... |
"""
Tests to assert that various incorporated middleware works as expected.
"""
from http import client as http_client
import os
import tempfile
from oslo_config import cfg
import oslo_middleware.cors as cors_middleware
from ironic.tests.unit.api import base
from ironic.tests.unit.api import utils
from ironic.tests.... | {
"content_hash": "70e7ea92faf8b5a95566c4721d0ca2cf",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 78,
"avg_line_length": 38.142857142857146,
"alnum_prop": 0.6127340823970038,
"repo_name": "openstack/ironic",
"id": "80f768fd13f8eed5e909a8d9bade0b85b99d0a0c",
"size": "59... |
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
import re
import shutil
import subprocess
import stat
import string
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# A regex matching an argument corresponding to th... | {
"content_hash": "1b21e7d6943d7ddadd287c30ecc46c9e",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 80,
"avg_line_length": 40.601941747572816,
"alnum_prop": 0.6343854615016739,
"repo_name": "svn2github/gyp",
"id": "ac15d737277dd83226912c11f2f0732bd0cad54b",
"size": "1272... |
def init_actions_(service, args):
"""
this needs to returns an array of actions representing the depencies between actions.
Looks at ACTION_DEPS in this module for an example of what is expected
"""
return {
'install': ['init']
}
def install(job):
# look for build host os service
... | {
"content_hash": "29ce7b4dc1936521077bdafabea1c2b1",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 89,
"avg_line_length": 34.8,
"alnum_prop": 0.5862068965517241,
"repo_name": "Jumpscale/ays_jumpscale8",
"id": "1dc634877723fccfcbfbc14cc50e0c8c745fa517",
"size": "1218",
... |
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| {
"content_hash": "243eb545f5c6e7515ac91f334fc1e896",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 42,
"avg_line_length": 37.5,
"alnum_prop": 0.6533333333333333,
"repo_name": "uogbuji/amara3-xml",
"id": "b48d5c6a6c341003c2f666fd7eea818e11068bbe",
"size": "415",
"binary"... |
from bx.misc.cdb import *
from tempfile import NamedTemporaryFile
def test():
d = {}
for i in range( 10000 ):
d[ 'foo' + str( i ) ] = 'bar' + str( i )
# Open temporary file and get name
file = NamedTemporaryFile()
file_name = file.name
# Write cdb to file
FileCDBD... | {
"content_hash": "50d372c775a7ecb30d5da16c77b5791f",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 51,
"avg_line_length": 21.647058823529413,
"alnum_prop": 0.5543478260869565,
"repo_name": "uhjish/bx-python",
"id": "0fb5d1c404c11435e6c22b0d21eb5a09271e6ae0",
"size": "736... |
"""linebot.models package."""
from .base import ( # noqa
Base,
)
from .error import ( # noqa
Error,
ErrorDetail,
)
from .events import ( # noqa
Event,
MessageEvent,
FollowEvent,
UnfollowEvent,
JoinEvent,
LeaveEvent,
PostbackEvent,
BeaconEvent,
Postback,
Beacon,
)
... | {
"content_hash": "9c8522e21ae4d88102a9152f99494435",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 36,
"avg_line_length": 18.073529411764707,
"alnum_prop": 0.6680227827502034,
"repo_name": "monhustla/line-bot-sdk-python",
"id": "455b5f14e1783d1719477c5aa9fcbc9ea28c5964",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.