text
stringlengths
4
1.02M
meta
dict
import asyncio import discord import os from datetime import datetime from discord.ext import commands from Cogs import DisplayName # This is the Torment module. It spams the target with pings for awhile class Torment: # Init with the bot reference, and a reference to the settings var def __init_...
{ "content_hash": "e5f6f31107cc3266ae667396d8cbc607", "timestamp": "", "source": "github", "line_count": 412, "max_line_length": 117, "avg_line_length": 28.686893203883496, "alnum_prop": 0.6380404433539216, "repo_name": "TheMasterGhost/CorpBot", "id": "1bdaacf730795b872322c0b3ca8cd3d758f0c2f4", "siz...
""" Command line argument parser for neon deep learning library This is a wrapper around the configargparse ArgumentParser class. It adds in the default neon command line arguments and allows additional arguments to be added using the argparse library methods. Lower priority defaults can also be read from a configura...
{ "content_hash": "341385da33a66f38206976abd949c7ec", "timestamp": "", "source": "github", "line_count": 347, "max_line_length": 95, "avg_line_length": 44.10086455331412, "alnum_prop": 0.5477357380905705, "repo_name": "Jokeren/neon", "id": "f1efb95d29d8b31b4d15bb8238b98ec490a3b2d6", "size": "16049",...
"""The fsl module provides classes for interfacing with the `FSL <http://www.fmrib.ox.ac.uk/fsl/index.html>`_ command line tools. This was written to work with FSL version 4.1.4. These are the base tools for working with FSL. Preprocessing tools are found in fsl/preprocess.py Model tools are found in fsl/model.py DTI...
{ "content_hash": "643cf695005662a6f471d6d168e6d4e5", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 105, "avg_line_length": 29.80081300813008, "alnum_prop": 0.599099713545219, "repo_name": "satra/NiPypeold", "id": "b8a227b01105c4971e891ab4bc1dd3776acd28aa", "size": "7445...
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, ...
{ "content_hash": "6470a3167b855e8cf70c69b471540b95", "timestamp": "", "source": "github", "line_count": 984, "max_line_length": 114, "avg_line_length": 32.083333333333336, "alnum_prop": 0.5698447893569845, "repo_name": "duncanhawthorne/robot-robot", "id": "1408e1d7909d930e035f17de0d7446f88198bfdf", ...
from django import template from reversion.models import Version register = template.Library() @register.inclusion_tag("includes/last_modified.html") def last_modified(obj): """Get all versions for specific object, display: "Created on ASD by DSA." "Last modified on ASD by DSA." """ versions = V...
{ "content_hash": "4bbc5b90ed4587cc66b1661f66d4ce01", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 73, "avg_line_length": 25.322580645161292, "alnum_prop": 0.5961783439490446, "repo_name": "pbanaszkiewicz/amy", "id": "4a4653321adc034815f989fe5f0c1c09e139bc3c", "size": "7...
import numpy from fgivenx.parallel import parallel_apply from fgivenx.io import CacheException, Cache def compute_samples(f, x, samples, **kwargs): r""" Apply f(x,theta) to x array and theta in samples. Parameters ---------- f: function list of functions :math:`f(x;\theta)` with dependent va...
{ "content_hash": "0beb20c3ca193212bc37d5b5c25e8451", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 76, "avg_line_length": 29.53211009174312, "alnum_prop": 0.6095060577819198, "repo_name": "williamjameshandley/fgivenx", "id": "345daad0de884f576f0a65453cb7de64b9e03b87", "...
from django.contrib import admin from models import Media admin.site.register(Media)
{ "content_hash": "0edc2888a84a73bfba83773fe7a63e07", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 32, "avg_line_length": 21.25, "alnum_prop": 0.8352941176470589, "repo_name": "jamesmfriedman/django-primer", "id": "c35444da7d1e3b747f58d241546ef7b01cee0ad9", "size": "85", ...
"""Syncronizes cell Zookeeper with LDAP data. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import time import click from treadmill import cli from treadmill import context from treadmill import...
{ "content_hash": "f6c3980a77884ef798dba1268c0f1add", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 75, "avg_line_length": 30.070422535211268, "alnum_prop": 0.6018735362997658, "repo_name": "Morgan-Stanley/treadmill", "id": "e770f5f3fe2255dd6b6479e0eaedd4468a0c3d48", "siz...
import logging import emission.analysis.configs.config_utils as eacc def get_config(user_id, time_query): # right now, we are not doing any server side overrides, so we pick the # last user defined configuration for this user SYNC_CONFIG_KEY = "config/sync_config" return eacc.get_last_entry(user_id, ti...
{ "content_hash": "dfc4475f78493021e73dc4b8a84a0133", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 75, "avg_line_length": 43.375, "alnum_prop": 0.7435158501440923, "repo_name": "yw374cornell/e-mission-server", "id": "2eec2ac0bb06c60d988f8fa4951b405d9672e99f", "size": "347...
import _plotly_utils.basevalidators class XhoverformatValidator(_plotly_utils.basevalidators.StringValidator): def __init__(self, plotly_name="xhoverformat", parent_name="isosurface", **kwargs): super(XhoverformatValidator, self).__init__( plotly_name=plotly_name, parent_name=paren...
{ "content_hash": "b1f1de93d98ff970d8cdc31771c8e85f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 87, "avg_line_length": 37.72727272727273, "alnum_prop": 0.6385542168674698, "repo_name": "plotly/plotly.py", "id": "e9c582a63b65c79a1e9a9be41dde1d6f4585d98e", "size": "415"...
import enum import numpy as np from itertools import cycle from src.util.debug_util import assert_type_in_container from base_grid import BaseGrid, BaseFace class TriangleGrid(BaseGrid): """ 正三角形の面を持つグリッドの基底クラス """ BAND_TYPE = enum.Enum('BAND_TYPE', 'HORIZON UPPER_RIGHT LOWER_RIGHT') def __ini...
{ "content_hash": "7d7cde7f7951eeefc017e48bb3b3377f", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 80, "avg_line_length": 32.17767653758542, "alnum_prop": 0.5364575959224126, "repo_name": "kanairen/RegularIcosahedronDict", "id": "93d111815676c73c86367362043323c3aec55707",...
import logging import math import time from django.utils import timezone from modularodm import Q from oauthlib.oauth2 import OAuth2Error from dateutil.relativedelta import relativedelta from framework.celery_tasks import app as celery_app from scripts import utils as scripts_utils from website.app import init_app ...
{ "content_hash": "17fe9b4a698f155434e16012776e5aa6", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 102, "avg_line_length": 34.708333333333336, "alnum_prop": 0.6071428571428571, "repo_name": "acshi/osf.io", "id": "9c1cc8623a1a85fd6dcfd1d4466dabb06470454c", "size": "3373",...
""" The figure module provides the top-level :class:`~matplotlib.artist.Artist`, the :class:`Figure`, which contains all the plot elements. The following classes are defined :class:`SubplotParams` control the default spacing of the subplots :class:`Figure` top level container for all plot elements """ from...
{ "content_hash": "08d9ff2999649658c9e7ef1251af2248", "timestamp": "", "source": "github", "line_count": 1729, "max_line_length": 79, "avg_line_length": 33.96124927703875, "alnum_prop": 0.5584393467191199, "repo_name": "daodaoliang/neural-network-animation", "id": "0243efaa34553c35c62015a8cd6574280047...
import asyncio import logging from datetime import datetime from aiohttp import web from aiocache import cached from aiocache.serializers import JsonSerializer @cached(key="function_key", serializer=JsonSerializer()) async def time(): return {"time": datetime.now().isoformat()} async def handle(request): re...
{ "content_hash": "72f3e991829fdeefc5c4cf8e9f154823", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 77, "avg_line_length": 29.1, "alnum_prop": 0.6364261168384879, "repo_name": "argaen/aiocache", "id": "c373f8435a7e979258cb7de4f6c47843c80292ed", "size": "1455", "binary":...
import pytest @pytest.fixture(name="sequence0") def fixture_sequence_0(): return 'NLYIQWLXDGGPSSGRPPPS' @pytest.fixture(name="sequence1") def fixture_sequence_1(): return 'NLYIQWLKDGGPSSGRPPPS' @pytest.fixture(name="sequence2") def fixture_sequence_2(): return 'MALPVTALLLPLALLLHAARPSQFRVSPLDRTWNLGETVEL...
{ "content_hash": "144639b3013c5c969bd389ca348ad1e2", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 78, "avg_line_length": 33.333333333333336, "alnum_prop": 0.79875, "repo_name": "ecolell/amphipathic", "id": "0abd9ebb8963d1d26d35435f5e38de798a1df5df", "size": "800", "bi...
import copy import time import uuid from dogpile.cache import api from dogpile.cache import proxy import mock from oslo_config import cfg from keystone.common import cache from keystone import exception from keystone.tests import unit CONF = cfg.CONF NO_VALUE = api.NO_VALUE def _copy_value(value): if value is...
{ "content_hash": "3df1b27cd1f50e7633d40970d1754af1", "timestamp": "", "source": "github", "line_count": 310, "max_line_length": 79, "avg_line_length": 41.30967741935484, "alnum_prop": 0.631578947368421, "repo_name": "idjaw/keystone", "id": "3c2afe6687b7a861305da6ba7155be56342b5f1e", "size": "13381"...
print "sara"
{ "content_hash": "85cc44a593ce3cffade72d4efcf75001", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 12, "avg_line_length": 12, "alnum_prop": 0.75, "repo_name": "CodeCatz/litterbox", "id": "912e084aa282d8829942934ee66eae44d472f06f", "size": "12", "binary": false, "copie...
""" Data Manager Frame Copyright (c) 2014, 2015 Andrew Hawkins Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, m...
{ "content_hash": "02a4cba9fd049b5022adc9298cc4f016", "timestamp": "", "source": "github", "line_count": 646, "max_line_length": 79, "avg_line_length": 29.69969040247678, "alnum_prop": 0.6000208485353904, "repo_name": "achawkins/Forsteri", "id": "c7370e3cbb896168543fb1caf94589e6b9622f6d", "size": "1...
__author__ = 'ghost' import os DEBUG = True APPDIR = os.path.abspath(os.path.dirname(__file__)) STATIC = os.path.join(APPDIR, 'static') AVATAR = os.path.join(STATIC, 'avatar') TEMPLATES = os.path.join(APPDIR, 'templates') SECRET_KEY = 'you-will-never-guess'
{ "content_hash": "65a3c99cf2ee91a6f9a4f318bdccd16e", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 51, "avg_line_length": 21.833333333333332, "alnum_prop": 0.6870229007633588, "repo_name": "rsj217/flask--scaffold", "id": "6df44538dcd24b746d453e0024b6cbb34f7bfbed", "size"...
"""Tests for grr.parsers.sqlite_file.""" import os import StringIO from grr.lib import flags from grr.lib import test_lib from grr.parsers import sqlite_file class SQLiteFileTest(test_lib.GRRBaseTest): """Test parsing of sqlite database files.""" query = "SELECT * FROM moz_places;" def testErrors(self): ...
{ "content_hash": "cb44dcd80516a65024b60eb6110f9671", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 63, "avg_line_length": 28.22222222222222, "alnum_prop": 0.7023622047244095, "repo_name": "statik/grr", "id": "528409520fd75a4fae6f8ae5791c6ba6530171b0", "size": "1292", "...
from SDA import * import numpy import unittest class FlightBoundaryContainerTestCase(unittest.TestCase): def setUp(self): self.test_boundary_container = FlightBoundariesContainer(numpy.array([[[-2000, -2000], [-2000, 2000], [2000, 2000], [2000, -2000]], [[-5000, -1000], [-4500, 2000], [2000, 2000], [2000,...
{ "content_hash": "cc390e01861bd24cdbf91c5b8743c218", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 203, "avg_line_length": 69.70588235294117, "alnum_prop": 0.6852320675105485, "repo_name": "FlintHill/SUAS-Competition", "id": "bc831aa94d09d5c22fda312766c27926dd01f133", "s...
""" Domino Public API Public API endpoints for Custom Metrics # noqa: E501 The version of the OpenAPI document: 5.3.0 Generated by: https://openapi-generator.tech """ import copy import logging import multiprocessing import sys import urllib3 from http import client as http_client from domino._impl...
{ "content_hash": "1453290da9343acad3f8755e29905390", "timestamp": "", "source": "github", "line_count": 438, "max_line_length": 98, "avg_line_length": 36.34703196347032, "alnum_prop": 0.6076005025125628, "repo_name": "dominodatalab/python-domino", "id": "14083c14a9dc1122d5f70a6a330cbd426cb407c1", "...
"""Punctuation. --- layout: post source: Garner's Modern American Usage source_url: http://bit.ly/1T4alrY title: dates date: 2014-06-10 12:31:19 categories: writing --- Dates. """ from proselint.tools import existence_check, memoize @memoize def check(text): """Check the text.""" err = "...
{ "content_hash": "89f738f9c94d016446538e87625a62a9", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 59, "avg_line_length": 18.035714285714285, "alnum_prop": 0.6099009900990099, "repo_name": "amperser/proselint", "id": "08bd11b8e071338017f28c5892b77fe2601a4acd", "size": "5...
""" Self test for Hitachi Block Storage Driver """ import mock from cinder import exception from cinder import test from cinder import utils from cinder.volume import configuration as conf from cinder.volume.drivers.hitachi import hbsd_basiclib from cinder.volume.drivers.hitachi import hbsd_common from cinder.volume....
{ "content_hash": "d933a06469acbd3ae084ad3fa8d16f38", "timestamp": "", "source": "github", "line_count": 479, "max_line_length": 79, "avg_line_length": 47.05845511482255, "alnum_prop": 0.5426556053413779, "repo_name": "jumpstarter-io/cinder", "id": "757c28d58af6a1d45f68c94ba2f5f96f38adb65d", "size":...
import _plotly_utils.basevalidators class ColoraxisValidator(_plotly_utils.basevalidators.SubplotidValidator): def __init__( self, plotly_name="coloraxis", parent_name="scattergeo.marker", **kwargs ): super(ColoraxisValidator, self).__init__( plotly_name=plotly_name, pa...
{ "content_hash": "81d84f0197a081945d3ee93b16623bbc", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 80, "avg_line_length": 36.6, "alnum_prop": 0.5828779599271403, "repo_name": "plotly/plotly.py", "id": "cb110116e5327a2fa493364060a5c48ececd8b46", "size": "549", "binary":...
from django.apps import AppConfig class RideshareApiConfig(AppConfig): name = 'rideshare_api' def ready(self): from rideshare_api import signals
{ "content_hash": "96d4546e5f080b50d17642bdc09d8296", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 41, "avg_line_length": 20.5, "alnum_prop": 0.7195121951219512, "repo_name": "RideQuest/rideshare-backend", "id": "4cc4121ab52e7a5c6806576db2220e3ad755fa36", "size": "164", ...
import math import numpy # - * - coding: utf - 8 - * - """ Created on Wed May 31 15:27:40 2017 @author: Kristen """ # - * - coding: utf - 8 - * - """ Created on Tue May 30 09:40:34 2017 @author: Kristen """ # finds the distance between two atoms def distance(position1, pos...
{ "content_hash": "bd5ee7fe3550838e4bbc8f620d83dbe8", "timestamp": "", "source": "github", "line_count": 524, "max_line_length": 79, "avg_line_length": 32.774809160305345, "alnum_prop": 0.530860603237452, "repo_name": "BursonLab/Silica-Coding-Project", "id": "d26f5e2e66f74624b9541e15fbad1b71493afd21",...
from .. import utils from ..Node import Node from ..Remote import Remote from ..Route import Route from .TCPServer import TCPServer from .TCPProtocol import TCPProtocol from .TCPRPC import TCPRPC from .TCPCall import TCPCall from .TCPEvent import TCPEvent class TCPService(object): """TCPService An Object pr...
{ "content_hash": "3841c232314ad715690648c4e2b73dfd", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 140, "avg_line_length": 30.773333333333333, "alnum_prop": 0.5641247833622184, "repo_name": "SkyZH/ddcm-protocol", "id": "128070a01d74b905436901609807a75972b11129", "size": ...
from django import template from django.template.loader import render_to_string from src.basic.tools.templatetags.utils import parse_ttag register = template.Library() class RenderTemplateNode(template.Node): def __init__(self, object_name, template_dir): self.object_name = object_name self.temp...
{ "content_hash": "7cb36eba669febd8bb25df517f89b0cf", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 93, "avg_line_length": 33.326530612244895, "alnum_prop": 0.6117575015309247, "repo_name": "hittu123/ruhive", "id": "a175cc8b33fdaac0dccafaadca4f3645f636f819", "size": "1633...
import pytest from django.contrib import auth from server.models import Log @pytest.mark.django_db def test_log_get_user(client): username = 'username' password = 'thepassword' user = auth.models.User.objects.create_user( username, 'username@vmprof.com', password ) Log....
{ "content_hash": "b42406de95ed54e723ec6c79ef4eb980", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 58, "avg_line_length": 23.225806451612904, "alnum_prop": 0.6486111111111111, "repo_name": "jerith/vmprof-server", "id": "6f3816ab5a2ba16732c4d6f8f40cb6b8fc3e544b", "size": ...
from .iq_sync import SyncIqProtocolEntity from .iq_sync_get import GetSyncIqProtocolEntity from .iq_sync_result import ResultSyncIqProtocolEntity from .notification_contact_add import AddContactNotificationProtocolEntity from .notification_contact_remove import RemoveContactNotificationProtocolEntity from .notification...
{ "content_hash": "0c15c9c10cf6894394f2e937238e32b3", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 80, "avg_line_length": 64.77777777777777, "alnum_prop": 0.8936535162950258, "repo_name": "biji/yowsup", "id": "ca6f461e9e69c75482badc6cfc793af7dc01e349", "size": "583", "b...
import os import json import datetime def check_file_exists(file_path): """ Check whether the file at file_path exists. """ if os.path.isfile(file_path): return True else: return False def check_date_string(date): """ Return True if the input string is a valid YYYY-MM-DD date, False ...
{ "content_hash": "da1a34b5d8de87b684f919a412a7518d", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 93, "avg_line_length": 28.02127659574468, "alnum_prop": 0.6461655277145026, "repo_name": "icydoge/dogexam", "id": "def2756afe0792be3cda237208685cbc9481afd5", "size": "1357"...
""" parser.py Created by Thomas Mangin on 2014-07-01. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ # Generic ====================================================================== # # As long as pack or unpack is needed here it means our API cleanup is not complete from struct import pack from st...
{ "content_hash": "3ecdb0603bf36a03d2ef3d76e97d16a9", "timestamp": "", "source": "github", "line_count": 591, "max_line_length": 144, "avg_line_length": 26.927241962774957, "alnum_prop": 0.6291315822546186, "repo_name": "lochiiconnectivity/exabgp", "id": "38fb9ee5a6f33b92bef6d862b19d94b828401c6a", "...
from flask.ext.wtf import Form from wtforms.fields import StringField, SubmitField, TextField from wtforms.fields.html5 import EmailField from wtforms.validators import Email, InputRequired, Length class ContactForm(Form): name = StringField( 'Name', validators=[ InputRequired(), L...
{ "content_hash": "ac321cf0be09764d7ccfb1b46bd681cc", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 64, "avg_line_length": 25.81578947368421, "alnum_prop": 0.5922528032619776, "repo_name": "hack4impact/asylum-connect-catalog", "id": "109ffd75254bf3be50e5410743752fc9946338ed...
class Singleton(object): _instance = None def __new__(cls, *args, **kwargs): if not cls._instance: cls._instance = super(Singleton, cls).__new__(cls, *args, **kwargs) return cls._instance
{ "content_hash": "1137962806b8abf0ef94e766ee3a28ab", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 73, "avg_line_length": 34.333333333333336, "alnum_prop": 0.6213592233009708, "repo_name": "jeanqasaur/jeeves", "id": "d135fa434ac2ddffa9ff122f5043e1efcdf35e49", "size": "206...
'''Clip all layers in the map to the specified polygon. Adapted from Alex Tereshenkov, http://gis.stackexchange.com/a/111712/108 ''' import os import arcpy arcpy.env.overwriteOutput = True mxd = arcpy.GetParameterAsText(0) clip_layer = arcpy.GetParameterAsText(1) out_gdb = arcpy.GetParameterAsText(2) if not mxd: ...
{ "content_hash": "50c788ef5a37b9bb146ae77fe1d8fd43", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 94, "avg_line_length": 33.885714285714286, "alnum_prop": 0.6500843170320405, "repo_name": "maphew/arcplus", "id": "94895a124391ce2fc9418b8334ba6b41f8060c6e", "size": "1186"...
'''This is the urlconf for contact urls.''' from django.conf.urls import * from external import views urlpatterns = patterns('', url(r'^new/$', views.ContactCreate.as_view(), name="contact-new"), url(r'^(?P<slug>[\w-]+)/$', views.ContactDetail.as_view(), name="contact-detail"), url(r'^(?P<slug>[\w-]+)/edit$', ...
{ "content_hash": "29efdf43ddbd04beec6b3ff74372ca71", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 89, "avg_line_length": 40.84615384615385, "alnum_prop": 0.6459510357815442, "repo_name": "davebridges/ExperimentDB", "id": "82dbe8f7dd800b367e1b21fd453f1cf8c001d106", "size...
""" Jegou S. et al "`The One Hundred Layers Tiramisu: Fully Convolutional DenseNets for Semantic Segmentation <https://arxiv.org/abs/1611.09326>`_" """ import tensorflow as tf from . import TFModel from .densenet import DenseNet class DenseNetFC(TFModel): """ DenseNet for semantic segmentation **Configurati...
{ "content_hash": "63258dbb53dc0b48ed75486ccfece260", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 106, "avg_line_length": 34.44444444444444, "alnum_prop": 0.5641577060931899, "repo_name": "analysiscenter/dataset", "id": "23ad5e665ab2c753767ee6230468341c6f0e37aa", "size...
from .disposable import Disposable from .booleandisposable import BooleanDisposable from .compositedisposable import CompositeDisposable from .singleassignmentdisposable import SingleAssignmentDisposable from .serialdisposable import SerialDisposable from .refcountdisposable import RefCountDisposable from .scheduleddi...
{ "content_hash": "b2fb344b077c08a51e3e4eb7667f7673", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 66, "avg_line_length": 44.375, "alnum_prop": 0.9014084507042254, "repo_name": "dbrattli/RxPY", "id": "376709a1f2a98e041766b18db6a97a593f74e0ea", "size": "355", "binary": f...
""" Collection of utilities to manipulate structured arrays. Most of these functions were initially implemented by John Hunter for matplotlib. They have been rewritten and extended for convenience. """ from __future__ import division, absolute_import, print_function import sys import itertools import numpy as np im...
{ "content_hash": "0d0f3de645753d0a11766f0f7321480a", "timestamp": "", "source": "github", "line_count": 1608, "max_line_length": 114, "avg_line_length": 35.274253731343286, "alnum_prop": 0.5826413497646374, "repo_name": "kushalbhola/MyStuff", "id": "40060b41a7dc2f6c213923e721b9144a4c229843", "size"...
import pandas as pd import numpy as np from scipy import stats import math def reduce_to_first_significant_digit(quantity, uncertainty): first_significant_digit = math.floor(math.log10(abs(uncertainty))) quantity = round(quantity, -first_significant_digit) uncertainty = round(uncertainty, -first_significan...
{ "content_hash": "f28279703730db7696e41f01dc333200", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 145, "avg_line_length": 37.8235294117647, "alnum_prop": 0.6467729393468118, "repo_name": "MobleyLab/SAMPL6", "id": "c864d37dcb72112d0be6546a5d527f8854619825", "size": "526...
import numpy as np import pytest import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm pa = pytest.importorskip("pyarrow", minversion="0.17.0") from pandas.core.arrays._arrow_utils import pyarrow_array_to_numpy_and_mask arrays = [pd.array([1, 2, 3, None], dtype=dtype) for dtype...
{ "content_hash": "c7518734590072a76310df5bbe8bb155", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 88, "avg_line_length": 34.273743016759774, "alnum_prop": 0.6616136919315403, "repo_name": "gfyoung/pandas", "id": "9f755412dbf39f25af3b8854279d93b4f1393aa7", "size": "6135...
from model.State import State from model.Turbine import Turbine from model.Condensor import Condensor from model.Reheater import Reheater from model.Pump import Pump from model.OFeedWater import OFeedWater import util.plotting as plot class OFWH(object): def __init__(self, t0, p0, p_1, t_1, p_2, eta_t, eta_p, p_c...
{ "content_hash": "8582e65c2a726f05aa3c95ec1d20608e", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 94, "avg_line_length": 41.24731182795699, "alnum_prop": 0.605318039624609, "repo_name": "BrandonTheBuilder/thermawesome", "id": "cd1db80fdafb36d0bcdf54bd335f38054df10ba8", ...
"""Tests for perfkitbenchmarker.benchmark_spec.""" import unittest from perfkitbenchmarker import benchmark_spec from perfkitbenchmarker import configs from perfkitbenchmarker import context from perfkitbenchmarker import flags from perfkitbenchmarker import os_types from perfkitbenchmarker import pkb from perfkitben...
{ "content_hash": "da9c845ed94988335e4a1c8fa18664d6", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 77, "avg_line_length": 35.368852459016395, "alnum_prop": 0.7049826187717265, "repo_name": "xiaolihope/PerfKitBenchmarker-1.7.0", "id": "031fa7d2a28be20c84abf7e8e0c03502a61fd...
import _plotly_utils.basevalidators class SizeValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="size", parent_name="volume.colorbar.title.font", **kwargs ): super(SizeValidator, self).__init__( plotly_name=plotly_name, parent_name...
{ "content_hash": "cc89db6c7e07eb86d77c3dd8693bd750", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 84, "avg_line_length": 33.6, "alnum_prop": 0.5793650793650794, "repo_name": "plotly/python-api", "id": "8e12d07ff10bc92a3a85b816acc1945bef41a4fc", "size": "504", "binary"...
from __future__ import absolute_import, unicode_literals """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ import functools from oauthlib.common import log from ..errors import TemporarilyUnavailableError, ...
{ "content_hash": "c3a36a261fef1bf882fc6fbafa335fa1", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 81, "avg_line_length": 27.311475409836067, "alnum_prop": 0.6122448979591837, "repo_name": "collabspot/muninn", "id": "984de2f91b2709913524fbdae9550bdc2c655bcf", "size": "16...
import logging import pymssql """Commander Plugin for Microsoft SQL Server Dependencies: pip3 install pymssql """ class Rotator: def __init__(self, login, password, host=None, port=1433, db=None, **kwargs): self.host = host self.port = port self.login = login self.passw...
{ "content_hash": "4797c19de03a8fa7c39d01234c0e7468", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 118, "avg_line_length": 34.95161290322581, "alnum_prop": 0.5717581910475311, "repo_name": "Keeper-Security/Commander", "id": "99ac18f19fce82663d564d91f3e335c8ec0faf22", "si...
import os import uuid import functools from os.path import join as opjoin import racy import glob import os.path from racy.rproject import ConstructibleRacyProject, LibName from racy.rutils import memoize, run_once from global_dico import * from templating import * class WixProjectError(racy.RacyProjectError)...
{ "content_hash": "33ef3505bcac1086baf5bb42db875b01", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 81, "avg_line_length": 30.857142857142858, "alnum_prop": 0.5034391534391535, "repo_name": "cfobel/sconspiracy", "id": "aca8e692384ef085f7c1e2f90740d87540bc4dec", "size": "...
from types import DictType from utils import flatten # -------------------------------------------------------------------------------- # Elements class Element(object): def __init__(self, tag_name, block_p, explicit_end_p, has_content_p, attrs=None): self.tag_name = tag_name self.block_p ...
{ "content_hash": "b2d47b0863140322576c0115a09818c6", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 85, "avg_line_length": 33.05555555555556, "alnum_prop": 0.5756302521008403, "repo_name": "scusack/tlhl", "id": "a72dcbe167557f365e1bc60823cd8da431a9dffa", "size": "1215", ...
"""Module providing views for the site navigation root""" from Products.Five.browser import BrowserView from Products.ZCatalog.interfaces import ICatalogBrain from plone import api from plone.app.contentlisting.interfaces import IContentListing from plone.app.contentlisting.interfaces import IContentListingObject from ...
{ "content_hash": "843faccebb79bbc0b9aef27ff884391a", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 78, "avg_line_length": 33.277227722772274, "alnum_prop": 0.5617375781017554, "repo_name": "a25kk/dhp", "id": "2c8cb5e255bf182c4490262227e7d288549df680", "size": "3385", ...
import os import sys import ujson as json class PluginStructure(object): """Provides tools for a plugin architecture.""" def __init__(self, plugin_folder = "./plugins", main_module="__init__"): super(PluginStructure, self).__init__() self.plugin_folder = plugin_folder self.main_module ...
{ "content_hash": "a8c7aa22c598d84394c22219ead35443", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 95, "avg_line_length": 38.743589743589745, "alnum_prop": 0.6254136333553938, "repo_name": "marcoapintoo/Biosignal-Intermediate-Format", "id": "51c29dbc402c36c0f6d24f4c5285036...
import signbank.settings import os import shutil from zipfile import ZipFile from datetime import datetime, date import json import re from django.utils.translation import override from signbank.dictionary.models import * from signbank.dictionary.update import gloss_from_identifier from django.utils.dateformat import...
{ "content_hash": "6a607306683ff13c4dd17f20afbac8bd", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 88, "avg_line_length": 28.05, "alnum_prop": 0.7344028520499108, "repo_name": "Signbank/BSL-signbank", "id": "84d2f39c6623b918655c8587a90237ad6b172d88", "size": "1122", "b...
def configuration(parent_package='', top_path=None): import os.path as op from numpy.distutils.misc_util import Configuration from sfepy import Config site_config = Config() system = site_config.system() os_flag = {'posix' : 0, 'windows' : 1}[system] auto_dir = op.dirname(__file__) au...
{ "content_hash": "c29f388e670f9c7dbf2a878df92c0805", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 76, "avg_line_length": 38.5, "alnum_prop": 0.5407792207792208, "repo_name": "sfepy/sfepy", "id": "5f4ab374573cbec59067fc94ca52dffe9a156a9a", "size": "1948", "binary": fal...
REPEATABLE = 'repeatable' FLAGS = [REPEATABLE] def _AssertFlagsAreValid(flags): assert isinstance(flags, list) for f in flags: if f not in FLAGS: raise AssertionError( 'Unrecognized flag for a timeline interaction record: %s' % f) def GetJavaScriptMarker(label, flags): """Computes the mar...
{ "content_hash": "8dcd4773083b7c3b402403963a264b6d", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 79, "avg_line_length": 27.257142857142856, "alnum_prop": 0.7054507337526206, "repo_name": "catapult-project/catapult", "id": "f2ab6e17f84c459151d4b441f3a6ed1ead09bf0f", "si...
from org.myrobotlab.service import Speech mouth = Runtime.createAndStart("mouth","Speech") from org.myrobotlab.service import Servo servo1 = Runtime.create("servo1","Servo") servo2 = Runtime.create("servo2","Servo") servo1.startService() servo2.startService() arduino = Runtime.createAndStart("arduino","Arduino") ardu...
{ "content_hash": "c8756c1fe073a5703692b590d1e026a5", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 57, "avg_line_length": 20.04705882352941, "alnum_prop": 0.6637323943661971, "repo_name": "MyRobotLab/pyrobotlab", "id": "3ee04adc66b6b369ae4b84f8cac5a8c6b7ea2b74", "size": ...
from oslo_utils import uuidutils from neutron.ipam.drivers.neutrondb_ipam import db_models # Database operations for Neutron's DB-backed IPAM driver class IpamSubnetManager(object): @classmethod def load_by_neutron_subnet_id(cls, session, neutron_subnet_id): return session.query(db_models.IpamSubne...
{ "content_hash": "6c8035415886f66d45510719ed1adfa9", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 79, "avg_line_length": 36.09230769230769, "alnum_prop": 0.6329923273657289, "repo_name": "sebrandon1/neutron", "id": "10263062ee3c5b403696a905d7c01ed784ae7546", "size": "5...
from nose.tools import * # flake8: noqa from urlparse import urlparse from framework.auth.core import Auth from website.models import NodeLog from api.base.settings.defaults import API_BASE from tests.base import ApiTestCase from tests.factories import ( ProjectFactory, RegistrationFactory, AuthUserFact...
{ "content_hash": "5f40ce599bebfc7d56f23740203d2a35", "timestamp": "", "source": "github", "line_count": 944, "max_line_length": 163, "avg_line_length": 46.00741525423729, "alnum_prop": 0.5768460316363887, "repo_name": "KAsante95/osf.io", "id": "b5cd7e75d99df30255216dfeaadf4e0a1545aba8", "size": "43...
from service import ServiceBase import os, sys, time, subprocess, atexit from signal import SIGTERM class LinuxService(ServiceBase): def __init__(self, name, label, stdout='/dev/null', stderr='/dev/null'): ServiceBase.__init__(self, name, label, stdout, stderr) self.pidfile = '/tmp/%s.pid' % name ...
{ "content_hash": "3a16c8b437c341811b39e0d27d371c56", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 89, "avg_line_length": 30.32126696832579, "alnum_prop": 0.5036561707207879, "repo_name": "mmangura/Base", "id": "eece4801d7d338ad3aaad86957d27ec52ceef771", "size": "6701",...
from __future__ import absolute_import from .assertrepr_compare import pytest_assertrepr_compare
{ "content_hash": "132528e05e9a7a9117d66c6f01fa9a07", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 57, "avg_line_length": 48, "alnum_prop": 0.8333333333333334, "repo_name": "jschwartz79/springfield", "id": "110c15ec60852e53fdb5afbffb3f6f8b490703c8", "size": "96", "binar...
""" Pyccuweather The Python Accuweather API connector.py Basic connector object and methods (c) Chris von Csefalvay, 2015. """ import requests from pyccuweather import errors from pyccuweather.froots import froot from pyccuweather.objects import * import os class Connection(object): """ Represents a connec...
{ "content_hash": "8afd33bc376b8e8e1ad598f0daa322f5", "timestamp": "", "source": "github", "line_count": 373, "max_line_length": 117, "avg_line_length": 33.088471849865954, "alnum_prop": 0.4944093339815265, "repo_name": "chrisvoncsefalvay/pyccuweather", "id": "ec1160cd128baf406c1c7be3a7f677e358031fca"...
"""Support for Proliphix NT10e Thermostats.""" from __future__ import annotations import proliphix import voluptuous as vol from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity from homeassistant.components.climate.const import ( ClimateEntityFeature, HVACAction, HVACMode, ) from ho...
{ "content_hash": "2a2afaa476000180fe3d0dc99cc44844", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 75, "avg_line_length": 27.58695652173913, "alnum_prop": 0.6448647228789073, "repo_name": "toddeye/home-assistant", "id": "0907602ed9dbe24cfe8470feae5e5704e20585d2", "size"...
import nltk sent = "They wind back the clock, while we chase after the wind." text = nltk.word_tokenize(sent) print text print nltk.pos_tag(text)
{ "content_hash": "7662ab90e4d26181891f450ef4b54936", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 65, "avg_line_length": 21.142857142857142, "alnum_prop": 0.7432432432432432, "repo_name": "MingjunZhou/nltk_book", "id": "f1fcecd5dee9c527dba0fbd8404a9f71db27c136", "size": ...
import logging class HtmlSource: def __init__(self, src, manualDependecy=""): self._src = src self.indentation = 0 self.fileExtension = src.split(".")[-1] self.manualDependency = manualDependecy self.hasRendered = False def setSource(self, src): self._src = src...
{ "content_hash": "56a7f77e394bf0e311b7fd4ee1209543", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 140, "avg_line_length": 39.114285714285714, "alnum_prop": 0.539810080350621, "repo_name": "smckee6192/HTMLGenerator", "id": "e5f2518b7123c1b575c96a9c510f6061792b7217", "siz...
import sys import django from django.conf import settings settings.configure( DEBUG=True, DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }, ROOT_URLCONF='urls', INSTALLED_APPS=( 'django.contrib.auth', 'django.contrib.contenttypes', ...
{ "content_hash": "93e78e69f4e0c5237e9d1c46377e730f", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 52, "avg_line_length": 22.644444444444446, "alnum_prop": 0.5966633954857704, "repo_name": "kfarr2/django-arcutils", "id": "3cc6cb0e542a046e3035b5a986906489749e0605", "size"...
from django import template from django.core.exceptions import ImproperlyConfigured from django.utils.safestring import mark_safe from ..processors import AssetRegistry register = template.Library() class AssetsNode(template.Node): def __init__(self, nodelist): self.nodelist = nodelist def render(...
{ "content_hash": "aa516d7d490f88662c08356dd6f57ce2", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 94, "avg_line_length": 28.861538461538462, "alnum_prop": 0.6572494669509595, "repo_name": "funkybob/django-amn", "id": "d08fee873672eac34b7b4ed85155f91542ed11d6", "size": "...
import numpy as np d = 64 # dimension nb = 100000 # database size nq = 10000 # nb of queries np.random.seed(1234) # make reproducible xb = np.random.random((nb, d)).astype('float32') xb[:, 0] += np.arange(nb) / 1000. xq = np.random.random...
{ "content_hash": "71f7ca5f58aac340ce7836633c9ab69b", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 67, "avg_line_length": 31.433333333333334, "alnum_prop": 0.5535524920466596, "repo_name": "facebookresearch/faiss", "id": "c458587ce905eba468c16ea4bf0df47aefaf5cce", "size"...
from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class CommonConfig(AppConfig): name = 'common' verbose_name = _("Common")
{ "content_hash": "638970dd9de21f63d8df8d94f51963bc", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 55, "avg_line_length": 24.857142857142858, "alnum_prop": 0.735632183908046, "repo_name": "DylanMcCall/stuartmccall.ca", "id": "139a67502223a03751ad2200c41d5e84155a7b77", "si...
import operator import platform from django.db import transaction from django.db.backends.base.features import BaseDatabaseFeatures from django.db.utils import OperationalError from django.utils.functional import cached_property from .base import Database class DatabaseFeatures(BaseDatabaseFeatures): # SQLite c...
{ "content_hash": "c75fbf7213668f43825cbc005c2e4e4c", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 109, "avg_line_length": 44.46825396825397, "alnum_prop": 0.647867213992504, "repo_name": "ghickman/django", "id": "ff3e3f47a9faa68a5de7cbcd61bd47011bdaadf6", "size": "5603...
"""Test bitcoind shutdown.""" from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, get_rpc_proxy from threading import Thread def test_long_call(node): block = node.waitfornewblock() assert_equal(block['height'], 0) class ShutdownTest(BitcoinTestFramewo...
{ "content_hash": "f4952870f643267d66eb1aa8927c5068", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 103, "avg_line_length": 38.03225806451613, "alnum_prop": 0.6759966072943172, "repo_name": "alecalve/bitcoin", "id": "a76e0f1b50afc9a81b9fb580c6cd1a85b557ada9", "size": "139...
import os import sys def show_usage(): print 'usage:\nsign.py [-k] apk\n-k\tkeep origin apk\nexample: sign.py comiz.pk' % () if __name__ == '__main__': #print sys.argv argc = len(sys.argv) if argc != 2 and argc != 3: show_usage() exit() keypath = '/mnt/DATA/proj/eclipse/Android/...
{ "content_hash": "12e6d1b19b4f288f91f9bddbfae7b7c4", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 111, "avg_line_length": 23.979591836734695, "alnum_prop": 0.563404255319149, "repo_name": "chrisju/script", "id": "4b23a2cce4b3733d478adf92c510560367b71f1a", "size": "1195"...
from typing import Optional, Text from zerver.lib.test_classes import WebhookTestCase class GoogleCodeInTests(WebhookTestCase): STREAM_NAME = 'gci' URL_TEMPLATE = "/api/v1/external/gci?&api_key={api_key}&stream={stream}" FIXTURE_DIR_NAME = 'gci' def test_abandon_event_message(self) -> None: e...
{ "content_hash": "aa04ae8d1510716fdeec5135638ac678", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 191, "avg_line_length": 64.45454545454545, "alnum_prop": 0.6650211565585331, "repo_name": "mahim97/zulip", "id": "22495da90dd79599fc06e41a5afe48ad3a188f50", "size": "2860",...
# Copyright 2014 Lukas Kemmer # # Licensed under the Apache License, Version 2.0 (the "License"); you # may not use this file except in compliance with the License. You # may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
{ "content_hash": "e8f083af5bc201dc118c8df613ce073c", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 71, "avg_line_length": 27.52980132450331, "alnum_prop": 0.6006735626653837, "repo_name": "lukas-ke/faint-graphics-editor", "id": "cb258401bd08c892842145bddda724982d8203fb", ...
"""Here's our handy setup script for the ipviking django authentication""" from setuptools import setup, find_packages setup( name = 'ipviking_django', version = '0.1', description = 'An example of using the IPViking API as authentication in a Django app.', author = 'Marcus Hoffman', url...
{ "content_hash": "37c736496876a55ef9ff0f2f0484cbe9", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 94, "avg_line_length": 44, "alnum_prop": 0.5634469696969697, "repo_name": "norsecorp/ipviking-django", "id": "b0ff503f1143360a87b016e31cfc31cfd8181f44", "size": "1056", "...
from pyxb.bundles.opengis.gml_3_3.raw.ce import *
{ "content_hash": "f80dcd927249cef47563504bfe5ecea2", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 49, "avg_line_length": 50, "alnum_prop": 0.76, "repo_name": "jonfoster/pyxb2", "id": "f4a66a8111072dafd7db2c79e0732b4d4797cde7", "size": "50", "binary": false, "copies":...
from flamebroiler import Trie import resource import timeit def find_words(): letters = [chr(i) for i in range(97,123)] for first in letters: for second in letters: print first + second matches = words.suffixes(first + second) print resource.getrusage(resource.RUSAGE_SELF).ru_m...
{ "content_hash": "eb23f9b90cfd32b6b02cfe92f9a8a060", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 96, "avg_line_length": 29.40909090909091, "alnum_prop": 0.6893353941267388, "repo_name": "apendleton/flamebroiler", "id": "d9dbef429a36593f6997d747725c5f8abf8c60cd", "size"...
"""awscfncli2 version.""" import pkg_resources __version__ = pkg_resources.require('awscfncli2')[0].version
{ "content_hash": "c1a4abacf566ad497a699650ca218e0d", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 60, "avg_line_length": 22, "alnum_prop": 0.7181818181818181, "repo_name": "Kotaimen/awscfncli", "id": "36e7b2d7e1d97976f11774c07aab93576adacf7a", "size": "110", "binary": ...
import errno import logging import os import uuid import struct import time import base64 import socket from ceph_deploy.cliutil import priority from ceph_deploy import conf, hosts, exc from ceph_deploy.util import arg_validators, ssh, net from ceph_deploy.misc import mon_hosts from ceph_deploy.lib import remoto from ...
{ "content_hash": "b630fdaaddd8575c87fe06550dbdee92", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 110, "avg_line_length": 31.1268115942029, "alnum_prop": 0.5860784541962519, "repo_name": "codenrhoden/ceph-deploy", "id": "842117bdbc310139ae2f42c4b01cb6af4d02a494", "size...
import os from oslo_config import cfg CONF = cfg.CONF CONF.import_opt('policy_file', 'cinder.policy', group='oslo_policy') CONF.import_opt('volume_driver', 'cinder.volume.manager') CONF.import_opt('backup_driver', 'cinder.backup.manager') CONF.import_opt('api_class', 'cinder.keymgr', group='key_manager') CONF.impor...
{ "content_hash": "50ef5442d09726fcb287ee386944799b", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 79, "avg_line_length": 44.775, "alnum_prop": 0.6610831937465104, "repo_name": "cloudbase/cinder", "id": "e442bb8e68e42739c5eb359adffdafd08ac011c6", "size": "2523", "binar...
from ggrc import db from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.ext.declarative import declared_attr from ggrc.models.mixins import deferred, Base from ggrc.models.reflection import PublishOnly class ObjectFile(Base, db.Model): __tablename__ = 'object_files' file_id = db.Column(d...
{ "content_hash": "6621afd2d3b004deb17a1be54db3280a", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 72, "avg_line_length": 28.493506493506494, "alnum_prop": 0.6572470373746582, "repo_name": "NejcZupec/ggrc-core", "id": "e79217d575a93ca26bd033ff780def021b89f8c4", "size": "...
import numpy as np def softmax(df): if len(df.shape) == 1: df[df > 20] = 20 df[df < -20] = -20 ppositive = 1 / (1 + np.exp(-df)) ppositive[ppositive > 0.999999] = 1 ppositive[ppositive < 0.0000001] = 0 return np.transpose(np.array((1 - ppositive, ppositive))) el...
{ "content_hash": "15bf276d01c856d87145eea95b8faf57", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 74, "avg_line_length": 40.0625, "alnum_prop": 0.5904836193447738, "repo_name": "hmendozap/auto-sklearn", "id": "d0b2dbf47a65c78218af877a63de3b6e22d0382b", "size": "1282", ...
class OpenIDMiddleware(object): """This middleware initializes some settings to make the python-openid library compatible with Google App Engine """ def process_view(self, request, view_func, view_args, view_kwargs): from openid import fetchers import openidgae.fetcher fetchers.setDefaultFetcher(ope...
{ "content_hash": "818190d36e4bffe5098c404c0b72c096", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 78, "avg_line_length": 43.03125, "alnum_prop": 0.6957153231663036, "repo_name": "lvbeck/niubi", "id": "532fc062cd1c9609535890b348f0b4fa9d8b1ae3", "size": "2201", "binary"...
from unittest import TestCase import tempfile, os from backup_monkey import SplunkLogging class SplunkLoggingTest(TestCase): parsed = None values = {} keys = ['body', 'severity', 'src_account', 'src_role', 'src_region', 'src_volume', 'src_snapshot', 'src_tags', 'subject', 'type', 'category'] log_file = tempfil...
{ "content_hash": "1dd65d722ec90a56a2ce26a7925eaa10", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 143, "avg_line_length": 33.51111111111111, "alnum_prop": 0.6326259946949602, "repo_name": "orionhealth/backup-monkey", "id": "1ce3472a6df898106b32983d8113e9a198143676", "si...
""" Annotation Type Hints ===================== Defines the annotation type hints, the module exposes many aliases from :mod:`typing` and :mod:`numpy.typing` to avoid having to handle multiple imports. """ from __future__ import annotations import numpy as np import numpy.typing as npt import re from types import Mo...
{ "content_hash": "71960e054f62e78e273d4523110de5f2", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 79, "avg_line_length": 23.642487046632123, "alnum_prop": 0.6351084812623274, "repo_name": "colour-science/colour", "id": "3d110746e1c3622542df3ceedb821cb01733d16d", "size"...
import csb.test as test from csb.io import MemoryStream from csb.bio.io.mrc import DensityMapReader, DensityMapWriter, DensityMapFormatError, HeaderInfo, ByteOrder @test.unit class TestDensityMapReader(test.Case): def setUp(self): super(TestDensityMapReader, self).setUp() ...
{ "content_hash": "bec64d574837fdc7da79af2d6626d382", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 107, "avg_line_length": 32.096385542168676, "alnum_prop": 0.5844594594594594, "repo_name": "csb-toolbox/CSB", "id": "24bda3c70c505c8a0ff558a1d88472307f88ff8b", "size": "266...
from flask import redirect, render_template, url_for, request, flash from time import time from pyfsw import app, db from pyfsw import Player, ShopCategory, ShopItem, ShopOrder, ShopHistory from pyfsw import login_required, current_user @app.route('/shop/offer') def route_shop(): categories = db.session.query(ShopCa...
{ "content_hash": "c1dfde4d05fba0ba241c8d23bfe4b8c0", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 95, "avg_line_length": 29.25609756097561, "alnum_prop": 0.7123801583993331, "repo_name": "diath/pyfsw", "id": "5fe718fe44d5d06772ebc891d649202c25f0b10c", "size": "2399", ...
from setuptools import find_packages, setup DESCRIPTION = 'App Engine backends for Django-nonrel' LONG_DESCRIPTION = None try: LONG_DESCRIPTION = open('README.rst').read() except: pass setup(name='djangoappengine', version='1.4.0', packages=find_packages(exclude=['docs']), install_requires...
{ "content_hash": "55b8942b080c254c089f3cf8f741d9ac", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 81, "avg_line_length": 32.911764705882355, "alnum_prop": 0.6309204647006256, "repo_name": "jerod2000/djangoappengine", "id": "8a6234072f35147ed717f43325152a55e3b07529", "si...
"""AbstractCoroutine provider tests.""" import asyncio from dependency_injector import providers, errors from pytest import mark, raises from .common import example def test_inheritance(): assert isinstance(providers.AbstractCoroutine(example), providers.Coroutine) @mark.asyncio @mark.filterwarnings("ignore"...
{ "content_hash": "ff0e8104527b0adb24ed2793cf0886e9", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 81, "avg_line_length": 27.181818181818183, "alnum_prop": 0.7090301003344481, "repo_name": "ets-labs/python-dependency-injector", "id": "4f09844282c2e2143c38b4b99f285a134ce770...
from twisted.internet import reactor from twisted.internet.defer import inlineCallbacks, returnValue from autobahn.wamp.types import CallOptions, RegisterOptions from autobahn.twisted.util import sleep from autobahn.twisted.wamp import ApplicationSession class Component(ApplicationSession): """ Application co...
{ "content_hash": "658dafb4bdde333176dd7d46a8002c18", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 89, "avg_line_length": 25.838709677419356, "alnum_prop": 0.6716604244694132, "repo_name": "eugenejen/AutobahnPython", "id": "777130688d33012ac9e0c483be25a490e6bfb026", "siz...
""" Filename: test_random.py Author: Daisuke Oyama Tests for markov/random.py """ import numpy as np from numpy.testing import ( assert_array_equal, assert_raises, assert_array_almost_equal_nulp ) from nose.tools import eq_, ok_, raises from quantecon.markov import ( random_markov_chain, random_stochastic_ma...
{ "content_hash": "50faac0481d8f2f5688ff6e09ca49591", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 79, "avg_line_length": 32.22222222222222, "alnum_prop": 0.5788793103448275, "repo_name": "gxxjjj/QuantEcon.py", "id": "dee4c701371e30a8ddae262047fbae48fc4c03af", "size": "...
import mock import six.moves.urllib.parse as urlparse import webob from nova.api.openstack import common from nova.api.openstack.compute import flavors as flavors_v21 from nova import context from nova import exception from nova import objects from nova import test from nova.tests.unit.api.openstack import fakes from ...
{ "content_hash": "2a9a0c2dd0b4372a9747b548525756c8", "timestamp": "", "source": "github", "line_count": 582, "max_line_length": 79, "avg_line_length": 38.7147766323024, "alnum_prop": 0.4610331972306054, "repo_name": "sebrandon1/nova", "id": "46481b5eb913d2b8809398d0064874230ebc06cc", "size": "23168...
import selectors import socket mysel = selectors.DefaultSelector() keep_running = True def read(connection, mask): "Callback for read events" global keep_running client_address = connection.getpeername() print('read({})'.format(client_address)) data = connection.recv(1024) if data: #...
{ "content_hash": "4d731bbe53c2af6d0ccc56772a976774", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 62, "avg_line_length": 26.48076923076923, "alnum_prop": 0.6775599128540305, "repo_name": "zaqwes8811/micro-apps", "id": "2b4ca9a49c73200280c49701043ec678ce1f7fb9", "size": ...
import sys from BeautifulSoup import BeautifulSoup """ Utility program to list AMIs for ubuntu cloud server releases: $ UDISTRO=precise; curl -o $UDISTRO.txt http://cloud-images.ubuntu.com/releases/$UDISTRO/release/ $ echo " $UDISTRO:"; ./ubuntu_cloud_images.py $UDISTRO.txt """ Arch = {'32-bit': 'i386', '64-bit': '...
{ "content_hash": "30c848d3f64f018191f7b5eb5835c63b", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 97, "avg_line_length": 30.76086956521739, "alnum_prop": 0.5844522968197879, "repo_name": "rubic/shaker", "id": "08b987c3296fbd1d69fcf44a705b4d21a94a4084", "size": "1437", ...
thumbSize = 200
{ "content_hash": "2687c0966daeb43326678b2389f1658d", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 15, "avg_line_length": 15, "alnum_prop": 0.8, "repo_name": "bhautikj/imageCatapult", "id": "dc44418f456cdc9baeacb534d2976b2f5e587ed9", "size": "1149", "binary": false, "...
import time import numpy as np import liblo as lo import grovepi import grove_oled from adxl345 import ADXL345 from optparse import OptionParser usage = "python sensor-osc.py --oscip 127.0.0.1 --oscport 7878 --with_accel 1 --with_oled 0 --with_pulse 1" parser = OptionParser(usage=usage) parser.add_option("-o", "--os...
{ "content_hash": "14d9a69968d84cdb219046894e3b2a2f", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 107, "avg_line_length": 30.738636363636363, "alnum_prop": 0.6428835489833642, "repo_name": "treeoftenere/Interactivity", "id": "14e22149543f2569181c416a5017e6c484342704", "...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import time import datetime __all__ = ["timestamp", "now"] def timestamp(): """Generate a timestamp using the current date and time. Returns ------- str The timestamp. Examples...
{ "content_hash": "7913e1e251962e24918cc01fb39741b6", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 80, "avg_line_length": 16.302325581395348, "alnum_prop": 0.5649072753209701, "repo_name": "compas-dev/compas", "id": "6895cf347d5045df3b5268953970919e9c2a7a48", "size": "70...
import os.path from matplotlib import pyplot as plt import numpy as np import tables as tb from scipy.optimize import curve_fit, leastsq import progressbar from pyLandau import landau from pybar.run_manager import RunManager # importing run manager from pybar.scans.scan_iv import IVScan from pybar.scans.test_regis...
{ "content_hash": "3131a36a001f1afa47e73e2f7c123088", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 279, "avg_line_length": 57.202185792349724, "alnum_prop": 0.6129155521589607, "repo_name": "SiLab-Bonn/pyBAR", "id": "9f63e1378fc0fce699fb56a1aa480a82cf3e7b61", "size": "1...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Line(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "barpolar.marker" _path_str = "barpolar.marker.line" _valid_props = { "autocolorscale",...
{ "content_hash": "4ade4ed07457c3e1f05211092d9ff4ae", "timestamp": "", "source": "github", "line_count": 658, "max_line_length": 87, "avg_line_length": 37.8951367781155, "alnum_prop": 0.5664327250852216, "repo_name": "plotly/plotly.py", "id": "1fc6461876505d4027f5a4265d8ada980129c241", "size": "2493...
"""Positive-Semidefinite Kernel library utilities.""" import numpy as np import tensorflow.compat.v2 as tf from tensorflow_probability.python.internal import dtype_util from tensorflow_probability.python.internal import prefer_static as ps from tensorflow_probability.python.internal import tensorshape_util __all__ =...
{ "content_hash": "bd5126ba8d55da5a0185ad58ca5d5a9b", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 80, "avg_line_length": 41.25167785234899, "alnum_prop": 0.6494753111526885, "repo_name": "tensorflow/probability", "id": "5df436b56ea006d8d274fa588828e3702bef0ebf", "size"...
""" Slack connections. TODO: Substitute all this for the slackclient? """ import json import logging import requests import asyncio import websockets log = logging.getLogger(__name__) def is_direct_channel(channel_id): if channel_id is None: return False if not channel_id: return False ...
{ "content_hash": "8b39f1545c4463f32903748afa3bab4d", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 86, "avg_line_length": 28.629032258064516, "alnum_prop": 0.5712676056338029, "repo_name": "PythonSanSebastian/pyper_the_bot", "id": "ec93bd0be11a14a6e7489cf29363595a38073706...
"""Part of the Keras training engine related to plain array data. """ # pylint: disable=protected-access from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import errors from tensorflow.python.keras import ba...
{ "content_hash": "9f51a0e3f0a526a5b6dfb85e7321be44", "timestamp": "", "source": "github", "line_count": 443, "max_line_length": 79, "avg_line_length": 35.25056433408578, "alnum_prop": 0.6141777663934426, "repo_name": "ZhangXinNan/tensorflow", "id": "e2c458c65f27c5802acd9186e9bcedd4062e5a2a", "size"...