text stringlengths 4 1.02M | meta dict |
|---|---|
from header_common import *
from header_operations import *
| {
"content_hash": "4f805f60b857c69d9e702f915f845669",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 31,
"avg_line_length": 30,
"alnum_prop": 0.8,
"repo_name": "qt911025/pw_module_system",
"id": "ec0634445ffa1e5372dee1d0937d780c23ca9ada",
"size": "276",
"binary": false,
... |
import collections
import logging
import re
from king_phisher import ipaddress
from king_phisher import its
from king_phisher.constants import SPFResult
import dns.exception
import dns.name
import dns.query
import dns.rdtypes.ANY.TXT
import dns.resolver
import smoke_zephyr.utilities
MACRO_REGEX = re.compile(r'%\{([s... | {
"content_hash": "3f8adc8aab1d9a27efb16fb2a9d11e1a",
"timestamp": "",
"source": "github",
"line_count": 507,
"max_line_length": 151,
"avg_line_length": 36.009861932938854,
"alnum_prop": 0.6950210878019389,
"repo_name": "guitarmanj/king-phisher",
"id": "6f616ad75de9f20d8f5a0611b230535b5f33e350",
"si... |
from trove.common import cfg
from trove.common.strategies.cluster import base
from trove.guestagent import api as guest_api
from trove.openstack.common import log as logging
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
class VerticaGuestAgentStrategy(base.BaseGuestAgentStrategy):
@property
def guest_c... | {
"content_hash": "6b3bca8b110a424f68c490d8645d8430",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 75,
"avg_line_length": 36.43589743589744,
"alnum_prop": 0.6537649542575651,
"repo_name": "CMSS-BCRDB/RDSV1.0",
"id": "14b35df982f6af299d24ce29f74caa429d881927",
"size": "20... |
from .jobscheduler import JobExistError
from .jobscheduler import JobScheduler
from .jobscheduler import NextFireTimeError
from .jobscheduler import get_next_fire_time
__all__ = [
'JobExistError',
'JobScheduler',
'NextFireTimeError',
'get_next_fire_time',
]
| {
"content_hash": "3e35852fef4be3d0019a9934c3ab2f65",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 44,
"avg_line_length": 25,
"alnum_prop": 0.7454545454545455,
"repo_name": "baishancloud/pykit",
"id": "f87ba9e5003b2aa4c23aa427b8503627fe222af8",
"size": "275",
"binary":... |
import json
import sys
def partialDOIMatch(d1, d2):
"""
Assumes d1 is a "full DOI", like '10.1145/1166253.1166292', and d2
is a partial DOI, like '1166292' or '1166253.1166292'. Returns true
if they match and false otherwise.
Note that in the previous case, a partial like '292' would be a
ne... | {
"content_hash": "5ba2942b4d0b1b7e2fbcc2960bab8607",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 83,
"avg_line_length": 36.1375,
"alnum_prop": 0.5876859218263577,
"repo_name": "drasnop/PaperQuest",
"id": "479d3dc75560e8458a404ebfbc1628deee545fce",
"size": "3567",
"bi... |
import requests
import json
import urllib
def getBuild(logURL):
try:
response = requests.get(logURL).json()
#response=urllib.urlopen(logURL).read()
except:
print('Error calling')
else:
data = response
parsedValue = data['lastSuccessfulBuild']['number']
return parsedVa... | {
"content_hash": "403cbb00d20f90eb335a6e8e92b0dfba",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 100,
"avg_line_length": 25.43243243243243,
"alnum_prop": 0.6780021253985122,
"repo_name": "lukepatrick/os-helm-aio-installer",
"id": "26fe10efe3a3a741b1ea1d1e2eac05baa06e0297... |
INDEX = "config/index.rst"
INDEX_PATH = '.index'
# Path to directives the user wants to include
DIRECTIVES = "config/directives.rst"
# Directory contain rst source files
SRC = "src"
| {
"content_hash": "acf65d82c43e5880a9738907e5710478",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 46,
"avg_line_length": 23,
"alnum_prop": 0.7336956521739131,
"repo_name": "kidaa/Encyclopedia",
"id": "8aad33422444d54ce53484cd76d77fda043cc808",
"size": "184",
"binary": ... |
from ray.rllib.env.external_env import ExternalEnv
from ray.rllib.env.external_multi_agent_env import ExternalMultiAgentEnv
from ray.rllib.env.vector_env import VectorEnv
from ray.rllib.env.multi_agent_env import MultiAgentEnv
from ray.rllib.utils.annotations import override, PublicAPI
ASYNC_RESET_RETURN = "async_rese... | {
"content_hash": "a7033117c0e01fff5e231bd9ed75848e",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 79,
"avg_line_length": 37.6420581655481,
"alnum_prop": 0.544098419113277,
"repo_name": "stephanie-wang/ray",
"id": "29c2e3a9cf43ec6049d14017498a7981d14eceb6",
"size": "168... |
"""Tests for Configuration objects."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import pytest
from confpy.core import config
from confpy.core import namespace
def test_config_instance_namespace_setting():
... | {
"content_hash": "63a1562caeb25353660b5ffbda1c01b1",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 78,
"avg_line_length": 27.416666666666668,
"alnum_prop": 0.7254305977710233,
"repo_name": "kevinconway/confpy",
"id": "3b83fea80b59b4f414fee734a1802e89c34ea849",
"size": "9... |
import json
import os
import unittest
from pymatgen.analysis.structure_prediction.substitutor import Substitutor
from pymatgen.core.composition import Composition
from pymatgen.core.periodic_table import Species
from pymatgen.util.testing import PymatgenTest
def get_table():
"""
Loads a lightweight lambda ta... | {
"content_hash": "260cca0f4416d83c7066ee742847e378",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 89,
"avg_line_length": 32.6875,
"alnum_prop": 0.6583811344805609,
"repo_name": "fraricci/pymatgen",
"id": "5e6a2a88645c034acc833a56337af7013fd86d9e",
"size": "1664",
"bin... |
from ..common import is_optimizer_op, OP_ROLE_KEY, OpRole, is_update_op
from paddle.framework import core
from paddle.utils import unique_name
__all__ = []
class PlaceType:
# sync with memcpy op, maybe not a good design
CPU = 0
CUDA = 1
CUDA_PINNED = 2
XPU = 3 # unsupport for now
NPU = 4
... | {
"content_hash": "131772d92b49908b3b0612c0624e9a9e",
"timestamp": "",
"source": "github",
"line_count": 566,
"max_line_length": 89,
"avg_line_length": 37.91696113074205,
"alnum_prop": 0.4932668561576814,
"repo_name": "PaddlePaddle/Paddle",
"id": "058b2adc8e18518501b9a3c371244a62ee4640de",
"size": "... |
import ldap3
import ssl
import re
import ast
import datetime
import pytz
from classes.ldapexceptions import LdapErrorException
from ldap3.core.exceptions import LDAPSSLConfigurationError
from classes.ldapdn import LdapDn
from ldap3.extend.microsoft.modifyPassword import ad_modify_password
def str_list(list):
newl... | {
"content_hash": "888a534e1ae50ce1a6be3a8156268aab",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 108,
"avg_line_length": 32.361486486486484,
"alnum_prop": 0.546507986219856,
"repo_name": "edushare-at/py-etd",
"id": "0804c5b1583214c533f3452b6927f89e087435c9",
"size": "... |
'''
Created on Mar 28, 2014
Provides functions for constructing the input file for STP.
@author: stefan
'''
import itertools
def blockCharacteristic(stpfile, characteristic, wordsize):
"""
Excludes this characteristic from being found.
"""
# Only add state words (x, y, s)
# TODO: extend for other... | {
"content_hash": "b20b34a3c5c7a2c5c436db09946239e2",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 85,
"avg_line_length": 31.71814671814672,
"alnum_prop": 0.5638466220328667,
"repo_name": "kste/cryptosmt",
"id": "6f24b323d1cee2b9548a4cca206305b6d6eebc5f",
"size": "8215"... |
"""Test configuration for the Matchlight SDK."""
import time
import uuid
import pytest
import matchlight
@pytest.fixture
def access_key():
"""Provides a fake access key in the form of a UUID4."""
return uuid.uuid4().hex
@pytest.fixture
def secret_key():
"""Provides a fake secret key in the form of a U... | {
"content_hash": "82bcac1f9c7ab6bb4bbb8654ef455a7f",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 79,
"avg_line_length": 25.616438356164384,
"alnum_prop": 0.5365418894830659,
"repo_name": "TerbiumLabs/python-matchlightsdk",
"id": "ea3008d6f5b0d48456c19d3dc4bc37363f7f8efa... |
import psutil
from os3.core.item import Os3Item
class Process(psutil.Process, Os3Item):
pass
| {
"content_hash": "19ae4d86068e79e1c8e7d6b924f7ee40",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 39,
"avg_line_length": 14.285714285714286,
"alnum_prop": 0.76,
"repo_name": "Nekmo/gradale",
"id": "dfd9e0fc484f87bc906c0e0e0e7659f04c91c0be",
"size": "124",
"binary": fal... |
from oslo_policy import policy
RULE_ADMIN_OR_OWNER = 'rule:admin_or_owner'
ROLE_ADMIN = 'role:admin'
UNPROTECTED = ''
rules = [
policy.RuleDefault(
name='context_is_admin',
check_str='role:admin'),
policy.RuleDefault(
name='admin_or_owner',
check_str='is_admin:True or tenant:%(... | {
"content_hash": "8c5eb1d9fd554d84c23355910deed0ba",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 59,
"avg_line_length": 21.571428571428573,
"alnum_prop": 0.6247240618101545,
"repo_name": "stackforge/cloudkitty",
"id": "66c0d38e80f206e5f59f3f5d88692f7da02da2cd",
"size":... |
from django.contrib import admin
from awl.admintools import make_admin_obj_mixin, fancy_modeladmin
from awl.tests.models import (Link, Author, Book, Chapter, Driver,
VehicleMake, VehicleModel, Dealer)
from awl.rankedmodel.admintools import (admin_link_move_up,
admin_link_move_down, admin_move_links)
# ======... | {
"content_hash": "39ca62753716af168352b57a39ba4437",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 78,
"avg_line_length": 32.526785714285715,
"alnum_prop": 0.5758989843535548,
"repo_name": "cltrudeau/django-awl",
"id": "d8348b3812c07b354af32bf410dd6c9fc8d42f52",
"size":... |
import numpy as np
import galsim
import os
from .galaxymaker import GalaxyMaker
from .great3_cosmos_gals.galaxies import COSMOSGalaxyBuilder
from .great3_cosmos_gals.noise import PlaceholderNoiseBuilder
from .. import utils
from ..observation import Observation
class GREAT3COSMOSGalaxyMaker(GalaxyMaker):
"""
... | {
"content_hash": "59c6be096791ef21069df5b761b05a89",
"timestamp": "",
"source": "github",
"line_count": 376,
"max_line_length": 139,
"avg_line_length": 42.58510638297872,
"alnum_prop": 0.566637521858606,
"repo_name": "kstory8/egret",
"id": "c5c3de150c877e4fe0f180a21c807ecd38d2a8d1",
"size": "16012"... |
from __future__ import absolute_import
from django import template
from django.conf import settings
from django.core.urlresolvers import reverse
from six.moves.urllib.parse import urlencode
from sentry.models import User, UserAvatar
from sentry.utils.avatar import get_email_avatar, get_gravatar_url, get_letter_avatar... | {
"content_hash": "3a5190d80c06156d649eab39d1a5874e",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 85,
"avg_line_length": 31.63953488372093,
"alnum_prop": 0.6622565233370085,
"repo_name": "mvaled/sentry",
"id": "dd38a5bb5ae4bac617197f65c88f0ca82dee2f90",
"size": "2721",
... |
import _plotly_utils.basevalidators
class SideValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="side",
parent_name="histogram2dcontour.colorbar.title",
**kwargs,
):
super(SideValidator, self).__init__(
plotly_name=... | {
"content_hash": "ed2d9bd7d6039acb9085f7b715b2c379",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 70,
"avg_line_length": 31.235294117647058,
"alnum_prop": 0.576271186440678,
"repo_name": "plotly/plotly.py",
"id": "0348d814c6d6e3b62413f8cbd191f5fa25bf1ce0",
"size": "531"... |
__title__ = 'events.contrib.themes.bootstrap3'
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2017 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = ('default_app_config', 'UID',)
default_app_config = 'events.contrib.themes.bootstrap3.apps.Config'
UID = 'bootstrap3'
| {
"content_hash": "5aa7bd56cdcef49fd2d517b8a916bd9d",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 67,
"avg_line_length": 35.111111111111114,
"alnum_prop": 0.689873417721519,
"repo_name": "mansonul/events",
"id": "110c855b50fa8daad5a31bf878021f448fcbfd36",
"size": "316",
... |
from caps.io import reader as db
simulation = "L500_NR_tracers"
mt = db.Simulation(simulation)
simdir, hcdir, profilesdir = mt.get_directories()
aexp_list = mt.get_halo_epochs()
for aexp in aexp_list:
clusters = mt.get_halo_ids(aexp=aexp, main_halos_only=True)
aexp_str = "%0.4f" % aexp
output = open(si... | {
"content_hash": "110ad4b008f3db5655c36850444e83c3",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 72,
"avg_line_length": 24.36842105263158,
"alnum_prop": 0.6544276457883369,
"repo_name": "cavestruz/L500analysis",
"id": "5832a09c01f3da902b457b963f282cccb6be3db3",
"size":... |
import json
import tweepy
from tweepy import OAuthHandler
import commonfunctions as cf
from commonfunctions import mysecrets
# Here I'm importing my API login details.
# If you're using your own login details, you can just replace them here.
# The Twitter API
sec = mysecrets.Secrets()
consumer_key = sec.consumer_key... | {
"content_hash": "e0a1ff19b7f91cdca537bc4e97f69a17",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 74,
"avg_line_length": 28.555555555555557,
"alnum_prop": 0.7486381322957198,
"repo_name": "keelanfh/electionary",
"id": "8b6c81402b9214ee37367e1dc359d260c81447b6",
"size": ... |
"""
This modules provides a function to transparently load the stylesheets
with the correct rc file.
"""
import logging
import platform
import os
__version__ = "2.1"
def _logger():
return logging.getLogger('skinstyle')
def load_stylesheet(theme, pyside=True):
"""
Loads the stylesheet. Takes care of imp... | {
"content_hash": "e5252d304820293165d0df882877ce78",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 84,
"avg_line_length": 29.102272727272727,
"alnum_prop": 0.5579851620460757,
"repo_name": "cloudteampro/juma-editor",
"id": "f86cb7cc4aadc1f2a9b8a6146f071daf4cf45044",
"siz... |
from qiime2.plugin import SemanticType
from q2_types.sample_data import SampleData
from q2_types.feature_data import FeatureData
ClassifierPredictions = SemanticType(
'ClassifierPredictions', variant_of=SampleData.field['type'])
RegressorPredictions = SemanticType(
'RegressorPredictions', variant_of=SampleDat... | {
"content_hash": "16de54b3b8fb9c6caaaa82d929f58c46",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 69,
"avg_line_length": 41.666666666666664,
"alnum_prop": 0.7773333333333333,
"repo_name": "nbokulich/q2-sample-classifier",
"id": "0e202b5fb6f68301803735a3c2536a01aa4e3c5c",
... |
from .adapter_base import AdapterBase
from graph_tool import Graph, Vertex, Edge
import os.path
class GraphAdapter(AdapterBase):
def __init__(self, seed_str, name,
file_extension='gml',
vertex_schema={
'gene' : 'vector<bool>',
'gen' : 'int',
'fitness' : 'v... | {
"content_hash": "72414406361bee0525da471d4bf6d0c0",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 89,
"avg_line_length": 30.6,
"alnum_prop": 0.5664488017429193,
"repo_name": "arrow-/PEAviz",
"id": "57873eb66faa6058b3b2b094a668de9e2dacb966",
"size": "2754",
"binary": f... |
import re
import logging
import datetime
logger = logging.getLogger(__name__)
EMAIL_REGEX = re.compile(r'[^@]+@[^@]+\.[^@]+')
def verify_identity(prenom: str, nom: str):
return nom and len(nom) > 0 and prenom and len(prenom) > 0
def verify_email(courriel: str):
return courriel and len(courriel) > 0 and EM... | {
"content_hash": "baf24017b8739c446a2baae2e162bdfb",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 102,
"avg_line_length": 32.67741935483871,
"alnum_prop": 0.6781836130306022,
"repo_name": "emeric254/gala-stri-website",
"id": "c69bc24e89c899958dd0fa57281f320f4bba51cd",
"... |
import math
from rpython.jit.metainterp.test.support import LLJitMixin
from rpython.rlib.rfloat import isinf, isnan, INFINITY, NAN
class MathTests:
def test_math_sqrt(self):
def f(x):
try:
return math.sqrt(x)
except ValueError:
return -INFINITY
... | {
"content_hash": "b3089c4468fcd40cf7ead5eeb6224f1c",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 59,
"avg_line_length": 31.65909090909091,
"alnum_prop": 0.5829145728643216,
"repo_name": "oblique-labs/pyVM",
"id": "26d94fa5dcee93f4dbba9d9943f831ba63c6dba9",
"size": "139... |
import numpy as np
import mahotas as mh
# This little script just builds an image with two examples, side-by-side:
text = mh.imread("../SimpleImageDataset/text21.jpg")
scene = mh.imread("../SimpleImageDataset/scene00.jpg")
h, w, _ = text.shape
canvas = np.zeros((h, 2 * w + 128, 3), np.uint8)
canvas[:, -w:] = scene
ca... | {
"content_hash": "29b2018130e3168e4c54ee1e6ed8d717",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 74,
"avg_line_length": 31.307692307692307,
"alnum_prop": 0.6683046683046683,
"repo_name": "xho95/BuildingMachineLearningSystemsWithPython",
"id": "058b1069182729d98529cfe623f... |
from juriscraper.opinions.united_states.state import pa
import re
class Site(pa.Site):
def __init__(self, *args, **kwargs):
super(Site, self).__init__(*args, **kwargs)
self.court_id = self.__module__
self.regex = re.compile("(.*)\n(.*)", re.M)
self.url = "http://www.pacourts.us/ass... | {
"content_hash": "a1a7f1f97db5c1e692e8a04ba926513e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 33.285714285714285,
"alnum_prop": 0.6180257510729614,
"repo_name": "Andr3iC/juriscraper",
"id": "81a64938bb50f272cfe35694b09f5f90fc82afe9",
"size": "... |
from interface_methods import bootstrap, mcmc, mapestimate, diagnostics, asir
def set_seed(value):
swignifit_raw.setSeed(value)
| {
"content_hash": "4eec6d4dadf7164a2d842dab286c48e3",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 77,
"avg_line_length": 33.25,
"alnum_prop": 0.7819548872180451,
"repo_name": "esc/Psignifit-3.x",
"id": "2ed2c1d122b46f010bcc90363765037806ccc032",
"size": "449",
"binary"... |
from openprocurement.api.utils import (
get_file,
upload_file,
update_file_content_type,
json_view,
context_unpack,
APIResource,
)
from openprocurement.api.validation import (
validate_file_update,
validate_file_upload,
validate_patch_document_data,
)
from openprocurement.tender.cor... | {
"content_hash": "15edf9efc08ca73da11e9e0fa71da037",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 155,
"avg_line_length": 51.31578947368421,
"alnum_prop": 0.6428717948717949,
"repo_name": "yarsanich/openprocurement.tender.belowthreshold",
"id": "2710471bf9caa97c4a9fcc6ba4... |
from django import forms
import models
from usuarios import models as usuarios
from Piscix.middleware import get_current_user
from django_autocomplete.widgets import AutocompleteWidget
from exile_ui.widgets import DatePickerWidget
from django_select2.forms import Select2Widget
class SeguimientoForm(forms.ModelForm):
... | {
"content_hash": "500d7e86540795cb5e87662c6556a7b7",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 92,
"avg_line_length": 30.28301886792453,
"alnum_prop": 0.638006230529595,
"repo_name": "exildev/Piscix",
"id": "0c456694e83ba22532129f701ffe574f97e284d7",
"size": "1605",
... |
import sublime
import sublime_plugin
import re
try:
from QuickSearchEnhanced.quick_search import panels
except ImportError as error:
sublime.error_message("Dependency import failed; please read readme for " +
"GotoLineEnhanced plugin for installation instructions; to disable this " +
"message remove this plu... | {
"content_hash": "0e02ecc8bb9071495e08a0ca867255a5",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 79,
"avg_line_length": 28.566473988439306,
"alnum_prop": 0.6244435451234318,
"repo_name": "shagabutdinov/sublime-goto-line-enhanced",
"id": "c70d937f0f4ec16a11c16dc7b016e458... |
from message.models import *
from posts.models import Post, Status
from datetime import date
def update_requests():
all_requests = Request.objects.all()
today = date.today()
for elem in all_requests:
if elem.end_date < today:
if elem.status == 'Accepted':
# Update the ... | {
"content_hash": "acfb3c484ccea4f7b65f19b07b16c8c6",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 61,
"avg_line_length": 29.095238095238095,
"alnum_prop": 0.563011456628478,
"repo_name": "Guillaume-Docquier/Thingy",
"id": "2f82d006327d4e777fed44378b5f4456b8871316",
"siz... |
from __future__ import annotations
import typing
import logging
import dataclasses
import pyuavcan
import pyuavcan.transport.serial
from pyuavcan.transport import Trace, TransferTrace, Capture, AlienSessionSpecifier, AlienTransferMetadata
from pyuavcan.transport import AlienTransfer, TransferFrom, Timestamp
from pyuavc... | {
"content_hash": "fdbefadd28a7d4e4dae734c2c09feabf",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 115,
"avg_line_length": 38.82846715328467,
"alnum_prop": 0.6635022088542156,
"repo_name": "UAVCAN/pyuavcan",
"id": "d3018b5f0dd13a8da2681b87de46926904c4e28a",
"size": "107... |
from flask import render_template, request, flash,abort,redirect,url_for
from flask.ext.login import login_required, current_user
from . import main
from .. import db
from sqlalchemy import and_,desc,or_
from app.models import users,backhosts,customers,backarchives,config,backfailed,count_day_status,count_mon_sta... | {
"content_hash": "2215b0f789c22eb1241e4e2e8e2c7a38",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 169,
"avg_line_length": 47.83458646616541,
"alnum_prop": 0.6147437912606099,
"repo_name": "linuxyan/BackManager",
"id": "341c9eba0762d38d517d439e95f02672cfe49104",
"size":... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: vultr_network_facts
deprecated:
removed_in: '2.13'
... | {
"content_hash": "fd47d556bf7b1941d199ac5118929f65",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 99,
"avg_line_length": 26.27857142857143,
"alnum_prop": 0.6287034520250068,
"repo_name": "thaim/ansible",
"id": "71b3193a725a98553df90b2dd60e1df2e04d5a40",
"size": "3847",... |
import yaml
import time
import random
import threading
import traceback
import subprocess
from rackattack import clientfactory
from rackattack.physical import config
from rackattack.api import Requirement, AllocationInfo
from rackattack.physical.tests.integration.main import useFakeGeneralConfiguration
class Rackatta... | {
"content_hash": "d5bab91b80726ff17920f8722d9d19a0",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 105,
"avg_line_length": 37.493449781659386,
"alnum_prop": 0.5948054973212206,
"repo_name": "Stratoscale/rackattack-physical",
"id": "0748b97f22e5a9da6e84ef4adc57ff8d01e7097e... |
"""
Module with functions related to image coordinates and coordinate conversions.
"""
__author__ = 'Carlos Alberto Gomez Gonzalez, Valentin Christiaens'
__all__ = ['dist',
'dist_matrix',
'frame_center',
'cart_to_pol',
'pol_to_cart',
'pol_to_eq',
'QU_to... | {
"content_hash": "ff19a439b7a96653f821f384ee9ede2e",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 80,
"avg_line_length": 30.2655737704918,
"alnum_prop": 0.5619109522261944,
"repo_name": "henry-ngo/VIP",
"id": "0f6d2876c435f546a5280853dd83df65a27c11f7",
"size": "9255",
... |
import unittest
from voluptuous import All, Length
from wtforms.validators import ValidationError
from datatypes.core import DictionaryValidator, SingleValueValidator
from datatypes.exceptions import *
class WtfTestDataType(SingleValueValidator):
def __init__(self):
super(self.__class__, self).__init__(... | {
"content_hash": "6f657f8f31dcde50fcae41040eae519c",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 101,
"avg_line_length": 33.93055555555556,
"alnum_prop": 0.6082685223086369,
"repo_name": "LandRegistry/datatypes-alpha",
"id": "3609d7b585f03d772a7105ad39da959f9753e90d",
... |
from flask import render_template, Blueprint, abort, send_file
from flask_jwt import verify_jwt
from flask.ext.jwt import current_user
main = Blueprint('main', __name__, template_folder='templates', static_folder='static/gen', static_url_path='/static')
@main.route('/templates/<path:partial>')
def render_partial(pa... | {
"content_hash": "c6146f7c7d2878bf1f086712dd5e9027",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 118,
"avg_line_length": 26.88888888888889,
"alnum_prop": 0.6787190082644629,
"repo_name": "timesqueezer/mdfork",
"id": "94819b969ab7e10f695e07d2ee1d88e241407e28",
"size": "... |
"""
sentry.plugins.sentry_urls.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import sentry
from django.utils.translation import ugettext_lazy as _
from sentry.plugins import register
from sentry.pl... | {
"content_hash": "93bc838daf81c3fbab55b151f7f20a5b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 75,
"avg_line_length": 25.43243243243243,
"alnum_prop": 0.6301806588735388,
"repo_name": "simmetria/sentry",
"id": "6c45663a1743b8c1cba6adb0b4a6610875a07edc",
"size": "941"... |
from operator import attrgetter
from django.core.exceptions import FieldError, ValidationError
from django.db import connection, models
from django.test import SimpleTestCase, TestCase
from django.test.utils import CaptureQueriesContext, isolate_apps
from .models import (
Base, Chef, CommonInfo, GrandChild, Grand... | {
"content_hash": "787ef9325e0f3196a3c07976280eee6b",
"timestamp": "",
"source": "github",
"line_count": 542,
"max_line_length": 108,
"avg_line_length": 38.04612546125461,
"alnum_prop": 0.6041899034964356,
"repo_name": "elena/django",
"id": "1ab0e15eeeda0e25f91b8fe2299268d5f1f99ea6",
"size": "20621"... |
from lxml import etree
import pytz
import xmltodict
from .ts_writer import TimeSeriesWriter
DNS = 'http://www.wldelft.nl/fews/PI' # default namespace
XSI = 'http://www.w3.org/2001/XMLSchema-instance'
XSD = 'http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd'
nsmap = {None: DNS, 'xsi': XSI}
DAT... | {
"content_hash": "2ce7613e7a0852b1692427c3060508d4",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 34.056338028169016,
"alnum_prop": 0.6149710504549214,
"repo_name": "nens/tslib",
"id": "dca05f6a741f802ca7ebb3a2a006dfa658852071",
"size": "2418",
... |
"""Utilities for loading a pretrained distance model.
"""
import jax
import ml_collections
from scenic.projects.func_dist import model as scenic_model
from scenic.projects.func_dist import train_utils
from scenic.train_lib_deprecated import pretrain_utils
def restore_model(config: ml_collections.ConfigDict, ckpt_p... | {
"content_hash": "bab309f291f9dd88d09118d7a229fcff",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 35.22727272727273,
"alnum_prop": 0.7638709677419355,
"repo_name": "google-research/scenic",
"id": "922f6e91a7fdb9c62c87d185557d1b9373cda033",
"size":... |
from __future__ import absolute_import, print_function, unicode_literals
from django.db import migrations, models
import wagtailvideos.models
class Migration(migrations.Migration):
dependencies = [
('wagtailvideos', '0003_auto_20160705_1646'),
]
operations = [
migrations.AlterField(
... | {
"content_hash": "bde87094082c5bd761cb86e478a23c71",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 125,
"avg_line_length": 26.35,
"alnum_prop": 0.6565464895635673,
"repo_name": "takeflight/wagtailvideos",
"id": "afc325998b98a8251d4cc90e423e40f22adf31f4",
"size": "599",
... |
''' Tool for sorting imports alphabetically, and automatically separated into sections.
Copyright (C) 2013 Timothy Edmund Crosley
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 restric... | {
"content_hash": "ab2eeb5c171bc0eaa4ec5c915a8dd45b",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 124,
"avg_line_length": 55.27548209366391,
"alnum_prop": 0.5893346623473711,
"repo_name": "lucidmotifs/auto-aoc",
"id": "efb3793d0a1b02f4b872e9f003066483bfbd687e",
"size":... |
from Root import application
import unittest
class test1(unittest.TestCase):
def test_one(self):
self.assertEqual(application.foo(),1)
def test_two(self):
self.assertEqual(application.foo(),1)
def test_three(self):
self.assertEqual(application.foo(),1)
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "f7b31e3f2b47732303f9f3c1da3b0324",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 39,
"avg_line_length": 27.818181818181817,
"alnum_prop": 0.7222222222222222,
"repo_name": "codeboardio/mantra",
"id": "7a24f8342fc8eae8c40fe24ac64af3db2b8b1ed3",
"size": "3... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.append(os.path.abspath('..'))
import textify
os.... | {
"content_hash": "afb6f118ee94f89e03bbcc2d3064f644",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 80,
"avg_line_length": 33.75,
"alnum_prop": 0.6914653784219001,
"repo_name": "sixpearls/django-textify",
"id": "27ee63e1a135f1a178c91cc09ca825272bf4fe62",
"size": "6635",
... |
import geojson
import sys
def validate_geojson(geojson_path):
""" Validate a GeoJSON file """
## Validate the GeoJSON file
with open(geojson_path, 'r') as geojson_file:
geojson_dump = geojson_file.read()
features = geojson.loads(geojson_dump)
validation = features.is_valid
... | {
"content_hash": "d3f4cfd10611b7ded497d35e6e969a91",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 60,
"avg_line_length": 26.74074074074074,
"alnum_prop": 0.6052631578947368,
"repo_name": "Geovation/tiler",
"id": "6a5749f4379d9ff0a99a5379d1f83628ff5e9c97",
"size": "722",... |
"""
Handling of RSA, DSA, and EC keys.
"""
from __future__ import absolute_import, division
import binascii
import itertools
import warnings
from hashlib import md5, sha256
import base64
from incremental import Version
from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.backends import de... | {
"content_hash": "21370ae3b396c763badfed36194e5497",
"timestamp": "",
"source": "github",
"line_count": 1552,
"max_line_length": 100,
"avg_line_length": 35.06829896907217,
"alnum_prop": 0.5179877264542682,
"repo_name": "ntuecon/server",
"id": "65760920b4a073d72c395667e98964da26630828",
"size": "545... |
from Foundation import *
from AppKit import *
import objc
import urllib2
import tumblr
from tumblr import Api
from DashboardController import *
class LoginController(NSWindowController):
blog = objc.IBOutlet()
password = objc.IBOutlet()
user = objc.IBOutlet()
def init(self):
self.errors = {'403':... | {
"content_hash": "6792e2f0caf5522714720ae5fde5d28c",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 119,
"avg_line_length": 27.761904761904763,
"alnum_prop": 0.6963979416809606,
"repo_name": "jyr/opentumblr-cocoa",
"id": "8ce550524fb87f9f401dedd8ee00c35d1be6df8a",
"size":... |
"""GitHub interactions."""
import json
import time
import gitlab
CommonError = gitlab.exceptions.GitlabError
def set_ref(repo, ref, sha, *, force=False, auto_create=True, retry=1):
branch_name = ref[len("heads/"):] if ref.startswith('heads') else ref
# Delete branch first
try:
repo.branches.de... | {
"content_hash": "1496322d43ffe1fb655eea0233ebfd1a",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 79,
"avg_line_length": 21.96385542168675,
"alnum_prop": 0.6615469007131103,
"repo_name": "coldnight/homu",
"id": "657ff51e324831a9948cc073851042602e86db85",
"size": "1823",... |
from django.test import TestCase
from rest_assured.testcases import CreateAPITestCaseMixin
from tests import mocks
from tests.models import Stuff
class TestCreateTestCase(TestCase):
def get_case(self, **kwargs):
class MockCreateTestCase(CreateAPITestCaseMixin, mocks.MockTestCase):
base_name =... | {
"content_hash": "93e16eee74f0e18e66dc922bfffc1964",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 79,
"avg_line_length": 37.09375,
"alnum_prop": 0.6588037068239259,
"repo_name": "yprez/django-rest-assured",
"id": "36f98d0693a5d8fa2846f3722cf20d3a69f73cf7",
"size": "2374... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Spell.casting_time'
db.alter_column('spell', 'casting_time', self.gf('django.db.models.fields.CharField')(... | {
"content_hash": "0850fbf476da183ee0298362662050b7",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 124,
"avg_line_length": 76.03571428571429,
"alnum_prop": 0.5497886331611085,
"repo_name": "machinalis/django-srd20",
"id": "49db94b44c1cdf7cf86de924623655086459c1bf",
"siz... |
from tests import utils
from tornado import testing
class TestRenderHandler(utils.HandlerTestCase):
@testing.gen_test
def test_options_skips_prepare(self):
# Would crash b/c lack of mocks
yield self.http_client.fetch(
self.get_url('/render'),
method='OPTIONS'
)... | {
"content_hash": "ea662f4ac2a9831fa11f87ad034b6339",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 47,
"avg_line_length": 24.692307692307693,
"alnum_prop": 0.6417445482866043,
"repo_name": "AddisonSchiller/modular-file-renderer",
"id": "c6b9ae371bf31c11266a2cc696a0cac21301... |
import numpy as np
from menpo.base import doc_inherit, name_of_callable
from menpo.math import as_matrix, ipca, pca, pcacov
from .linear import MeanLinearVectorModel
from .vectorizable import VectorizableBackedModel
class PCAVectorModel(MeanLinearVectorModel):
r"""
A :map:`MeanLinearModel` where components a... | {
"content_hash": "f1beb133442755517ca2a19df4314f44",
"timestamp": "",
"source": "github",
"line_count": 1568,
"max_line_length": 88,
"avg_line_length": 37.00701530612245,
"alnum_prop": 0.5515880538370069,
"repo_name": "menpo/menpo",
"id": "23a96945476d96082648cda0af818b49f297b4a1",
"size": "58027",... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Teacher'
db.delete_table('contacts_and_people_teacher')
# Deleting fie... | {
"content_hash": "8bc0a3c1810b6d54940d85d34f7856c1",
"timestamp": "",
"source": "github",
"line_count": 358,
"max_line_length": 262,
"avg_line_length": 94.31284916201118,
"alnum_prop": 0.56572088615093,
"repo_name": "bubenkoff/Arkestra",
"id": "0f82bcdf4787abe801c85f08df28c990ac0f182e",
"size": "33... |
from django.views.generic import ListView, RedirectView
from django.views.generic.edit import FormView, UpdateView, DeletionMixin, CreateView
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse_... | {
"content_hash": "9e867aced0192dbf4cf7bb761089b001",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 118,
"avg_line_length": 31.96652719665272,
"alnum_prop": 0.6827225130890052,
"repo_name": "AlexeyBerezhnoy/lucas",
"id": "b893974c5890e9b97efc406ea115cf5122986383",
"size"... |
from eth_utils import (
is_checksum_address,
is_list_like,
is_same_address,
)
PRIVATE_KEY_HEX = '0x56ebb41875ceedd42e395f730e03b5c44989393c9f0484ee6bc05f933673458f'
PASSWORD = 'web3-testing'
ADDRESS = '0x844B417c0C58B02c2224306047B9fb0D3264fE8c'
PRIVATE_KEY_FOR_UNLOCK = '0x392f63a79b1ff8774845f3fa69de4a... | {
"content_hash": "555244dc72c27abc14f44cbd0e307240",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 93,
"avg_line_length": 40.24691358024691,
"alnum_prop": 0.5874233128834356,
"repo_name": "pipermerriam/web3.py",
"id": "848686d1b2266e65f58b9f8552c4928a5abb3bde",
"size": "... |
from setuptools import setup, find_packages
version = '0.1'
LONG_DESCRIPTION = """
This is a basic forum component that can plug into any existing Django installation
and use its' existing templates, users, and admin interface. Perfect for adding
forum functionality to an existing website.
"""
setup(
name='dj... | {
"content_hash": "455022bc06f84ab3ab36d055a8159893",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 83,
"avg_line_length": 28.516129032258064,
"alnum_prop": 0.6753393665158371,
"repo_name": "RockHoward/django-forum",
"id": "f2733469f2e5b69b3461a650e649816da04c6583",
"size... |
'''
Created on Apr 24, 2016
@author: marina
'''
from __future__ import unicode_literals, division
import hashlib
import time
import requests
import json
import logging
from datetime import datetime
from datetime import timedelta
from requests.exceptions import ConnectionError
from enums import SortBy, SortOrder
LOGGE... | {
"content_hash": "91a6e45392a11f0848ef2d3b6c7c3032",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 191,
"avg_line_length": 44.389830508474574,
"alnum_prop": 0.5631920580374189,
"repo_name": "sudhakargmail/botkitwebhooks",
"id": "8a0a6aed28fa10d8cb6cc1b70b639aae15f2148a",
... |
import optparse
import StringIO
import time
import unittest
import sys
from webkitpy.common.system import executive_mock
from webkitpy.common.system.executive_mock import MockExecutive2
from webkitpy.common.system.systemhost_mock import MockSystemHost
from webkitpy.layout_tests.port import chromium_android
from webki... | {
"content_hash": "ca131f22263d2ac42102e262cc750a39",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 123,
"avg_line_length": 47.8421052631579,
"alnum_prop": 0.6088323118026089,
"repo_name": "leighpauls/k2cro4",
"id": "856ac31517c50f89a472d65454dd35365a3262b8",
"size": "14... |
import dask
from .scheduler import ray_dask_get, ray_dask_get_sync
from .callbacks import (
RayDaskCallback,
local_ray_callbacks,
unpack_ray_callbacks,
)
from .optimizations import dataframe_optimize
dask_persist = dask.persist
def ray_dask_persist(*args, **kwargs):
kwargs["ray_persist"] = True
r... | {
"content_hash": "7ef9ca7ca1a106220164d6d2591ce974",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 75,
"avg_line_length": 24.69811320754717,
"alnum_prop": 0.6951871657754011,
"repo_name": "pcmoritz/ray-1",
"id": "ac07c68345aaeb3841a019802236b8d9dd6955fb",
"size": "1309",... |
from django import http
from django.utils.translation import ugettext
from olympia.access import acl
from olympia.addons.models import Addon
from olympia.amo.feeds import NonAtomicFeed
from olympia.amo.templatetags.jinja_helpers import absolutify, page_name
from olympia.amo.urlresolvers import reverse
from olympia.bro... | {
"content_hash": "3888327355221c7bc4b94dbe5f84e5d7",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 73,
"avg_line_length": 29.296296296296298,
"alnum_prop": 0.6510745891276865,
"repo_name": "harry-7/addons-server",
"id": "0b47827badc55b9b1d0dd5b728738a1e31a4589f",
"size":... |
import logging
import sets
from openerp import models, fields, api, _
_logger = logging.getLogger(__name__)
class barcode_rule(models.Model):
_inherit = 'barcode.rule'
def _get_type_selection(self):
types = sets.Set(super(barcode_rule, self)._get_type_selection())
types.update([
... | {
"content_hash": "5ee1cb49c1fdd9e908e810908d250bdf",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 163,
"avg_line_length": 46.73913043478261,
"alnum_prop": 0.622093023255814,
"repo_name": "vileopratama/vitech",
"id": "fb5b52d01d039de0bff518cea7876a94061e1f44",
"size": "4... |
from sys import argv, stdout
from os import SEEK_END, SEEK_CUR, SEEK_SET
from struct import pack, unpack
from array import array
from cStringIO import StringIO
def bits(byte):
return ((byte >> 7) & 1,
(byte >> 6) & 1,
(byte >> 5) & 1,
(byte >> 4) & 1,
(byte >> 3) & 1... | {
"content_hash": "5dee6d61f9dc5289e1c7e06620629531",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 69,
"avg_line_length": 24.84,
"alnum_prop": 0.5209339774557166,
"repo_name": "magical/nlzss",
"id": "6c12dd14ef665e4b6e1ed1c790fc186ce30453ae",
"size": "2508",
"binary":... |
import socket
from pysnmp.carrier.base import AbstractTransportAddress
from pysnmp.carrier.asyncio.dgram.base import DgramAsyncioProtocol
from pysnmp.carrier import error
try:
import asyncio
except ImportError:
import trollius as asyncio
loop = asyncio.get_event_loop()
domainName = snmpUDPDomain = (1, 3, 6, 1... | {
"content_hash": "6c3415c43bd27109247b5b7496aa465f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 66,
"avg_line_length": 27.65,
"alnum_prop": 0.8010849909584087,
"repo_name": "imron/scalyr-agent-2",
"id": "653c83c40e1c5a781ccd1fb0f41e4a56ed6be538",
"size": "1979",
"bi... |
from __future__ import unicode_literals
import pytest
import simple_graph
@pytest.fixture(scope="function")
def create_graph():
new_graph = simple_graph.G()
return new_graph
@pytest.fixture(scope="function")
def build_graph(create_graph):
jerry = simple_graph.Node('Jerry', 5)
allen = simple_graph.No... | {
"content_hash": "0a6af4b1d5a39894043b9fd384bc69ad",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 83,
"avg_line_length": 32.56666666666667,
"alnum_prop": 0.6811668372569089,
"repo_name": "jesseklein406/data-structures",
"id": "012daef37098227d2a998458dfcf369d90116361",
... |
import os
import argparse
import sys
# argparse for information
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--dir", help="input directory with files (will iterate over all files)")
parser.add_argument("-l", "--list", help="list of files to purge")
args = parser.parse_args()
# sanity check
if not l... | {
"content_hash": "db691f73ffe59ffe5a8c931cf950b55e",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 120,
"avg_line_length": 25.818181818181817,
"alnum_prop": 0.5845070422535211,
"repo_name": "Twinstar2/Python_Master_scripts",
"id": "e4ec734cda17c67852e2307e4285c444be4a14e5"... |
from .settings import * # noqa
# Settings meant to run the test suite with Django’s development server, for integration tests.
DEBUG = True
DATABASES["default"]["NAME"] = "ui_tests.db" # noqa
INSTALLED_APPS += [ # noqa
"pattern_library",
]
TEMPLATES[0]["OPTIONS"]["builtins"] = ["pattern_library.loader_tags"]... | {
"content_hash": "43058712482c18b2be8ac5dbbe2369d8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 95,
"avg_line_length": 34.30434782608695,
"alnum_prop": 0.6831432192648923,
"repo_name": "rsalmaso/wagtail",
"id": "12bf4849c3402fa9381a2378a960aac008d4a0b5",
"size": "791"... |
import json
import responses
from conftest import Mock
from upcloud_api import Tag
def tag_post_callback(request):
print(request.body)
request_body = json.loads(request.body)
if 'name' not in request_body['tag']:
raise Exception('required field missing')
if 'servers' in request_body['tag']... | {
"content_hash": "e9062c3772906aa2b321f4f4fc3f2cb1",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 98,
"avg_line_length": 32.66129032258065,
"alnum_prop": 0.5958024691358025,
"repo_name": "UpCloudLtd/upcloud-python-api",
"id": "538876f966cbbf4dbb411e13b396fd08d66b077e",
... |
from django.contrib import admin
from .models import Grill, GrillComment, GrillCommentVote
# Register your models here.
admin.site.register(Grill)
admin.site.register(GrillComment)
admin.site.register(GrillCommentVote)
| {
"content_hash": "ddd1def92f538d7501c428a8987eeab2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 57,
"avg_line_length": 31.428571428571427,
"alnum_prop": 0.8318181818181818,
"repo_name": "sparcs-kaist/araplus",
"id": "974b5e728b58cdb174648359b6145c97b5aff80c",
"size": "... |
import os
import time
import memory
from generic import obj
from project_base import Pobj
from simulation import Simulation
def trivial(sim,*args,**kwargs):
None
#end def trivial
class ProjectManager(Pobj):
def __init__(self):
#variables determined by self
modes = self.modes
self.per... | {
"content_hash": "2a38b29b4432b17e8849a2c0a79e9abd",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 119,
"avg_line_length": 35.607669616519175,
"alnum_prop": 0.5198409410985005,
"repo_name": "habanero-rice/hcpp",
"id": "ca3a7e34b32119d77b05d686829fc3c60640c283",
"size": ... |
import logging
from typing import Tuple, Union
import anndata
import numba
import numpy as np
import pandas as pd
import scipy.sparse as sp_sparse
logger = logging.getLogger(__name__)
def _compute_library_size(
data: Union[sp_sparse.spmatrix, np.ndarray]
) -> Tuple[np.ndarray, np.ndarray]:
sum_counts = data... | {
"content_hash": "d275ac46534460588baec5719223794a",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 98,
"avg_line_length": 35.5,
"alnum_prop": 0.6356156742434806,
"repo_name": "YosefLab/scVI",
"id": "0a38a763ed715ec14e8291d02b00e92ef6debf2d",
"size": "7171",
"binary": ... |
"""
Main function registry for Sharrock.
"""
from django.conf import settings
from django.template.defaultfilters import slugify
import inspect
import os.path
descriptor_registry = {}
resource_registry = {}
def get_module(module_name):
"""
Imports and returns the named module.
"""
module = __import__(... | {
"content_hash": "4112656851c298f2dd5ed796c01f5187",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 165,
"avg_line_length": 35.72868217054263,
"alnum_prop": 0.6378824039921892,
"repo_name": "Axilent/sharrock",
"id": "a031a8a1c5e339a270310c9a5bfdf8cb18ace881",
"size": "46... |
"""Pytest configuration."""
from __future__ import absolute_import, print_function
import os
import shutil
import tempfile
from os.path import dirname, join
import pytest
from elasticsearch.exceptions import RequestError
from flask import Flask
from flask.cli import ScriptInfo
from flask_login import LoginManager
fr... | {
"content_hash": "a1ab72225222a9fbf99510424b2e9d0a",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 77,
"avg_line_length": 28.80921052631579,
"alnum_prop": 0.6921671614523864,
"repo_name": "inveniosoftware/invenio-openaire",
"id": "ddeab0e8383198efbe4e4eb6275157c1e1c67c43"... |
"""The tests for the MQTT statestream component."""
import homeassistant.components.mqtt_statestream as statestream
from homeassistant.core import State
from homeassistant.setup import async_setup_component
from tests.async_mock import ANY, call
from tests.common import mock_state_change_event
async def add_statestr... | {
"content_hash": "345de17f19f53a06a6b06b5fd398104c",
"timestamp": "",
"source": "github",
"line_count": 535,
"max_line_length": 88,
"avg_line_length": 37.183177570093456,
"alnum_prop": 0.6926054390991806,
"repo_name": "tboyce1/home-assistant",
"id": "cea4b492f3ed1bacc3a0f22366f7a833445a5b83",
"size... |
import argparse as ap
import numpy as np
import pandas as pd
import os
import pkg_resources
from sklearn.linear_model import LogisticRegressionCV
from sklearn.model_selection import train_test_split
from itertools import chain
from sklearn.metrics import f1_score
from sklearn import preprocessing
from sklearn.externa... | {
"content_hash": "d4734a29967b5fad190664e1f78f750d",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 75,
"avg_line_length": 28.504065040650406,
"alnum_prop": 0.5633200228180263,
"repo_name": "kahnjw/wincast",
"id": "7cd0dd966d945464b12f6cd71cb4c16f5b9b59b1",
"size": "3506... |
"""
Entry point
"""
from repl import Repl
def run():
Repl().loop()
| {
"content_hash": "afb58a5310fd428ed260591e4765e30c",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 21,
"avg_line_length": 9.125,
"alnum_prop": 0.5753424657534246,
"repo_name": "thuo/bc-6-matlabette",
"id": "dc56ec7e00c52f968527081298a92d9c09ed9bfc",
"size": "73",
"binar... |
"""The test service unit tests."""
from __future__ import print_function
import contextlib
import os
import shutil
import mock
from chromite.api.gen.chromiumos import common_pb2
from chromite.cbuildbot import commands
from chromite.cbuildbot import goma_util
from chromite.lib import build_target_lib
from chromite.l... | {
"content_hash": "38480257542d39157109352c264e7aba",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 80,
"avg_line_length": 38.162393162393165,
"alnum_prop": 0.6809257185516984,
"repo_name": "endlessm/chromium-browser",
"id": "187c21ce9b75c78832de98dc590e374a64321a08",
"s... |
import datetime
import logging
from django.conf import settings
from common import api
from common import clock
from common import exception
from common import throttle
from common.test import base
from common.test import util as test_util
class ThrottleTest(base.FixturesTestCase):
def setUp(self):
super(Throt... | {
"content_hash": "695a4a7faaac07a89dd38b37e708d515",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 65,
"avg_line_length": 27.146341463414632,
"alnum_prop": 0.7178796046720575,
"repo_name": "CollabQ/CollabQ",
"id": "e34728bdb4ba9de409c68a849168c7dcf875e1ba",
"size": "1729... |
import os.path
import sys
ROOT = os.path.dirname(os.path.realpath(__file__))
# ******
# Admins
# ******
ADMINS = (
('Foo Bar', 'foobar@sogetthis.com'),
)
MANAGERS = ADMINS
# ****
# Time
# ****
TIME_ZONE = 'America/Chicago'
USE_TZ = False
DATETIME_FORMAT = 'd F, Y H:i'
DATE_FORMAT = 'd F, Y'
# ****
# I18N
# *... | {
"content_hash": "a80fb800e84c11fd6cc7f2b01798c55e",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 81,
"avg_line_length": 21.375,
"alnum_prop": 0.5680580762250453,
"repo_name": "feedzilla/feedzilla",
"id": "06a34eeddfbd909798b56bd63b2b3020cadcb735",
"size": "5035",
"b... |
from abc import ABCMeta, abstractmethod
import typing
class Core(metaclass=ABCMeta):
@abstractmethod
def get_keys(self) -> typing.List[str]:
pass
@abstractmethod
def get_modifiers(self) -> typing.List[str]:
pass
| {
"content_hash": "0f8cbfbac234e44109518dd931031464",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 48,
"avg_line_length": 20.583333333333332,
"alnum_prop": 0.6720647773279352,
"repo_name": "flacjacket/qtile",
"id": "71d262f35c243d34bf28b4d9faec2f9d4b3dc6f3",
"size": "247... |
import os.path
from xmloutput import XMLOutput
def handleFile(o, fullname):
with o.scope('p'):
with o.scope('b'):
o << fullname
o.endl()
with o.scope('pre'):
o << '# Copyright (c) 2010 Nicholas Bray'
o.endl()
o.endl()
for line in open(fullname):
o << line.rstrip()
o.endl()
o = open("crunch.ht... | {
"content_hash": "1ee37f8411502cf4752a4dcbfaa9411d",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 43,
"avg_line_length": 18.29032258064516,
"alnum_prop": 0.5978835978835979,
"repo_name": "ncbray/pystream",
"id": "0229661dd28a7210b133271d86107505def5b485",
"size": "1145"... |
import os
'''
db_stewart_connect = {
"host": "127.0.0.1",
"user": "pg8000-test",
"database": "pg8000-test",
"password": "pg8000-test",
"socket_timeout": 5,
"ssl": False}
db_local_connect = {
"unix_sock": "/tmp/.s.PGSQL.5432",
"user": "mfenniak"}
db_local_win_connect = {
"host": "l... | {
"content_hash": "7577c766d0737268b0a354be16918e04",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 79,
"avg_line_length": 23.710526315789473,
"alnum_prop": 0.5982241953385128,
"repo_name": "kaniini/pg8000",
"id": "92d27b92e8ad08fa41b9cde3b44c4179c0f2e584",
"size": "901",... |
from kafkatest.services.zookeeper import ZookeeperService
from kafkatest.services.kafka import KafkaService
from kafkatest.services.console_consumer import ConsoleConsumer
from kafkatest.services.verifiable_producer import VerifiableProducer
from kafkatest.services.transactional_message_copier import TransactionalMessa... | {
"content_hash": "5443f250165b7425dc73a3647bdaeb0f",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 151,
"avg_line_length": 49.05384615384615,
"alnum_prop": 0.5860122314567978,
"repo_name": "sslavic/kafka",
"id": "2889f84687481776b5e52f6bd77be000b00ef743",
"size": "13535... |
"django-taggable"
from taggable import signals
__version__ = '0.01'
signals.register()
del signals
| {
"content_hash": "75efd99dcc7bd16e8ef2535c5ac8710a",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 28,
"avg_line_length": 12.75,
"alnum_prop": 0.7254901960784313,
"repo_name": "tabo/django-taggable",
"id": "d2449c38d9d00f5d7a00858b70a63a594284843d",
"size": "102",
"bina... |
import pytest
import sklearn.datasets as datasets
import sklearn.covariance as covariance
import pandas_ml as pdml
import pandas_ml.util.testing as tm
class TestCovariance(tm.TestCase):
def test_objectmapper(self):
df = pdml.ModelFrame([])
self.assertIs(df.covariance.EmpiricalCovar... | {
"content_hash": "2666ed37fcea470fd5f4c8970b00c904",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 88,
"avg_line_length": 38.95,
"alnum_prop": 0.6729781771501926,
"repo_name": "sinhrks/expandas",
"id": "9dd99212292e018d09131c8846673e1992739bfa",
"size": "3139",
"binary... |
"""
Query message
In the simple query protocol, the frontend sends a Query message, which contains
an SQL command (or commands) expressed as a text string. The backend then sends
one or more response messages depending on the contents of the query command
string, and finally a ReadyForQuery message.
"""
from __future... | {
"content_hash": "fa89a85f539a046311a18e7539174734",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 80,
"avg_line_length": 29.074074074074073,
"alnum_prop": 0.710828025477707,
"repo_name": "uber/vertica-python",
"id": "29b9aa71267eb8aaa93e53d5587ea3dae1055863",
"size": "2... |
'''
ComputationalArt.py
John Bozzella
'''
from random import choice
import numpy.random as npr
from math import *
from PIL import Image
def blockrecurse(depth, blocks, parameters):
"""
Choose a random function block from the list of blocks, if depth greater than one, recurse and start again
"""
if depth == 1:
... | {
"content_hash": "b26a7373fefc81c8dbd8f099f2b42505",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 111,
"avg_line_length": 33.37234042553192,
"alnum_prop": 0.6742110296461588,
"repo_name": "bozzellaj/SoftwareDesignFall15",
"id": "3bd1c15cbe0f87429e60e5dfa6d9436ba9a647ab",
... |
"""
alfred.helpers
~~~~~~~~~~~~~~
Model validation helpers mostly.
"""
import ipaddress
from bson.errors import InvalidId
from bson.objectid import ObjectId
def is_object_id(val):
"""Tries to determine if the given value is a Mongo ObjectId"""
try:
ObjectId(val)
return True
exc... | {
"content_hash": "2752f01757c93812f1b24136ad1e51a8",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 67,
"avg_line_length": 22.88,
"alnum_prop": 0.6416083916083916,
"repo_name": "vktr/alfred",
"id": "128ecd34e3950427f899d4ca1a2667d926bf82af",
"size": "572",
"binary": fal... |
"""BlameThrower modules for reading the output of version control system
"blame" (or "annotate") commands."""
__all__ = ['git', 'hg']
if __debug__:
def _check_reporeader_output(files_authors):
"""Validate the output from a reporeader `analyze` function and pass it through."""
for filename, authorl... | {
"content_hash": "183e962f10d6effa19237c4376631804",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 91,
"avg_line_length": 40.23529411764706,
"alnum_prop": 0.6578947368421053,
"repo_name": "jkleint/blamethrower",
"id": "2cafca1f7bed24409be6f1547a50c278a9bac06a",
"size": "... |
"""
Interface to the accounts table. Data format is dicts, not objects.
"""
from anchore_engine.configuration.localconfig import ADMIN_ACCOUNT_NAME
from anchore_engine.db import Account, AccountStates, AccountTypes
from anchore_engine.db.entities.common import anchore_now
class AccountNotFoundError(Exception):
de... | {
"content_hash": "67eff1f1f639e727feb166f577dcc6a5",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 105,
"avg_line_length": 29.38888888888889,
"alnum_prop": 0.6559546313799622,
"repo_name": "anchore/anchore-engine",
"id": "a94c86ad346b1f082503360b6dc24c0a253479c7",
"size... |
"""
sentry.utils.http
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import six
import urllib
from collections import namedtuple
from urlparse import urlparse, urljoin
from ipaddr im... | {
"content_hash": "fb0c58c8bf6113dc873c54d85d7aea6d",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 101,
"avg_line_length": 27.256830601092897,
"alnum_prop": 0.6138732959101845,
"repo_name": "imankulov/sentry",
"id": "8c47c2729d4ae62a65c5f95a8d17be8c46a1f90c",
"size": "4... |
#
# Pyrex - Parse tree nodes
#
import string, sys
import Code
from Errors import error, one_time_warning, InternalError
import Naming
import PyrexTypes
from PyrexTypes import py_object_type, c_int_type, error_type, \
CTypedefType, CFuncType
from Symtab import ModuleScope, LocalScope, \
StructOrUnionScope, P... | {
"content_hash": "054afb5a9c228028c77e46f48943dab5",
"timestamp": "",
"source": "github",
"line_count": 3249,
"max_line_length": 121,
"avg_line_length": 35.02431517389966,
"alnum_prop": 0.548543859957467,
"repo_name": "Distrotech/Pyrex",
"id": "fb974df0b300740a1493d9578a786194560a435b",
"size": "11... |
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.contrib.sessions.backends.db import SessionStore
#App imports
from .. import user_successfully_created_msg, referrer_url_session_key, referring_user_id_session_key
from ..models import ... | {
"content_hash": "abdb37c6e7766b75c817aad7e9f526ea",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 134,
"avg_line_length": 35.6036866359447,
"alnum_prop": 0.7312969194926223,
"repo_name": "elricgit/django-social-launch",
"id": "52007d4b7eb014b60c4469384c473c38f1c6535b",
... |
from __future__ import division, absolute_import, print_function
import collections
import enum
import math
import os
import signal
import six
import subprocess
import sys
import warnings
from multiprocessing.pool import ThreadPool, RUN
from six.moves import zip, queue
from threading import Thread, Event
from beets i... | {
"content_hash": "a513141601df05e3a561dd550c27f2d3",
"timestamp": "",
"source": "github",
"line_count": 1374,
"max_line_length": 79,
"avg_line_length": 36.1863173216885,
"alnum_prop": 0.5532984714400644,
"repo_name": "shamangeorge/beets",
"id": "5060c8efe7e0e5ac14713f26ab6e17e46ebd8939",
"size": "5... |
"""Utilities for configuring platform specific installation."""
import os
import re
import shutil
from googlecloudsdk.core.util import platforms
from googlecloudsdk.core.console import console_io
from googlecloudsdk.core.credentials import gce as c_gce
# pylint:disable=superfluous-parens
# pylint:disable=unused-a... | {
"content_hash": "888c4c045e1fb8cd8e1c8e9e35f0e04d",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 79,
"avg_line_length": 32.47386759581882,
"alnum_prop": 0.6606223175965665,
"repo_name": "wemanuel/smry",
"id": "6bceea6635b175f7069a99069355b1ed6e330263",
"size": "9371",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.