text
stringlengths
4
1.02M
meta
dict
""" @author: Daniel Antunes & Cédric Hubert """ import vrep import sys import numpy as np import random #import time import matplotlib.pyplot as plt # declaration des constantes DELAY = 150 NB_ITERATIONS = 1500 NB_ACTIONS_ECHANTILLONAGE = 40 NS = 250 K = 10 # declaration des variables LE = [] #liste erreur à...
{ "content_hash": "d15e0b3d66937e81ed53729b2b8dd246", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 138, "avg_line_length": 36.244680851063826, "alnum_prop": 0.6061050777810391, "repo_name": "dantunescost/Projet-IAR-intelligent-adaptive-curiosity", "id": "703685290ce59cab9...
""" FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2007 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") http://www.gnu.org/licen...
{ "content_hash": "ca27f204831200cdd8a192ace62bda13", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 76, "avg_line_length": 24.333333333333332, "alnum_prop": 0.6301369863013698, "repo_name": "farra/apachecon-consite", "id": "a66185f1e3823b1a2eccb13c7dcf098630b670e9", "size...
"""Support for HDMI CEC.""" from collections import defaultdict from functools import partial, reduce import logging import multiprocessing from pycec.cec import CecAdapter from pycec.commands import CecCommand, KeyPressCommand, KeyReleaseCommand from pycec.const import ( ADDR_AUDIOSYSTEM, ADDR_BROADCAST, ...
{ "content_hash": "0cb3a0743be8b2cf7a1168bd985d0e85", "timestamp": "", "source": "github", "line_count": 489, "max_line_length": 87, "avg_line_length": 31.470347648261757, "alnum_prop": 0.5932159334589642, "repo_name": "adrienbrault/home-assistant", "id": "c7dfd335c3212f7c92d4e2c0229be5efae4447f5", ...
import numpy as np from nnabla.models.object_detection.draw_utils import DrawBoundingBoxes from nnabla.utils.image_utils import imresize def draw_bounding_boxes(img, bboxes, names, colors=None, thresh=0.5): ''' The transformed cordinates are further used to draw bounding boxes for the detected objects. A...
{ "content_hash": "362858629e096c4db119d794d0ee639e", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 162, "avg_line_length": 36.00751879699248, "alnum_prop": 0.5959490499060347, "repo_name": "sony/nnabla", "id": "b8d894a79521bbee42965d57fcea2d5543fe501a", "size": "5421", ...
"""This module contains regression tests for stats API handlers.""" from grr.gui import api_regression_test_lib from grr.gui.api_plugins import stats as stats_plugin from grr.gui.api_plugins.report_plugins import report_plugins_test_mocks from grr.lib import aff4 from grr.lib import flags from grr.lib import rdfval...
{ "content_hash": "c30c11d3c87de1dfee9361f32a1972c6", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 77, "avg_line_length": 31.058441558441558, "alnum_prop": 0.6717541292076102, "repo_name": "pidydx/grr", "id": "946a0c5ad798a8c2cf4522738cdcbd223789106d", "size": "4805", ...
from django.core.urlresolvers import reverse from django.db import models from django.db.models.signals import post_save from django.utils.safestring import mark_safe from django.utils.text import slugify # Create your models here. class ProductQuerySet(models.query.QuerySet): def active(self): return self.filter(...
{ "content_hash": "00882ce26e41e81fdcd46a9879b8e89f", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 115, "avg_line_length": 27.75862068965517, "alnum_prop": 0.7269151138716357, "repo_name": "codingforentrepreneurs/ecommerce-2", "id": "f2b1b412743c0356b0ecd30fa2c6a1d8e36c6b...
"""The auditing system.""" import os from grr.lib import action_mocks from grr.lib import aff4 from grr.lib import flags from grr.lib import rdfvalue from grr.lib import test_lib class TestAuditSystem(test_lib.FlowTestsBaseclass): def testFlowExecution(self): client_mock = action_mocks.ActionMock("ListDirec...
{ "content_hash": "54acdd573c31aa2f88e0dbe3152aa29a", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 76, "avg_line_length": 26.25, "alnum_prop": 0.7082251082251082, "repo_name": "pchaigno/grreat", "id": "1a71a7d1ee58064f091b126e3ada687723a6ab65", "size": "1177", "binary"...
"""Unit test for KNX/IP TimerNotify objects.""" from xknx.knxip import KNXIPFrame, TimerNotify class TestKNXIPTimerNotify: """Test class for KNX/IP TimerNotify objects.""" def test_timer_notify(self): """Test parsing and streaming TimerNotify KNX/IP packet.""" message_authentication_code = by...
{ "content_hash": "0875620774927047a0567b60f96dbb8e", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 86, "avg_line_length": 37.348837209302324, "alnum_prop": 0.599626400996264, "repo_name": "XKNX/xknx", "id": "51c3c6be22e4afa2c3e512c3e899243d076f8f58", "size": "1606", "b...
from sqlalchemy.orm import scoped_session, create_session from flask import current_app db_session = scoped_session( lambda: create_session(bind=current_app.db_engine, autocommit=False, autoflush=False)) def db_sync(): from sqlalchemy import DDL, event # Import all modules here that might define model...
{ "content_hash": "c3b58729672400afb11346c26a6bd2a3", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 90, "avg_line_length": 30.72, "alnum_prop": 0.6927083333333334, "repo_name": "kyouko-taiga/trexmo", "id": "4ea6221e9c8899fe98aedf123e788f339f8a8965", "size": "768", "bina...
from fluxgui import xfluxcontroller class FluxController(xfluxcontroller.XfluxController): """ FluxController is the same as XfluxController except that it requires a Settings instance and updates that instance when relevant controller calls are made. """ def __init__(self, settings): s...
{ "content_hash": "40beaf7612ad8f139535c3b79e57fc8b", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 80, "avg_line_length": 34.422222222222224, "alnum_prop": 0.6726920593931569, "repo_name": "NHellFire/f.lux-indicator-applet", "id": "90f8f23e1a23dbe2b2827f5667d68ed058d6cf3d"...
from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer, mutually_exclusive class Source(AWSProperty): props = { 'Password': (basestring, False), 'Revision': (basestring, False), 'SshKey': (basestring, False), 'Type': (basestring, False), 'Url': ...
{ "content_hash": "03c5cb594d2d18382f5faf7c35da988b", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 79, "avg_line_length": 30.431754874651812, "alnum_prop": 0.5956064073226545, "repo_name": "johnctitus/troposphere", "id": "cea522ffbceefdb2b96d25498ed1aad501786a3e", "size...
from distutils.core import setup import sys import io NAME = 'ipwhois' VERSION = '0.10.3' AUTHOR = "Philip Hane" AUTHOR_EMAIL = "secynic AT gmail DOT com" DESCRIPTION = "Retrieve and parse whois data for IPv4 and IPv6 addresses." KEYWORDS = [ "Python", "WHOIS", "RWhois", "ASN", "IP Address", "I...
{ "content_hash": "cde086bce627bc3835bfa9d69167b496", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 74, "avg_line_length": 26.05952380952381, "alnum_prop": 0.6034719049794427, "repo_name": "athrun/ipwhois", "id": "15dc8d21fa35bb04a4514e63f1a3fe4e59e5fbf8", "size": "2211",...
class TrunkPayload(object): """Payload for trunk-related callback registry notifications.""" def __init__(self, context, trunk_id, current_trunk=None, original_trunk=None, subports=None): self.context = context self.trunk_id = trunk_id self.current_trunk = current_trunk...
{ "content_hash": "d126e451e030c4d6c4cd845bf38ade30", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 68, "avg_line_length": 36.470588235294116, "alnum_prop": 0.5967741935483871, "repo_name": "eayunstack/neutron", "id": "4e42a438da4a35961bd25fcde52330b161b00a04", "size": "1...
"""This module contains stuff related to the datastore.""" from google.appengine.ext import db class ZoneRun(db.Model): """A zone run is when you water a zone for some amount of time.""" zone = db.IntegerProperty() runtime_seconds = db.IntegerProperty() created_at = db.DateTimeProperty(auto_now_add=True) d...
{ "content_hash": "8c47badf6eede1bbead5cb9e724cf3b3", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 68, "avg_line_length": 30.933333333333334, "alnum_prop": 0.7219827586206896, "repo_name": "google/irrduino", "id": "7e965ad451ce65cdc3d51e6f07725f3da7c6b510", "size": "1038...
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
{ "content_hash": "60229b081d4a469410478b2b8bcc2751", "timestamp": "", "source": "github", "line_count": 3294, "max_line_length": 92, "avg_line_length": 32.853369763205826, "alnum_prop": 0.6016226355815523, "repo_name": "randyzingle/tools", "id": "363a6309e556b72f81b1945d6c31406aaa244bc2", "size": "...
from oslo_serialization import jsonutils import six from nova.db.sqlalchemy import api as db from nova.db.sqlalchemy import api_models from nova import exception from nova import objects from nova.objects import base from nova.objects import fields from nova.objects import instance as obj_instance from nova.virt impor...
{ "content_hash": "06e98fae12a65235665ad89f04af3220", "timestamp": "", "source": "github", "line_count": 503, "max_line_length": 79, "avg_line_length": 44.48906560636183, "alnum_prop": 0.6258825632317455, "repo_name": "dims/nova", "id": "3c9e92288fbc7b72f09bfa85806deaea589bef88", "size": "22987", ...
def rotate(arr): return [list(a) for a in zip(*reversed(arr))]
{ "content_hash": "0d30ea986501c7145086bb2d59b54b93", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 49, "avg_line_length": 33.5, "alnum_prop": 0.6417910447761194, "repo_name": "the-zebulan/CodeWars", "id": "adc3e8cdafe5570ffe783da53713be5ae3c0442f", "size": "67", "binary...
from __future__ import absolute_import import fnmatch from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import pytest from sunpy.database.commands import AddEntry, RemoveEntry, EditEntry,\ AddTag, RemoveTag, NoSuchEntryError, NonRemovableTagError,\ EmptyCommandStackError, CommandM...
{ "content_hash": "19fe13d74dbe2a72fdec39eda6a6f371", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 86, "avg_line_length": 28.975778546712803, "alnum_prop": 0.6750656794841176, "repo_name": "Alex-Ian-Hamilton/sunpy", "id": "2e481e70b40cc96c3f56ec238e09ac69daae5d5f", "siz...
import unittest import os import sys if __name__ == '__main__': srqi_containing_dir = os.path.dirname(os.path.dirname(os.getcwd())) sys.path.append(srqi_containing_dir) loader = unittest.TestLoader() suite = loader.discover(os.getcwd(), top_level_dir=os.path.dirname(os.getcwd())) unittest...
{ "content_hash": "5c3750c1b6081ea627b4d9391b265246", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 85, "avg_line_length": 30.416666666666668, "alnum_prop": 0.6712328767123288, "repo_name": "tectronics/dicom-sr-qi", "id": "35efabf9dd9c3c251c29df7882ffd51021df1f33", "size"...
from pprint import pprint from googleapiclient import discovery from oauth2client.client import GoogleCredentials import os import math import argparse parser = argparse.ArgumentParser("autoscaler.py") parser.add_argument("-p", "--project_id", help="Project id", type=str) parser.add_argument("-r", "--region", help="G...
{ "content_hash": "7ef84018075f308647c1bf743cab4536", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 184, "avg_line_length": 36.948, "alnum_prop": 0.6703475154270867, "repo_name": "aljim/deploymentmanager-samples", "id": "2a0458c02199ca5315f3e3ae37e7f2050ffabcda", "size":...
import subprocess, tempfile, threading class ShellOneLiner: # oneliner : one liner script of shell # input : input object # outfile : output file # reader : reader python function reads output from one liner # writer : writer python function writes input to one liner def fieldReader(self, line): return line[0:...
{ "content_hash": "2d6f950518168775de54836761d31c66", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 86, "avg_line_length": 21.642857142857142, "alnum_prop": 0.6364136413641364, "repo_name": "kaznak/shellOneLiner", "id": "6904ea03f410ea1f004a3a0152dadfecf42c5642", "size": ...
import hashlib import shlex import tarfile import subprocess from fabric.contrib.files import is_link from fabric.utils import abort import os from fabric.context_managers import show, settings, cd, prefix, lcd from fabric.contrib import files from fabric.operations import run, sudo, get, local, put, open_shell from fa...
{ "content_hash": "e06e388f1b0bd495e506fd9d961cec73", "timestamp": "", "source": "github", "line_count": 343, "max_line_length": 130, "avg_line_length": 32.36151603498542, "alnum_prop": 0.626936936936937, "repo_name": "gipi/OHR", "id": "0ed3ec980909da100d6252a826370857d36b1f81", "size": "11100", "...
''' This thread interacts with a openflow floodligth controller to create dataplane connections ''' __author__="Pablo Montes, Alfonso Tierno" __date__ ="17-jul-2015" #import json import threading import time import Queue import requests import logging class FlowBadFormat(Exception): '''raise when a bad format o...
{ "content_hash": "eb86b8593baeb0589575f08f5abc680d", "timestamp": "", "source": "github", "line_count": 552, "max_line_length": 155, "avg_line_length": 45.90217391304348, "alnum_prop": 0.495264030310206, "repo_name": "nfvlabs/openmano", "id": "a002b894dd583eee74ad67103f43995fc4022aa4", "size": "261...
"""Python bindings for Mesos.""" from __future__ import print_function import sys __all__ = ( 'Executor', 'ExecutorDriver' 'Scheduler', 'SchedulerDriver', ) class Scheduler(object): """ Base class for Mesos schedulers. Users' schedulers should extend this class to get default implementations of me...
{ "content_hash": "be19a4d38522463670f613a148658266", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 76, "avg_line_length": 37.27522935779817, "alnum_prop": 0.6935761752399705, "repo_name": "jmanero/mesos-service", "id": "818f41b97221abaca9f15d530365937f8515287c", "size":...
import time import logging logger = logging.getLogger() import os.path import hwsim_utils import hostapd from utils import HwsimSkip from wlantest import Wlantest def check_cipher(dev, ap, cipher): if cipher not in dev.get_capability("pairwise"): raise HwsimSkip("Cipher %s not supported" % cipher) par...
{ "content_hash": "6f083f3f24fbecf4f20ca7505873827d", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 135, "avg_line_length": 40.36180904522613, "alnum_prop": 0.6078187250996016, "repo_name": "wangybgit/Chameleon", "id": "a1ddcaddb9111ccbf050d62f3ef6843751802aeb", "size": ...
import os import sys import time import zlib import ctypes import os.path import sqlite3 try: import pefile except ImportError, err: print "Error while importing pefile module: %s" % str(err) print "Please make sure it is installed: http://code.google.com/p/pefile/" sys.exit(1) #This is a list of inte...
{ "content_hash": "a4bf578568a6cbedc6a4f7d4d8a707ab", "timestamp": "", "source": "github", "line_count": 713, "max_line_length": 122, "avg_line_length": 28.82608695652174, "alnum_prop": 0.5552960638349632, "repo_name": "meilinxiaoxue/flare-ida", "id": "e748bf41c08c2f63bc08ca20817fe3670ecc9ace", "siz...
from .settings import * DEBUG = os.environ.get('DEBUG', False) EMBEDLY_KEY = os.environ.get('EMBEDLY_KEY') SECRET_KEY = os.environ.get('SECRET_KEY') # Amazon credentials AWS_ACCESS_KEY_ID = os.environ.get('AWS_ACCESS_KEY_ID') AWS_SECRET_ACCESS_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY') AWS_STORAGE_BUCKET_NAME = '...
{ "content_hash": "57a98fe40da117f1c4b8be13ccc2934a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 74, "avg_line_length": 32.041666666666664, "alnum_prop": 0.7464239271781534, "repo_name": "VladimirFilonov/moscowdjango", "id": "4249b99ba1671553a7e98c423696b48c5152b056", ...
""" Functionality for different replica types in the cloud storage system. """ ########################################################################## ## Imports ########################################################################## from .base import * from .store import * from .access import * from .consensus...
{ "content_hash": "ccaca74eca266f630a4eafbd4ce111db", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 76, "avg_line_length": 32.734939759036145, "alnum_prop": 0.6231137283768863, "repo_name": "bbengfort/cloudscope", "id": "b25325ac4d9ff46e8b997dc9f5367a96a6dd831b", "size": ...
from __future__ import unicode_literals from .base import Operation class SeparateDatabaseAndState(Operation): """ Takes two lists of operations - ones that will be used for the database, and ones that will be used for the state change. This allows operations that don't support state change to have i...
{ "content_hash": "d7aaf5f513ad6e6407e2642db94a2aa9", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 97, "avg_line_length": 38.15625, "alnum_prop": 0.6179361179361179, "repo_name": "runekaagaard/django-contrib-locking", "id": "91261f724fa93668c2a82281880e291e90375ae3", "s...
import asyncio from asyncio import coroutine from zeroservices import BaseService from zeroservices.resources import NoActionHandler from ..utils import test_medium, TestCase, _async_test, _create_test_resource_service try: from unittest.mock import Mock except ImportError: from mock import Mock class _Base...
{ "content_hash": "ad4ba316e119f370dae0f120da2f281f", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 85, "avg_line_length": 39.28668941979522, "alnum_prop": 0.5287985405264529, "repo_name": "Lothiraldan/ZeroServices", "id": "01c74c6d72e9911aa772dead2ec9622fbecec538", "siz...
import flatbuffers from flatbuffers.compat import import_numpy np = import_numpy() class TensorTypeAndShape(object): __slots__ = ['_tab'] @classmethod def GetRootAsTensorTypeAndShape(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = TensorTypeAndSha...
{ "content_hash": "4f0ccd4dc33abb484291eac961bd5c1e", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 144, "avg_line_length": 38.75, "alnum_prop": 0.6862170087976539, "repo_name": "ryfeus/lambda-packs", "id": "481a1b2bf178dc84762593632d3db0c94e58d112", "size": "1793", "bi...
from ._compat import unittest from ._adapt import DEFAULT_URI, drop, IS_MSSQL, IS_IMAP, IS_GAE, IS_TERADATA, IS_ORACLE from pydal import DAL, Field from pydal._compat import PY2 @unittest.skipIf(IS_IMAP, "Reference not Null unsupported on IMAP") @unittest.skipIf(IS_ORACLE, "Reference Not Null unsupported on Oracle") ...
{ "content_hash": "66c25dcc2f399d80d74d7d9d8dadd3f7", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 92, "avg_line_length": 37.83756345177665, "alnum_prop": 0.5818352562382614, "repo_name": "willimoa/pydal", "id": "96ce79985f51dfaa69cdff27a108ecb9e146fd99", "size": "7487"...
from taskplus.core.shared.action import Action from taskplus.core.shared.request import Request from taskplus.core.shared.response import ResponseSuccess class DeleteTaskStatusAction(Action): def __init__(self, repo): super().__init__() self.statuses_repo = repo def process_request(self, req...
{ "content_hash": "bb095d05c669ad6cbe7abe514e50075f", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 78, "avg_line_length": 27.4375, "alnum_prop": 0.6469248291571754, "repo_name": "Himon-SYNCRAFT/taskplus", "id": "bf0b372ed9190ce9526d536f5c0219ea25fb8b19", "size": "878", ...
import json from writers import template_writer def GetWriter(config): '''Factory method for creating RegWriter objects. See the constructor of TemplateWriter for description of arguments. ''' return RegWriter(['win', 'win7'], config) class RegWriter(template_writer.TemplateWriter): '''Class for genera...
{ "content_hash": "bb8e6b14bb0fde7330d697802810991a", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 76, "avg_line_length": 33.37864077669903, "alnum_prop": 0.6410703897614892, "repo_name": "ric2b/Vivaldi-browser", "id": "3fbd0a6b3583b7ddb6c3c0072ba982d2adc725dd", "size":...
from poppy.model.helpers import domain def load_from_json(json_data): domain_name = json_data.get('domain') protocol = json_data.get('protocol', 'http') certification_option = json_data.get('certificate', None) return domain.Domain(domain_name, protocol, certification_option)
{ "content_hash": "8e575fbab99a6ab502dfb8a13d4ac1a1", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 69, "avg_line_length": 36.875, "alnum_prop": 0.7254237288135593, "repo_name": "obulpathi/poppy", "id": "d4d03069b9ceb8857a2d83ca384458ba9ab9ba3a", "size": "880", "binary":...
from jsonrpc import jsonrpc_method from gallery.models import Event, Picture @jsonrpc_method('events.get_all', authenticated=True) def get_events(request, null): return [i.to_json() for i in Event.objects.all()] #marker: https://docs.djangoproject.com/en/1.8/topics/db/queries/#lookups-that-span-relationships @jsonr...
{ "content_hash": "c723df09f061dfc7b372d43248066ccc", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 97, "avg_line_length": 33.95238095238095, "alnum_prop": 0.7419354838709677, "repo_name": "Noneus/NoPidi", "id": "2ec4a4255402ca9c8faf3d99059956fc7e3dbdc7", "size": "713", ...
''' This script reads data from xlsx file and store in MongoDB. ''' import pyexcel import logging import models from transform_date import * from accent_remover import * logging.basicConfig(filename='logs/apc.info.txt', level=logging.INFO) logger = logging.getLogger(__name__) # Add Access count for journals def apc...
{ "content_hash": "ff3fbe07313cc4b5d6c88488429a7a6f", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 69, "avg_line_length": 22.70212765957447, "alnum_prop": 0.569821930646673, "repo_name": "scieloorg/journals-catalog", "id": "9dbc10655188f4652bb28b2493ea5492311db480", "siz...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/clothing/shared_clothing_ith_pants_field_15.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "4c51717b9e656bf1998a32d18ed1be3d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 91, "avg_line_length": 24.615384615384617, "alnum_prop": 0.7, "repo_name": "obi-two/Rebelion", "id": "ee39845c4ec95e7f732073ef3142f437fb5e164e", "size": "465", "binary": ...
import datetime import unittest import perlinpinpin class TestPerlinpinpin(unittest.TestCase): def _make_date(self): class MockDate(datetime.date): @classmethod def today(cls): return datetime.date(2009, 3, 6) return MockDate def setUp(self): se...
{ "content_hash": "70afd589d7bb67dd6d7f8519fea38ac3", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 103, "avg_line_length": 52.207142857142856, "alnum_prop": 0.6768367765768231, "repo_name": "cyberdelia/perlinpinpin", "id": "feae2655faa2254ebae1bce6c1630ce9e8579405", "si...
""" Docstrings for generated ufuncs The syntax is designed to look like the function add_newdoc is being called from numpy.lib, but in this file add_newdoc puts the docstrings in a dictionary. This dictionary is used in numpy/core/code_generators/generate_umath.py to generate the docstrings for the ufuncs in numpy.co...
{ "content_hash": "0db577975e71253786686605144b1100", "timestamp": "", "source": "github", "line_count": 3924, "max_line_length": 83, "avg_line_length": 25.239041794087665, "alnum_prop": 0.562329610856439, "repo_name": "shoyer/numpy", "id": "8b1a5a3db2705094400c433c4211c0b5a84fa963", "size": "99038"...
"""This module contains Google Cloud Vision operators.""" from typing import TYPE_CHECKING, Dict, Optional, Sequence, Union from google.api_core.retry import Retry from google.cloud.videointelligence_v1 import enums from google.cloud.videointelligence_v1.types import VideoContext from google.protobuf.json_format impor...
{ "content_hash": "d18a6294dd0b992d6301fa0c33c1ef3e", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 109, "avg_line_length": 47, "alnum_prop": 0.6734080144350049, "repo_name": "bolkedebruin/airflow", "id": "6f2cd220626463336d7974458b54a77501c042c1", "size": "14088", "bi...
from contextlib import closing import getpass import sys import psycopg2 DB_CXN = { 'user' : getpass.getuser(), 'host' : 'lon.lib.virginia.edu' } def is_gis_db(cxn, db_name): """This checks that the database has a geometry_columns table. """ with closing(cxn.cursor()) as c: ...
{ "content_hash": "e88d2ec4eb9dbaa779fb84d9fe7ed071", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 77, "avg_line_length": 28.125, "alnum_prop": 0.5266666666666666, "repo_name": "erochest/problayers", "id": "bd9e70971a4b29650f64e1ff28e85129e0167b93", "size": "1824", "bi...
"""Functions and utilities to apply aesthetic styling to plots.""" from itertools import cycle from functools import wraps import matplotlib.pyplot as plt from neurodsp.plts.settings import AXIS_STYLE_ARGS, LINE_STYLE_ARGS, CUSTOM_STYLE_ARGS, STYLE_ARGS from neurodsp.plts.settings import (LABEL_SIZE, LEGEND_SIZE, LE...
{ "content_hash": "9ade22c69cb230d886d22a35a17fdef5", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 99, "avg_line_length": 36.8268156424581, "alnum_prop": 0.6339502427184466, "repo_name": "voytekresearch/neurodsp", "id": "dca350cbe1408659063a7e0190867b3a2cdda5f5", "size"...
from mcfw.restapi import rest from mcfw.rpc import returns, arguments from plugins.tff_backend.bizz.agenda import list_events, get_event, put_event, list_participants from plugins.tff_backend.bizz.audit.audit import audit from plugins.tff_backend.bizz.audit.mapping import AuditLogType from plugins.tff_backend.bizz.auth...
{ "content_hash": "0c1de159c043f4a618d9522b032032de", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 105, "avg_line_length": 37.68181818181818, "alnum_prop": 0.7490952955367913, "repo_name": "threefoldfoundation/app_backend", "id": "357a4568c8b6a282c85f604cabaf6af6a414feed",...
""" PosteriorContainer saves (usually sampled) inputs to the generative model and their likelihood of producing some observed data. Comes with a bunch of supporting methods to analyze the samples. """ import numpy as np import matplotlib.pyplot as plt import sys import os.path import math class PosteriorContainer(ob...
{ "content_hash": "fe13773c653fdf9818c3b831350c91a4", "timestamp": "", "source": "github", "line_count": 572, "max_line_length": 173, "avg_line_length": 43.56643356643357, "alnum_prop": 0.5268057784911717, "repo_name": "julianje/Bishop", "id": "1b8963546b0fe36b58452257919cb08add0397a7", "size": "249...
from a10sdk.common.A10BaseClass import A10BaseClass class Network(A10BaseClass): """This class does not support CRUD Operations please use parent. :param broadcast: {"default": 0, "not-list": ["non-broadcast", "point-to-point", "point-to-multipoint"], "type": "number", "description": "Specify OSPF broad...
{ "content_hash": "7887edc4e8e713e13a1a95b2a47dca8e", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 675, "avg_line_length": 44.766666666666666, "alnum_prop": 0.6174875013296458, "repo_name": "amwelch/a10sdk-python", "id": "b3c91a301f3c5a4eed7bd0d4e60d78cabce7f088", "size...
from collections import Counter def scramble(s1, s2): # Minor refactor of a solution by 00kevin on CodeWars return not(Counter(s2) - Counter(s1)) # def scramble(s1, s2): # cnt = 0 # length = len(s2) # s2 = sorted(s2) # for letter in sorted(s1): # if letter == s2[cnt]: # c...
{ "content_hash": "a2e7ae918e73578c0765cb226658c605", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 57, "avg_line_length": 22.72222222222222, "alnum_prop": 0.5403422982885085, "repo_name": "the-zebulan/CodeWars", "id": "24cd5b1e1deb06e70477d252adc179e762e9bb54", "size": "...
import json import os from swiftclient import exceptions as swiftexp from solum.api.handlers import handler from solum.common import exception as exc from solum.common import solum_swiftclient from solum import objects from solum.openstack.common import log as logging LOG = logging.getLogger(__name__) class Userl...
{ "content_hash": "808b3d6058004069e38625ffb845f966", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 79, "avg_line_length": 33.6140350877193, "alnum_prop": 0.5913361169102297, "repo_name": "devdattakulkarni/test-solum", "id": "f547c40777a0f5d989a7bac060f9bfdc53d42a1a", "si...
import smtplib import os from django.shortcuts import render from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText def contact(request): if request.method == 'GET': context = None return render(request, 'contact.html', context) if request.method == 'POST': ...
{ "content_hash": "9e636372b70343ed0f39574f41e60386", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 86, "avg_line_length": 33.75675675675676, "alnum_prop": 0.6212970376301041, "repo_name": "grantrygh/apchemhelp", "id": "be6c3568c7c89355e1d27d1b4e1e040b04a978a1", "size": "...
import copy import os import re import sys import time from conary.deps import deps from conary_test import recipes from testrunner import testhelp from rmake import compat from rmake.build import builder from rmake.lib import logfile from rmake.lib import repocache from rmake_test import resources from rmake_test i...
{ "content_hash": "a204fca364bbca2e768f95d8f5ef86a8", "timestamp": "", "source": "github", "line_count": 712, "max_line_length": 184, "avg_line_length": 37.77949438202247, "alnum_prop": 0.5796498011078479, "repo_name": "fedora-conary/rmake-2", "id": "b34e9321a15f6e71db069953ddf2f1f48dbcfe7d", "size"...
""" ======================= Triggered File Reader ======================= This component accepts a filepath as an "inbox" message, and outputs the contents of that file to "outbox". All requests are processed sequentially. This component does not terminate. """ from Axon.Component import component class TriggeredFi...
{ "content_hash": "bc3974b1f961733d746c447507ce8f20", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 75, "avg_line_length": 26.5, "alnum_prop": 0.5523156089193825, "repo_name": "bbc/kamaelia", "id": "aef9406bec21766b196ca7d6acd23226e29dcc25", "size": "2073", "binary": fa...
try: import djsqla_query_operations except ImportError: djsqla_query_operations = None
{ "content_hash": "564ba0062e9efa73c8f07c698be76572", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 34, "avg_line_length": 23.75, "alnum_prop": 0.7578947368421053, "repo_name": "rjusher/djsqla-rest", "id": "a2adefa8c1a90a53163c5bf72b33755811e58209", "size": "119", "binar...
""" The PyBuilder execution module. Deals with the execution of a PyBuilder process by running tasks, actions and initializers in the correct order regarding dependencies. """ import inspect import re import types import copy from pybuilder.errors import (CircularTaskDependencyException, ...
{ "content_hash": "8caf0434e00f153bce09d1815f5681cc", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 118, "avg_line_length": 35.01497005988024, "alnum_prop": 0.6108593415989739, "repo_name": "Designist/pybuilder", "id": "087487b2d1d42fa291df68e0e13f4cb917da8954", "size": ...
import clusto from clusto.drivers.base import ResourceManager from clusto.exceptions import ResourceException class SimpleNameManagerException(ResourceException): pass class SimpleNameManager(ResourceManager): """ SimpleNameManager - manage the generation of a names with a common prefix and an increm...
{ "content_hash": "0fefd0c21198f23b767ebadebd55f61b", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 86, "avg_line_length": 26.90721649484536, "alnum_prop": 0.5812260536398467, "repo_name": "motivator/clusto", "id": "8f0fa2126774e465560ac3f8c92536f45970d079", "size": "2610...
import mythboxtest import unittest2 as unittest from mockito import Mock, when, any from mythbox.feeds import TwitterFeed, FeedHose log = mythboxtest.getLogger('mythbox.unittest') class FeedHoseTest(unittest.TestCase): def test_getLatestEntries_None(self): # Setup settings = Mock()...
{ "content_hash": "a1b556ccf7c670be1ee263376cf44232", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 65, "avg_line_length": 25.6, "alnum_prop": 0.6328125, "repo_name": "GetSomeBlocks/Score_Soccer", "id": "11fed84d3eb300625e3efaacf44a5baa061d3537", "size": "1712", "binary...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='nirvaris-dictionary', version='1.9...
{ "content_hash": "e4387a424bc6bb0bf960a0bb86de2809", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 96, "avg_line_length": 35.05882352941177, "alnum_prop": 0.6484899328859061, "repo_name": "nirvaris/nirvaris-dictionary", "id": "0f9d56dd724f8fbb1c8e081efffd32d57da48c57", "...
""" NetCDF reader/writer module. This module is used to read and create NetCDF files. NetCDF files are accessed through the `netcdf_file` object. Data written to and from NetCDF files are contained in `netcdf_variable` objects. Attributes are given as member variables of the `netcdf_file` and `netcdf_variable` objects...
{ "content_hash": "4f000f07f0aae2373b22cc0a5f9fe534", "timestamp": "", "source": "github", "line_count": 1088, "max_line_length": 107, "avg_line_length": 35.923713235294116, "alnum_prop": 0.5705769476781374, "repo_name": "scipy/scipy", "id": "64b64324f06b53f0f78b4b64b41222f11db52ae1", "size": "39085...
"""Circuits Library - Web circuits.web contains the circuits full stack web server that is HTTP and WSGI compliant. """ from utils import url from loggers import Logger from sessions import Sessions from controllers import expose, Controller from events import Request, Response from servers import BaseServer, Server ...
{ "content_hash": "7cdf5b3da1064a3f62a85ca408811904", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 69, "avg_line_length": 24.75, "alnum_prop": 0.8013468013468014, "repo_name": "antont/tundra", "id": "85650c208a44dd86d0781c18d09d7786c149f1b6", "size": "710", "binary": f...
import os import glob import six from st2common import log as logging from st2common.constants.pack import MANIFEST_FILE_NAME from st2common.content.loader import MetaLoader from st2common.content.loader import ContentPackLoader from st2common.models.api.pack import PackAPI from st2common.persistence.pack import Pack...
{ "content_hash": "44191aac48876037c17e0734df00bf59", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 99, "avg_line_length": 33.41085271317829, "alnum_prop": 0.6320185614849188, "repo_name": "armab/st2", "id": "e28827d2dbe66bb167234bd5a105ef2d65c6a41a", "size": "5090", "...
from pants.backend.python.target_types import ( PythonSourcesGeneratorTarget, PythonSourceTarget, PythonTestsGeneratorTarget, PythonTestTarget, PythonTestUtilsGeneratorTarget, ) from pants.engine.target import BoolField class SkipYapfField(BoolField): alias = "skip_yapf" default = False ...
{ "content_hash": "050cdbc35daa1939ec10d534e228a331", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 76, "avg_line_length": 31.875, "alnum_prop": 0.7516339869281046, "repo_name": "benjyw/pants", "id": "bd6c595e87cce3866f239eb45e484f3b8eb715cc", "size": "897", "binary": f...
import os class ArgHandlerWithParam: ''' Handler for some arguments which needs a value ''' def __init__(self, arg_name, convert_val=None, default_val=None): self.arg_name = arg_name self.arg_v_rep = '--%s' % (arg_name,) self.convert_val = convert_val self....
{ "content_hash": "01161cd35dd1bb32b72d99b567372d48", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 121, "avg_line_length": 33.94219653179191, "alnum_prop": 0.5667574931880109, "repo_name": "glenngillen/dotfiles", "id": "82dd47546895a4cd1f3fec8ed8509ef069f6ebac", "size":...
"""installer script for pywikibot 2.0 framework""" # # (C) Pywikipedia team, 2009-2012 # __version__ = '$Id$' # # Distributed under the terms of the MIT license. # import sys from distribute_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages if sys.version_info[0] != 2: rais...
{ "content_hash": "8e677ec00247038b8418efff06801562", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 84, "avg_line_length": 26.513513513513512, "alnum_prop": 0.7043832823649337, "repo_name": "pywikibot/core-migration-example", "id": "66c5d19bed1769f9a8d33285d9ec1b447591165d"...
from math import factorial def memoize_factorial_sum(func): cache={} def inner(n, length=None): if n is not str: n=str(n) if not n in cache: cache[n]=func(n, length) return cache[n] return inner @memoize_factorial_sum def factorial_sum(n, length=None): i...
{ "content_hash": "2e1b8272654c310ecfbd31febecc897d", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 67, "avg_line_length": 23.155555555555555, "alnum_prop": 0.5738963531669866, "repo_name": "Bolt64/my_code", "id": "70cd33cd71da1a347d98dee2ed7e840eb2a5269e", "size": "1066"...
import logging from django.db.utils import DataError from scholarly_citation_finder.tools.nameparser.AuthorNameParser import AuthorNameParser from scholarly_citation_finder.apps.core.models import Author, AuthorNameBlock, AuthorNameVariation from scholarly_citation_finder.apps.parser.Exceptions import ParserDataError ...
{ "content_hash": "2688b0d739786045ac1fea53ce05d344", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 141, "avg_line_length": 51.287234042553195, "alnum_prop": 0.4266749637004771, "repo_name": "citationfinder/scholarly_citation_finder", "id": "596e015784d55cc57f0fe3507cc0b55c...
import factory from factory.django import DjangoModelFactory from .. import models class AccountFactory(DjangoModelFactory): # pylint: disable=R0903 class Meta: model = models.Account username = factory.Faker('user_name') email = factory.LazyAttribute( lambda f: '{0}.{1}@example.com'...
{ "content_hash": "d51e51348a060ad70284da8341a3e6d2", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 47, "avg_line_length": 24.652173913043477, "alnum_prop": 0.6490299823633157, "repo_name": "ahmed-taj/test_travis", "id": "68504e2cf3349b48e7cb731b72894b4991f00445", "size":...
import itertools from heapq import heappop, heappush, heapify # Based on: # docs.python.org/2/library/heapq.html#priority-queue-implementation-notes class PriorityQueue: def __init__(self): # entry: [priority, count from counter, task] self.heap = [] # list of entries arr...
{ "content_hash": "e4d99ec4f9b611ca3df03577084d13a5", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 80, "avg_line_length": 36.078947368421055, "alnum_prop": 0.5802334062727936, "repo_name": "baharev/sdopt-tearing", "id": "506bbdda64321d25c3d35d0a068cfe41fc90ec0a", "size":...
from twisted.trial.unittest import TestCase from txjsonrpc.jsonrpc import BaseProxy, BaseQueryFactory from txjsonrpc.jsonrpclib import Fault, VERSION_PRE1, VERSION_1, VERSION_2 class BaseQueryFactoryTestCase(TestCase): def test_creation(self): factory = BaseQueryFactory("someMethod") self.assert...
{ "content_hash": "0fe5ce1a4c7df1540a449c2f9818452a", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 76, "avg_line_length": 33.34615384615385, "alnum_prop": 0.6401384083044983, "repo_name": "medialab/txjsonrpc", "id": "780c81e742af8d1322d08be20ade215d7b9132e0", "size": "3...
from django.shortcuts import render, get_object_or_404 # Create your views here. from django.views.generic import DetailView, ListView, CreateView, UpdateView, DeleteView from nectr.tutor.models import Tutor def get_tutor_profile_by_username(request, username): tutor = get_object_or_404(Tutor, user__username=us...
{ "content_hash": "3b3ab2d4b45009ea281f841cbff505cd", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 114, "avg_line_length": 25.857142857142858, "alnum_prop": 0.7142857142857143, "repo_name": "nectR-Tutoring/nectr", "id": "b94950f77f66ab909fd2fc23bb5244c8befa6452", "size":...
import unittest from logEntry import LogEntry class TestLogEntry(unittest.TestCase): def test_parse_log_1(self): line = '188.45.108.168 - - [12/Dec/2015:19:44:09 +0100] "GET /images/stories/raith/almhuette_raith.jpg HTTP/1.1" 200 43300 "http://www.almhuette-raith.at/" "Mozilla/5.0 (Linux; And...
{ "content_hash": "b57b45c9b188d2918484725649ec05a4", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 336, "avg_line_length": 54.044444444444444, "alnum_prop": 0.6591282894736842, "repo_name": "luchasei/http-log-app", "id": "b3f79e68c9f2e7ca216e612d04e7992c2c89749b", "size"...
"""Utils for metrics used in eval.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import inspect import numpy as np import six from tensor2tensor.layers import common_layers from tensor2tensor.utils import bleu_hook from tensor2tensor.utils import regis...
{ "content_hash": "85fca98f0842cbc98547453fda490378", "timestamp": "", "source": "github", "line_count": 672, "max_line_length": 80, "avg_line_length": 38.5625, "alnum_prop": 0.6719147950914564, "repo_name": "vthorsteinsson/tensor2tensor", "id": "db9ddb183181a2d73a8eee54e4c1bae07c3645b8", "size": "2...
from pystorm.bolt import BasicBolt class SentenceSplitterBolt(BasicBolt): def process(self, tup): sentence = tup.values[0] for word in sentence.split(' '): BasicBolt.emit(word) if __name__ == '__main__': SentenceSplitterBolt().run()
{ "content_hash": "e2819d8b0581da6848e5dc95fb0ec934", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 40, "avg_line_length": 21.076923076923077, "alnum_prop": 0.6240875912408759, "repo_name": "thedrow/streamparse", "id": "a83e9aed8b692aeee7764377422f256af3ca5a25", "size": "...
from __future__ import absolute_import def get_support_mail(): """Returns the most appropriate support email address""" from sentry.options import get return get("system.support-email") or get("system.admin-email") or None
{ "content_hash": "5ca9ba394bd858f34e1a5f90c94328f3", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 75, "avg_line_length": 29.75, "alnum_prop": 0.7184873949579832, "repo_name": "mvaled/sentry", "id": "8b23d0e6724d1f949b1a38f3bbecaffb2b535e5d", "size": "238", "binary": fa...
from __future__ import absolute_import, unicode_literals from django.core.exceptions import ValidationError from django.db import connection from django.test import TestCase from django_pg.models.fields.json import JSONField from tests.jsont.models import Song import math class JSONSuite(TestCase): """Test suite ...
{ "content_hash": "f6bf2ca5f991509c3e7b150f80cae1a6", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 78, "avg_line_length": 35.33913043478261, "alnum_prop": 0.5670521653543307, "repo_name": "lukesneeringer/django-pgfields", "id": "6f966085078944d24cb30440d2b1eadf4b26c17e", ...
from .plotter import (plot_with_plotly, plot_embedding_with_plotly, plot_with_matplotlib, plot_embedding_with_matplotlib)
{ "content_hash": "e71ecc7748411449e25432a5af58ca21", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 67, "avg_line_length": 63, "alnum_prop": 0.7857142857142857, "repo_name": "mmp2/megaman", "id": "ab2ce1e6b215a0a46547a29657b4924b91343d9d", "size": "205", "binary": false,...
from PyQt4 import QtCore, QtGui import vtrace.qt import vdb.qt.base from vqt.main import * class VdbRegistersWindow(vdb.qt.base.VdbWidgetWindow): def __init__(self, db, dbt, parent=None): vdb.qt.base.VdbWidgetWindow.__init__(self, db, dbt, parent=parent) self.regsWidget = vtrace.qt.RegistersView...
{ "content_hash": "f475296a75dc4b524a61c14ac46ac7b7", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 75, "avg_line_length": 26.892857142857142, "alnum_prop": 0.6613545816733067, "repo_name": "HackerTool/vivisect", "id": "0428513ba2bc94838b5524fb24fe7003f6896962", "size": "...
import json import tempfile import uuid import nose.exc from keystone import config from keystone import exception from keystone.openstack.common import jsonutils from keystone.policy.backends import rules import test_v3 CONF = config.CONF DEFAULT_DOMAIN_ID = CONF.identity.default_domain_id class IdentityTestPro...
{ "content_hash": "55368ff80cc72ee14a88cf2d8d36845a", "timestamp": "", "source": "github", "line_count": 310, "max_line_length": 76, "avg_line_length": 41.061290322580646, "alnum_prop": 0.5892057506481263, "repo_name": "paypal/keystone", "id": "ea38b24c47976b1225ddc42bdcbde587114048ee", "size": "133...
"""labquiz URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/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-ba...
{ "content_hash": "33367f22c754890791990d0de6a5c781", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 38.30769230769231, "alnum_prop": 0.6947791164658634, "repo_name": "sehgalayush1/labquiz", "id": "7501d5bcf6953a129b910065a89c4b344a72722c", "size": "...
"""Tensor and Operation class for computation declaration.""" # pylint: disable=invalid-name from __future__ import absolute_import as _abs from ._ffi.node import NodeBase, NodeGeneric, register_node, convert_to_node from . import _api_internal from . import make as _make from . import expr as _expr class TensorSlice...
{ "content_hash": "0188b0df9316c55fe02824b4909b83b1", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 93, "avg_line_length": 28.033742331288344, "alnum_prop": 0.5895612211401685, "repo_name": "Huyuwei/tvm", "id": "1cadf0621823e7db7479a1ef2d7cb3013444e2ab", "size": "9924", ...
"""Provide pre-made queries on top of the recorder component.""" from collections import defaultdict from datetime import timedelta from itertools import groupby import logging import time import voluptuous as vol from homeassistant.const import ( HTTP_BAD_REQUEST, CONF_DOMAINS, CONF_ENTITIES, CONF_EXCLUDE, CONF_...
{ "content_hash": "d881ae61e5784e4d0237db8ca846a567", "timestamp": "", "source": "github", "line_count": 402, "max_line_length": 79, "avg_line_length": 37.549751243781095, "alnum_prop": 0.6211990725405764, "repo_name": "jabesq/home-assistant", "id": "d0dd098638f62fb05a3f34ef5d3c98b2322b13bc", "size"...
""" **Note**: this connector is in beta! The ``@dockerssh`` connector allows you to run commands on Docker containers on a remote machine. .. code:: shell # A Docker base image must be provided pyinfra @dockerssh/remotehost:alpine:3.8 ... # pyinfra can run on multiple Docker images in parallel pyinf...
{ "content_hash": "d09c011202f9cfb73e338a67ca36629d", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 99, "avg_line_length": 27.169329073482427, "alnum_prop": 0.5940733772342427, "repo_name": "Fizzadar/pyinfra", "id": "5aedd4a66a1e11bcc9581b71c60a081c7cecf816", "size": "85...
from django.db import models from django.utils.translation import ugettext_lazy as _ from ocd.validation import enhance_html import random import string class HTMLField(models.TextField): """ A string field for HTML content. """ description = _("HTML content") def formfield(self, **kwargs): ...
{ "content_hash": "d57d64da3f4ff0e8616455a7dc17a048", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 78, "avg_line_length": 27.737704918032787, "alnum_prop": 0.6270685579196218, "repo_name": "hasadna/OpenCommunity", "id": "5b38bdf7247c00a2a9017d97a7428018ca9c979b", "size"...
"""Defines utility things. """ import os import shelve import inspect import hashlib import datetime from enum import Enum from django.conf import settings class ChoiceEnum(Enum): """Enum class which can be used in django field choices. """ @classmethod def choices(cls): # get all members o...
{ "content_hash": "631b2c89dedb57cac4914f6beaf25336", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 77, "avg_line_length": 25.772727272727273, "alnum_prop": 0.6272780717225162, "repo_name": "daftshady/dropbeat", "id": "8e65cbf0b8833d4a063dd07ba8a0c8bb01cc5628", "size": "1...
try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst', 'rb') as readme_file: readme = readme_file.read().decode('utf8') with open('HISTORY.rst', 'rb') as history_file: history = history_file.read().decode('utf8') requirements = [ "marshmall...
{ "content_hash": "5d72d5263366ab1f4a4f4684930dc10d", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 78, "avg_line_length": 30.653061224489797, "alnum_prop": 0.6138482023968043, "repo_name": "Scille/umongo", "id": "aa5b05c308daba4e7abf64430a144f168fc20e58", "size": "1553",...
import pkg_resources from turbodbc_intern import Megabytes, Rows from .api_constants import apilevel, paramstyle, threadsafety from .connect import connect from .constructors import Date, Time, Timestamp from .data_types import BINARY, DATETIME, NUMBER, ROWID, STRING from .exceptions import DatabaseError, Error, Inter...
{ "content_hash": "f1bafa9c473b1eb853d05c8777c3f1d5", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 76, "avg_line_length": 22.944444444444443, "alnum_prop": 0.6634382566585957, "repo_name": "blue-yonder/turbodbc", "id": "f0b9a14c0deec54e330e13489d4988dc0c94d5ac", "size": ...
import numpy as np import os.path from pickle_ import dump, load # Logger from log import getLogger logger = getLogger('basic') # all __all__ = [ 'coefficient', 'points', 'required_total', 'required_weight' ] # Source files WILKS_TABLE_MEN = 'wilks_data/wilks_men.txt' WILKS_TABLE_WOMEN = 'wilks_data/...
{ "content_hash": "c048be25789dd73fc2cf7636aa3a9e65", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 74, "avg_line_length": 22.928571428571427, "alnum_prop": 0.6335315774568111, "repo_name": "rstebbing/powerlifting-meet-manager", "id": "b682c2b158de9195fe53d639de67a987bee48...
from utils import CanadianScraper, CanadianPerson as Person from pupa.scrape import Organization import re COUNCIL_PAGE = 'http://www.gov.pe.ca/mapp/municipalitites.php' class PrinceEdwardIslandMunicipalitiesPersonScraper(CanadianScraper): def scrape(self): page = self.lxmlize(COUNCIL_PAGE) dis...
{ "content_hash": "88b78d846cf52c81d47b4ef1784d41c0", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 155, "avg_line_length": 48.45454545454545, "alnum_prop": 0.5579737335834897, "repo_name": "opencivicdata/scrapers-ca", "id": "0a199b912e34ef8fd24e4b7512ea234b5482cdbc", "si...
"""Tests for deCONZ config flow.""" import asyncio import pydeconz from homeassistant import data_entry_flow from homeassistant.components import ssdp from homeassistant.components.deconz import config_flow from homeassistant.components.deconz.config_flow import ( CONF_MANUAL_INPUT, CONF_SERIAL, DECONZ_MA...
{ "content_hash": "a78f52ad727200193e7760169ead1cae", "timestamp": "", "source": "github", "line_count": 572, "max_line_length": 92, "avg_line_length": 32.64685314685315, "alnum_prop": 0.6230052479383099, "repo_name": "tchellomello/home-assistant", "id": "43536a44bbece1979595de6a87a124f0c169b6a5", "...
import logging from fuel_agent_ci.objects import Object LOG = logging.getLogger(__name__) class Vm(Object): __typename__ = 'vm' def __init__(self, env, name, boot=None): self.env = env self.name = name self.interfaces = [] self.disks = [] self.boot = boot or 'hd' ...
{ "content_hash": "a6840a66b1d2b7f44ad832a48f03690a", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 71, "avg_line_length": 25, "alnum_prop": 0.559322033898305, "repo_name": "Axam/nsx-web", "id": "2e7c847cefc70b46bb5e2cec94b37cb00259c70c", "size": "2053", "binary": false...
import SimpleHTTPServer import SocketServer import requests import md5 def calc_hash_terrain(s): # When Ian built the hash for terrain tiles he used the path without # the leading slash and the first 6 chars of the hex digest instead of 5 m = md5.new() m.update(s[1:]) md5_hash = m.hexdigest() ...
{ "content_hash": "cfef23e9ab444b30d77f5abc43fec9d1", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 76, "avg_line_length": 26.333333333333332, "alnum_prop": 0.584256329113924, "repo_name": "mapzen/tile-hash-proxy", "id": "3ee9e1a1f6e9caa15e30202e5ef379c24877bc94", "size":...
from mpi4py import MPI def bcast_if_comm_is_not_null(x, comm): """ MPI broadcast. Broadcast object over given communicator only if the communicator is not null. Parameters ---------- x : any object The object would shared over given communicator. comm : MPI_Comm MPI commun...
{ "content_hash": "57387b0217ad99097ff19af01900662e", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 79, "avg_line_length": 26.555555555555557, "alnum_prop": 0.603905160390516, "repo_name": "ibara1454/pyss", "id": "1c5963fc17264bcaa0660b1397df9e0f180c3821", "size": "764", ...
import inspect import six from oslo_utils import strutils from oslo_utils import uuidutils import wsme from wsme import types as wtypes from magnum.common import exception from magnum.common import utils from magnum.i18n import _ class DNSListType(wtypes.UserType): """A comman delimited dns nameserver list""" ...
{ "content_hash": "658cbedde85f18c7e052fc664abf493c", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 79, "avg_line_length": 29.307317073170733, "alnum_prop": 0.6126830892143809, "repo_name": "ArchiFleKs/magnum", "id": "5fa6c51fe45b1a680c82bc237bfb7094b3df7eba", "size": "6...
import getpass import os import json import requests import uuid class GithubException(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) class Github: def get_credential(self,scopes,save_path): if os.path.isfile(save_path): ...
{ "content_hash": "02244509b0f6aa7f561774a075cfc3c2", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 124, "avg_line_length": 27.88095238095238, "alnum_prop": 0.609735269000854, "repo_name": "gk024kfd/gist_it", "id": "b590a230c1456dda2dbe0a9c6d9f02032a459c9b", "size": "1171...
from django.shortcuts import render_to_response from django.http import HttpResponse from django.core.context_processors import csrf from django.conf import settings import logging logger = logging.getLogger(__name__) try: from json import dumps as to_json except ImportError: from simplejson import dumps as t...
{ "content_hash": "5c1d7e2e71105adc973d66b5f423cb6c", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 80, "avg_line_length": 32.801980198019805, "alnum_prop": 0.614246906127377, "repo_name": "eevans/caqel", "id": "5c0e86bea84d4ddba94395313aa5915d9bc978e4", "size": "3314", ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ITDB_Main', '0010_auto_20150822_1221'), ] operations = [ migrations.AddField( model_name='cast', name='end_year', ...
{ "content_hash": "cbb4b2c34022a7cf3f2f718978103d0c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 53, "avg_line_length": 25.696969696969695, "alnum_prop": 0.5436320754716981, "repo_name": "Plaudenslager/ITDB", "id": "a0f01f66466fbfbf36099db17065e28f9bcdb073", "size": "8...
import struct class Particle(object): """Information used to restart a specific particle that caused a simulation to fail. Parameters ---------- filename : str Path to the particle restart file Attributes ---------- current_batch : int The batch containing the particl...
{ "content_hash": "838dd756ee30dcf21f578903915c1375", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 82, "avg_line_length": 26.2, "alnum_prop": 0.5797285835453775, "repo_name": "kellyrowland/openmc", "id": "72bf3ac3dec80b20e034aa7e1542a32ba86a3e31", "size": "2358", "bina...
import numpy as np import os os.pathsep() a = np.complex(1,1)
{ "content_hash": "803ad2e128644ca87e87adc093e72b2f", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 19, "avg_line_length": 10.666666666666666, "alnum_prop": 0.6875, "repo_name": "gregnordin/micropython_pyboard", "id": "df26e189436dbf282169de5f2e870f9eb1ac1615", "size": "64...
from .connectivity_test import ConnectivityTest, Endpoint, ReachabilityDetails from .reachability import ( CreateConnectivityTestRequest, DeleteConnectivityTestRequest, GetConnectivityTestRequest, ListConnectivityTestsRequest, ListConnectivityTestsResponse, OperationMetadata, RerunConnectivi...
{ "content_hash": "a7f2f3ed868518203f29dbfe46aa2dbf", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 78, "avg_line_length": 22.88888888888889, "alnum_prop": 0.7045769764216366, "repo_name": "googleapis/python-network-management", "id": "d19cc05aa65dc989154dbae751ee06fbefee96...
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager from django.db import models """@package docstring Documentation. """ class SCUser(AbstractBaseUser,PermissionsMixin): """La classe SCUser e' la rappresentazione della nostra classe utente che va a sostituire la classe ut...
{ "content_hash": "468b90d25b8fa2be3ef9431ddcf4b8da", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 126, "avg_line_length": 36.79338842975206, "alnum_prop": 0.681266846361186, "repo_name": "samzek/social_circle", "id": "91b34917e1eab15e1b31a7dd264b40d9f8e066ab", "size": ...
"""Test PyMongo's SlaveOkay with: - A direct connection to a standalone. - A direct connection to a slave. - A direct connection to a mongos. """ import itertools import unittest from mockupdb import MockupDB, going from pymongo import MongoClient from pymongo.read_preferences import make_read_preference, read_pref...
{ "content_hash": "631600f3d73c53a8ba7a76b772e42942", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 96, "avg_line_length": 29.463414634146343, "alnum_prop": 0.652317880794702, "repo_name": "ShaneHarvey/mongo-python-driver", "id": "bd36c77a048049d554e1230cc51b433a36adf991", ...
from django.apps import AppConfig class ChatAppConfig(AppConfig): name = "openslides.chat" verbose_name = "OpenSlides Chat" def ready(self): # Import all required stuff. from ..utils.rest_api import router from . import serializers # noqa from .views import ( ...
{ "content_hash": "5f9f52eea24622a4798e0148198c6797", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 85, "avg_line_length": 28.28125, "alnum_prop": 0.5966850828729282, "repo_name": "CatoTH/OpenSlides", "id": "71cede8377487c5c6a9372c8ae67c270ab5d62bc", "size": "905", "bin...