text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Uses Scikit-Learn to compute a best fit function, then draws it in the plot.
"""
##########################################################################
## Imports
##########################################################################
import numpy as np
import matplotlib.pyplot as plt
from sklearn import ... | {
"content_hash": "e2cabf7946b9008a28f312c6447d021d",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 251,
"avg_line_length": 31.775086505190313,
"alnum_prop": 0.587063051290428,
"repo_name": "pdamodaran/yellowbrick",
"id": "32b401fa87822b02b4d821168c74ea5f3155f445",
"size... |
import re
from wlauto import LinuxDevice, Parameter
from wlauto.exceptions import DeviceError
from wlauto.core.device import RuntimeParameter
from wlauto.utils.misc import convert_new_lines
from wlauto.utils.types import boolean
class ChromeOsDevice(LinuxDevice):
name = "chromeos_test_image"
description = "... | {
"content_hash": "36c94658320d27d7773f6277ef62aae0",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 99,
"avg_line_length": 32.11904761904762,
"alnum_prop": 0.6137879911045219,
"repo_name": "bjackman/workload-automation",
"id": "943027a0a29a7e54cb78939c1ad954ef12a8f688",
"... |
from msrest.serialization import Model
class AccessKeys(Model):
"""Namespace/Relay Connection String.
:param primary_connection_string: Primary connection string of the created
namespace authorization rule.
:type primary_connection_string: str
:param secondary_connection_string: Secondary connec... | {
"content_hash": "3a5dee13ca12539f1ff55415ba287d21",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 142,
"avg_line_length": 44.166666666666664,
"alnum_prop": 0.6855345911949685,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "ad3ee4dcc53d652db8346ee30ebcc56dd6ff9470"... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "flights.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is rea... | {
"content_hash": "eea016538b84596c5c166dc2bc634434",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.285714285714285,
"alnum_prop": 0.6206896551724138,
"repo_name": "kostya9/KPI.RelationalDatabases",
"id": "07cfaf696b8ab8599cbfa487f608642564ba9d8f",... |
from security_monkey import app
from security_monkey.cloudaux_watcher import CloudAuxWatcher
from security_monkey.cloudaux_watcher import CloudAuxChangeItem
from security_monkey.decorators import record_exception
from cloudaux.decorators import iter_account_region
class CloudAuxBatchedWatcher(CloudAuxWatcher):
d... | {
"content_hash": "3d78261190303407beb474e9069b6d79",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 117,
"avg_line_length": 48.08163265306123,
"alnum_prop": 0.5600594227504244,
"repo_name": "Netflix/security_monkey",
"id": "a547e8e0e88b4401998e0f1a71a6e143586465fe",
"size... |
import os
import unittest
import numpy as np
import paddle.fluid as fluid
import paddle
os.environ["CPU_NUM"] = "2"
class TestFetchUnmerged(unittest.TestCase):
def conv_net(self, img, label):
conv_pool_1 = fluid.nets.simple_img_conv_pool(
input=img,
filter_size=5,
num_... | {
"content_hash": "aa74cb8058a2c3f516f0b6a743cfa0d0",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 78,
"avg_line_length": 35.1551724137931,
"alnum_prop": 0.5505149583128984,
"repo_name": "luotao1/Paddle",
"id": "0da628db92c1123170e606f29abee330d6a8e66e",
"size": "4691",... |
import base64
from saml2.authn_context import INTERNETPROTOCOLPASSWORD
from saml2.saml import NAMEID_FORMAT_TRANSIENT
from saml2.samlp import NameIDPolicy
from s2repoze.plugins.sp import make_plugin
from saml2.server import Server
ENV1 = {'SERVER_SOFTWARE': 'CherryPy/3.1.2 WSGI Server',
'SCRIPT_NAME': '',
'A... | {
"content_hash": "a249db6e98c09c78607580ae429b9f83",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 102,
"avg_line_length": 35.78947368421053,
"alnum_prop": 0.5658088235294118,
"repo_name": "arbn/pysaml2",
"id": "76c2b551f2b13facc3301e75b42d061e78f82614",
"size": "2767",
... |
import os
import subprocess
import json
import contextlib
from nose.tools import istest, assert_equal, assert_raises
from whack.sources import \
PackageSourceFetcher, PackageSourceNotFound, SourceHashMismatch, \
PackageSource, create_source_tarball
from whack.tempdir import create_temporary_dir
from whack.fil... | {
"content_hash": "5d02fa0d409dc929d852ccccb32b46fa",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 85,
"avg_line_length": 35.06437768240343,
"alnum_prop": 0.6427172582619339,
"repo_name": "mwilliamson/whack",
"id": "3ad857e1ad7b40f3c231bf6edc07cf383754a6c8",
"size": "81... |
import math
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
from utils import *
class batch_norm(object):
def __init__(self, epsilon=1e-5, momentum = 0.9, name="batch_norm"):
with tf.variable_scope(name):
self.epsilon = epsilon
self.momentum... | {
"content_hash": "92bf1981780328ebf5c6977e2633624d",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 157,
"avg_line_length": 40.489583333333336,
"alnum_prop": 0.5809107280679187,
"repo_name": "ultra-lstm/RNA-GAN",
"id": "73463b2b5e1e817800fc84617c999ffb48edf2f5",
"size": "... |
import functools
import itertools
import logging
import random
import time
import six
from oslo.config import cfg
from oslo.messaging._drivers import amqp as rpc_amqp
from oslo.messaging._drivers import amqpdriver
from oslo.messaging._drivers import common as rpc_common
from oslo.messaging import exceptions
from oslo... | {
"content_hash": "9839b766c35c95f0034c4fc9410fe8f3",
"timestamp": "",
"source": "github",
"line_count": 712,
"max_line_length": 79,
"avg_line_length": 36.30477528089887,
"alnum_prop": 0.5481063097218462,
"repo_name": "viggates/oslo.messaging",
"id": "f79fae6a722542a409c5621068c330ae9aa72ece",
"size... |
from __future__ import absolute_import, division, print_function, \
with_statement
import os
import sys
import hashlib
import logging
import binascii
import struct
import base64
import time
import random
import hmac
import hashlib
import string
from shadowsocks import common
from shadowsocks.obfsplugin import pla... | {
"content_hash": "b0cbcac5725c37a2aae4047097ea4d97",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 230,
"avg_line_length": 44.44897959183673,
"alnum_prop": 0.5550964187327824,
"repo_name": "yalewoosoft/shadowsocks",
"id": "1ecf66df878fd189da990e7c571cc889658e56f7",
"siz... |
import json
import os
import tempfile
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from django.test import (
TestCase as BaseTestCase,
Client as BaseClient
)
import factory
from django_nose.tools import assert_equal
from factory import LazyAttribute, Sequence,... | {
"content_hash": "e46b7bd3bb7e9680084706282f260ebc",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 87,
"avg_line_length": 26.936241610738254,
"alnum_prop": 0.6589012084215772,
"repo_name": "mastizada/pontoon",
"id": "c66933104892f55e10fab25d6a15505fe14bd737",
"size": "8... |
from sys import maxsize
class Group:
def __init__(self, group_name=None, group_header=None, group_footer=None, id=None):
self.group_name = group_name
self.group_header = group_header
self.group_footer = group_footer
self.id = id
def __repr__(self):
return '%s:%s' % (se... | {
"content_hash": "3baf63a44030641b78298ec5756fcc3a",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 115,
"avg_line_length": 30.736842105263158,
"alnum_prop": 0.583904109589041,
"repo_name": "werbk/task-4.12-and-4.13",
"id": "123986345f52abded53d378dbd01681bbc7fc42f",
"si... |
"""
Contains the dynamic nested sampler class :class:`DynamicSampler` used to
dynamically allocate nested samples. Note that :class:`DynamicSampler`
implicitly wraps a sampler from :mod:`~dynesty.nestedsamplers`. Also contains
the weight function :meth:`weight_function` and stopping function
:meth:`stopping_function`. ... | {
"content_hash": "b9a1cc0157231f0bcda1c27b61fff6d4",
"timestamp": "",
"source": "github",
"line_count": 2083,
"max_line_length": 79,
"avg_line_length": 41.689390302448395,
"alnum_prop": 0.5213095498566312,
"repo_name": "joshspeagle/dynesty",
"id": "57294af1860e861104e4e1431f7ae7357dc2efd3",
"size":... |
import logging
import traceback
import uuid
from enum import IntEnum, unique
from ._journal import send, syslog_priorities
try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping
_priorities = syslog_priorities()
__all__ = "write", "send", "Priority", "JournaldLogHand... | {
"content_hash": "573d5afc0146e30ee33520eb2dd71c80",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 79,
"avg_line_length": 25.110526315789475,
"alnum_prop": 0.5663382938587298,
"repo_name": "mosquito/python-systemd",
"id": "e58c80971770cb5633dd9cee2f5ddc68189c843e",
"siz... |
from kolibri.auth.api import KolibriAuthPermissions, KolibriAuthPermissionsFilter
from kolibri.content.api import OptionalPageNumberPagination
from rest_framework import filters, viewsets
from .models import ContentRatingLog, ContentSessionLog, ContentSummaryLog, UserSessionLog
from .serializers import ContentRatingLo... | {
"content_hash": "670f1bb6b7fe22d202d18cf78a0c4b72",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 135,
"avg_line_length": 39.22641509433962,
"alnum_prop": 0.8013468013468014,
"repo_name": "ralphiee22/kolibri",
"id": "2fc568ae924af949e53303ddf2ff896263644f04",
"size": "2... |
"""The tests for the litejet component."""
import logging
import unittest
from homeassistant.components import litejet
from tests.common import get_test_home_assistant
_LOGGER = logging.getLogger(__name__)
class TestLiteJet(unittest.TestCase):
"""Test the litejet component."""
def setup_method(self, method... | {
"content_hash": "413cb3fa1ebfa274c2225d7301ed66b1",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 63,
"avg_line_length": 33.333333333333336,
"alnum_prop": 0.6392857142857142,
"repo_name": "ma314smith/home-assistant",
"id": "6d62e1ab0cda60ac0d9ae32e355559f77bb1cd4a",
"si... |
import inspect
import weakref
from typing import TYPE_CHECKING
from typing import Any
from typing import Dict
from typing import Tuple
from typing import Union
import pandas as pd
import apache_beam as beam
from apache_beam import pvalue
from apache_beam.dataframe import expressions
from apache_beam.dataframe import ... | {
"content_hash": "e59a481ef90262b55c65829d234b06af",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 82,
"avg_line_length": 38.526315789473685,
"alnum_prop": 0.6982012750455373,
"repo_name": "robertwb/incubator-beam",
"id": "2b207dda7270df7f36a5724a36a0dbdd97fd6a26",
"siz... |
"""SCons.Platform
SCons platform selection.
This looks for modules that define a callable object that can modify a
construction environment as appropriate for a given platform.
Note that we take a more simplistic view of "platform" than Python does.
We're looking for a single string that determines a set of
tool-ind... | {
"content_hash": "c87958830a6a44b0141ccf08cece9dea",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 97,
"avg_line_length": 38.697095435684645,
"alnum_prop": 0.6316748874115377,
"repo_name": "dezelin/scons",
"id": "f8d804128d0ffd82672e53a9e4643b57815ec05b",
"size": "9326"... |
from flask import Blueprint, render_template
main_module = Blueprint(
'main', __name__, template_folder='transporter/templates')
@main_module.route('/')
def index():
context = {}
return render_template('index.html', **context)
| {
"content_hash": "3c0237e0e4d2a3afd3712d039aecaed6",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 62,
"avg_line_length": 22.09090909090909,
"alnum_prop": 0.6790123456790124,
"repo_name": "suminb/transporter",
"id": "74dbe5a4837a6c1e458b2edd5023dc9870250851",
"size": "24... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='question',
name='demo_1',
field=model... | {
"content_hash": "09b482e34974a657edbaf57cb934a37a",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 73,
"avg_line_length": 28.736842105263158,
"alnum_prop": 0.5412087912087912,
"repo_name": "vithd/vithd.github.io",
"id": "59cf6d6a73a561bf618eaf8ab483436058ee052b",
"size":... |
from setuptools import __version__
from setuptools import setup
if not int(__version__.partition(".")[0]) >= 47:
raise RuntimeError(f"Setuptools >= 47 required. Found {__version__}")
setup()
| {
"content_hash": "471c8837db41361030443c1cfef0303c",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 73,
"avg_line_length": 28.142857142857142,
"alnum_prop": 0.6802030456852792,
"repo_name": "sqlalchemy/alembic",
"id": "1a4f69a8c0cc456cfe831517adad46568b4cbeb1",
"size": "19... |
'''
iOS Compass
-----------
'''
from plyer.facades import Compass
from pyobjus import autoclass
class IosCompass(Compass):
def __init__(self):
super(IosCompass, self).__init__()
self.bridge = autoclass('bridge').alloc().init()
self.bridge.motionManager.setMagnetometerUpdateInterval_(0.1)... | {
"content_hash": "b734ac72cf65d6ec3f5f4f38fbaca13a",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 69,
"avg_line_length": 25.27906976744186,
"alnum_prop": 0.5998160073597056,
"repo_name": "KeyWeeUsr/plyer",
"id": "a710c866d3c8bedd56423bbd5369d0fce67842ff",
"size": "1087"... |
"""project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | {
"content_hash": "65b46f62a9b7d241c6e95e897b5df887",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 118,
"avg_line_length": 42.85454545454545,
"alnum_prop": 0.6304624522698346,
"repo_name": "mitodl/open-discussions",
"id": "f74260293aa5559f90e79ab0f030fcacd1ae4a29",
"siz... |
import os
import ast
import sys
import fnmatch # Py 2
from setuptools import setup
def _glob_glob_recursive(directory, pattern):
# python 2 glob.glob doesn't have a recursive keyword
# this implements for the specific case that we want an exact match
# See also https://stackoverflow.com/a/2186565
ma... | {
"content_hash": "b0f3db20aba37436ef8bec58d75c74a0",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 76,
"avg_line_length": 37.44444444444444,
"alnum_prop": 0.6102161933022467,
"repo_name": "openpathsampling/openpathsampling",
"id": "cf559c88a43da16d9fb68bd3309659c3459c0a7c... |
from radish.stepregistry import step
from radish import when
@step("I have the number {number:g}")
def have_number(step, number):
step.context.numbers.append(number)
@when("I sum them")
def sum_numbers(step):
step.context.result = sum(step.context.numbers)
| {
"content_hash": "4b82368867a84f5aa16df0776bcaf4f3",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 51,
"avg_line_length": 22.416666666666668,
"alnum_prop": 0.7323420074349443,
"repo_name": "SamuelYvon/radish",
"id": "1854f6293953ba9a4855497a8a23cebe6676a2f4",
"size": "29... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 0, transform = "RelativeDifference", sigma = 0.0, exog_count = 100, ar_order = 12); | {
"content_hash": "c7c369a292a7b99f7e3c55ef4706e05d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 177,
"avg_line_length": 39.57142857142857,
"alnum_prop": 0.7184115523465704,
"repo_name": "antoinecarme/pyaf",
"id": "df922dc4f82bdf099a59bd9b601c1641117c24fb",
"size": "277... |
from django.contrib import admin
from test_rest.models import Plant, Animal
# Register your models here.
admin.site.register(Plant)
admin.site.register(Animal) | {
"content_hash": "db8425808b0a497d8d9f5d5e8c45aee9",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 42,
"avg_line_length": 23,
"alnum_prop": 0.8074534161490683,
"repo_name": "sorenh/angular-django-rest-resource",
"id": "3ab7b84b4f993e368911d822f05a1fa9a6dac30b",
"size": "1... |
__author__ = 'reggie'
###START-CONF
##{
##"object_name": "StubModel",
##"object_poi": "vph-101",
##"group" : "public",
##"remoting" : "False",
##"parameters": [
## {
## "name": "StubModelParam",
## "description": "data directory tarred",
## ... | {
"content_hash": "dba869ddd31d29d6e9136394a1b74a40",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 106,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.5163043478260869,
"repo_name": "recap/pumpkin",
"id": "0d1726e53bf2c35fad2e923865ab2c161bb38e75",
"size": "3864... |
from BinPy import *
from BinPy.analog.base import *
class Resistor(Analog):
"""
This Class implements the Resistor, having the following parameters:
'+' : Resistor end at positive potential
'-' : Resistor end at negative potential
'r' : Resistance value
'i' : Current flowing through the resis... | {
"content_hash": "20cf1dc5e5ff60197b1f59976459ca94",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 79,
"avg_line_length": 31.114754098360656,
"alnum_prop": 0.5105374077976818,
"repo_name": "daj0ker/BinPy",
"id": "c944fc76b05f4371965ffe254f27a9e4c8a60c61",
"size": "1898",... |
"""Custom request handlers for pushing data to connected clients."""
from asyncio import Queue
import logging
from tornado.web import RequestHandler
from tornado.websocket import WebSocketHandler, WebSocketClosedError
from tornado.iostream import StreamClosedError
from tornado.log import access_log
from . ... | {
"content_hash": "9fde316b4db93bfd319cba6d69d6caaf",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 84,
"avg_line_length": 32.267716535433074,
"alnum_prop": 0.6220107369448511,
"repo_name": "mivade/tornadose",
"id": "42a04ec94085998408cbbc3323b495496277ac03",
"size": "40... |
__revision__ = "$Id: acspyTestUnitACSHandler.py,v 1.1.1.1 2012/03/07 17:40:45 acaproni Exp $"
#--REGULAR IMPORTS-------------------------------------------------------------
import unittest
import mock
from time import gmtime,sleep
import logging
#--ACS IMPORTS____------------------------------------------------------... | {
"content_hash": "06ac4dbb11cf743ee1f11147d767b027",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 150,
"avg_line_length": 47.10498687664042,
"alnum_prop": 0.6233910960049033,
"repo_name": "csrg-utfsm/acscb",
"id": "2c64b1dbc94f624389de33e0aa122d29cd453069",
"size": "19... |
import sys
class StripeError(Exception):
def __init__(self, message=None, http_body=None, http_status=None,
json_body=None, headers=None):
super(StripeError, self).__init__(message)
if http_body and hasattr(http_body, 'decode'):
try:
http_body = http_... | {
"content_hash": "7706e683f36a6f24645a8f2db6ea2b75",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 70,
"avg_line_length": 27.86046511627907,
"alnum_prop": 0.5847245409015025,
"repo_name": "lextoumbourou/txstripe",
"id": "83a98f3cd97a8a4b7e4a9d578ac00a6b93df0ff1",
"size":... |
from __future__ import unicode_literals
import frappe
from frappe.utils import strip
from frappe.website.doctype.website_theme.website_theme import get_active_theme
no_sitemap = 1
base_template_path = "templates/www/website_script.js"
def get_context(context):
context.javascript = frappe.db.get_single_value('Website... | {
"content_hash": "d57d745c4e02f7795c21b0f758d51191",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 105,
"avg_line_length": 32.5,
"alnum_prop": 0.7369230769230769,
"repo_name": "paurosello/frappe",
"id": "0db00bc3d879f6f18288b99c94b9fe9f94318ee1",
"size": "751",
"binary... |
"""Runs the cluster insight data collector in master mode.
Collects context metadata from multiple places and computes a graph from it.
"""
import argparse
import logging
import sys
import flask
from flask_cors import CORS
# local imports
import collector_error
import constants
import context
import docker
import g... | {
"content_hash": "03eebebe9eeffd2bfed01bdc03c6ceae",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 80,
"avg_line_length": 31.68470588235294,
"alnum_prop": 0.6845388385563642,
"repo_name": "EranGabber/cluster-insight",
"id": "9592d631b988197fa230b9eae7bab5f645066cdc",
"s... |
"""Utility for loading a snapshot of a CouchDB database from a multipart MIME
file.
"""
from __future__ import print_function
from base64 import b64encode
from optparse import OptionParser
import sys
from couchdb import __version__ as VERSION
from couchdb import json
from couchdb.client import Database
from couchdb.m... | {
"content_hash": "f3772d4bcf0d46720dcf5e1b585e5cd3",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 79,
"avg_line_length": 36.71084337349398,
"alnum_prop": 0.579586478503446,
"repo_name": "djc/couchdb-python",
"id": "0d5b7866e11fd92d29e9018357590a9c2a4d8e43",
"size": "328... |
import logging
from threading import local
from django.db import connection
from django.conf import settings
from django.utils._os import safe_join
from tenant_schemas.postgresql_backend.base import FakeTenant
logger = logging.getLogger(__name__)
class TenantProperties(local):
"""
A tenant property file i... | {
"content_hash": "90b81cfd8447368c7eafe567db364f4b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 96,
"avg_line_length": 31.845070422535212,
"alnum_prop": 0.6240601503759399,
"repo_name": "jfterpstra/bluebottle",
"id": "4db378d477030701aa97a9dc8ac1b6186c7acca4",
"size":... |
import _plotly_utils.basevalidators
class CustomdatasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="customdatasrc", parent_name="pointcloud", **kwargs):
super(CustomdatasrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=paren... | {
"content_hash": "fda80e546382b695375aab5bb874710d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 88,
"avg_line_length": 37.72727272727273,
"alnum_prop": 0.6385542168674698,
"repo_name": "plotly/plotly.py",
"id": "4db30466e19af7ca1ca5f0cf2ea9caaab0858585",
"size": "415"... |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import division
import numpy as np
from sklearn import datasets, cluster, metrics
from sklearn.model_selection import GridSearchCV
class UnsupervisedCV(object):
def __init__(self, n_samples):
self.n_samples = n... | {
"content_hash": "79da3e7db001b41e94c507f71e4741f6",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 102,
"avg_line_length": 28.029411764705884,
"alnum_prop": 0.6594963273871983,
"repo_name": "joshloyal/ClumPy",
"id": "a280bd259b3e5466581cabc16168f9a6d43a16b0",
"size": "19... |
from builtins import object
from pyemvtlv.types import tags
td = {getattr(getattr(tags, n), '_tagid', None): getattr(tags, n)
for n in dir(tags) if getattr(getattr(tags, n), '_tagid', None)}
FS = '\x1c'
class Decoder(object):
def __init__(self, taghash):
self.__taghash = taghash
def __call__(... | {
"content_hash": "9ee5146c9ea767025d7707e97d82edb3",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 73,
"avg_line_length": 30.137931034482758,
"alnum_prop": 0.5732265446224256,
"repo_name": "mmattice/pyemvtlv",
"id": "b635d8c578102ebbcd25d1f9dd97d2295766c162",
"size": "23... |
"""
To run these tests against a live database:
1. Modify the file `keystone/tests/unit/config_files/backend_sql.conf` to use
the connection for your live database.
2. Set up a blank, live database.
3. Run the tests using::
tox -e py27 -- keystone.tests.unit.test_sql_migrate_extensions
WARNING::
Your data... | {
"content_hash": "53fc4037a063c93cc841341e2cd23ff0",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 77,
"avg_line_length": 28.773809523809526,
"alnum_prop": 0.643773272652048,
"repo_name": "klmitch/keystone",
"id": "125b915055d269a222eed4e0a5d0acdecb13b8ec",
"size": "3002... |
import random
import sys
from logging import Logger, LoggerAdapter
from typing import Union
RESET_CODE = '\x1b[m'
class LogDecorator(LoggerAdapter):
"""Decorates log messages with colors in console output."""
def __init__(self, logger: Union[Logger, LoggerAdapter], key: str):
super().__init__(logger, {})
... | {
"content_hash": "3bb9245dac27874ee7042be0b1bf2341",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 90,
"avg_line_length": 31.054054054054053,
"alnum_prop": 0.6614447345517842,
"repo_name": "firebase/firebase-android-sdk",
"id": "177f5a1a3ba0b71d0f2e9d2c07a06af8664e38ff",
... |
import numpy as np
import scipy.stats as stats
import sys
# lib eh a nossa biblioteca criada para este trabalho
import lib.naive_bayes as nb
import lib.preprocessing as prep
import lib.validation as valid
from config.constants import *
def case2(indexes=CASE_2_ATTRIBUTE_INDEXES,output=True):
accuracy_in_each_... | {
"content_hash": "f63800c146d8b7d33975a0418069b8ea",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 189,
"avg_line_length": 36.54978354978355,
"alnum_prop": 0.6008527774487741,
"repo_name": "queirozfcom/spam-filter",
"id": "a9409ae93e931598bca9cc75ed117745a8e1f952",
"siz... |
import _plotly_utils.basevalidators
class UsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="usrc", parent_name="cone", **kwargs):
super(UsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwa... | {
"content_hash": "a5ec7441a4682dd1dfe0e899c9504647",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 73,
"avg_line_length": 34.72727272727273,
"alnum_prop": 0.6073298429319371,
"repo_name": "plotly/plotly.py",
"id": "b3f75fb6fa292d7635dc473afac4e825651a17d2",
"size": "382"... |
from __future__ import absolute_import
from __future__ import print_function
import sys, os.path
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from dpark import DparkContext
from dpark.bagel import Vertex, Edge, Bagel
def parse_vertex(line, numV):
fields = line.split(' ')
t... | {
"content_hash": "71157fb2421ffe898879b03ae2bbfa05",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 96,
"avg_line_length": 34.659574468085104,
"alnum_prop": 0.6390423572744015,
"repo_name": "douban/dpark",
"id": "61348fa17f476081fcc301ccf6ec63a3726e9f18",
"size": "1651",
... |
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import int_or_none
class LiveLeakIE(InfoExtractor):
_VALID_URL = r'^(?:http://)?(?:\w+\.)?liveleak\.com/view\?(?:.*?)i=(?P<video_id>[\w_]+)(?:.*)'
_TESTS = [{
'url': 'http://www.liveleak.com/... | {
"content_hash": "3751143355f7f70fde3e252f841ffe5e",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 223,
"avg_line_length": 40.145833333333336,
"alnum_prop": 0.5228334198235599,
"repo_name": "Celthi/youtube-dl-GUI",
"id": "b04be1e8cfda94addca26a1d1e3731ce61519dc1",
"size"... |
from app import db
class Asset(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64), index=True)
bytes = db.Column(db.Integer)
batch_id = db.Column(db.Integer, db.ForeignKey('batch.id'))
def __repr__(self):
return '<Asset %r>' % (self.name)
class Batche... | {
"content_hash": "1ae1c96d92e37ebe75ef3596c8e3edcd",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 63,
"avg_line_length": 25.142857142857142,
"alnum_prop": 0.6041666666666666,
"repo_name": "jwestgard/elk",
"id": "055580b1950428e8c9061ea3fead76ca844cb2ad",
"size": "528",
... |
"""Functional tests for depthwise convolutional operations."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.fram... | {
"content_hash": "528d96ac57e060b5a449da578ddcd47d",
"timestamp": "",
"source": "github",
"line_count": 619,
"max_line_length": 80,
"avg_line_length": 39.25686591276252,
"alnum_prop": 0.5837037037037037,
"repo_name": "alsrgv/tensorflow",
"id": "0717b058f47f6d63a330459511a236e8a5479528",
"size": "24... |
"""Tests for recurrent layers functionality other than GRU, LSTM, SimpleRNN.
See also: lstm_test.py, gru_test.py, simplernn_test.py.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python import keras
from tensorflow... | {
"content_hash": "72bd548c929bd41ef60056ac9a9a3792",
"timestamp": "",
"source": "github",
"line_count": 564,
"max_line_length": 81,
"avg_line_length": 36.273049645390074,
"alnum_prop": 0.5977612669860202,
"repo_name": "jart/tensorflow",
"id": "fefb92826b33b65a14ba667207995b6e4194c202",
"size": "211... |
"""
Application main for the mixmind app
"""
import os
import random
import datetime
import tempfile
import urllib.request, urllib.parse, urllib.error
import codecs
import pendulum
from functools import wraps
from flask import g, render_template, flash, request, send_file, jsonify, redirect, url_for, after_this_reque... | {
"content_hash": "455606482a0f782f5df33cd445c9845b",
"timestamp": "",
"source": "github",
"line_count": 887,
"max_line_length": 203,
"avg_line_length": 42.95377677564825,
"alnum_prop": 0.6020734908136482,
"repo_name": "twschum/mix-mind",
"id": "b15f2924c16661ae9a203380f80b729d1d51b69a",
"size": "38... |
import os
from girder.models.setting import Setting
class ImageSpaceSetting(Setting):
requiredSettings = ('IMAGE_SPACE_SOLR',
'IMAGE_SPACE_PREFIX',
'IMAGE_SPACE_SOLR_PREFIX')
def validateImageSpaceSolr(self, doc):
return doc.rstrip('/')
def valida... | {
"content_hash": "b427b2b1a435174f3cad7a8e0186a135",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 89,
"avg_line_length": 29.3,
"alnum_prop": 0.6063708759954494,
"repo_name": "smadha/image_space",
"id": "1b9d60dc48024d0f4fc19a7bbdca0b464a244b38",
"size": "879",
"binary... |
"""Probabilistic neural layers.
See ${python/contrib.bayesflow.layers}.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# go/tf-wildcard-import
# pylint: disable=wildcard-import
from tensorflow.contrib.bayesflow.python.ops.layers_dense_variational_impl... | {
"content_hash": "19b29384360c7fcb6d1f1eaf6bee43f3",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 83,
"avg_line_length": 26.652173913043477,
"alnum_prop": 0.7487765089722676,
"repo_name": "laszlocsomor/tensorflow",
"id": "dcead38af826a12e776160bdb251ba021e6b953c",
"size... |
import olympia.core.logger
from olympia.amo.celery import task
from olympia.tags.models import Tag
task_log = olympia.core.logger.getLogger('z.task')
@task(rate_limit='10/m')
def update_all_tag_stats(pks, **kw):
task_log.info("[%s@%s] Calculating stats for tags starting with %s" %
(len(pks), u... | {
"content_hash": "47f3e14a22a85e212dfda30c967db657",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 73,
"avg_line_length": 30.047619047619047,
"alnum_prop": 0.6434231378763867,
"repo_name": "harikishen/addons-server",
"id": "9b1c789188f37d98d956725b7a0613a4ece30384",
"siz... |
import os
import sys
import shutil
files = []
for dirpath, dirnames, filenames in os.walk(".", True):
if dirpath.find(".svn")>=0: continue
for elem in dirnames:
if elem.find(".svn") >= 0:
dirnames.pop(dirnames.index(elem))
for filename in filenames:
if filename.ends... | {
"content_hash": "7bcfa9a177455d53fae4c7f8658a4135",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 63,
"avg_line_length": 23.37142857142857,
"alnum_prop": 0.5501222493887531,
"repo_name": "mpasternak/django-platnosci",
"id": "c9f73788e8f39e7887f3eb7d80cee6c54766edef",
"s... |
import logging
import numpy as np
import copy
logger = logging.getLogger("vaex.ui.undo")
class UndoManager(object):
def __init__(self, max_bytes=1024**3):
self.actions_undo = []
self.actions_redo = []
self.undo_count = 0 # number of times undo is pressed
def undo(self):
logg... | {
"content_hash": "ae294e021ce974354843ff6b5a93c146",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 129,
"avg_line_length": 36.97457627118644,
"alnum_prop": 0.6348842539537016,
"repo_name": "maartenbreddels/vaex",
"id": "92d326dab70f505220eefdc935db413f8fd20ee9",
"size":... |
from imgurpython import ImgurClient
import click
import os
@click.command()
@click.argument('gif', type=click.Path(exists=True))
def upload_gif(gif):
"""Uploads an image file to Imgur"""
client_id = os.environ.get('IMGUR_API_ID')
client_secret = os.environ.get('IMGUR_API_SECRET')
if client_id is Non... | {
"content_hash": "31249202450baf323ff2d9923db92b17",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 107,
"avg_line_length": 27.321428571428573,
"alnum_prop": 0.6784313725490196,
"repo_name": "atbaker/imgur-uploader",
"id": "ec0b1e80ff6f58279511012919feb15992e116ec",
"size... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import mezzanine.core.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('pages', '0003_auto_20150527_1555'),
]
operations = [
migrations.Cr... | {
"content_hash": "9be53e056d8b543ab2e9cbac19d8c796",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 185,
"avg_line_length": 30.551724137931036,
"alnum_prop": 0.5880361173814899,
"repo_name": "serialworm/jessiebeemine",
"id": "5f21af8aaefe57cbee12a414e44815d53f150da7",
"si... |
for f in AllFonts():
hasEdits = False
for name, members in f.groups.items():
groupHasEdits = False
new = []
for m in members:
if m[-1] == "'":
groupHasEdits = True
hasEdits = True
new.append(m[:-1])
else:
... | {
"content_hash": "06abd365b2b0c5f1b1b9774ef60ef67a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 47,
"avg_line_length": 27,
"alnum_prop": 0.46393762183235865,
"repo_name": "typemytype/RoboFontExamples",
"id": "5b331c2066db077ace61434be519cb6efa9f9196",
"size": "514",
... |
"""Tests for prefetching_ops_v2."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.distribute.python import prefetching_ops_v2
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.framework import errors
from ten... | {
"content_hash": "cef3e7bd45df110f8db212c18f70b03d",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 73,
"avg_line_length": 33.276315789473685,
"alnum_prop": 0.6888098062475286,
"repo_name": "kobejean/tensorflow",
"id": "16799104e8112f4391152c0cf2a15af81f8c2c9d",
"size": "... |
import json
import re
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import transaction
from django.utils.html import format_html
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy, gettext_noo... | {
"content_hash": "fc17233911842e4a5150bd35c8053575",
"timestamp": "",
"source": "github",
"line_count": 994,
"max_line_length": 127,
"avg_line_length": 35.145875251509054,
"alnum_prop": 0.588178044940604,
"repo_name": "dimagi/commcare-hq",
"id": "6a0a067ed6178efaa3360f25c887d50cffb09202",
"size": "... |
from setuptools import setup
from Cython.Build import cythonize
import Cython.Compiler.Options
Cython.Compiler.Options.annotate = True
setup(
name="cyintegrate",
ext_modules=cythonize('cyintegrate.pyx', compiler_directives={'embedsignature': True}),
)
| {
"content_hash": "a51580fe2e65c169565895c7ea800db9",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 91,
"avg_line_length": 26.2,
"alnum_prop": 0.7786259541984732,
"repo_name": "tleonhardt/Python_Interface_Cpp",
"id": "7546d6c9e4874ab80f9d1fdd74c29d67d7c98883",
"size": "27... |
import posix
from nova import test
from nova.virt.docker import hostinfo
class HostInfoTestCase(test.NoDBTestCase):
def setUp(self):
super(HostInfoTestCase, self).setUp()
hostinfo.get_meminfo = self.get_meminfo
hostinfo.statvfs = self.statvfs
def get_meminfo(self):
data = ['... | {
"content_hash": "1224ca4a84d2a8dc80008cb9ce95cc30",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 62,
"avg_line_length": 34.93023255813954,
"alnum_prop": 0.6198402130492676,
"repo_name": "TieWei/nova",
"id": "c66768896da174a93089a9be9f9cb6f945f3a432",
"size": "2182",
... |
from __future__ import unicode_literals
from distutils import dir_util
from pytest import fixture
import os
@fixture
def datadir(tmpdir, request):
"""
Fixture responsible for searching a folder with the same name of test
module and, if available, moving all contents to a temporary directory so
tests c... | {
"content_hash": "f4500d722d5aba97bc9aa4921314140a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 77,
"avg_line_length": 26.8,
"alnum_prop": 0.7014925373134329,
"repo_name": "SirEdvin/Pandas-Pipe",
"id": "3c97a0fed655933de8243160a9422cbf560c6553",
"size": "536",
"bina... |
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pp... | {
"content_hash": "edbb5fdfa40288eef6b7ab4898a7f3c7",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 193,
"avg_line_length": 33.79421221864952,
"alnum_prop": 0.6113225499524263,
"repo_name": "docusign/docusign-python-client",
"id": "3f33601cf7b6d779cb28bad2fffc6fffcd49ae94"... |
from __future__ import absolute_import
from .bspecs import Bspecs
from .monte import Monte
from .eci import ECI
from .helpers import *
from . import monte
from . import ECI
from . import properties
| {
"content_hash": "db63d7f904c2bf637495187dee4ee8ca",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 38,
"avg_line_length": 22.11111111111111,
"alnum_prop": 0.7688442211055276,
"repo_name": "goirijo/thermoplotting",
"id": "a272f93252b3b5291728c772103d4f165c98e611",
"size": ... |
from rlkit.policies.base import Policy
class RandomPolicy(Policy):
"""
Policy that always outputs zero.
"""
def __init__(self, action_space):
self.action_space = action_space
def get_action(self, obs):
return self.action_space.sample(), {}
| {
"content_hash": "29174fb83ea728525c8cb8c45edb7ee6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 45,
"avg_line_length": 21.53846153846154,
"alnum_prop": 0.6321428571428571,
"repo_name": "google-research/DBAP-algorithm",
"id": "ef9ef71935290e1b329831d2a77d2bc0a915da76",
... |
import sys
import unittest
from libcloud.utils.py3 import httplib
from libcloud.dns.types import RecordType, ZoneDoesNotExistError
from libcloud.dns.types import RecordDoesNotExistError
from libcloud.dns.drivers.hostvirtual import HostVirtualDNSDriver
from libcloud.test import MockHttp
from libcloud.test.file_fixture... | {
"content_hash": "aeb2aef5ac1b58d8447e7968370e9c24",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 79,
"avg_line_length": 38.111111111111114,
"alnum_prop": 0.6111651009610193,
"repo_name": "Jc2k/libcloud",
"id": "3ff404f870739d0a910c1df131064b0ea78aacde",
"size": "10043... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.pr... | {
"content_hash": "fdb50e390bf46492ad35e18a07ee43c2",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 436,
"avg_line_length": 42.98888888888889,
"alnum_prop": 0.7428276040320496,
"repo_name": "bellowsj/aiopogo",
"id": "fbc49167ec272977634bbd5b256a40ad17067b9d",
"size": "400... |
__author__ = 'Bryan Gregory'
__email__ = '[email protected]'
__date__ = '12-24-2013'
#Internal modules
import utils
#Start logger to record all info, warnings, and errors to Logs/logfile.log
log = utils.start_logging(__name__)
import munge
import train
import data_io
import features
import ensembles
#External ... | {
"content_hash": "3c0aa7bd3a63ac8ffa18afdbc238358c",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 120,
"avg_line_length": 57.88211382113821,
"alnum_prop": 0.5920359575812908,
"repo_name": "rolando/theusual-kaggle-seeclickfix-ensemble",
"id": "bb0aa4b44412e8e8a28526ce6a60... |
import copy
import eventlet
import mock
from nova import exception
from nova import objects
from nova import test
from pypowervm.tests import test_fixtures as pvm_fx
from pypowervm.wrappers import iocard as pvm_card
from pypowervm.wrappers import network as pvm_net
from nova_powervm.tests.virt import powervm
from nov... | {
"content_hash": "e5bc1fddb318a29044a6cfa00aaff536",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 79,
"avg_line_length": 43.8225,
"alnum_prop": 0.6013463403502767,
"repo_name": "stackforge/nova-powervm",
"id": "c04e8aa221456c287f5d42ec2b421df322445b3a",
"size": "18162"... |
from __future__ import division
import numpy as np
from library import match_args_return
from constants import cp0
from conversions import t_from_CT, pt_from_CT
from absolute_salinity_sstar_ct import CT_from_t
from basic_thermodynamic_t import rho_t_exact, alpha_wrt_CT_t_exact
from basic_thermodynamic_t import beta_c... | {
"content_hash": "af70dd4562a076ac40b5145f7c25b1f7",
"timestamp": "",
"source": "github",
"line_count": 856,
"max_line_length": 79,
"avg_line_length": 29.917056074766354,
"alnum_prop": 0.629270959428326,
"repo_name": "lukecampbell/python-gsw",
"id": "bf6ceefd24711772231c90a40fd4391552ccc8c7",
"size... |
"""Utilities for exporting TensorFlow symbols to the API.
Exporting a function or a class:
To export a function or a class use tf_export decorator. For e.g.:
```python
@tf_export('foo', 'bar.foo')
def foo(...):
...
```
If a function is assigned to a variable, you can export it by calling
tf_export explicitly. For ... | {
"content_hash": "90ba466182d783a1abb28b5a3fcd3339",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 95,
"avg_line_length": 33.10941475826972,
"alnum_prop": 0.6829849369812481,
"repo_name": "Intel-Corporation/tensorflow",
"id": "ec126807620614fab011599b72b694f67fce419a",
... |
class Solution:
# @param root, a tree node
# @return a boolean
def isSymmetric(self, root):
if not root:
return True
return self.isSym(root.left, root.right)
def isSym(self, left, right):
if (not left) and (not right):
return True
if ... | {
"content_hash": "e1d39da3b19b2df2fa32265220c244e6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 88,
"avg_line_length": 30.526315789473685,
"alnum_prop": 0.5448275862068965,
"repo_name": "pikeszfish/Leetcode.py",
"id": "68a9f5580228eb681a3f920d661a1b294a30db55",
"size"... |
from __future__ import absolute_import
import sys
from thrift.util.Recursive import fix_spec
from thrift.Thrift import TType, TMessageType, TPriority, TRequestContext, TProcessorEventHandler, TServerInterface, TProcessor, TException, TApplicationException, UnimplementedTypedef
from thrift.protocol.TProtocol import TPro... | {
"content_hash": "4be85ca9d76c695aedaff2866b2cb653",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 184,
"avg_line_length": 29.90909090909091,
"alnum_prop": 0.7826747720364742,
"repo_name": "facebook/fbthrift",
"id": "f0d29b26f382455140d058cb0f182855c5e31da1",
"size": "77... |
FAILEDOPERATION = 'FailedOperation'
# API网关触发器创建失败。
FAILEDOPERATION_APIGATEWAY = 'FailedOperation.ApiGateway'
# 创建触发器失败。
FAILEDOPERATION_APIGW = 'FailedOperation.Apigw'
# 获取Apm InstanceId失败。
FAILEDOPERATION_APMCONFIGINSTANCEID = 'FailedOperation.ApmConfigInstanceId'
# 当前异步事件状态不支持此操作,请稍后重试。
FAILEDOPERATION_ASYNCEVEN... | {
"content_hash": "a5bcd6a3a8fbfc80dd8e1da515dcd47d",
"timestamp": "",
"source": "github",
"line_count": 820,
"max_line_length": 119,
"avg_line_length": 29.76951219512195,
"alnum_prop": 0.8446192290360903,
"repo_name": "tzpBingo/github-trending",
"id": "02daac0195c759a79be57085148ca6cb767ff6d2",
"si... |
from __future__ import absolute_import
"""
"""
__author__ = "Jerome Samson"
__copyright__ = "Copyright 2015, Mikros Image"
import logging
from datetime import datetime
try:
import simplejson as json
except ImportError:
import json
from puliclient.server.server import Server, RequestError, RequestTimeoutErro... | {
"content_hash": "2441372c3189c5079d884940e7d2c13e",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 86,
"avg_line_length": 29.298969072164947,
"alnum_prop": 0.5816326530612245,
"repo_name": "smaragden/OpenRenderManagement",
"id": "a701d3be9befdd49769f4d06f99d77eb8a026f8a",... |
__author__ = 'Mark McBride'
from . import Command
import os
import shutil
import subprocess
import traceback
from copy import copy
from twitter.common.collections import OrderedSet
from twitter.pants import is_jvm
from twitter.pants.base import Address, Target
from twitter.pants.targets import JavaLibrary
from twitt... | {
"content_hash": "5b3341d9bdbffe0e658d4c01ff2cafa4",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 109,
"avg_line_length": 35.324503311258276,
"alnum_prop": 0.6370453693288339,
"repo_name": "foursquare/commons-old",
"id": "67c1c70afc4e9c0b781ebf03b6a222460804bc7a",
"siz... |
from flask_wtf import Form
from wtforms import TextField
from wtforms.validators import DataRequired
class TodoForm(Form):
todo = TextField('todo', validators=[DataRequired()])
| {
"content_hash": "d6570dddb9d5da721077e6b61bcd6cb1",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 57,
"avg_line_length": 26.142857142857142,
"alnum_prop": 0.7814207650273224,
"repo_name": "stanzheng/tastemvc",
"id": "8a6276d74521184f9510d7ccc401b6818d8c88f1",
"size": "18... |
from discord.ext import commands
import discord
class Help:
def __init__(self, bot):
self.bot = bot
self.bot.remove_command('help')
@commands.command(pass_context=True)
async def help(self, ctx):
embed = discord.Embed(colour=0x933FCA)
embed.set_author(name=self.bot.user.nam... | {
"content_hash": "7dc2760f5670f87ec828001da379ad8e",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 124,
"avg_line_length": 32.723404255319146,
"alnum_prop": 0.5325097529258778,
"repo_name": "Mine15029/Magikal-Wazard-Bots",
"id": "fff9f0291555f474ac9fac946f8c8bf25207b222",
... |
from rosbridge_library.capability import Capability
from datetime import datetime
import threading
class ReceivedFragments():
"""
Singleton class to hold lists of received fragments in one 'global' object
"""
class __impl:
""" Implementation of the singleton interface """
def spam(self)... | {
"content_hash": "5201b4b2f91be2cb254ae2e0d28fe753",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 212,
"avg_line_length": 44.192893401015226,
"alnum_prop": 0.5746611532276591,
"repo_name": "SNU-Sigma/rosbridge_suite",
"id": "29ef1a6e9db2a410b3e2579a6d145ffc1d3ea432",
"... |
import rest_framework.views
import rest_framework.response
from fjord.base.utils import smart_str
from fjord.events.models import get_product_details_history
class EventAPI(rest_framework.views.APIView):
def get(self, request):
events = get_product_details_history()
products = smart_str(request.... | {
"content_hash": "479622fba3e5513dd01e1c0bf51277fc",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 69,
"avg_line_length": 34.975,
"alnum_prop": 0.5889921372408864,
"repo_name": "Ritsyy/fjord",
"id": "ffdafb1d3887f765ca149205b608af1db1367281",
"size": "1399",
"binary": ... |
"""plot metrics with matplotlib"""
import os.path
import shutil
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
from ._numpy import NumpyMetric
__all__ = ['PlotMetric']
class PlotMetric(NumpyMetric... | {
"content_hash": "8973ff053813dbaabdd032d0b199ba41",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 103,
"avg_line_length": 33.1764705882353,
"alnum_prop": 0.6205673758865248,
"repo_name": "wearpants/measure_it",
"id": "b40e842775e838d2dd3b29cf00e1cf5d19eb008c",
"size": "... |
from django.shortcuts import render
from django.views.generic import TemplateView, View
from django.http import HttpResponse
from django.views.decorators.cache import cache_page
from django.views.decorators.csrf import csrf_exempt
from django.conf import settings
from common.diagrams_gpcr import DrawSnakePlot
from co... | {
"content_hash": "0e38c221ed5068ce9a7b70ae9d602c9b",
"timestamp": "",
"source": "github",
"line_count": 2351,
"max_line_length": 379,
"avg_line_length": 51.393024245002124,
"alnum_prop": 0.5432898820608317,
"repo_name": "fosfataza/protwis",
"id": "094c222543c805cfbf845fac2cf288ffc90c0ae8",
"size": ... |
"""
This module provides tools for deblending overlapping sources labeled in
a segmentation image.
"""
import warnings
from multiprocessing import cpu_count, get_context
import numpy as np
from astropy.units import Quantity
from astropy.utils.decorators import deprecated_renamed_argument
from astropy.utils.exceptions... | {
"content_hash": "4284add07dd5a2643f29ea6c669e1fff",
"timestamp": "",
"source": "github",
"line_count": 552,
"max_line_length": 78,
"avg_line_length": 42.15760869565217,
"alnum_prop": 0.6126079669975506,
"repo_name": "astropy/photutils",
"id": "f9efd47002d2f3b879320939fc659fd0f2318d0f",
"size": "23... |
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest ; pytest
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Standard library imports
# External impo... | {
"content_hash": "dafed40b8257f8a0a9029a3dd7241d66",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 82,
"avg_line_length": 30.375,
"alnum_prop": 0.3230452674897119,
"repo_name": "jakirkham/bokeh",
"id": "1f9975f405aede474ad481e149e0f534e3bf4fdc",
"size": "1978",
"binary... |
import sys,ctypes
from twisted.python import filepath
from pyglet import gl
from pyglet import clock
def glvec(*args):
return (gl.GLfloat * len(args))(*args)
## Debugging stuff
def show_caller(level):
l = level + 1
frame = sys._getframe(l)
fname = frame.f_code.co_filename.split(os.path.sep)[-1]
... | {
"content_hash": "41b400d23ea54903851bb9dfaab0b599",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 85,
"avg_line_length": 28.69182389937107,
"alnum_prop": 0.6067514248136782,
"repo_name": "Knio/miru",
"id": "80356c7a40375b534b5dbf89d1a44b373e5b0dc9",
"size": "4672",
"... |
"""NDArray configuration API."""
import ctypes
from ..base import _LIB
from ..base import c_str_array, c_handle_array
from ..base import NDArrayHandle, CachedOpHandle, SymbolHandle
from ..base import check_call
from .. import _global_var
def _monitor_callback_wrapper(callback):
"""A wrapper for the user-defined... | {
"content_hash": "65963e4f626e25ad1015c592dc85e2e5",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 106,
"avg_line_length": 36.5026455026455,
"alnum_prop": 0.5860269604290477,
"repo_name": "leezu/mxnet",
"id": "15bdbc4afdc49ce1b719e6dead6d0bdfc2a159e5",
"size": "7820",
... |
nullField = None
class NullField(object):
"""
Represents a null field that does not exists.
"""
def __new__(cls, *args, **kwargs):
global nullField
if nullField is None:
nullField = object.__new__(cls, *args, **kwargs)
return nullField
def __init__(self):
... | {
"content_hash": "265d7075193118b28e7823258edf71cd",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 60,
"avg_line_length": 21.695652173913043,
"alnum_prop": 0.5425851703406813,
"repo_name": "srickardti/openthread",
"id": "19103300b441e2efe3619010fec5c8ef4e7ffeb1",
"size":... |
import pytz
from datetime import datetime
from factory import DjangoModelFactory
from factory.fuzzy import FuzzyDateTime, FuzzyChoice
from mii_interface.models import Report
class ReportFactory(DjangoModelFactory):
class Meta:
model = Report
date = FuzzyDateTime(datetime(2000, 1, 1, tzinfo=pytz.UT... | {
"content_hash": "b3704284cb2ef742bee6407b2aedf359",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 71,
"avg_line_length": 25.235294117647058,
"alnum_prop": 0.7319347319347319,
"repo_name": "MiiRaGe/miilibrary",
"id": "39f35f977957c6b6ce053efb5fa08252d02f048b",
"size": "4... |
{{ license }}
# Author: {{ author }}
class CommonError(Exception):
message = "An unknown exception occurred."
errcode = -1
def __init__(self, **kwargs):
super(CommonError, self).__init__(self.message % kwargs)
self.msg = self.message % kwargs
def __unicode__(self):
return uni... | {
"content_hash": "4a959bd56298aa2e9d13ef04b94a2e05",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 64,
"avg_line_length": 23.11764705882353,
"alnum_prop": 0.6030534351145038,
"repo_name": "jianingy/codeskel",
"id": "152de9d1da57777163fcf2c6d17f561643c52ace",
"size": "443... |
import sys
from search import views as search_views
from dashboard import views as dashboard_views
from dashboard import api as dashboard_api
if sys.version_info[0] > 2:
from django.urls import re_path
else:
from django.conf.urls import url as re_path
urlpatterns = [
re_path(r'^install_examples$', search_views... | {
"content_hash": "47f956ba9ac6c217dbd2aad040d3ff16",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 113,
"avg_line_length": 47.95918367346939,
"alnum_prop": 0.7148936170212766,
"repo_name": "cloudera/hue",
"id": "fb61c3ea5bc84670cc280019cafbb4812e9292fe",
"size": "3142",
... |
"""
.. module:: upload.constants
"""
CONTENT_RANGE_HEADER = 'Content-Range'
MAX_CHUNKSIZE = 512000 # 512 kb
ALLOWED_MIMETYPES = [
'video/x-msvideo',
'image/x-ms-bmp',
'application/msword',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.openxmlformat... | {
"content_hash": "337688f1b2600eac5e16ac302ac9d3a6",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 80,
"avg_line_length": 27.29787234042553,
"alnum_prop": 0.6718628215120811,
"repo_name": "CityOfNewYork/NYCOpenRecords",
"id": "962de66e7606f90eae776313c810d306f3bf426c",
"... |
__all__ = ['subsystem_apply']
from itertools import product
from numpy import transpose, sqrt, arange, array, isreal, zeros, shape
from numpy import hstack, vsplit, hsplit, reshape
from scipy.linalg import eig
from qutip.qobj import Qobj, issuper, isket, isoper
from qutip.states import ket2dm
from qutip.operators im... | {
"content_hash": "d37ef2abc850d30155ad1bfbc0719d95",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 79,
"avg_line_length": 34.261538461538464,
"alnum_prop": 0.609452177817692,
"repo_name": "anubhavvardhan/qutip",
"id": "4b3ff19a4d7a63d5bb96068d08f195f6ef7e9486",
"size": ... |
import pyopencl as cl
import numpy as np
import time # For measure the running times
VECTOR_SIZE = 50000 # Elements of vector
# Create two random vectors a & b
a_host = np.random.rand(VECTOR_SIZE).astype(np.float32)
b_host = np.random.rand(VECTOR_SIZE).astype(np.float32)
# Create a empyy vector for the result
res_... | {
"content_hash": "5a56ece5dda568dc21962c35ad7091ba",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 102,
"avg_line_length": 25.208333333333332,
"alnum_prop": 0.6942148760330579,
"repo_name": "javierip/parallel-processing-teaching-toolkit",
"id": "5144c763b7cb3c07dce78a7a1f4... |
import pyd.support
from pyd.support import setup, Extension, pydexe_sanity_check
pydexe_sanity_check()
projName = 'class_wrap'
ext_modules = setup(
name=projName,
version='1.0',
ext_modules=[
Extension("class_wrap", ["class_wrap.d"],
d_unittest=True,
build_deimos=... | {
"content_hash": "f594e3b7082666eca443f327e72c877c",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 61,
"avg_line_length": 23.4375,
"alnum_prop": 0.5653333333333334,
"repo_name": "John-Colvin/pyd",
"id": "41daefb7380142574bfa5e43abcea60fd390ab29",
"size": "375",
"binary... |
""" Basic MORSE simulation scene using the under_water environment. Used to
evaluate the correct handling of the HVL. It represents a simplified UOX
fuel element surrounded by water.
Run with a command line argument "debug" to connect to the PyCharm remote
debugger (you have to alter the path to the library to match y... | {
"content_hash": "d6eecba96c6893cf4c75fb25b3c3a367",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 99,
"avg_line_length": 32.72222222222222,
"alnum_prop": 0.7702320316921336,
"repo_name": "mklostermann/morse-radiation_sensor",
"id": "c4ee4aabe7967691e3c14361b38d98ae32248a0... |
import sys
# Force the local copy of csbuild to be used rather than the installed copy.
sys.path.insert(0, "../../../")
import csbuild
csbuild.Toolchain( "gcc", "ios" ).Compiler().SetCppStandard( "c++11" )
csbuild.Toolchain( "gcc", "ios" ).SetCppStandardLibrary( "libc++" )
csbuild.DisablePrecompile()
csbuild.Disabl... | {
"content_hash": "43739665318e1b42b30ea8ab89616391",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 110,
"avg_line_length": 33,
"alnum_prop": 0.7634885439763488,
"repo_name": "ShadauxCat/csbuild",
"id": "e4b2088d3d6f00a0126fe3b31b617222fd186cf9",
"size": "1372",
"binary... |
import logging
import datetime
import json
import re
from google.appengine.api import urlfetch
from google.appengine.api import memcache
from api.v2.parking.parkingdata import ParkingData
from api.BeautifulSoup import BeautifulSoup
from api.v2 import api_utils
# Handles fetch, parse and combine of cityparking data... | {
"content_hash": "bb9dba6152ad64e9cddc933e622ac647",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 114,
"avg_line_length": 39.370892018779344,
"alnum_prop": 0.5949201049367995,
"repo_name": "gtracy/madison-transit-api",
"id": "9531ccdf2f78c35b9efafe5b9a1254c18d66275c",
... |
from __future__ import print_function
import unittest
from mock import MagicMock
from mock import call
from mock import patch
from apache_beam.io.gcp.datastore.v1 import fake_datastore
from apache_beam.io.gcp.datastore.v1 import helper
from apache_beam.io.gcp.datastore.v1 import query_splitter
from apache_beam.io.gc... | {
"content_hash": "600d70fbf96d85be2214e9ab766c7ec5",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 80,
"avg_line_length": 40.97231833910035,
"alnum_prop": 0.6766320412127355,
"repo_name": "tgroh/beam",
"id": "e131f93d52076f1cd4d4a995bf083bf7ed13e6f0",
"size": "12626",
... |
from setuptools import setup, find_packages
setup(
name='BinPy',
version='0.3.1',
author='BinPy Developers',
author_email='[email protected]',
url='http://pypi.python.org/pypi/BinPy/',
# license=open('docs/LICENSE.txt').read(),
description='Virtualizing Electronics',
# long_description... | {
"content_hash": "914ada64b51a0420098a079d386f30c1",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 72,
"avg_line_length": 33.35294117647059,
"alnum_prop": 0.656084656084656,
"repo_name": "MridulS/BinPy",
"id": "80104da12482161ed1d71ce970f21012e0ca6ed9",
"size": "567",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.