text stringlengths 4 1.02M | meta dict |
|---|---|
"""
default resource
"""
from zunzuncito import tools
class APIResource(object):
def dispatch(self, request, response):
request.log.debug(tools.log_json({
'API': request.version,
'URI': request.URI,
'method': request.method,
'vroot': request.vroot
... | {
"content_hash": "8e0457977580720b6395ca8fdbd6a4a7",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 42,
"avg_line_length": 19.72222222222222,
"alnum_prop": 0.5605633802816902,
"repo_name": "nbari/zunzuncito",
"id": "7855e35b9e14eab754dc43d291489e14aeda4120",
"size": "355"... |
"""
This module contains routines for calculating and modelling the
flight times of different airline flights to the same
destinations.
Contains routines to answer the following questions:
-Do different airlines have the same travel times to the
same locations?
"""
import numpy as np
import matplotlib.pyplot... | {
"content_hash": "83200f7b7f8cbe3d0de37f0e67b2e1ff",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 75,
"avg_line_length": 30.28723404255319,
"alnum_prop": 0.5900948366701791,
"repo_name": "jrentsch/2015_flight_analysis",
"id": "8fdcd77bfee9bcea5adbf7ec4d0442bc8f5af5d5",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import multiselectfield.db.fields
class Migration(migrations.Migration):
dependencies = [
('initiatives', '0026_auto_20201112_1519'),
]
operations = [
migrations.AddField(
model_name='initiative... | {
"content_hash": "3865b57a18a0599ce3b7b8008bae2bf6",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 209,
"avg_line_length": 33,
"alnum_prop": 0.6464646464646465,
"repo_name": "onepercentclub/bluebottle",
"id": "28989dbd424f8d201eb47592ab7a98f33f382f1a",
"size": "866",
"... |
import urllib
from tempest.common import service_client
class DatabaseVersionsClientJSON(service_client.ServiceClient):
def __init__(self, auth_provider, service, region,
endpoint_type=None, build_interval=None, build_timeout=None,
disable_ssl_certificate_validation=None, ca_ce... | {
"content_hash": "fb1920506c4de1b9b6d49cdeef9b3a1c",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 77,
"avg_line_length": 36.32258064516129,
"alnum_prop": 0.6225577264653641,
"repo_name": "rzarzynski/tempest",
"id": "aa2fef7c9fa5a9a44251a3366e15d391c6473ee2",
"size": "17... |
import sys
if sys.version_info < (3, 5, 2):
raise SystemExit('ERROR: Tried to install Meson with an unsupported Python version: \n{}'
'\nMeson requires Python 3.5.2 or greater'.format(sys.version))
from mesonbuild.coredata import version
from setuptools import setup
# On windows, will create... | {
"content_hash": "b11f392880c2dd0f8cd4526beec475fc",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 108,
"avg_line_length": 37,
"alnum_prop": 0.6216216216216216,
"repo_name": "becm/meson",
"id": "1f95be70c84f9b6ebe3eb2862329dc945757f75e",
"size": "2092",
"binary": false... |
import re
import warnings
from itertools import chain
from django.core.exceptions import FieldError
from django.db.models.constants import LOOKUP_SEP
from django.db.models.expressions import OrderBy, Random, RawSQL, Ref
from django.db.models.query_utils import QueryWrapper, select_related_descend
from django.db.models... | {
"content_hash": "46b918c6e65c26e333bed9b955052495",
"timestamp": "",
"source": "github",
"line_count": 1152,
"max_line_length": 98,
"avg_line_length": 43.322048611111114,
"alnum_prop": 0.5623660007614162,
"repo_name": "ecrespo/django_kanban-agile",
"id": "810031f47ef59001d7fcbf500a49215568347d9f",
... |
"""
A parser for Purple programs.
The result is a parse object that can return a (recursive) relational algebra
expression.
"""
from pyparsing import Literal, CaselessLiteral, Word, delimitedList, \
Optional, Combine, Group, alphas, nums, alphanums, oneOf, quotedString, \
ZeroOrMore, restOfLine
import raco
f... | {
"content_hash": "31cd4420fc380f9b1f05878a1cc8e3d1",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 91,
"avg_line_length": 28.65193370165746,
"alnum_prop": 0.6629386810644041,
"repo_name": "uwescience/raco",
"id": "06f95a123cdd144e2b91f41f277f8a82d08a2956",
"size": "5186... |
from __future__ import (absolute_import, division, print_function)
from ansible.errors import AnsibleError
__metaclass__ = type
try:
from ansible.plugins.terminal import NetconfBase
"""
Examples:
https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/netconf/iosxr.py
... | {
"content_hash": "3963da0d6e493841cf95e6d4983fae12",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 97,
"avg_line_length": 39.59090909090909,
"alnum_prop": 0.7060849598163031,
"repo_name": "mantti/fgci-tut",
"id": "2ef95cd392dd88badf487599aaeba4de91953636",
"size": "1553"... |
"""Tests for ops which manipulate lists of tensors."""
# pylint: disable=g-bad-name
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np # pylint: disable=unused-import
from tensorflow.python.client import session
from tensorflow.python.eage... | {
"content_hash": "cdc261493626e0be99c10072075b0d18",
"timestamp": "",
"source": "github",
"line_count": 504,
"max_line_length": 80,
"avg_line_length": 42.6031746031746,
"alnum_prop": 0.6276080476900149,
"repo_name": "AnishShah/tensorflow",
"id": "0f5607712b7c87e163f7d29c229cdbedc8fa6d0e",
"size": "... |
"""
Unit tests for the salt.pillar.nacl module
"""
import salt.pillar.nacl
from tests.support.mock import patch
def test_fips_mode():
"""
Nacl pillar doesn't load when fips_mode is True
"""
opts = {"fips_mode": True}
with patch("salt.pillar.nacl.__opts__", opts, create=True):
ret = sa... | {
"content_hash": "6b6246f6e99012c5561d4892e47c3118",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 76,
"avg_line_length": 26.625,
"alnum_prop": 0.6338028169014085,
"repo_name": "saltstack/salt",
"id": "e71988baf9b31dcc62c03623f14a87a7d489cd0d",
"size": "426",
"binary":... |
"""
jinja2.compiler
~~~~~~~~~~~~~~~
Compiles nodes into python code.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from itertools import chain
from copy import deepcopy
from keyword import iskeyword as is_python_keyword
from jinja2 import node... | {
"content_hash": "12254e13d908b5a62d60fb8aeb536442",
"timestamp": "",
"source": "github",
"line_count": 1685,
"max_line_length": 87,
"avg_line_length": 38.87655786350148,
"alnum_prop": 0.5457737341047522,
"repo_name": "fancasy/final",
"id": "5dcb42f81e4a20ebda5dd5d3a1b48731d2328d0e",
"size": "65532... |
import argparse
import os
import sys
import shutil as st
from lib.textgrid import TextGrid
from lib import utils
def neg_vot_creator(audio_path, textgrid_path, output_path, l):
# defines
tmp_dir = 'tmp/'
tmp_input = tmp_dir + 'tmp.input'
tmp_label = tmp_dir + 'tmp.labels'
label_suffix = '.labels'
... | {
"content_hash": "1b80a1360041055093db32ed58a0073c",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 123,
"avg_line_length": 38.48913043478261,
"alnum_prop": 0.5272521886472747,
"repo_name": "adiyoss/DeepVOT",
"id": "69f059109ba800510b9504d53b52194700ddd33a",
"size": "3541... |
from rand import adapted_rand
import numpy as np
import yaml
from tifffile import imread
import sys
def run(config):
image_path, labels_path, raw_path = config['SAVE_PRED'], config['LABELS_DENSE'], config['DATA']
seg, labels, raw = imread(image_path)[2:12], imread(labels_path)[-16:-6], imread(raw_path)[-16:-6,... | {
"content_hash": "8b9400aad80cc2dae8f92a40e98ee0f8",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 108,
"avg_line_length": 35.23529411764706,
"alnum_prop": 0.6444073455759599,
"repo_name": "jwohlwend/Flood-Filling-Networks",
"id": "568fcef68daa0bee812f326c8632150d5e6c3834"... |
"""
extracty.server -- HTTP interface to extracty
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import urlparse
import logging
try:
import simplejson as json
except ImportError:
import json
from . import extract
from .utils import fetch_url
__all__ = ('application',)
# TODO: remove me
logging.... | {
"content_hash": "0fbda8bea656fe80f7957487bc45f03c",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 75,
"avg_line_length": 25.52112676056338,
"alnum_prop": 0.5634657836644592,
"repo_name": "andreypopp/extracty",
"id": "676181ff9bd3e077780f6dc1d4c10faa9de53e95",
"size": "1... |
import argparse
import asyncio
import logging
import math
import time
from collections import namedtuple
from pathlib import Path
from struct import pack, calcsize
from typing import Awaitable, List, Tuple
import aiohttp
import humanize
from aiohttp.formdata import FormData
from jinja2 import Environment, FileSyste... | {
"content_hash": "35d579d09c6b0517cebdbd03b50e5570",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 85,
"avg_line_length": 26.46005509641873,
"alnum_prop": 0.6064549713690786,
"repo_name": "IL2HorusTeam/il2-heightmap-creator",
"id": "da262d06a7203666aa52470fcb99b55e97ecb13... |
import sys
# Clear possible previous mock... there has to be better way
sys.modules.pop('atrium.requester', '')
from mock import MagicMock
requestsMock = sys.modules['requests'] = MagicMock(spec=[
'get',
'post',
'put',
'delete',
'exceptions'
])
from atrium.requester import request
from atrium.erro... | {
"content_hash": "9ccbff48cb7dbebd9b9568bca72ab1ce",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 75,
"avg_line_length": 24.305785123966942,
"alnum_prop": 0.6229173750425026,
"repo_name": "phantomxc/pytrium",
"id": "4cb5d02cca87c698ba8c640df42f317bd1f7f4bf",
"size": "2... |
"""
Custom widgets for Allusive
"""
##########################################################################
## Imports
##########################################################################
from .frame import *
from .text import *
| {
"content_hash": "971bd4809db09a92965ec3c5d8785137",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 74,
"avg_line_length": 24,
"alnum_prop": 0.25,
"repo_name": "bbengfort/allusive-editor",
"id": "4d07c6db53283481bc83219b64712b614f26b179",
"size": "515",
"binary": false,... |
import datetime
import importlib
import logging
import os
import platform
import socket
import sys
import pikka_bird_collector
from .config import Config
COLLECTORS = [
'system', # keep first; sort rest
'mongodb',
'mysql',
'postgresql',
'rabbitmq',
'redis']
COLLECTORS_MODULE_P = 'pikka_bird_... | {
"content_hash": "a3009916526276245239a18d3894b2b7",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 85,
"avg_line_length": 31,
"alnum_prop": 0.5440638510143,
"repo_name": "tiredpixel/pikka-bird-collector-py",
"id": "bbc37378d583057e324abfde45264ae1fa219795",
"size": "3007... |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('primer.comments.views',
##
# prefix: comments
#
url(r'^load/$', 'load', name='comments-load'),
url(r'^post/$', 'post', name='comments-post'),
url(r'^delete/$', 'delete', name='comments-delete'),
url(r'^like/$', 'like'... | {
"content_hash": "95f1a5c95c59fa6e1263ce2875a6a961",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 56,
"avg_line_length": 26.692307692307693,
"alnum_prop": 0.6109510086455331,
"repo_name": "jamesmfriedman/django-primer",
"id": "5f27f3cf57b246783e491dd91cb3ef275a70559d",
... |
import unittest
from day08 import Screen
class TestInitializingScreen(unittest.TestCase):
def test_inits_screen(self):
screen = Screen(3, 5)
self.assertEqual(len(screen.data), 3)
self.assertEqual(len(screen.data[0]), 5)
class TestParsingCommands(unittest.TestCase):
cases = (
... | {
"content_hash": "911f982557fc8df50a7abbd2ee647cd6",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 67,
"avg_line_length": 32.17857142857143,
"alnum_prop": 0.5508694043655198,
"repo_name": "mpirnat/aoc2016",
"id": "2d1907a50aad051fb2ebe051e2ad3b083a8007b1",
"size": "2726"... |
"""\
pytest_watch.command
~~~~~~~~~~~~~~~~~~~~
Implements the command-line interface for pytest-watch.
All positional arguments after `--` are passed directly to py.test executable.
Usage:
ptw [options] [<directories>...] [-- <args>...]
Options:
-h --help Show this help.
--version Show versio... | {
"content_hash": "563fb4343456ab7175b060c5bccc7516",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 33.736111111111114,
"alnum_prop": 0.569781803211198,
"repo_name": "blueyed/pytest-watch",
"id": "fd44622b242f44f4d1508dc483e3e781f588586c",
"size": "... |
"""Generate template values for attributes.
Extends IdlType with property |constructor_type_name|.
Design doc: http://www.chromium.org/developers/design-documents/idl-compiler
"""
import idl_types
import dart_types
from dart_utilities import DartUtilities
from v8_globals import interfaces
import v8_attributes
def... | {
"content_hash": "cebeab213bb23c3e141c4dc639f0faee",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 112,
"avg_line_length": 42.2520325203252,
"alnum_prop": 0.6245911102559168,
"repo_name": "takaaptech/sky_engine",
"id": "8ed32c07982d30227af5af0f66d9bb3d49a7dde6",
"size":... |
"""
New Tab Extension for Python-Markdown
=====================================
Modify the behavior of Links in Python-Markdown to open a in a new
window. This changes the HTML output to add target="_blank" to all
generated links.
"""
import markdown
from markdown.inlinepatterns import \
LinkPattern, ReferencePatt... | {
"content_hash": "92ac67a011567e0bc547044fbad4d556",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 87,
"avg_line_length": 28.962264150943398,
"alnum_prop": 0.701628664495114,
"repo_name": "dataquestio/Python-Markdown",
"id": "9cea03864b8a9b70ff580d589f0d811fcc0bb438",
"s... |
from tornado.ioloop import IOLoop
from tornado.web import RequestHandler, Application, url
from tornado import log
import logging
import Filter
import Settings
import Cache
import os
import json
import Log
import time
class MainHandler(RequestHandler):
def get(self):
self.write("FeedFilter")
class Filte... | {
"content_hash": "b7d683f6af345fee6c2c3bc43ba141e0",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 96,
"avg_line_length": 31.240384615384617,
"alnum_prop": 0.6509695290858726,
"repo_name": "Yustos/FeedFilter",
"id": "d4e5432fe1fd7a0577109164babe916c33569102",
"size": "3... |
import types
from StringIO import StringIO
from validator.contextgenerator import ContextGenerator
try:
from html.parser import HTMLParser, HTMLParseError
except ImportError:
from HTMLParser import HTMLParser, HTMLParseError
class DTDParser(object):
'Parses and serializes DTD files. This is useful for L1... | {
"content_hash": "89a9ea921c261c256a4717099fa15c0d",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 75,
"avg_line_length": 30.091954022988507,
"alnum_prop": 0.5626432391138273,
"repo_name": "kumar303/amo-validator",
"id": "864e8ae9481e10ba0a427c9c6f52c885d511444b",
"size"... |
# Tools for managing the processing of SGD files
import MySQLdb
import sys, string
import Config
class ModelOrganisms( ) :
def __init__( self, db, cursor ) :
self.db = db
self.cursor = cursor
def buildSGDIDHash( self ) :
self.cursor.execute( "SELECT gene_id, gene_external_value FROM " + C... | {
"content_hash": "d894e6c64da98a2e91f73b97a8168ed9",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 231,
"avg_line_length": 42.71653543307087,
"alnum_prop": 0.6425806451612903,
"repo_name": "starkfree/BioGRID-Annotation",
"id": "95bc022b47aa6c36308ecc730ad8070c925e9a0b",
... |
"""Test the RPC HTTP basics."""
import http.client
import urllib.parse
from test_framework.test_framework import PivxTestFramework
from test_framework.util import assert_equal, str_to_b64str
class HTTPBasicsTest (PivxTestFramework):
def set_test_params(self):
self.num_nodes = 3
def setup_network(se... | {
"content_hash": "8946a568c33cff0e17eeca1e95a250ef",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 111,
"avg_line_length": 44.00952380952381,
"alnum_prop": 0.6215104955637308,
"repo_name": "PIVX-Project/PIVX",
"id": "660c786f6cd34f1cfdaa46405ec5f79cc1ac61c9",
"size": "4... |
from .websocket_server import *
| {
"content_hash": "737aa2296b1a0d27530494a1a9cff0f4",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 31,
"avg_line_length": 33,
"alnum_prop": 0.7575757575757576,
"repo_name": "ijonglin/WsJsPy",
"id": "4651755d63900b43a25b3c30b1e1651fadd81411",
"size": "33",
"binary": fals... |
import os
import sys
# import source code dir
here = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, here)
sys.path.insert(0, os.path.join(here, os.pardir))
SITE_ID = 300
DEBUG = True
ROOT_URLCONF = 'tests.urls'
SECRET_KEY = 'skskqlqlaskdsd'
AUTOCOMMIT = True
DATABASES = {
'default': {
'... | {
"content_hash": "14af57924482e02a0e2c2ad63393e606",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 96,
"avg_line_length": 18.724137931034484,
"alnum_prop": 0.6261510128913443,
"repo_name": "robinedwards/django-neomodel",
"id": "171c81bc470b41dc45e18715471214cefd1dfb34",
... |
"""Tracing metaclass.
XXX This is very much a work in progress.
"""
import sys
class TraceMetaClass:
"""Metaclass for tracing.
Classes defined using this metaclass have an automatic tracing
feature -- by setting the __trace_output__ instance (or class)
variable to a file object, trace messages abou... | {
"content_hash": "a453e64080d208c8b47a2ccf540c190d",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 79,
"avg_line_length": 30.47517730496454,
"alnum_prop": 0.5310681871072842,
"repo_name": "jim-cooley/abletonremotescripts",
"id": "998290f8429fb3aa299410eecb4dfd1b0e90cd6b",... |
import datetime
from math import sin, cos, pi
from volttron.platform.vip.agent import Agent, RPC, Core
from volttron.platform.agent import utils
# The 'connector' api doesn't come with a nice
# way to install itself so we have it added
# as a subtree here. Hopefully this will
# change in the future.
import sys
sys.pat... | {
"content_hash": "7096d57dae406c7aae7082f6d3f5cffe",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 72,
"avg_line_length": 30.976190476190474,
"alnum_prop": 0.5962080450935178,
"repo_name": "schandrika/volttron",
"id": "292eabbcfbdc8c81faab8e77308159522acfe1a1",
"size": ... |
from instapy_cli import client
username = 'USERNAME'
password = 'PASSWORD'
cookie = '{COOKIE_STRING_JSON_OBJ}'
with client(username, password, cookie=cookie) as cli:
# get string cookies
cookies = cli.get_cookie()
print(type(cookies)) # == str
print(cookies)
# do stuffs with cli
ig = cli.api()... | {
"content_hash": "9a0559e632a5681013a6db9c95ad1335",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 54,
"avg_line_length": 24.133333333333333,
"alnum_prop": 0.6546961325966851,
"repo_name": "b3nab/instapy-cli",
"id": "21faf816c34715986817277a89f48ebf0089d720",
"size": "36... |
import json
import logging
import math
import re
import tba_config
import urllib
from difflib import SequenceMatcher
from google.appengine.api import memcache, urlfetch
from google.appengine.ext import ndb
from models.location import Location
from models.sitevar import Sitevar
from models.team import Team
class Loc... | {
"content_hash": "8edc3227161d19bd1dd303ce9da0851c",
"timestamp": "",
"source": "github",
"line_count": 574,
"max_line_length": 137,
"avg_line_length": 43.254355400696866,
"alnum_prop": 0.5579184791364589,
"repo_name": "verycumbersome/the-blue-alliance",
"id": "6c66aa01bd52d205975b3a66fdaa316f87aea8e... |
import logging
import django
from django.utils.log import AdminEmailHandler
class DbbackupAdminEmailHandler(AdminEmailHandler):
def emit(self, record):
# Monkey patch for old Django versions without send_mail method
if django.VERSION < (1, 8):
from . import utils
django.cor... | {
"content_hash": "fbea79fd85bf978214a52164f2dbdc8a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 90,
"avg_line_length": 32.78125,
"alnum_prop": 0.7054337464251669,
"repo_name": "django-dbbackup/django-dbbackup",
"id": "9bb94936882c9727ce5c39dc0c7da16c4acbaa87",
"size":... |
import logging
from os.path import dirname
import imp
import sys
from six.moves.queue import Queue
from tornado import ioloop
from tornado.web import Application, FallbackHandler
from tornado.wsgi import WSGIContainer
from .settings import settings as server_settings
from ..settings import settings as bokeh_settings
... | {
"content_hash": "f6ac0d0d5b61cd126436195df1355ba0",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 117,
"avg_line_length": 35.183098591549296,
"alnum_prop": 0.6813450760608487,
"repo_name": "almarklein/bokeh",
"id": "7bf073e3cbe7791981c9566d6ff291c01f2ee44b",
"size": "4... |
import logging
import os
from unittest import TestCase
import gevent
from gevent.server import StreamServer
import gevent_dht
import mock
from herd.manager.server import HerdManager
class ManagerTest(TestCase):
def setUp(self):
real_path = os.path.dirname(os.path.realpath(__file__))
self.config_p... | {
"content_hash": "968315294d7837a0be600218973ce5e5",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 114,
"avg_line_length": 45.386792452830186,
"alnum_prop": 0.6185824152982747,
"repo_name": "hoangelos/Herd",
"id": "ebe5c50b6f571adf9c68de9ecf267737a59f15b4",
"size": "544... |
from __future__ import absolute_import
from django.db.models import Q
from rest_framework import serializers
from rest_framework.response import Response
from sentry.api.bases.organization import (OrganizationEndpoint, OrganizationPermission)
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.seri... | {
"content_hash": "bf2e53734d300e8e13099dec15f21e4a",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 99,
"avg_line_length": 32.42613636363637,
"alnum_prop": 0.5994392850884879,
"repo_name": "gencer/sentry",
"id": "f424c016b73e8bddceed70e8b85fe54acbab203d",
"size": "5707",... |
from dodo_commands import Dodo
from dodo_commands.framework.args_tree import ArgsTreeNode
from dodo_commands.framework.decorator_utils import uses_decorator
class Decorator: # noqa
def add_arguments(self, parser): # noqa
parser.add_argument(
"--use-debugger",
action="store_true",... | {
"content_hash": "55e3068645bc9662169158ecad3affa7",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 84,
"avg_line_length": 36.625,
"alnum_prop": 0.6552901023890785,
"repo_name": "mnieber/dodo_commands",
"id": "c29d06cf8b2c27e4a489487571f6f2d8efc9d494",
"size": "879",
"b... |
"""BIG-IP® system software update module
REST URI
``http://localhost/mgmt/tm/sys/software/update``
GUI Path
``System --> Software Management --> Update Check``
REST Kind
``tm:sys:software:update:updatestate``
"""
from f5.bigip.resource import UnnamedResource
class Update(UnnamedResource):
"""BIG-I... | {
"content_hash": "cf58e800527ffb47b809572d3a3dd857",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 73,
"avg_line_length": 25.928571428571427,
"alnum_prop": 0.6391184573002755,
"repo_name": "F5Networks/f5-common-python",
"id": "94f23ece3612783c68c085d7628bc1d52f8f9f9e",
"... |
import httplib
import socket
import urllib2
import sys
import logging
import shelve
from urlparse import urlparse, urljoin
from datetime import datetime
class HTTPRequest:
def __init__(self, url):
self.url = url
self.urlparsed = None
self.HTML = ''
self.headers = {}
s... | {
"content_hash": "1af81f541e370d078ea92a9998cb2618",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 178,
"avg_line_length": 33.52564102564103,
"alnum_prop": 0.5200764818355641,
"repo_name": "ravelsoft/ploufseo",
"id": "bc9fdda8c5584068c923ebd63a938c0dcc909c78",
"size": "2... |
import datetime
from datetime import timedelta
from dateutil import rrule
from dateutil.relativedelta import relativedelta
from operator import itemgetter
from openerp import tools
from openerp.osv import fields, osv
from openerp.tools.float_utils import float_compare
from openerp.tools.translate import _
import pytz
... | {
"content_hash": "47fc0030a1087d314f24f531153bb214",
"timestamp": "",
"source": "github",
"line_count": 814,
"max_line_length": 356,
"avg_line_length": 51.54914004914005,
"alnum_prop": 0.5734134076880913,
"repo_name": "lbk0116/NTDP",
"id": "dd96c15bce717b877b80cb5e10a0d0fbd4f48627",
"size": "42947"... |
import os
import oss2
from oss2.crypto import BaseCryptoProvider
from oss2.utils import b64encode_as_string, b64decode_from_string, to_bytes
from oss2.headers import *
from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
from requests.structures import CaseInsensitiveDict
# 以下代码展示了用户自行提供加密算法进行客户端文件加... | {
"content_hash": "7145e6023b8998b3640fc3ad303e01a3",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 134,
"avg_line_length": 29.204166666666666,
"alnum_prop": 0.6785561421030104,
"repo_name": "aliyun/aliyun-oss-python-sdk",
"id": "e9605a893efafa813cccd688db5939415c6fe23f",
... |
import pygame, time
from math import pi
import numpy as np
SAMPLE_RATE = 192000
def split(n):
n1 = n >> 8
n2 = n - (n1 << 8)
return (n2, n1)#Little edian
def setSampleRate(n):
SAMPLE_RATE = n
def genTonePattern(freq, secs, sampleRate=192000):
numSamples = int(np.floor(sampleRate * secs))
sec... | {
"content_hash": "a0dfddec1aa676b1f940872631617a49",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 115,
"avg_line_length": 33.464285714285715,
"alnum_prop": 0.6173959445037354,
"repo_name": "powerboat9/PUDT",
"id": "ce5dc3ae6b4d1fdd2ad752154695dd37aea4ebd3",
"size": "187... |
"""Test various command line arguments and configuration file parameters."""
import os
from test_framework.test_framework import BitcoinTestFramework
class ConfArgsTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
def test_config_file_pa... | {
"content_hash": "5ddbc1025873b15af96d897671f0c851",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 218,
"avg_line_length": 55.02803738317757,
"alnum_prop": 0.649796195652174,
"repo_name": "afk11/bitcoin",
"id": "2b93e3c24d763dd37c5072c49f431f42220e97c3",
"size": "6102",... |
from .fprot import FProt
from ..interface import AntivirusPluginInterface
from irma.common.plugins import PluginMetaClass, BinaryDependency, \
PlatformDependency
from irma.common.base.utils import IrmaProbeType
class FProtPlugin(AntivirusPluginInterface, metaclass=PluginMetaClass):
# =================
#... | {
"content_hash": "3f81e53af2d2ddb85aee4ce0914f4648",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 71,
"avg_line_length": 27.7,
"alnum_prop": 0.6305655836341757,
"repo_name": "quarkslab/irma",
"id": "3e65ceecbc9fe861141a83cdb5ad38e30708fc6c",
"size": "1356",
"binary": ... |
from app import db
from flask.ext.login import LoginManager, UserMixin
class User(db.Model,UserMixin):
id = db.Column(db.Integer, primary_key=True)
nickname = db.Column(db.String(64), index=True, unique=True)
email = db.Column(db.String(120), index=True, unique=True)
social_id = db.Column(db.String(120)... | {
"content_hash": "3b1ca02f7c25cd3cf67a8c4e4a7896e5",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 65,
"avg_line_length": 32.03333333333333,
"alnum_prop": 0.63579604578564,
"repo_name": "sandeep6189/Pmp-Webapp",
"id": "863a54a549fc73bd5cc566f57d0066d967c34f36",
"size": "... |
from OpenGLCffi.GLES3 import params
@params(api='gles3', prms=['mode', 'start', 'count', 'primcount'])
def glDrawArraysInstancedEXT(mode, start, count, primcount):
pass
@params(api='gles3', prms=['mode', 'count', 'type', 'indices', 'primcount'])
def glDrawElementsInstancedEXT(mode, count, type, indices, primcount):
... | {
"content_hash": "944730362f240e63818d1d93a404e102",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 76,
"avg_line_length": 29.818181818181817,
"alnum_prop": 0.7164634146341463,
"repo_name": "cydenix/OpenGLCffi",
"id": "686a3d918218ebaf17cac4992be160be52e01bc8",
"size": "3... |
import typing
from pathlib import Path
from typing import List, Text, Union
from ruamel import yaml
if typing.TYPE_CHECKING:
from rasa.shared.core.events import Event
from rasa.shared.core.training_data.structures import StoryStep
class StoryWriter:
@staticmethod
def dumps(
story_steps: List... | {
"content_hash": "d22a5bc6503606e863621033644c0966",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 87,
"avg_line_length": 34.3013698630137,
"alnum_prop": 0.597444089456869,
"repo_name": "RasaHQ/rasa_nlu",
"id": "d92f72426787d8fc1e0463ab1e74414da4da3bac",
"size": "2504",
... |
import re
import six
from env_tools import load_env
from raven.processors import Processor
from raven.utils import varmap
class SanitizeEnvProcessor(Processor):
"""
Sanitize the environment to prevent leaking data like credit cards and
passwords.
"""
MASK = "*" * 8
FIELDS = []
try:
... | {
"content_hash": "ab4509782b515100bee2de2d1690540f",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 75,
"avg_line_length": 26.014285714285716,
"alnum_prop": 0.5035694673256452,
"repo_name": "PersonalGenomesOrg/open-humans",
"id": "104d7518ed264655830fc87f871b1f50ed18a076",
... |
from pylib import constants
from pylib.output import local_output_manager
from pylib.output import remote_output_manager
from pylib.utils import local_utils
def CreateOutputManager(args):
if args.local_output or not local_utils.IsOnSwarming():
return local_output_manager.LocalOutputManager(
output_dir=c... | {
"content_hash": "40fb8258ba5565593ea99932fa034291",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 57,
"avg_line_length": 34.53846153846154,
"alnum_prop": 0.7817371937639198,
"repo_name": "endlessm/chromium-browser",
"id": "97a0d88d1ec843f711b386670e3a01075351fed4",
"siz... |
class TweepError(Exception):
"""Tweepy exception"""
def __init__(self, reason, response=None):
self.reason = reason #self.reason = unicode(reason) in python 2
self.response = response
Exception.__init__(self, reason)
def __str__(self):
return self.reason
| {
"content_hash": "ecca1e6dc3870cbf749090924e6be348",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 72,
"avg_line_length": 27.545454545454547,
"alnum_prop": 0.6105610561056105,
"repo_name": "felHR85/Tweepy-3",
"id": "08aa94e97b38fdfcc260818a5515a11d5f5743c3",
"size": "379... |
import os
import platform
from subprocess import Popen, STDOUT
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common import utils
import time
class FirefoxBinary(object):
NO_FOCUS_LIBRARY_NAME = "x_ignore_nofocus.so"
def __init__(self, firefox_path=None, log_file=None):
... | {
"content_hash": "4a0b2b5ba299235794cbf982704bc14b",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 194,
"avg_line_length": 40.03664921465968,
"alnum_prop": 0.5760428926376356,
"repo_name": "lukeis/selenium",
"id": "63fdb8a4cdb107c16b932b5996b881a2990cc12c",
"size": "843... |
import os
from cookiecutter import repository, exceptions
import pytest
def test_finds_local_repo(tmpdir):
"""A valid local repository should be returned."""
project_dir = repository.determine_repo_dir(
'tests/fake-repo',
abbreviations={},
clone_to_dir=str(tmpdir),
checkout=No... | {
"content_hash": "5a0ba02331679e69b08c2c42c7ce9c1c",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 74,
"avg_line_length": 28.115942028985508,
"alnum_prop": 0.565979381443299,
"repo_name": "terryjbates/cookiecutter",
"id": "b2ca4f1d1f17206c882a0aadeefe6d8e0fa6184f",
"size... |
import unittest
import os
import sys
import shutil
import logging
import errno
import oeqa.utils.ftools as ftools
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
from oeqa.utils.decorators import LogResults
@LogResults
class oeSelfTest(unittest.TestCase):
log = logging.getLogger("self... | {
"content_hash": "1451ffa67aefce5745265511d8031fa7",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 114,
"avg_line_length": 40.56910569105691,
"alnum_prop": 0.6210420841683367,
"repo_name": "0x000000FF/yocto-mostfun-pro",
"id": "80b9b4b312591bb7551ea1cd33c6dbb17e97f508",
... |
from django.core.management.base import NoArgsCommand
from basic_profiles.models import Profile
from django.contrib.auth.models import User
from django.conf import settings
class Command(NoArgsCommand):
help = 'Create a profile object for users which do not have one.'
def handle_noargs(self, **options):
... | {
"content_hash": "b76ea3771c227bf591268ea57024c31a",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 69,
"avg_line_length": 38.5,
"alnum_prop": 0.7186147186147186,
"repo_name": "ericholscher/pinax",
"id": "496f3adc37e05094e4fb59c24c6e1f1a48d8b6dc",
"size": "462",
"binary... |
"""Test for pyinstaller compatibility."""
from __future__ import absolute_import
from unittest import TestCase, SkipTest
from tempfile import mkdtemp, NamedTemporaryFile
from subprocess import check_call, CalledProcessError
import os
from six import PY2
if PY2:
FileNotFoundError = OSError
class PyInstallerTes... | {
"content_hash": "1bd0252c7932a57d7ba1a218a3f14890",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 85,
"avg_line_length": 28.976190476190474,
"alnum_prop": 0.5595727198027938,
"repo_name": "ClusterHQ/eliot",
"id": "1b07c92af9371b5de579268336567a64b94eebe2",
"size": "1217... |
"""Built-in volume type properties."""
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_log import log as logging
import six
from cinder import context
from cinder import db
from cinder import exception
from cinder.i18n import _, _LE
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
... | {
"content_hash": "040cabc77a832e3bf5d8cf492ca63d39",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 79,
"avg_line_length": 34.67368421052632,
"alnum_prop": 0.5521149564865412,
"repo_name": "rakeshmi/cinder",
"id": "1b3cbadb2f7d95600f5fc146f8baae9913e8ec48",
"size": "1074... |
<<<<<<< HEAD
<<<<<<< HEAD
from .. import util
from . import util as import_util
import importlib._bootstrap
import sys
from types import MethodType
import unittest
import warnings
class CallingOrder:
"""Calls to the importers on sys.meta_path happen in order that they are
specified in the sequence, starting ... | {
"content_hash": "9a1783c72376721397033986a438d3ab",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 83,
"avg_line_length": 36.86501377410468,
"alnum_prop": 0.5894485129278135,
"repo_name": "ArcherSys/ArcherSys",
"id": "76381d1b5e74e542fa5f4f25e0ea24c859abcfdb",
"size": "... |
"""
Holds the formencode validators for debexpo.
"""
__author__ = 'Jonny Lamb'
__copyright__ = 'Copyright © 2008 Jonny Lamb'
__license__ = 'MIT'
import formencode
import logging
from debexpo.lib.base import *
from debexpo.lib.gnupg import GnuPG
from debexpo.model import meta
from debexpo.model.users import User
fro... | {
"content_hash": "b89836301d4e27410fb263bbd4a1b4f1",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 187,
"avg_line_length": 32.6583850931677,
"alnum_prop": 0.6215290985165463,
"repo_name": "swvist/Debexpo",
"id": "021b4dddbd7021330570496dc4e00486b698302b",
"size": "6576"... |
"""Test data generators producing signals pairs intended to be used to
test the APM module. Each pair consists of a noisy input and a reference signal.
The former is used as APM input and it is generated by adding noise to a
clean audio track. The reference is the expected APM output.
Throughout this file, the followi... | {
"content_hash": "258303ddb1864ccbfd326cb6f7260260",
"timestamp": "",
"source": "github",
"line_count": 498,
"max_line_length": 80,
"avg_line_length": 36.19879518072289,
"alnum_prop": 0.6860265157818828,
"repo_name": "WymanLyu/WYDemo",
"id": "f42944cedd312574e5efbd1e24912609cbaad93b",
"size": "1842... |
from subprocess import call
from os import path
import hitchpostgres
import hitchselenium
import hitchpython
import hitchserve
import hitchredis
import hitchtest
import hitchsmtp
# Get directory above this file
PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..'))
class ExecutionEngine(hitchtest... | {
"content_hash": "8b905cddc468d42ac1faeef099a2c81d",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 114,
"avg_line_length": 34.37837837837838,
"alnum_prop": 0.6118317610062893,
"repo_name": "megcunningham/django-diesel",
"id": "6350db8a79a044c1118b11683367e91a367ba8b1",
... |
"""
BenchExec is a framework for reliable benchmarking.
This file is part of BenchExec.
Copyright (C) 2007-2015 Dirk Beyer
All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
... | {
"content_hash": "3f8e9b56a3ab2f7d703c9f5d030ffc27",
"timestamp": "",
"source": "github",
"line_count": 727,
"max_line_length": 146,
"avg_line_length": 43.59422283356258,
"alnum_prop": 0.623102893383397,
"repo_name": "bjowac/impara-benchexec",
"id": "8d99149786c1da652d05f2e7dacc4556fa998ff0",
"size... |
"""
This module offers a modified interface for MCMC inference with the following objectives:
- making MCMC independent of Pyro specific trace data structure, to facilitate
integration with other PyTorch based libraries.
- bringing the interface closer to that of NumPyro to make it easier to write
code that... | {
"content_hash": "874c98e1b02570c6322c5fe4c9dabcaa",
"timestamp": "",
"source": "github",
"line_count": 789,
"max_line_length": 105,
"avg_line_length": 36.8871989860583,
"alnum_prop": 0.5619846069268829,
"repo_name": "uber/pyro",
"id": "2e6a00288b6bb422446eac4437646554a3cb237c",
"size": "29193",
... |
from slick.utils.core import get_client
from slick.utils.html import strip_tags
from slick.utils.nested_dict import lookup, multikeysort
from SoftLayer import HardwareManager, SoftLayerAPIError
def all_servers(hw_filter=None):
systems = []
if not hw_filter:
hw_filter = {}
for hw in get_hardware_... | {
"content_hash": "ff6f4ab71e61890f9df743a36612def7",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 79,
"avg_line_length": 30.28735632183908,
"alnum_prop": 0.5774826059456041,
"repo_name": "softlayer/slick",
"id": "ad3b71d17add36d71c39c21db176cff7f2b9ddb6",
"size": "7905... |
"""passlib.utils.compat._ordered_dict -- backport of collections.OrderedDict for py26
taken from stdlib-suggested recipe at http://code.activestate.com/recipes/576693/
this should be imported from passlib.utils.compat.OrderedDict, not here.
"""
try:
from thread import get_ident as _get_ident
except ImportError:
... | {
"content_hash": "3c592b8883138ca493733b97e8e1ecdf",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 87,
"avg_line_length": 34.578512396694215,
"alnum_prop": 0.5424235181644359,
"repo_name": "morreene/tradenews",
"id": "cfd766db3aed5b85c4811c0e6560d988b70e8409",
"size": "... |
import os
import unittest
from textwrap import dedent
from mock import Mock
from parameterized.parameterized import parameterized
from conans.client.graph.python_requires import ConanPythonRequire
from conans.client.loader import ConanFileLoader
from conans.test.utils.test_files import temp_folder
from conans.test.ut... | {
"content_hash": "7407b684c93e36be639da27d520d4464",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 93,
"avg_line_length": 32.958990536277604,
"alnum_prop": 0.5491960183767228,
"repo_name": "conan-io/conan",
"id": "b123478e9747c1c0a1d938fda8db6706a2420399",
"size": "1044... |
from verta._swagger.base_type import BaseType
class ModeldbAddExperimentRunTag(BaseType):
def __init__(self, id=None, tag=None):
required = {
"id": False,
"tag": False,
}
self.id = id
self.tag = tag
for k, v in required.items():
if self[k] is None and v:
raise ValueErro... | {
"content_hash": "8a208e899e0f7b3c5e27a0cc28490a91",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 62,
"avg_line_length": 21.357142857142858,
"alnum_prop": 0.5769230769230769,
"repo_name": "mitdbg/modeldb",
"id": "fd59019a27598a8b2d5db0a1603d293f472a9da2",
"size": "641",... |
"""Google Translate Module
From https://github.com/EArmour/pyfibot/
"""
import logging
log = logging.getLogger("trans")
try:
import requests
except ImportError:
log.error("Missing requests library. The translate module won't work.")
gturl = "http://translate.google.com/translate_a/t"
gtheaders = {
... | {
"content_hash": "a9cda222f2122fdd7f3177034bf123ab",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 75,
"avg_line_length": 31.571428571428573,
"alnum_prop": 0.6523378582202112,
"repo_name": "mikar/demibot",
"id": "4e53d2c06e3b07cd5d619f5e2a12d1b6456e7956",
"size": "1350",... |
import argparse
import getpass
import os
import urllib
import subprocess
import shutil
import re
import datetime
import time
import atexit
import json
from shutil import copyfile
run_timestamp = time.time()
# -------------------------------------------------------------------------------------------------
zookeeper_... | {
"content_hash": "ae99ba8807cb67563d122cb022e901e2",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 99,
"avg_line_length": 32.70564516129032,
"alnum_prop": 0.5338429293551966,
"repo_name": "ucb-bar/bits",
"id": "dfc846782196126275e6aa9a4fab650488a5e483",
"size": "8370",
... |
"""imports checkers for Python code"""
import collections
from distutils import sysconfig
import os
import sys
import copy
import six
import astroid
from astroid import are_exclusive
from astroid.modutils import (get_module_part, is_standard_module)
import isort
from pylint.interfaces import IAstroidChecker
from py... | {
"content_hash": "45c502fac8d0312acb57963abd52c16e",
"timestamp": "",
"source": "github",
"line_count": 781,
"max_line_length": 95,
"avg_line_length": 41.79001280409731,
"alnum_prop": 0.5676512041178994,
"repo_name": "lucidmotifs/auto-aoc",
"id": "630090c41314df25ff5f2074a39b9f71b9817146",
"size": ... |
"""SCons.Tool.gs
Tool-specific initialization for Ghostscript.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a ... | {
"content_hash": "d557caa18292f938644e881cd896a861",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 76,
"avg_line_length": 30.333333333333332,
"alnum_prop": 0.71998371998372,
"repo_name": "azatoth/scons",
"id": "ada169ac32cf98232818759379c40275dcc8eda0",
"size": "2457",
... |
import json
from datetime import datetime
import pytest
from django.urls import reverse
from rest_framework import viewsets
from rest_framework.serializers import ModelSerializer, SerializerMethodField
from rest_framework_json_api.renderers import JSONRenderer
from example.models import Blog, Comment, Entry
# seri... | {
"content_hash": "998b698dca0b5f25d6a4965619d98cfa",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 85,
"avg_line_length": 27.61881188118812,
"alnum_prop": 0.5820039433590249,
"repo_name": "django-json-api/django-rest-framework-json-api",
"id": "d74edac740c2b5c28e8b364cc0b... |
from __future__ import division, absolute_import, print_function
import os
import sys
import subprocess
import shutil
from setuptools import setup
def _read(fn):
path = os.path.join(os.path.dirname(__file__), fn)
return open(path).read()
def build_manpages():
# Go into the docs directory and build the ... | {
"content_hash": "3bca830e586fa8f0ee73c5a6767dac99",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 77,
"avg_line_length": 27.440944881889763,
"alnum_prop": 0.5569583931133429,
"repo_name": "Kraymer/beets",
"id": "14864383755e45fb2a39f182f8834b4d90536043",
"size": "4179"... |
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232
class Infra(recipe_util.Recipe):
"""Basic Recipe class for the Infrastructure repositories."""
@staticmethod
def fetch_spec(_props):
solution = lambda name... | {
"content_hash": "100de02fa16328ead141d1d13cb0142c",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 73,
"avg_line_length": 23.488372093023255,
"alnum_prop": 0.5752475247524752,
"repo_name": "HackFisher/depot_tools",
"id": "3c65b4420f78aaef05421dfd187a64fbe50e7863",
"size"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0038_contentnode_author'),
]
operations = [
migrations.AlterField(
model_name='formatpreset',
name='id',
... | {
"content_hash": "4ee2b9b3994f2138e70c8a4bd45e399e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 602,
"avg_line_length": 52.22222222222222,
"alnum_prop": 0.6574468085106383,
"repo_name": "aronasorman/content-curation",
"id": "76765bd24d6c4b9f9cfe908292e7db343a57b15d",
... |
"""
Settings for the hello scripts.
You most likely need to edit a few of them, e.g. API_HOST and the OAuth
credentials.
"""
OUR_BANK = '00100'
USERNAME = '1000203893'
PASSWORD = '1000203893'
CONSUMER_KEY = 'bvldezvlnqj4mtva4jfktke4xliep0bt1xm44yxi'
CONSUMER_SECRET = 'fgwo35uhkroebasxlqg... | {
"content_hash": "543cdcc6e480f95ce51b2468ed689132",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 77,
"avg_line_length": 29.18421052631579,
"alnum_prop": 0.7105500450856628,
"repo_name": "OpenBankProject/Hello-OBP-DirectLogin-Python",
"id": "c70d22124fd8a0e9d65f0e2df32fff... |
import sys
import csv
import datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
if len(sys.argv) != 2:
print "Please specify a file to read"
sys.exit(1)
fileToPlot = open(sys.argv[1], "r")
csvReader = csv.DictReader(fileToPlot)
timestamps = []
data = []
for row in ... | {
"content_hash": "2748545496620eaebe7652533d202483",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 88,
"avg_line_length": 22.161290322580644,
"alnum_prop": 0.7088791848617176,
"repo_name": "boztalay/LappyLogger",
"id": "4ea49dc0f352c02761e809388f82cb02add8001f",
"size": ... |
from datetime import datetime # noqa
from datetime import timedelta # noqa
from django.utils.translation import ugettext_lazy as _ # noqa
from horizon import exceptions
from horizon import tabs
from openstack_dashboard import api
from openstack_dashboard.api import ceilometer
from openstack_dashboard.dashboards.a... | {
"content_hash": "24a3ef3e5ab6601df51c6700ad167374",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 79,
"avg_line_length": 37.464114832535884,
"alnum_prop": 0.5627075351213282,
"repo_name": "r-icarus/openstack_microserver",
"id": "6539a62e2d29ec4c880dfe82be70cac1f00352fb",... |
from sef import *
from sef2 import *
from helpers import *
import time
import traceback
# from AnimalChecker import get_actual_neighbor
def other_player(player, game):
''' return the opponent player, used for alphaBetaMinimax'''
for p in game.players:
if player != p:
return p
def _sef(boar... | {
"content_hash": "bd89fa726cdb48421242696b19905716",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 153,
"avg_line_length": 40.86695278969957,
"alnum_prop": 0.552930056710775,
"repo_name": "Mimieam/CS540_AI",
"id": "c6e7777454f50638ff4218cc9ebcf55ce2705ac0",
"size": "952... |
'''
Author : DORIAN JAVA BROWN
Version : N/A
Copyright : All Rights Reserve; You may use, distribute and modify this code.
Description : This Guessing Game tries to guess the user number by generating
a random number between 1 and 5
'''
# import the random module
import random
# titl... | {
"content_hash": "1d1b8097e42f7896968f9db752bfb051",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 81,
"avg_line_length": 27.064935064935064,
"alnum_prop": 0.5283109404990403,
"repo_name": "ZEUSOFCS/Python",
"id": "1580a1d70e2e4c1fece420eb1927172d41ac0894",
"size": "2084... |
"""
Tests for Posix backup driver.
"""
import os
import mock
from six.moves import builtins
from cinder.backup.drivers import posix
from cinder import context
from cinder import test
FAKE_FILE_SIZE = 52428800
FAKE_SHA_BLOCK_SIZE_BYTES = 1024
FAKE_BACKUP_ENABLE_PROGRESS_TIMER = True
FAKE_CONTAINER = 'fake/contain... | {
"content_hash": "92278f99501fc2ff84a89efef19b7826",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 79,
"avg_line_length": 35.48809523809524,
"alnum_prop": 0.6343508889634351,
"repo_name": "dims/cinder",
"id": "5e1138e9438e848516a4268843e73e27cd0c4e54",
"size": "6594",
... |
import base64
import os
from flask import Flask, request
app = Flask(__name__)
# [END eventarc_pubsub_server]
# [START eventarc_pubsub_handler]
@app.route('/', methods=['POST'])
def index():
data = request.get_json()
if not data:
msg = 'no Pub/Sub message received'
print(f'error: {msg}')
... | {
"content_hash": "27f924f3beaa3bebe2f35f0c48f17398",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 79,
"avg_line_length": 25.829268292682926,
"alnum_prop": 0.6213408876298395,
"repo_name": "GoogleCloudPlatform/python-docs-samples",
"id": "614dd5bc97134c60d498dee0ec2ffb9ad3... |
from app import settings
from tests.integration.integration_test_case import IntegrationTestCase
class TestApplicationVariablesNegative(IntegrationTestCase):
def setUp(self):
settings.EQ_DEV_MODE = True
settings.EQ_ENABLE_LIVE_RELOAD = False
super().setUp()
def test_flask_toolbar_is_... | {
"content_hash": "48893970c690c4aeb174340fa6f4641f",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 71,
"avg_line_length": 33.8,
"alnum_prop": 0.6887573964497041,
"repo_name": "ONSdigital/eq-survey-runner",
"id": "3b37e2f7190337be8b03b7955f584062a306142f",
"size": "845",
... |
import turtle
# Get user's input
line_length = input('Enter length: ')
degree = input('Enter degree: ')
# Validate user's input
try:
line_length = int(line_length)
if line_length == 0:
raise Exception('Length cannot be equal to 0.')
degree = int(degree)
except ValueError:
print('Invalid inpu... | {
"content_hash": "c154d60394f5f465a3956a5121ddbcf6",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 55,
"avg_line_length": 18.333333333333332,
"alnum_prop": 0.6727272727272727,
"repo_name": "Valka7a/python-playground",
"id": "3fe4b8a49094d5fed8c2cc2d35442f960fb390b6",
"si... |
import sys
import os
import shlex
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../..'))
# ... | {
"content_hash": "6e68c5aa5855b88ba54eb777bdd3e45e",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 79,
"avg_line_length": 32.719424460431654,
"alnum_prop": 0.7023966578715919,
"repo_name": "MoneyPush/AlgorithmicTradingApiPython",
"id": "4f5501e6b306a2c541f6aec9197adf612a8... |
import subprocess
import sys
import setup_util
import os
from os.path import expanduser
home = expanduser("~")
def start(args, logfile, errfile):
setup_util.replace_text("nawak/model_postgre.nim", "host=.* port=5432",
"host=" + args.database_host + " port=5432")
# compile the app
subpr... | {
"content_hash": "b9186721bae21b3efd5a7a3ec63bbe6b",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 125,
"avg_line_length": 34.53488372093023,
"alnum_prop": 0.6727272727272727,
"repo_name": "ratpack/FrameworkBenchmarks",
"id": "99b461fafedd42be032d0b2e0ab335038b0bed5f",
"... |
class ZiplineError(Exception):
msg = None
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
self.message = str(self)
def __str__(self):
msg = self.msg.format(**self.kwargs)
return msg
__unicode__ = __str__
__repr__ = __str__
class... | {
"content_hash": "3e73ebeeaff88f3b67c869044c204622",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 79,
"avg_line_length": 27.015,
"alnum_prop": 0.6790671848972792,
"repo_name": "michaeljohnbennett/zipline",
"id": "8fd97ba52b01021dc66456a30a47f0f5c00f9d30",
"size": "1139... |
from datetime import datetime
import os
from os.path import join, exists
from subprocess import check_call
from citools.build import rename_template_files as _rename_template_files, replace_template_files, get_common_variables
from paver.easy import *
from paver.setuputils import _get_distribution
@task
@consume_arg... | {
"content_hash": "00d118065e61374106f569e32c003c9d",
"timestamp": "",
"source": "github",
"line_count": 428,
"max_line_length": 148,
"avg_line_length": 33.399532710280376,
"alnum_prop": 0.6728226652675761,
"repo_name": "ella/citools",
"id": "4c558e25d79a6c3421748941ba8341bda9d047be",
"size": "14295... |
"""Helper class for implementing a beam search decoder.
Individual models just need to provide a few callback functions.
"""
import collections
import re
import lingvo.compat as tf
from lingvo.core import base_layer
from lingvo.core import ops
from lingvo.core import py_utils
from tensorflow.python.ops import inplac... | {
"content_hash": "c1a7fe8aff291e7dfa4eb6123c74a9c2",
"timestamp": "",
"source": "github",
"line_count": 906,
"max_line_length": 80,
"avg_line_length": 46.567328918322296,
"alnum_prop": 0.6268784072054989,
"repo_name": "tensorflow/lingvo",
"id": "4f226aa3f9b7c2b838810c7092779d2a130c2953",
"size": "4... |
from django.contrib.syndication.views import Feed
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
from django.utils.feedgenerator import Atom1Feed
from django.utils.html import strip_tags
from mezzanine.blog.models import BlogPost, BlogCategory
from mezzanine.generic.models ... | {
"content_hash": "0c365cc761e83cb26c6737e4d7c2752b",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 78,
"avg_line_length": 32.138888888888886,
"alnum_prop": 0.6211466436185538,
"repo_name": "wrwrwr/mezzanine",
"id": "efc561b433293e153b010ef59eba6a517a6c5a2b",
"size": "34... |
import os
import os.path
import sys
import string
import getopt
import re
import socket
import time
import threading
import traceback
import types
import io
import linecache
from code import InteractiveInterpreter
from platform import python_version
try:
from Tkinter import *
except ImportError:
print>>sys.__... | {
"content_hash": "25682be2414c9cab84edc9f54a6cece8",
"timestamp": "",
"source": "github",
"line_count": 1566,
"max_line_length": 87,
"avg_line_length": 35.82375478927203,
"alnum_prop": 0.5674866310160428,
"repo_name": "efortuna/AndroidSDKClone",
"id": "81af85a84044e4f53ed3df3e69c1a2f3c54a9015",
"si... |
import os
from github_acadwf import getenvOrDie
from github_acadwf import getCSVFromURL
GHA_GITHUB_ORG = getenvOrDie("GHA_GITHUB_ORG",
"Error: please set GHA_GITHUB_ORG to name of github organization for the course, e.g. UCSB-CS56-W14")
GHA_STUDENT_LIST_URL = getenvOrDie('GHA_STUDENT_LIST_U... | {
"content_hash": "842bf396d2abccb2b09dccdb6cc1f3bb",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 125,
"avg_line_length": 33.25352112676056,
"alnum_prop": 0.7005506141465481,
"repo_name": "UCSB-CS-Using-GitHub-In-Courses/github-acad-scripts",
"id": "9f12974ec1f8adc2480fb1... |
from participantCollection import ParticipantCollection
import string
import re
import datetime
import pyperclip
# Edit Me!
# Remember, this is during signup, so current month is not March, it's February.
currentMonthTotalDays = 31
currentMonthURL = "https://www.reddit.com/r/pornfree/comments/6qvbft/stay_clean_august_... | {
"content_hash": "af080c9188bea1c7802c5de6f63cd1ec",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 569,
"avg_line_length": 62.885714285714286,
"alnum_prop": 0.7022565500530062,
"repo_name": "foobarbazblarg/stayclean",
"id": "8613d89502630e93f92fb1b19c782e12c8e9fa9f",
"s... |
"""
Author: Evan Hubinger
License: Apache 2.0
Description: Convenience functions for using Coconut as a module.
"""
# -----------------------------------------------------------------------------------------------------------------------
# IMPORTS:
# --------------------------------------------------------------------... | {
"content_hash": "6ee294e9c0bb2075539ed3957790477f",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 121,
"avg_line_length": 33.50375939849624,
"alnum_prop": 0.5353456014362658,
"repo_name": "evhub/coconut",
"id": "917734d60d28ec20195b4f5d73674026e0f6c6bf",
"size": "9212"... |
import string
import nltk
import json
from nltk.stem.porter import PorterStemmer
import numpy as np
import sys, argparse
reload(sys)
sys.setdefaultencoding('utf8')
#######
# based on http://www.cs.duke.edu/courses/spring14/compsci290/assignments/lab02.html
stemmer = PorterStemmer()
def stem_tokens(tokens, stemmer):
... | {
"content_hash": "e4ce9b81cba7dcf4626e2aec7f8b9efe",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 310,
"avg_line_length": 37.97872340425532,
"alnum_prop": 0.7053221288515407,
"repo_name": "lmartinet/ISTEX_MentalRotation",
"id": "2b4f3615dc05d2d4a4aed43756637cfff86fe6ac",... |
import _plotly_utils.basevalidators
class ZValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="z", parent_name="mesh3d.lightposition", **kwargs):
super(ZValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edi... | {
"content_hash": "a4acfcef634349e06363a2902fcf1573",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 86,
"avg_line_length": 36.84615384615385,
"alnum_prop": 0.5908141962421712,
"repo_name": "plotly/plotly.py",
"id": "886e1e997ac1b839af7dfdd1d663972a2f9c7330",
"size": "479"... |
import datetime
from paypal.pro.helpers import PayPalWPP
from paypal.pro.exceptions import PayPalFailure
from django.conf import settings
from billing import Gateway, GatewayNotConfigured
from billing.utils.credit_card import (Visa, MasterCard, AmericanExpress,
Discover, Invali... | {
"content_hash": "d3dda042898bdf3b4a557e5181e82513",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 119,
"avg_line_length": 43.27891156462585,
"alnum_prop": 0.5910091166299906,
"repo_name": "agiliq/merchant",
"id": "1e1125d2964e795f9d434d453a7f819beb711f84",
"size": "636... |
from __future__ import absolute_import
from docker_registry_client.Image import Image
from docker_registry_client._BaseClient import BaseClientV1
from tests.mock_registry import mock_v1_registry
class TestImage(object):
def test_init(self):
url = mock_v1_registry()
image_id = 'test_image_id'
... | {
"content_hash": "812cf5f39258a7e96ce575fdb9ce17b9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 31.46153846153846,
"alnum_prop": 0.7090464547677262,
"repo_name": "twaugh/docker-registry-client",
"id": "ee44adc3e3e19797eb04a7f3bdbeebb714804af9",
... |
"""
f2py2e - Fortran to Python C/API generator. 2nd Edition.
See __usage__ below.
Copyright 1999--2005 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@cens.ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMP... | {
"content_hash": "4d6d8825f5d25a52f03e83005b3017f4",
"timestamp": "",
"source": "github",
"line_count": 565,
"max_line_length": 173,
"avg_line_length": 36.876106194690266,
"alnum_prop": 0.5859371250299976,
"repo_name": "santisiri/popego",
"id": "fd207b4eb9fc80fcf5d80ec9276108db8d4a2479",
"size": "2... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... | {
"content_hash": "3038a99adf320668f2556d4ec06fdb75",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 120,
"avg_line_length": 32.45161290322581,
"alnum_prop": 0.584493041749503,
"repo_name": "sardred/andlarweb",
"id": "18861a2aadb5ed46bb144bcc50bff644ad3d2057",
"size": "107... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.