text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import absolute_import, unicode_literals
import collections
import warnings
from importlib import import_module
from django import forms
from django.core import checks
from django.core.exceptions import ImproperlyConfigured
from django.template.loader import render_to_string
from django.utils import s... | {
"content_hash": "98eb4a756eef47c4f2f12bd7d1f39c9a",
"timestamp": "",
"source": "github",
"line_count": 563,
"max_line_length": 114,
"avg_line_length": 41.619893428063946,
"alnum_prop": 0.6264510071696825,
"repo_name": "nutztherookie/wagtail",
"id": "1531762983998db72acfea526fc6468c55204c50",
"size... |
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
infos = GSGlyphsInfo.alloc().init()
font = Glyphs.font
build_glyphs = False
names = []
for info in infos.glyphInfos():
if (
not info.components
or info.name in font.glyphs
or info.name.... | {
"content_hash": "b4b5078d3edeb58b315cb168ab0b3ca9",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 90,
"avg_line_length": 24.282608695652176,
"alnum_prop": 0.5926589077887198,
"repo_name": "jenskutilek/Glyphs-Scripts",
"id": "09a4bf26edc0edaf66a54951c87d0a095ef274b7",
"s... |
import sys
from conftest import rvo_output, rvo_err
from click.testing import CliRunner
from rvo import cli
def test_add_all_parameters(isatty_true):
options = ['add', '-t', 'test', '-c', 'test', '--content', 'test']
output = ['Document "test" created.']
rvo_output(options,output)
def test_add_tags(isatty... | {
"content_hash": "f3c656fac22c9e8bb6d3154d825ff145",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 120,
"avg_line_length": 42.31972789115646,
"alnum_prop": 0.6651663719659219,
"repo_name": "noqqe/rvo",
"id": "27e97720b7f7607b81cff91683a91c7ab63ddf6f",
"size": "6288",
... |
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_tatooine_evil_hermit_small2.iff"
result.attribute_template_id = -1
result.stfName("poi_n","base_poi_building")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "4bc308d0ab322a1d21557aba1d45b8a3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 79,
"avg_line_length": 24.076923076923077,
"alnum_prop": 0.6964856230031949,
"repo_name": "anhstudios/swganh",
"id": "9d70b6ea78e8926f52044988ae1af50496ee769e",
"size": "45... |
import mock
import tempfile
from . import resize_image
from digits import test_utils
test_utils.skipIfNotFramework('none')
class TestOutputValidation():
def test_no_filename(self):
assert resize_image.validate_output_file(None), 'All new files should be valid'
@mock.patch('os.access')
def tes... | {
"content_hash": "38ccbd7a88d75d77bd2efb6b3319979a",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 116,
"avg_line_length": 36.24561403508772,
"alnum_prop": 0.6902226524685382,
"repo_name": "Deepomatic/DIGITS",
"id": "1ee383dca6dc2406e708cbecf775bc9159558d53",
"size": "21... |
import sys
import os
import os.path
import re
import datetime, time
# local configuration details
BY_ROW = False
TABLE_COLS = 6
# default stylesheet details
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_DIR = os.path.abspath(THIS_DIR + '/templates')
STYLESHEET = os.path.join(TEMPLATE_DIR, 'bcmd.css')... | {
"content_hash": "76b6a1a8d66d6fcbc8cb6deaf8c595ce",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 195,
"avg_line_length": 38.825,
"alnum_prop": 0.5441797238320097,
"repo_name": "buck06191/bcmd-web",
"id": "9236ddfd1106ed4450b3e1eb5835cb8419023919",
"size": "14014",
"... |
from keystoneclient import base
from keystoneclient import exceptions
from keystoneclient.v3.contrib.fiware_roles.utils import ROLES_PATH
class RoleAssignment(base.Resource):
pass
class RoleAssignmentManager(base.CrudManager):
"""Manager class for manipulating user and organization roles assignments."""
... | {
"content_hash": "0e5750b555540debf8c65028a4b9bd72",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 94,
"avg_line_length": 39.130434782608695,
"alnum_prop": 0.5966666666666667,
"repo_name": "ging/python-keystoneclient",
"id": "2289d563f0f94c32e31ffd0749d9bd7ea77cacda",
"s... |
"""Retriever script for Forest Inventory and Analysis
"""
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
import os
from retriever.lib.templates import Script
from retriever.lib.models import Table
from pkg_resources import parse_version
try:
from retr... | {
"content_hash": "1cc26624eeee64b28ae15b269680a8ee",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 252,
"avg_line_length": 46.56310679611651,
"alnum_prop": 0.542535446205171,
"repo_name": "goelakash/retriever",
"id": "bc383327d5d95e09ea0d6ca7612847da4ce00720",
"size": "... |
from setuptools import setup
setup(
name='lektor-gae',
description='Publishes your Lektor site to Google App Engine.',
url='https://github.com/isotherm/lektor-gae/',
version='0.1',
author=u'Kirk Meyer',
author_email='[email protected]',
license='MIT',
platforms='any',
... | {
"content_hash": "0190a046bf5711b485ba110c4f399435",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 70,
"avg_line_length": 30.34375,
"alnum_prop": 0.557157569515963,
"repo_name": "isotherm/lektor-gae",
"id": "28a855fec68f3389703aa429f816a64f3827b3e1",
"size": "971",
"bi... |
def permutationCipher(password, key):
table = str.maketrans(''.join(map(chr, range(ord('a'), ord('z') + 1))), key)
return password.translate(table)
| {
"content_hash": "e7f7feffa5a09a7475d9286118c0aba7",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 80,
"avg_line_length": 52,
"alnum_prop": 0.6602564102564102,
"repo_name": "RevansChen/online-judge",
"id": "2837588194636ac783736279be7ef674196f8761",
"size": "191",
"bina... |
import json
import threading
import time
from six import moves
from oslo import messaging
from oslo.messaging._drivers import base
class FakeIncomingMessage(base.IncomingMessage):
def __init__(self, listener, ctxt, message, reply_q, requeue):
super(FakeIncomingMessage, self).__init__(listener, ctxt, mes... | {
"content_hash": "ccceaaa0f52588f7c61e343c39ba1810",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 79,
"avg_line_length": 35.863414634146345,
"alnum_prop": 0.5622959738846572,
"repo_name": "redhat-openstack/oslo.messaging",
"id": "dfce5a4a8d2d111280f4700dbcb2bec3bdc7921b"... |
''' A scatter plot of a smooth periodic oscillation. This example demonstrates red
circle scatter markers with black outlines, using the low-level ``bokeh.models``
API.
.. bokeh-example-metadata::
:apis: bokeh.models.Circle, bokeh.models.Plot, bokeh.models.ColumnDataSource, bokeh.models.LinearAxis, bokeh.models.Pa... | {
"content_hash": "2ca50417b33c98cbb90facedef1ca7e7",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 155,
"avg_line_length": 29.456521739130434,
"alnum_prop": 0.6959409594095941,
"repo_name": "bokeh/bokeh",
"id": "31d3e88d5fafe2dd7c64fbee7afbc04fbd093986",
"size": "1355",
... |
import requests
from django import forms
from django.conf import settings
from django_comments.forms import CommentForm
from django_markdown.widgets import MarkdownWidget
from core.utils import get_client_ip
from error_posts.models import ErrorPost
class ErrorPostForm(forms.ModelForm):
recaptcha = forms.CharFi... | {
"content_hash": "59e5adc07ecb09b6e08e39ae036b4aa3",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 87,
"avg_line_length": 34.14545454545455,
"alnum_prop": 0.5958466453674122,
"repo_name": "fixmydjango/fixmydjango",
"id": "863909adc567868fbb5fc8540e0fa08e249b23b2",
"size"... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
import factory
from mock import Mock, patch
from django.http import HttpRequest
from django.test import TestCase
from seahub.base.accou... | {
"content_hash": "0b5532db68dfc3914d53e4d2f1af4d50",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 79,
"avg_line_length": 34.03875968992248,
"alnum_prop": 0.6331131860624004,
"repo_name": "saukrIppl/seahub",
"id": "4458ea94791c108c2c0e1408760120526e9c354f",
"size": "439... |
"""
I look at the unknown HADS table and see if any of these stations exist
in the mesosite database, if so, then I set online to true!
Run from RUN_2AM.sh
"""
from pandas import read_sql
from pyiem.util import get_dbconn, get_dbconnstr, logger
LOG = logger()
def review_iemaccess():
"""Go find stations that ha... | {
"content_hash": "5a01eb754f49e045ea42311d1991cb11",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 78,
"avg_line_length": 28.025,
"alnum_prop": 0.5526315789473685,
"repo_name": "akrherz/iem",
"id": "037b6f59e3472d68c5b7dee163b92a1f3fab8965",
"size": "2242",
"binary": f... |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from models import Profile
from django.contrib.auth.models import Group
# Groups are not used, in favor of per-user flags.
# Crates use case involves just a handful of users.
admin.site.unregist... | {
"content_hash": "6645ab5244ad93353c4bdbad4978f127",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 120,
"avg_line_length": 37.3,
"alnum_prop": 0.6548257372654156,
"repo_name": "naggie/crates",
"id": "3be18a13891b047772fbd1b8adf8db8d4aad2aea",
"size": "1492",
"binary": ... |
import os
import argparse
from ffissh.ssh import Connection
def _ssh(args):
conn = Connection(host=args.host, port=args.port, username=args.username)
conn.privkey = args.privkey
conn.pubkey = args.pubkey
conn.passphrase = args.passphrase
buf = ''
with conn:
chan = conn.request_portfor... | {
"content_hash": "d8e011342edbcd1b18399ac1fe53fcc5",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 77,
"avg_line_length": 31.37837837837838,
"alnum_prop": 0.6296296296296297,
"repo_name": "tehasdf/ffissh",
"id": "5226c4a3c3b025d6263f3a2e8893f0019aee6c5e",
"size": "1385",... |
'''
blockr.io
'''
import logging
from lib import config, util, util_jetcoin
def get_host():
if config.BLOCKCHAIN_SERVICE_CONNECT:
return config.BLOCKCHAIN_SERVICE_CONNECT
else:
return 'http://tjet.blockr.io' if config.TESTNET else 'http://jet.blockr.io'
def check():
pass
def getinfo():
... | {
"content_hash": "dd4641374e278ae60eb73cf4ef602f4a",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 145,
"avg_line_length": 36.833333333333336,
"alnum_prop": 0.5415575136937366,
"repo_name": "paytokens-beta/payblockd",
"id": "1a58409e7e26010a29264c1076a38c89fd8e4b57",
"s... |
import gettext
import httplib
import logging
import logging.handlers
import re
import time
import XenAPI
translations = gettext.translation('nova', fallback=True)
_ = translations.ugettext
##### Logging setup
def configure_logging(name):
log = logging.getLogger()
log.setLevel(logging.DEBUG)
sysh = logg... | {
"content_hash": "16801373d8b209275af02a281c04fc50",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 79,
"avg_line_length": 32.022222222222226,
"alnum_prop": 0.558501040943789,
"repo_name": "plumgrid/plumgrid-nova",
"id": "72d499664642ce4b840acec8b0ec6812b5be9878",
"size"... |
import os
import sys
from contextlib import contextmanager
from cStringIO import StringIO
import time
from .iterator import consume
@contextmanager
def ignored(*exceptions):
try:
yield
except exceptions:
pass
@contextmanager
def consuming(iterator):
try:
yield iterator
finall... | {
"content_hash": "813bef151de54e02531f988878531cfd",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 81,
"avg_line_length": 18.066666666666666,
"alnum_prop": 0.6146547179757512,
"repo_name": "tmr232/awesomelib",
"id": "fc6ab7e5c329a0b51b6c9494a4fb581e2bd436b8",
"size": "1... |
from __future__ import absolute_import
from django import http
import dmp_packs
from dmp_packs.actions.exceptions import ParameterProcessingException
def coerce_to_expected_type(http_raw_input, expected_type):
if expected_type not in ["string", "integer"]:
raise ValueError
if expected_t... | {
"content_hash": "efefb112712e54067b56f7dfc13949c6",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 77,
"avg_line_length": 31.458333333333332,
"alnum_prop": 0.5947019867549669,
"repo_name": "rjusher/docker-container-manager",
"id": "29843fc983854428c22137b7ace3288906384e03"... |
"""Open-source TensorFlow Inception v3 Example."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
from absl import app
from absl import flags
import absl.logging as _logging # pylint: disable=unused-import
import tensorflow as tf
im... | {
"content_hash": "69c025380343683cf56b041980d33e52",
"timestamp": "",
"source": "github",
"line_count": 871,
"max_line_length": 85,
"avg_line_length": 34.01607347876005,
"alnum_prop": 0.6672066963683002,
"repo_name": "mlperf/training_results_v0.5",
"id": "fb2c85a4264b025824dd7ce643b8fc09b59925f8",
... |
""" Functions dealing with invalid commands """
def print_invalid_command(command, *args, **kwargs):
print('Invalid command: {}'.format(command))
| {
"content_hash": "89121bfbf7f7d0b5d0e0d38baa3f215a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 52,
"avg_line_length": 30.4,
"alnum_prop": 0.6973684210526315,
"repo_name": "robobrobro/foe",
"id": "6cc5dc8ff1ea0564cc963ffe8df2a4e255a70795",
"size": "152",
"binary": fa... |
from __future__ import absolute_import, division, print_function
# Import astronomical modules
from astropy.units import Unit
from astropy import constants
# Import the relevant PTS classes and modules
from ..tools.logging import log
from ..tools import filesystem as fs
from ..basics.filter import Filter
from ...magi... | {
"content_hash": "91b0651c161cbf3462bea417a13c362a",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 209,
"avg_line_length": 35.04556962025316,
"alnum_prop": 0.5420067904355992,
"repo_name": "Stargrazer82301/CAAPR",
"id": "60c1a81157e41324b28041d302b03e92ee199d40",
"size"... |
"""benchmarking through py.test"""
import py
from py.__.test.item import Item
from py.__.test.terminal.terminal import TerminalSession
from math import ceil as _ceil, floor as _floor, log10
import timeit
from inspect import getsource
# from IPython.Magic.magic_timeit
#units = ["s", "ms", "\xc2\xb5s", "ns"]
units =... | {
"content_hash": "17a20198da2a439d740d5a635429aeb3",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 90,
"avg_line_length": 27.721739130434784,
"alnum_prop": 0.5006273525721455,
"repo_name": "srjoglekar246/sympy",
"id": "b6c6b27077d22c864fa6717850f020f3e0d3d0f1",
"size": ... |
"""
celery.security
~~~~~~~~~~~~~~~
Module implementing the signing message serializer.
"""
from __future__ import absolute_import
from kombu.serialization import (
registry, disable_insecure_serializers as _disable_insecure_serializers,
)
from celery.exceptions import ImproperlyConfigured
from .se... | {
"content_hash": "8449a83183853b2717d6885ba941825b",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 77,
"avg_line_length": 27.12857142857143,
"alnum_prop": 0.6929963138493944,
"repo_name": "johankaito/fufuka",
"id": "352d400cfcec4f6a6c2b435ebb8e18f5378f44c6",
"size": "192... |
import re
import random
import base64
import logging
class RandomProxy(object):
def __init__(self, settings):
self.proxy_list = settings.get('PROXY_LIST')
fin = open(self.proxy_list)
self.proxies = {}
for line in fin.readlines():
parts = re.match('(\w+://)(\w+:\w+@)?(.... | {
"content_hash": "276456e51a5397487268e61dba578d1f",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 72,
"avg_line_length": 29.68,
"alnum_prop": 0.5633423180592992,
"repo_name": "trujunzhang/djzhang-targets",
"id": "1cdc82fb5ca4a115fe7f523edcbc24aea2b7ac54",
"size": "2608"... |
from django import forms
from django.contrib.auth.forms import PasswordResetForm, UserCreationForm, AuthenticationForm
from django.utils.translation import gettext_lazy as _
from django.contrib.auth import get_user_model
from captcha.fields import ReCaptchaField
from django.conf import settings
class CaptchaPasswordRe... | {
"content_hash": "e22417837dc136a5938a5b8cf58d1d2e",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 93,
"avg_line_length": 36.59016393442623,
"alnum_prop": 0.6671146953405018,
"repo_name": "wallysalami/gamified-education",
"id": "cafa255de8b10ebf0c25c4d9f42ad4daa90adb03",
... |
"""
This plugin does not perform ANY test: The aim is to visit all URLs grabbed so far and build
the transaction log to feed data to other plugins
NOTE: This is an active plugin because it may visit URLs retrieved by vulnerability scanner spiders
which may be considered sensitive or include vulnerability probing
"""
im... | {
"content_hash": "76ca22d22afb1b10e6b2da68b9dcd766",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 99,
"avg_line_length": 39.81818181818182,
"alnum_prop": 0.7625570776255708,
"repo_name": "owtf/owtf",
"id": "2cedad59b10aa0fe10ea1da3ac0153b03988dee5",
"size": "876",
"bi... |
"""
Base class every component used. A component is handled as a plugin.
The features of a plugin is defined by interfaces. Those interfaces will
force a component to resolve queries that come from the framework.
"""
from glob import glob
import imp
import pkg_resources
from pkg_resources import working_set, Distributi... | {
"content_hash": "1a810bccbd33b1c0416f9145bdadc518",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 91,
"avg_line_length": 43.10909090909091,
"alnum_prop": 0.5782370307886967,
"repo_name": "moritz-wundke/Concurrent",
"id": "45942cc2aeae60490d0f6c797b95f308f46ca653",
"siz... |
import itertools
import json
import os
from urllib.parse import unquote
from django.apps import apps
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.template import Context, Engine
from django.urls import translate_url
from django.utils.encoding imp... | {
"content_hash": "a431fd8ad8cc9d36a93ae1690826e6f6",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 117,
"avg_line_length": 35.18125,
"alnum_prop": 0.6093444661573992,
"repo_name": "harisibrahimkv/django",
"id": "ce78742fd8d41193e1295d1df8bb481744be6471",
"size": "11258"... |
from six.moves import urllib
from nova import exception
from nova.i18n import _
from nova import utils
class SecurityGroupBase(object):
def parse_cidr(self, cidr):
if cidr:
try:
cidr = urllib.parse.unquote(cidr).decode()
except Exception as e:
self... | {
"content_hash": "872d0abc337289702487e8c5c32c49a5",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 78,
"avg_line_length": 35.724444444444444,
"alnum_prop": 0.5666832545409306,
"repo_name": "alaski/nova",
"id": "66244ef9c815a0533a0f6789a0407114e62c573c",
"size": "8876",
... |
"""
####################################################################################################
TITLE : HPE XP7 Migration, Migrate
DESCRIPTION : Migrate the data to the new server
AUTHOR : Koen Schets / StorageTeam
VERSION : Based on previous ODR framework
1.0 Initial version
CONFIG : xpmig.ini
... | {
"content_hash": "32a41d63c86353b76ce853ae48111798",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 100,
"avg_line_length": 27.24137931034483,
"alnum_prop": 0.5379746835443038,
"repo_name": "kschets/XP_migrator",
"id": "5637b918bfe12546d684d4eda20abbd8a7a22808",
"size": "... |
import sys
from subprocess import call, Popen, PIPE
from devlib.utils.misc import escape_double_quotes
from wa import Command
from wa.framework import pluginloader
from wa.framework.configuration.core import MetaConfiguration, RunConfiguration
from wa.framework.exception import NotFoundError
from wa.framework.target.... | {
"content_hash": "b7a6d5a6659b0c7869118d1f0771d166",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 97,
"avg_line_length": 38.46153846153846,
"alnum_prop": 0.6137777777777778,
"repo_name": "setrofim/workload-automation",
"id": "45531a4c4d38b733a018a83c294fedcdb9a30754",
... |
"""Support for the ZHA platform."""
import functools
import time
from homeassistant.components.device_tracker import DOMAIN, SOURCE_TYPE_ROUTER
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispa... | {
"content_hash": "40a65bd3deea0b422f2b888f50814dad",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 86,
"avg_line_length": 33.505050505050505,
"alnum_prop": 0.651492312330419,
"repo_name": "adrienbrault/home-assistant",
"id": "ffb37e33b0fcc3f1a18dddf2e9802bc799970d6e",
"s... |
import tweepy
import json
import re
import time
import random
def create_api(config_filename):
"""
Creates an authorized tweepy API object given a config file containing
appropriate twitter application keys
:param config_filename: string containing the config filename
:return: the tweepy API obje... | {
"content_hash": "fd7940007881b98a016d3f8d87185b8d",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 101,
"avg_line_length": 28.49514563106796,
"alnum_prop": 0.5296422487223169,
"repo_name": "wilg64/MarkovTweet",
"id": "cbdf9a68f6435750c367ed207ab72e74a21d63f7",
"size": "... |
import copy
from rdkit.Chem.FeatMaps import FeatMaps
class MergeMethod(object):
# Put the new point at the weighted average position of the two fused points
WeightedAverage = 0
# Put the new point at the un-weighted average position of the two fused points
Average = 1
# Put the new point at the position of ... | {
"content_hash": "8b56ab0ec3f96afcab47076438f7177f",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 95,
"avg_line_length": 31.035087719298247,
"alnum_prop": 0.6526286037309215,
"repo_name": "rdkit/rdkit",
"id": "4aee8b46c1635254dfe0e9a061b244e14dec4881",
"size": "7341",
... |
"""Test for catching non-exceptions."""
# pylint: disable=too-many-ancestors, no-absolute-import, import-error, multiple-imports,wrong-import-position
from __future__ import print_function
import socket, binascii
class MyException(object):
"""Custom 'exception'."""
class MySecondException(object):
"""Custom ... | {
"content_hash": "bf587b1718af633a1d310e809517bc53",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 110,
"avg_line_length": 20.05504587155963,
"alnum_prop": 0.6875571820677036,
"repo_name": "mith1979/ansible_automation",
"id": "1eca134d2b5ad2f90d6d411ae553055da8e17ed2",
... |
from typing import Optional, Text, Tuple, Union
import tensorflow as tf
from tensorflow.python.layers.utils import smart_cond
from tensorflow.keras import backend as K
import numpy as np
from rasa.utils.tensorflow.layers import RandomlyConnectedDense
# from https://www.tensorflow.org/tutorials/text/transformer
# and ... | {
"content_hash": "44860a67caf23736a94cac98e40a0d64",
"timestamp": "",
"source": "github",
"line_count": 638,
"max_line_length": 88,
"avg_line_length": 39.641065830721004,
"alnum_prop": 0.59511288600688,
"repo_name": "RasaHQ/rasa_nlu",
"id": "57a37a5fe13c62958e6f67d5864adb94debde03b",
"size": "25291... |
'''
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import test_stub
import zstackwoodpecker.test_state as test_state
test_obj_dict = test_state.TestStateDict()
vol_num = 24
volume_list = []
def test():
global test_obj_dict
global ... | {
"content_hash": "6dd295c98ead4845790435eb74540e8d",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 160,
"avg_line_length": 29.183098591549296,
"alnum_prop": 0.6076254826254827,
"repo_name": "quarkonics/zstack-woodpecker",
"id": "9d57f2bdba912e004797e67873e5043bf18e1a25",
... |
import _plotly_utils.basevalidators
class NamelengthsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="namelengthsrc", parent_name="choropleth.hoverlabel", **kwargs
):
super(NamelengthsrcValidator, self).__init__(
plotly_name=plotly_name,
... | {
"content_hash": "ffaf35350a7c0043df8ebebcc1209af1",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 88,
"avg_line_length": 34.57142857142857,
"alnum_prop": 0.6115702479338843,
"repo_name": "plotly/python-api",
"id": "003e029c90c1f56f0a2137a65faf2aa55c943d2d",
"size": "484... |
import sublime
from sublime_plugin import TextCommand
class GsInsertTextAtCursorCommand(TextCommand):
"""
Insert the provided text at the current cursor position(s).
"""
def run(self, edit, text):
text_len = len(text)
selected_ranges = []
for region in self.view.sel():
... | {
"content_hash": "4f7397ee4b5a68138322403cc1b5c593",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 82,
"avg_line_length": 31.410714285714285,
"alnum_prop": 0.6236498010233087,
"repo_name": "jmanuel1/GitSavvy",
"id": "f41b1f3860f55e78105a876a94cfc7517a0f96f0",
"size": "17... |
import os
import pytest
import cPickle as pickle
import pandas as pd
from middleware.display.beautify import beautify, json_return, has_failed
from tests.constants import ARGS_DICT, BEAUTIFY_VF_SEROTYPE
vf_serotype_gene_dict = os.path.join('tests/refs', 'GCA_000005845.2_ASM584v2_genomic.fna_ectyper-vf_serotype.p')
am... | {
"content_hash": "3c7d7f5c8d716d10b1482599d058631a",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 123,
"avg_line_length": 42.351351351351354,
"alnum_prop": 0.6860242501595405,
"repo_name": "superphy/backend",
"id": "3fbab9ed07b24e330c6e50231d991000209dc4ef",
"size": "31... |
NON_SORTABLE = 'non_sortable'
SEARCH_CONFIG = 'search_config'
| {
"content_hash": "4711613f0c1d910680380d73242f8bc4",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 31,
"avg_line_length": 31,
"alnum_prop": 0.7419354838709677,
"repo_name": "ENCODE-DCC/snovault",
"id": "aba772b96a2986c267221b1a8c6ae9b03d984221",
"size": "62",
"binary": ... |
'''
Written by Lijun An and CBIG under MIT license:
https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
'''
import os
import numpy as np
import pandas as pd
from copy import deepcopy
from utils.misc import create_folder, txt2list
def merge_multi_bins(args,
round1_threshold_list,
... | {
"content_hash": "35b0c7fa2a2206c86ad5a345c2e4f0e0",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 79,
"avg_line_length": 44.80628272251309,
"alnum_prop": 0.6090207992521617,
"repo_name": "ThomasYeoLab/CBIG",
"id": "dd3bffc1bdd2f6c522cb82a17ba6b85cf99c82d6",
"size": "86... |
'''
jsonconf
@author: Andrew Philpot
@version 0.5
encode/decode objects in JSON format as configurations
Usage: python jsonconf.py
Options:
\t-h, --help:\tprint help to STDOUT and quit
\t-v, --verbose:\tverbose output
'''
import sys
import getopt
from objcode import ObjectDecoder
import os
import util
from util impor... | {
"content_hash": "7e5612352b9d7d61f4a7cfe6e6e1df01",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 79,
"avg_line_length": 29.844155844155843,
"alnum_prop": 0.5942123585726719,
"repo_name": "philpot/pymod",
"id": "f558cf28ac5a318454a77765dd421cd2d668e286",
"size": "4639"... |
"""subprocess42 is the answer to life the universe and everything.
It has the particularity of having a Popen implementation that can yield output
as it is produced while implementing a timeout and NOT requiring the use of
worker threads.
Example:
Wait for a child process with a timeout, send SIGTERM, wait a grace ... | {
"content_hash": "72e93bbea9e3c8ec7d0ed0b72367f4eb",
"timestamp": "",
"source": "github",
"line_count": 1042,
"max_line_length": 106,
"avg_line_length": 34.71017274472169,
"alnum_prop": 0.6533952665339526,
"repo_name": "endlessm/chromium-browser",
"id": "4205da14aa18ca9abef0af57b404432bec9d4f9e",
"... |
import _plotly_utils.basevalidators
class AlignsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="alignsrc", parent_name="box.hoverlabel", **kwargs):
super(AlignsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "6f20d68f3ea4ea3ef26000d8624e5f12",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 87,
"avg_line_length": 36.72727272727273,
"alnum_prop": 0.6262376237623762,
"repo_name": "plotly/plotly.py",
"id": "b62f55c0350358bdf2e176a66a5a89dd0d6a68d8",
"size": "404"... |
from desktop.models import Document
try:
import json
except ImportError:
import simplejson as json
import logging
import shutil
import time
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.forms.formsets import formset_factory
from django.forms.models import inlineformset_fa... | {
"content_hash": "91f1bc339216f1653df5d1d83ae58f70",
"timestamp": "",
"source": "github",
"line_count": 848,
"max_line_length": 153,
"avg_line_length": 37.73231132075472,
"alnum_prop": 0.6993780666937526,
"repo_name": "pwong-mapr/private-hue",
"id": "574cd836b46f3ba488936ca7c5e04979ca57f362",
"size... |
from django.apps import AppConfig
class AuditlogConfig(AppConfig):
name = 'auditlog'
| {
"content_hash": "d508ef44afb6d448f1a77a5a05c0a223",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 18.2,
"alnum_prop": 0.7582417582417582,
"repo_name": "mrts/foodbank-campaign",
"id": "6bfa1cc1734e2ef98491468efe963cdfebce2208",
"size": "91",
"bina... |
from paraview.simple import *
import glob, os.path
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
print("cwd=", os.getcwd())
dirname = '/home/boman/dev/Projet_MP/waves/sph/louis/workspace/tests_waterdrop'
# create a new 'XML Structured Grid Reader'
gridvts = XMLStructu... | {
"content_hash": "0c49ccc8148b18a245c4c3509abd73d2",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 151,
"avg_line_length": 38.2906976744186,
"alnum_prop": 0.8053446705132098,
"repo_name": "rboman/progs",
"id": "78d57fa3cf6ab30f57ab46e397b8e6014ad54a74",
"size": "7223",
... |
"""Datastore models used by the Google App Engine Pipeline API."""
from google.appengine.ext import db
from google.appengine.ext import blobstore
# Relative imports
import simplejson
class _PipelineRecord(db.Model):
"""Represents a Pipeline.
Properties:
class_path: Path of the Python class to use for this ... | {
"content_hash": "8fe21dbe9dbf25496af6f1c6b77dd8a8",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 78,
"avg_line_length": 32.41538461538462,
"alnum_prop": 0.6954595791805094,
"repo_name": "russomi/appengine-pipeline-read-only",
"id": "568a86c9d679725d7fdb16fd867aedf2745e7... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('simulation', '0004_auto_20180325_2103'),
]
operations = [
migrations.AlterField(
model_name='simulationstagematch',
name='ca... | {
"content_hash": "9f1f64b62ddccccdf471a08d26431ab5",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 104,
"avg_line_length": 32.61290322580645,
"alnum_prop": 0.6083086053412463,
"repo_name": "bilbeyt/ituro",
"id": "0c1fe8f817b2830f41f5f7b3d51574225bbe6870",
"size": "1035",... |
"""
Coursera's tools for interacting with research data exports.
You may install it from source, or via pip.
"""
import argcomplete
import argparse
import logging
import sys
from courseraresearchexports import commands
from courseraresearchexports.commands import utils
def build_parser():
"""
Build an argp... | {
"content_hash": "89578659812c08d626fb34ead2cd3620",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 79,
"avg_line_length": 28.376623376623378,
"alnum_prop": 0.6929061784897025,
"repo_name": "coursera/courseraresearchexports",
"id": "8d188cf3236503391b881512ff044aba15da2aaf"... |
""" An extensible ASCII table reader and writer.
core.py:
Core base classes and functions for reading and writing tables.
:Copyright: Smithsonian Astrophysical Observatory (2010)
:Author: Tom Aldcroft ([email protected])
"""
import copy
import csv
import functools
import itertools
import operator
impo... | {
"content_hash": "8cdc99711d9e848d3421b43dec71e770",
"timestamp": "",
"source": "github",
"line_count": 1543,
"max_line_length": 106,
"avg_line_length": 37.209332469215816,
"alnum_prop": 0.5975197686975302,
"repo_name": "MSeifert04/astropy",
"id": "e4c5cb7dc228ac644c60f09bb678aab6ca923bc9",
"size":... |
import sqlite3
from view import Frontend
from model import OssemDB
user_interface = Frontend()
member_database = OssemDB()
keep_running = ""
while keep_running != "q":
keep_running = user_interface.select_option()
if keep_running == "1":
member_database.new_member()
if keep_running == "2":
... | {
"content_hash": "0035be29973a97924f919fc6ae30b90c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 49,
"avg_line_length": 27.384615384615383,
"alnum_prop": 0.6825842696629213,
"repo_name": "ossem/member_database",
"id": "8523f972ed87beccbf981ee85800d6870f82eba4",
"size":... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_eg6_power_droid_crafted.iff"
result.attribute_template_id = 9
result.stfName("droid_name","eg_6_power_droid_base")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "422ee1c9503eed6fe40ef241b610d5f2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 69,
"avg_line_length": 23.923076923076923,
"alnum_prop": 0.6945337620578779,
"repo_name": "obi-two/Rebelion",
"id": "128bb71dd7d7e2479cd114e5753a2438b82f9e7a",
"size": "456... |
from __future__ import absolute_import
from sentry.cache import default_cache
from .base import BaseAttachmentCache
class DefaultAttachmentCache(BaseAttachmentCache):
def __init__(self, **options):
super(DefaultAttachmentCache, self).__init__(default_cache, **options)
| {
"content_hash": "a2b1dbcb059f89ef8be5ec700db647c6",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 78,
"avg_line_length": 28.5,
"alnum_prop": 0.7508771929824561,
"repo_name": "mvaled/sentry",
"id": "4386f3bbc404557840ab32d48743366b0befa143",
"size": "285",
"binary": fa... |
import pymongo
import ujson as json
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from datetime import datetime as dt
consumer_key = "cadDGYYIDjUz2aCzBqcy1Ff99"
consumer_secret = "Xi02ZDEvmWKMVw20WKoRmnUJlkiem3SbKeCRRuCfo8Oop8KF4n"
access_token = "363711223-HEyP... | {
"content_hash": "d7d78df2d9c81da12481fa3ad7181d8b",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 71,
"avg_line_length": 31.05128205128205,
"alnum_prop": 0.6131296449215524,
"repo_name": "xiaohan2012/lst",
"id": "3ca0b4040b5450228dbd8080a828859a53aeaec6",
"size": "2422"... |
import doctest
import pickle
import unittest
from genshi import core
from genshi.core import Markup, Attrs, Namespace, QName, escape, unescape
from genshi.input import XML, ParseError
from genshi.compat import StringIO, BytesIO
class StreamTestCase(unittest.TestCase):
def test_render_utf8(self):
xml = X... | {
"content_hash": "952a545a0a30439effb66b88e6110582",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 97,
"avg_line_length": 35.90909090909091,
"alnum_prop": 0.5964777105118327,
"repo_name": "hodgestar/genshi",
"id": "7b2f8a77beed22185dc52fee6bddfbc61ff0f48d",
"size": "960... |
import sqlalchemy
from keystone.common.sql import migration_helpers
def list_constraints(migrate_engine):
meta = sqlalchemy.MetaData()
meta.bind = migrate_engine
user_table = sqlalchemy.Table('user', meta, autoload=True)
group_table = sqlalchemy.Table('group', meta, autoload=True)
domain_table = ... | {
"content_hash": "5b4a18586c841ac594c04bbac6eb0654",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 74,
"avg_line_length": 33.15151515151515,
"alnum_prop": 0.6471663619744058,
"repo_name": "UTSA-ICS/keystone-kerberos",
"id": "bca00902cb94f05b31954daeb68fd2ef31e824b4",
"si... |
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from orcid_api_... | {
"content_hash": "3119ac8cd292e098db4b4fe61e2afeeb",
"timestamp": "",
"source": "github",
"line_count": 460,
"max_line_length": 276,
"avg_line_length": 29.86304347826087,
"alnum_prop": 0.5961272475795297,
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"id": "9de3dd3c32fe90ea48646795f30aa47... |
from __future__ import division
from .processor import Processor
import os
class OpenPdf(Processor):
def open_pdf(self, root):
"""
Open the generated pdf file.
"""
pdf_name = root + os.path.extsep + 'pdf'
self.logger.info('Opening "{0}"...'.format(pdf_name))
os.system('/usr/bin/open "{0}"'.format(pdf_nam... | {
"content_hash": "09bd62889e10e172060a132c955c12d9",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 55,
"avg_line_length": 21.733333333333334,
"alnum_prop": 0.6595092024539877,
"repo_name": "olivierverdier/pydflatex",
"id": "ba3c61c6fa8b3b8cee0a829578160727ced16eef",
"siz... |
"""
CrowdFlower Search Relevance Challenge (Kaggle)
multi_svm_model.py: build one SVM model for each query (train and test queries are the same).
__author__: gbakie
"""
import re
import numpy as np
from collections import defaultdict
from operator import itemgetter
from nltk.tokenize import RegexpTokenizer
from nltk.... | {
"content_hash": "5a6787bc10272a564f2c599c2fe1281b",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 155,
"avg_line_length": 27.752100840336134,
"alnum_prop": 0.5364118092354278,
"repo_name": "gbakie/kaggle-cf-search",
"id": "a89240362d080a164e81430d6f0eeed93febc66f",
"si... |
import tempfile
from contextlib import contextmanager
import os
import zlib
from mock import MagicMock
from ... import core
from ...core.application_base import Application
@contextmanager
def make_file(contents, suffix, decompress=False):
"""Context manager to write data to a temporary file,
and delete on ... | {
"content_hash": "03db970a6ed6b1815909c8f5396c34cb",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 61,
"avg_line_length": 25.367346938775512,
"alnum_prop": 0.6532582461786002,
"repo_name": "bsipocz/glue",
"id": "c94587c4121db821996199d18fa1eca1200f0b0c",
"size": "1243",
... |
"""The Gumbel distribution."""
from equadratures.distributions.template import Distribution
from equadratures.distributions.recurrence_utils import jacobi_recurrence_coefficients
import numpy as np
from scipy.stats import gumbel_r
RECURRENCE_PDF_SAMPLES = 50000
class Gumbel(Distribution):
"""
The class defines ... | {
"content_hash": "d64c4abe3ac9bd4c7bf8384c7b1ad323",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 176,
"avg_line_length": 39.505050505050505,
"alnum_prop": 0.6169777550498594,
"repo_name": "psesh/Effective-Quadratures",
"id": "0de30a51110ff36445d8a5146ad4316fcbe3de2e",
... |
from project.library import sub
def main(condition):
if condition:
return sub.sub_func(condition)
else:
y = 0
return sub.sub_func(y)
| {
"content_hash": "1827ef400f8d507f4106427dad9af32b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 38,
"avg_line_length": 18.555555555555557,
"alnum_prop": 0.6107784431137725,
"repo_name": "Robpol86/coveralls-multi-ci",
"id": "64d5c1aa146169f4eddf03a0c5bd8756e2fc395d",
"s... |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | {
"content_hash": "be22f9839e25335df384f590002e8931",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 133,
"avg_line_length": 30.638686131386862,
"alnum_prop": 0.5612864800476474,
"repo_name": "mmottahedi/neuralnilm_prototype",
"id": "f2835ffabd9483ee3a768beacaaf3f2dc8d6aec2... |
"""Python file with invalid syntax, used by scripts/linters/
python_linter_test. This file is using str() which is not allowed.
"""
from __future__ import absolute_import # pylint: disable=import-only-modules
from __future__ import unicode_literals # pylint: disable=import-only-modules
import python_utils
class F... | {
"content_hash": "389c68aeaa29df6b6413165a2dd9e814",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 78,
"avg_line_length": 29.037037037037038,
"alnum_prop": 0.6377551020408163,
"repo_name": "prasanna08/oppia",
"id": "126b66f02f1c2ab7f3cf49af81ed28b39be8c3c0",
"size": "140... |
from __future__ import annotations
import sys
from itertools import count
from unittest.mock import MagicMock, Mock, patch
import pytest
from kombu import Connection
from kombu.transport import pyamqp
def test_amqps_connection():
conn = Connection('amqps://')
assert conn.transport # evaluate transport, do... | {
"content_hash": "570c4481316abf4d3f6d73f19a5be585",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 73,
"avg_line_length": 31.008849557522122,
"alnum_prop": 0.6078767123287672,
"repo_name": "celery/kombu",
"id": "bd40239574cdda5e49875828d221e40de755b83a",
"size": "7008",... |
from __future__ import absolute_import
from sys import *
if version_info[0] == 2:
intern = intern
| {
"content_hash": "9f3914b78539e219bab391dcb0aa0db0",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 38,
"avg_line_length": 17.333333333333332,
"alnum_prop": 0.6730769230769231,
"repo_name": "AbsoluteMSTR/pies",
"id": "64087b099a4d0fe8f15f2a0e1a14efa530b11bc1",
"size": "104... |
import _plotly_utils.basevalidators
class ShapeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="shape", parent_name="scattercarpet.line", **kwargs):
super(ShapeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "5fcad2d2efc4d8d40c2fabf31b93d036",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 88,
"avg_line_length": 39.083333333333336,
"alnum_prop": 0.6140724946695096,
"repo_name": "plotly/plotly.py",
"id": "bf3b7d18d1d1c63f1e62fde9954cafc00f674e27",
"size": "469... |
import platform
import os
print(os.name)
print(platform.system())
print(platform.release())
| {
"content_hash": "6f1c0f1689ae3d8ddfeca60b1c4de076",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 25,
"avg_line_length": 18.4,
"alnum_prop": 0.782608695652174,
"repo_name": "dadavidson/Python_Lab",
"id": "fafedaaf98e4d8f588a020250626c383f2c9af6a",
"size": "219",
"binar... |
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
| {
"content_hash": "4ab1b8b1b1f6403022e6e5c6454ea33d",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 50,
"avg_line_length": 33,
"alnum_prop": 0.6363636363636364,
"repo_name": "OpenTouch/night-watch",
"id": "391e772e3159805db715b03f2f8144ed6ea1e37d",
"size": "711",
"binary... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../'))
# -- General con... | {
"content_hash": "22a75f0de6398885db140daa0752886f",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 79,
"avg_line_length": 32.083969465648856,
"alnum_prop": 0.6950987389959553,
"repo_name": "balbinot/arghphot",
"id": "b6caef5f48e2c44b6a18674aa68d4b4ef93b7c59",
"size": "8... |
"""
Test for emptynet.py
"""
import unittest
import pexpect
class testEmptyNet( unittest.TestCase ):
prompt = 'mininet>'
def testEmptyNet( self ):
"Run simple CLI tests: pingall (verify 0% drop) and iperf (sanity)"
p = pexpect.spawn( 'python -m mininet.examples.emptynet' )
p.expect( ... | {
"content_hash": "84065aaa283692a426ee38161086d2d8",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 75,
"avg_line_length": 27.1,
"alnum_prop": 0.5473554735547356,
"repo_name": "5GExchange/escape",
"id": "0d4d01ddaab52bb1fc19bd26c850ad1cc337dcce",
"size": "836",
"binary"... |
import pandas as pd
import numpy as np
from sklearn.metrics import f1_score, confusion_matrix, precision_score, accuracy_score, recall_score, roc_auc_score
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from scipy import stats
import matplotlib.pyplot as plt
import ... | {
"content_hash": "70263f1f9d244d259f2395f07a21531f",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 163,
"avg_line_length": 34.73076923076923,
"alnum_prop": 0.6995201181247693,
"repo_name": "mworles/capstone_one",
"id": "2ba2cc4a9a45da09cba7afdd02b724d75702f56e",
"size": ... |
"""
Script to check for new clusterfuzz issues since the last rolled v8 revision.
Returns a json list with test case IDs if any.
Security considerations: The security key and request data must never be
written to public logs. Public automated callers of this script should
suppress stdout and stderr and only process c... | {
"content_hash": "25fd92d59e4d33aec4a95012f82f1899",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 79,
"avg_line_length": 23.829596412556054,
"alnum_prop": 0.6140383891607075,
"repo_name": "hkernbach/arangodb",
"id": "0fdffd93ac2756cb5640dd6fe00304b422ab8dd9",
"size": "... |
import tensorflow as tf
w = tf.Variable(tf.random_normal([2, 1], stddev=1, seed=1))
y = tf.matmul(x, w)
loss = tf.reduce_mean(tf.square(y_ - y)) + tf.contrib.layers.l2_regularizer(lambda1)(w)
| {
"content_hash": "9f02459a7ff5a46ef0776abc79ebe080",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 87,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.6804123711340206,
"repo_name": "pearpai/TensorFlow-action",
"id": "4f5f9b226924fbdf83265b1ea5528e1799923cf8",
"siz... |
import argparse
import json
import os
import re
import urllib.request
_REPO_URL = 'https://dl.google.com/dl/android/maven2'
_GROUP_NAME = 'com/google/firebase'
_MODULE_NAME = 'firebase-iid'
_FILE_EXT = 'aar'
_OVERRIDE_LATEST = None
_PATCH_VERSION = 'cr1'
def do_latest():
if _OVERRIDE_LATEST is not None:
... | {
"content_hash": "c8344e63de273d46a68da00e9e5cd72d",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 79,
"avg_line_length": 31.542857142857144,
"alnum_prop": 0.5942028985507246,
"repo_name": "nwjs/chromium.src",
"id": "f4f2531790f18df54ae45a74441fc1db03eec08f",
"size": "24... |
"""
all dj-webmachine resources should inherit from the Resource object:
.. code-block:: python
from webmachine import Resource
class MyResource(Resource):
pass
All Resource methods are of the signature:
.. code-block:: python
def f(self, req, resp):
return result
``req`` is a :clas... | {
"content_hash": "9e2e89bb6ffb093cae2e4d0a47595775",
"timestamp": "",
"source": "github",
"line_count": 640,
"max_line_length": 122,
"avg_line_length": 30.5578125,
"alnum_prop": 0.57646878355576,
"repo_name": "benoitc/dj-webmachine",
"id": "cc4519b7a240c1375fa14a424f3cd8f73db57e00",
"size": "19692"... |
from rna_tools.tools.simrna_trajectory.simrna_trajectory import SimRNATrajectory
s = SimRNATrajectory()
s.load_from_file('rp14_aa22-6d8fb934_ALL.trafl', top_level=True)
s.plot_energy('plot1.png')
s.sort()
s.plot_energy('plot2.png')
| {
"content_hash": "05c73929c6ef6886a0f618b8ac01e7bc",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 80,
"avg_line_length": 38.666666666666664,
"alnum_prop": 0.7758620689655172,
"repo_name": "m4rx9/rna-pdb-tools",
"id": "bc6cfea4233ac54a58e0bc05e668c550464732fa",
"size": "2... |
"""Configuration structure and functionality for testing config validity."""
import argparse
import getpass
import grp
import inspect
import logging
import multiprocessing
import os
import pathlib
import pwd
import socket
import tempfile
from .exceptions import ConfigException
from .utils import Singleton, get_versi... | {
"content_hash": "bffe6f26b83decd12c2ff76ae47598a0",
"timestamp": "",
"source": "github",
"line_count": 1106,
"max_line_length": 78,
"avg_line_length": 30.084086799276673,
"alnum_prop": 0.5405283563249481,
"repo_name": "kura/blackhole",
"id": "8b67afd79d441fcc79dd6f6674ffcac9e217fc11",
"size": "344... |
"""
accessor.py contains base classes for implementing accessor properties
that can be mixed into or pinned onto other pandas classes.
"""
from typing import Set
import warnings
from pandas.util._decorators import Appender
class DirNamesMixin:
_accessors = set() # type: Set[str]
_deprecations = frozenset(... | {
"content_hash": "757089634abb64dc20c548a453e9542e",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 85,
"avg_line_length": 27.58957654723127,
"alnum_prop": 0.6017709563164109,
"repo_name": "toobaz/pandas",
"id": "f84033e9c3c90fc7807087ab9a08d03ad3e03634",
"size": "8470",... |
try:
from collections.abc import Sequence, Mapping
except ImportError:
from collections import Sequence, Mapping
__all__ = ['BROKEN_ITERABLE', 'BROKEN_SEQUENCE', 'BROKEN_MAPPING']
class BrokenIterable:
def __iter__(self):
yield 'x'
raise ValueError(type(self).__name__)
def __getite... | {
"content_hash": "3f5cb9e7bc4d0c93b0c1f9fa116827b6",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 66,
"avg_line_length": 18.235294117647058,
"alnum_prop": 0.6725806451612903,
"repo_name": "robotframework/robotframework",
"id": "2f808768dc45fdc880d76cd278f360964d34ad60",
... |
"""Extend functionality from webob.dec.wsgify for Placement API."""
import webob
from oslo_log import log as logging
from webob.dec import wsgify
from nova.api.openstack.placement import util
LOG = logging.getLogger(__name__)
class PlacementWsgify(wsgify):
def call_func(self, req, *args, **kwargs):
"... | {
"content_hash": "be2d7d9053f1dbfc84a1ae90ae2a37d0",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 75,
"avg_line_length": 30.227272727272727,
"alnum_prop": 0.6736842105263158,
"repo_name": "vmturbo/nova",
"id": "4aa8b789ba5f9051305aba53d9ef68cc224624e2",
"size": "1237",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.INFO)
TIMESERIES_COL = "height"
N_OUTPUTS = 1 # in each sequence, 1-49 are features, and 50 is label
SEQ_LEN = None
DEFAULTS = None
N_INPUTS = None... | {
"content_hash": "3d125ceaed3c6f2c8415ec577bb63571",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 131,
"avg_line_length": 39.89010989010989,
"alnum_prop": 0.6535812672176309,
"repo_name": "turbomanage/training-data-analyst",
"id": "4146bca4030b0e41e0cb8e896f248806f0d2a19... |
from iptest.assert_util import skiptest
skiptest("win32", "cli64", "posix")
from iptest.cominterop_util import *
from iptest.file_util import file_exists, delete_files
import nt
#------------------------------------------------------------------------------
#--SANITY CHECK
if not IsWordInstalled():
from sys import... | {
"content_hash": "a5738af1b21d0ae37c570c03215645ef",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 124,
"avg_line_length": 31.647368421052633,
"alnum_prop": 0.642275070680193,
"repo_name": "IronLanguages/ironpython3",
"id": "2b63ac57f8a037e9e399e21d004b2dad6f8b5ea0",
"s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from GitSearch.Indexer.NewJavaParser import parse
from GitSearch.MyUtils import remove_unified_stop_lists, write_search_log
def Generator(code):
file_content = code
# print '1. Origianl Query : ', file_content
ast = parse(file_content, resolve=False) # newJa... | {
"content_hash": "38cf5194cd1a0ac3883ca8c1f9ab9c68",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 81,
"avg_line_length": 27.690322580645162,
"alnum_prop": 0.5580149114631874,
"repo_name": "facoy/facoy",
"id": "4b41831e57aa23ff4f0c088f6c63ba32d7d1233f",
"size": "4314",
... |
"""Test of "New Hunt" wizard."""
from absl import app
from selenium.webdriver.common import keys
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.rdfvalues import file_finder as rdf_file_finder
from grr_response_core.lib.rdfvalues import paths as rdf_paths
from grr_response_server import data_sto... | {
"content_hash": "d2089c91d0d4a6ceb0d2d36f7854aa26",
"timestamp": "",
"source": "github",
"line_count": 594,
"max_line_length": 80,
"avg_line_length": 39.925925925925924,
"alnum_prop": 0.6611148591668072,
"repo_name": "google/grr",
"id": "f9b29f38348c0bb6395e820ee219462050b1deef",
"size": "23738",
... |
import os
import boto.swf
import json
import datetime
import time
import zipfile
import shutil
import re
from ftplib import FTP
import ftplib
import activity
import boto.s3
from boto.s3.connection import S3Connection
import provider.s3lib as s3lib
import provider.simpleDB as dblib
from elifetools import parseJATS... | {
"content_hash": "3f3c1514d844a85c96debf9636414bc4",
"timestamp": "",
"source": "github",
"line_count": 678,
"max_line_length": 107,
"avg_line_length": 32.892330383480825,
"alnum_prop": 0.5633828079458321,
"repo_name": "gnott/elife-bot",
"id": "353f208edc88825f7ed8b497f884d58d8c7e3844",
"size": "22... |
"""
ILCM tutorial on mnist using advbox tool.
ILCM method extends "BIM" to support targeted attack.
"""
import sys
sys.path.append("..")
import matplotlib.pyplot as plt
import paddle.fluid as fluid
import paddle
from advbox.adversary import Adversary
from advbox.attacks.gradient_method import ILCM
from advbox.models.... | {
"content_hash": "7a859b57f1f5554d9c7644e9b402cb67",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 84,
"avg_line_length": 31.5,
"alnum_prop": 0.5811965811965812,
"repo_name": "kuke/models",
"id": "b12ffaab0367769d9bf9d58ec7396c8edd2487e9",
"size": "4095",
"binary": fa... |
"""
Creates an index of OBO terms in either Python Pickle format or JSON
Input:
You provide a full go.obo file. Only the term id, name and is_a relationship is
really used. The rest is ignored.
Output:
The output is a lookup with the highest-level keys being the different GO namespaces.
Each of these values is a... | {
"content_hash": "e19e26bf4cf9ae87a8708f16d84f2817",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 132,
"avg_line_length": 33.82631578947368,
"alnum_prop": 0.5506457133966081,
"repo_name": "jorvis/biocode",
"id": "e11a97d1e1efd227456aab8293c21745539433c0",
"size": "6451... |
"""A client for in-process kernels."""
#-----------------------------------------------------------------------------
# Copyright (C) 2012 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#------------... | {
"content_hash": "836ccd6a31c26a341d58ba3662c651b1",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 79,
"avg_line_length": 34.08988764044944,
"alnum_prop": 0.523731048121292,
"repo_name": "mattvonrocketstein/smash",
"id": "5f31265771c5170bf53bda4225589e358089b8a0",
"size"... |
import os
from setuptools import setup
PACKAGE_NAME = 'cenaming'
ENCODING = 'utf-8'
local_directory = os.path.abspath(os.path.dirname(__file__))
version_path = os.path.join(local_directory, PACKAGE_NAME, '_version.py')
version_ns = {}
with open(version_path, 'r', encoding=ENCODING) as f:
exec(f.read(), {}, vers... | {
"content_hash": "6c9a42f0536f2d30e64c477b7ac50b61",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 76,
"avg_line_length": 31.372093023255815,
"alnum_prop": 0.6360266864343959,
"repo_name": "portfoliome/cenaming",
"id": "2bdcadeba29aa7e0a9ad2d27730c48a925ff0b86",
"size": ... |
import time
import sys
from i_o import io
from alu import ALU
from memory import Memory
class Controller:
def __init__(self):
"""Model of a standard contoller unit demonstrating the Texas 4-step (fetch,decode,execute,store) with methods for each."""
self.R1 = 0 #General purpose reg... | {
"content_hash": "e3bd5518b2748db24a19470cdf7e17ee",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 131,
"avg_line_length": 41.8375,
"alnum_prop": 0.5162832387212429,
"repo_name": "yebra06/RPNv2-CPU-Simulator",
"id": "dcbf7b09a607ea09b8ada1bd45581f84f0925949",
"size": "33... |
import re
import time
import os
import select
from os import access
from os.path import join, exists, getmtime, getsize
from urllib import unquote
from BaseHTTPServer import BaseHTTPRequestHandler as _
from libs.git import Git
def format_date_time(timestamp):
year, month, day, hh, mm, ss, wd, y, z = time.gmtime(... | {
"content_hash": "d64f10f9ec59623acc87b34825580fd5",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 97,
"avg_line_length": 34.35668789808917,
"alnum_prop": 0.5296625880608083,
"repo_name": "douban/gpack",
"id": "4aed6719f2edd61b3f22dc853e7d5e254e29829a",
"size": "10788",... |
from __future__ import absolute_import
from copy import copy
from itertools import chain
import os
import re
import sys
import shlex
try:
from urllib.request import pathname2url
from urllib.parse import urljoin
except ImportError: # Python2
from urllib import pathname2url
from urlparse import urljoin... | {
"content_hash": "b55e737a0f1775f9328748a04362bee9",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 85,
"avg_line_length": 30.245714285714286,
"alnum_prop": 0.5790666918571699,
"repo_name": "unrealsolver/django-wkhtmltopdf",
"id": "f9d7ac1e59978aeb8e1b1a95b337e05f4e5913ff"... |
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from socialregistration.clients.oauth import OAuth2
from socialregistration.settings import SESSION_KEY
import json
class Instagram(OAuth2):
client_id = getattr(settings, 'INSTAGRAM_CLIENT_ID... | {
"content_hash": "e29a60f2bf031de12b87dec926598558",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 97,
"avg_line_length": 34.651162790697676,
"alnum_prop": 0.6597315436241611,
"repo_name": "mark-adams/django-socialregistration",
"id": "ed7d2348523020d5f26b9860c6edaf5f52adc... |
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils import timezone
from django.db.models import F
from .managers import TopicQuerySet
from ..core.ut... | {
"content_hash": "f460f71dfaad388f6d89b75df2858fa9",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 111,
"avg_line_length": 37.208333333333336,
"alnum_prop": 0.6610675625233297,
"repo_name": "adiyengar/Spirit",
"id": "d68fd9490e096cc69b4c7919c6e463f63eef4b69",
"size": "27... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.