text
stringlengths
4
1.02M
meta
dict
""" Josh Kelle May 5, 2016 CS 345 Greed algorithm for TSP. Assumes input file is .tsp format. """ import sys from math import sqrt ################################################################################ # greedy algorithm # #####################...
{ "content_hash": "21b4d3099118d1d09ffe28b073104cac", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 109, "avg_line_length": 27.943037974683545, "alnum_prop": 0.46772366930917325, "repo_name": "rellermeyer/99tsp", "id": "f5e39746233ac801b956357e82b99329567c64f1", "size": ...
from robot.errors import DataError from robot.utils import get_error_message, is_bytes, is_list_like, is_string, type_name from .arguments import PythonArgumentParser def no_dynamic_method(*args): return None class _DynamicMethod: _underscore_name = NotImplemented def __init__(self, lib): self...
{ "content_hash": "e82afc5d57f74dea4d82fc959a6d1e3c", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 87, "avg_line_length": 29.805755395683452, "alnum_prop": 0.6058411778904176, "repo_name": "HelioGuilherme66/robotframework", "id": "aa5f30a1fe4748f9fe7eafb03431745faf3cbae2"...
from openerp import tools, models, fields, api, exceptions import datetime, hashlib, pymongo from legrand_proc import pub, log, calc_cikkek_uid ############################################################################################################################ Hely ### class LegrandHely(models.Model): _nam...
{ "content_hash": "010059c2a5802a883a11f656fc3aab0c", "timestamp": "", "source": "github", "line_count": 1074, "max_line_length": 221, "avg_line_length": 56.32309124767225, "alnum_prop": 0.5891454927179249, "repo_name": "csokt/odoo8", "id": "57e1cd286c9f49779d08ff45b76991d1c697d87d", "size": "61155"...
import _plotly_utils.basevalidators class PositionValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="position", parent_name="indicator.delta", **kwargs): super(PositionValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_n...
{ "content_hash": "10c7a40f7ad6c4fb4d45a6b27f919ed9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 88, "avg_line_length": 41, "alnum_prop": 0.6022514071294559, "repo_name": "plotly/python-api", "id": "853a902df7a2724a80ee7fe3d2b6dfc9ef93ccbb", "size": "533", "binary": ...
"""Tests for tensorflow.python.training.saver.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import glob import math import os import random import time import numpy as np import six from google.protobuf.any_pb2 import Any from tensorflow.core.pr...
{ "content_hash": "723d7d3714ba65adc5eb7a4590fee205", "timestamp": "", "source": "github", "line_count": 3133, "max_line_length": 80, "avg_line_length": 42.51579955314395, "alnum_prop": 0.6435864326361466, "repo_name": "sarvex/tensorflow", "id": "b83a2a6b995f88a3ed1c3d907ad73079ede261fd", "size": "1...
from xml_tools import xml_get_text class StorageVolume(object): def __init__(self, deltacloud, dom): self._deltacloud = deltacloud self.xml = dom.toxml() self.created = xml_get_text(dom, "created")[0] self.state = xml_get_text(dom, "state")[0] self.capacity = xml_get_te...
{ "content_hash": "7a3ff04b2c4df0f3867095f493da38e0", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 56, "avg_line_length": 31.333333333333332, "alnum_prop": 0.5872340425531914, "repo_name": "bmbouter/Opus", "id": "1543b1df0744f2c1f43874af76552d77b225c81e", "size": "1656",...
from __future__ import print_function, unicode_literals import mock import pytest from django.http import QueryDict from test_project.one_to_one.api import PlaceFilterSet from test_project.one_to_one.models import Place, Restaurant from url_filter.filtersets import FilterSet, ModelFilterSet from url_filter.integratio...
{ "content_hash": "f481dd578792b3ff79f20742c21d0bc3", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 78, "avg_line_length": 30.625, "alnum_prop": 0.6326530612244898, "repo_name": "barseghyanartur/django-url-filter", "id": "f93ecdd81887f9f8fba1685038695a53c22f4b6d", "size":...
import logging from avocado import Test class CheckVersionDB(object): def __init__(self, host, user, passwd): self.host = host self.user = user self.passwd = passwd self.db_name = 'housekeeping' self.connect() self.log = logging.getLogger('check_version_db') de...
{ "content_hash": "612ca69f3d2ed116c7c24f0c5ab61082", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 114, "avg_line_length": 31.344086021505376, "alnum_prop": 0.5427101200686106, "repo_name": "scylladb/scylla-artifact-tests", "id": "d9c666526c789e455aee0b5d3b470af07a876134",...
from novaclient.v1_1 import security_groups from novaclient.tests import utils from novaclient.tests.v1_1 import fakes cs = fakes.FakeClient() class SecurityGroupsTest(utils.TestCase): def _do_test_list_security_groups(self, search_opts, path): sgs = cs.security_groups.list(search_opts=search_opts) ...
{ "content_hash": "38316a3d5c6d58a77b106ad01aa3a506", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 76, "avg_line_length": 38.63934426229508, "alnum_prop": 0.6470089096308868, "repo_name": "tylertian/Openstack", "id": "9f3ae46bbb3c4d117fac9f638d7e983b9d184239", "size": "2...
""" Be careful with circularity. """ __author__ = 'donal' __project__ = 'dcleaner' # to be used in views - from flask import Blueprint proj = Blueprint('proj', __name__) from data_handler2 import DataHandler2 from se_corrects import FromStrTo fst = FromStrTo() # needs to go last (coming back from views) - from . impor...
{ "content_hash": "cb5dbe46f576a03fb33b6d8716c597ac", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 45, "avg_line_length": 23.357142857142858, "alnum_prop": 0.709480122324159, "repo_name": "carverdo/dcleaner", "id": "19897f99bb52ac4826316d4562ea2013e305ba39", "size": "327...
import logging import unittest import sys from anima.ui import IS_PYSIDE, IS_PYQT4 from anima.ui.dialogs import reference_editor logger = logging.getLogger('anima.ui.reference_editor') if IS_PYSIDE(): logger.debug('environment is set to pyside, importing pyside') from PySide import QtCore, QtGui elif IS_PYQ...
{ "content_hash": "d177338450cd5f911c30fc5b06876698", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 75, "avg_line_length": 27.916666666666668, "alnum_prop": 0.6149253731343284, "repo_name": "eoyilmaz/anima", "id": "bbceae545c180f83c2288fa848d936c6977e8739", "size": "1700"...
from ..extensions import db from ..roster import Person class Event(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String, nullable=False) location = db.Column(db.String, nullable=False) date = db.Column(db.Date, nullable=False) time = db.Column(db.Time) end_date ...
{ "content_hash": "46429aad7cda2dc4d7c7e0af069b55c5", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 93, "avg_line_length": 36.958333333333336, "alnum_prop": 0.6307779030439684, "repo_name": "team294/surfmanage", "id": "68c79d3d5e9ba642d9b2be6731807563c30c8b64", "size": "1...
""" MOF class for file I/O and molecular operations. """ import os import numpy as np from . import ase class MOF: """ Metal Organic Framework class. """ def __init__(self, read=None): """ Initialize MOF object by reading a molecule file.name, unit cell volume and parameters, atom name...
{ "content_hash": "e33cd9314074cab1512cdbb47925589d", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 127, "avg_line_length": 32.56976744186046, "alnum_prop": 0.5812209925026777, "repo_name": "kbsezginel/tee_mof", "id": "845a26f92fa518481077895dadeb112b949f4421", "size": "2...
from hashlib import md5 from reportlab.lib.enums import TA_RIGHT from reportlab.lib.styles import ParagraphStyle from reportlab.lib.utils import flatten, open_for_read, getStringIO, \ LazyImageReader, haveImages from reportlab.platypus.doctemplate import BaseDocTemplate, PageTemplate, IndexingFlowable from reportla...
{ "content_hash": "55885d7c6ffa606c73c228e17c833df3", "timestamp": "", "source": "github", "line_count": 865, "max_line_length": 114, "avg_line_length": 36.15838150289017, "alnum_prop": 0.5438501135019344, "repo_name": "hepochen/xhtml2pdf", "id": "5dfb25d4cd646ec41c0713ddaf7636e2c522a98e", "size": "...
"""Common functions for RFLink component tests and generic platform tests.""" from unittest.mock import Mock from homeassistant.bootstrap import async_setup_component from homeassistant.components.rflink import ( CONF_RECONNECT_INTERVAL, SERVICE_SEND_COMMAND) from homeassistant.const import ( ATTR_ENTITY_ID, ...
{ "content_hash": "a4a148d2dbc77b8999c450eb33f5eaff", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 77, "avg_line_length": 30.356890459363957, "alnum_prop": 0.5768827843091607, "repo_name": "tinloaf/home-assistant", "id": "b2f80b3ede66ff67a1f4c96b6ecaab1a1f0fd8ba", "size...
class Renderer: # Takes in a list representation of a board and pretty prints it def render(self, board): print '------' for y in board: for x in y: print x, print '' print '------' class Game: def __init__(self, renderer): self.rende...
{ "content_hash": "242ca503b0c7e74e1873711fdd6115de", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 115, "avg_line_length": 28.903225806451612, "alnum_prop": 0.5152529761904762, "repo_name": "HiccupinGminor/tidbits", "id": "260cfec29e86201a84bb04389464962382c4a64a", "size...
import praw import time import json from collections import Counter import os import zipfile data = [] limit = 5 ######################## ####### CRAWLERS ####### ######################## def crawl(comments): i = 1 data = [] print "Getting an average delay time over the last 5 verifications." for com...
{ "content_hash": "9f67f3e30abfda59a7510c98a95d919a", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 117, "avg_line_length": 33.26943005181347, "alnum_prop": 0.5706276280953123, "repo_name": "MaximeKjaer/such-tip-stats", "id": "4bd8f35277131533f91fa64eb9762143ec3ce78b", "...
import csv path = "google_stock_data.csv" file = open(path, newline='') reader = csv.reader(file) header = next(reader) data = [row for row in reader] print(header) print(data)
{ "content_hash": "63aaf5ba23875cadbc54bbed6edf18a9", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 30, "avg_line_length": 19.77777777777778, "alnum_prop": 0.7078651685393258, "repo_name": "khoanguyen0791/cs170", "id": "711ea5260a18422ffe94dca7f114da513c0c5fed", "size": "1...
'''OpenGL extension ARB.texture_storage_multisample This module customises the behaviour of the OpenGL.raw.GL.ARB.texture_storage_multisample to provide a more Python-friendly API Overview (from the spec) The ARB_texture_storage extension and OpenGL 4.2 introduced the concept of immutable texture objects. With ...
{ "content_hash": "4e73e0d454d421b1447c277fd4db6aec", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 72, "avg_line_length": 46.10344827586207, "alnum_prop": 0.8152580403889305, "repo_name": "frederica07/Dragon_Programming_Process", "id": "f17bc5234cc2c9f5fa62c1a4e7ac2da56da3...
import unittest try: import simplejson as json except ImportError: import json from uuid import uuid4 from alerta.app import create_app, db class HeartbeatTestCase(unittest.TestCase): def setUp(self): test_config = { 'TESTING': True, 'AUTH_REQUIRED': False } ...
{ "content_hash": "cdb79b1b76da5951f290b333976407cd", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 104, "avg_line_length": 31.6125, "alnum_prop": 0.6219849742981416, "repo_name": "satterly/alerta5", "id": "3423a10a9cd14201f0a36e1827ed8dfb8d003cd5", "size": "2530", "bin...
""" Nordugrid Information system modeling classes. """ __author__="Placi Flury placi.flury@switch.ch" __date__="12.12.2008" __version__="0.1.0" from ldap.cidict import cidict class LDAPSearchResult: """ A class to model LDAP results. Taken from example in http://www.packtpub.com/article/python-ldap-ap...
{ "content_hash": "fab295f7f29f6ca3826b82799b075899", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 103, "avg_line_length": 24, "alnum_prop": 0.5647163120567376, "repo_name": "placiflury/gridmonitor-infocache", "id": "9e6af5c4421b11f281b299dc1b1b30fbd940df12", "size": "22...
"""Button class. Represents a button in the frontend using a widget. Allows user to listen for click events on the button and trigger backend code when the clicks are fired. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Dis...
{ "content_hash": "2d3a56c2bade40e65a7e82a223466eb2", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 78, "avg_line_length": 37.58536585365854, "alnum_prop": 0.54574951330305, "repo_name": "initNirvana/Easyphotos", "id": "4d5549c0acde9062211fd97bc85e4d1b5a0142fe", "size": "...
import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) DATABASES = { 'default': { 'NAME': 'django_backup', # Or path to database file if using sqli...
{ "content_hash": "960f34f9624be847ebc5367fe2620831", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 100, "avg_line_length": 33.435754189944134, "alnum_prop": 0.6910609857978279, "repo_name": "lucernae/django-backup", "id": "2927ce79b065cb4738f74ce5f32362a11a185615", "siz...
from __future__ import absolute_import, unicode_literals import datetime from django.core.files.uploadedfile import SimpleUploadedFile from django.db import models from django.forms import Form, ModelForm, FileField, ModelChoiceField, CharField from django.forms.models import ModelFormMetaclass from django.test impor...
{ "content_hash": "fb6a4217e89cb2a1ca2e46f08c5f0cea", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 217, "avg_line_length": 48.96595744680851, "alnum_prop": 0.6663769879203962, "repo_name": "redhat-openstack/django", "id": "8d5a78558781e730e7df44b24c349e5a9434b410", "siz...
class Command(object): def __init__(self, args=None): self.args = args def __str__(self): return '{0}'.format(self.__class__.__name__) class GetState(Command): pass class Stop(Command): pass class GetProperty(Command): def __init__(self, prop=None): self.prop = prop ...
{ "content_hash": "9808ea47faab839b88b42baa773953d3", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 95, "avg_line_length": 21.85, "alnum_prop": 0.5537757437070938, "repo_name": "unix-beard/gloria", "id": "c6fb8015a4cb45fe5907f945fd4aa22f14b4f788", "size": "874", "binary...
import requests yahoo = 'https://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places%20where%20text%3D%22(52.06839%2C5.10569)%22%20limit%201)%20and%20u%3D%22c%22' class TheWeatherMan: def getTodaysWeather(): resp = requests....
{ "content_hash": "c1c9d77be72e50ef8d3bedcb5c703ab8", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 238, "avg_line_length": 45.18181818181818, "alnum_prop": 0.7263581488933601, "repo_name": "SSGvanStraalen/rpiZeroWakeUp", "id": "60bdaeb76b0e5ac4650d66fd6ef9cb749e4e73f4", ...
""" Thanks to the sympy project REMINDER: remove the clock from the window and put it to the engine """ from pyglet.window import Window from pyglet.clock import Clock class ManagedWindow(Window): """ A pyglet window with an event loop which executes automatically in a separate thread. Behavior is added b...
{ "content_hash": "ea6f94348334aeb9c1637ba0604789d5", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 79, "avg_line_length": 31.464285714285715, "alnum_prop": 0.5366061293984109, "repo_name": "fos/fos-legacy", "id": "f1e2ea31cee7289347f7cbe32212e916e7823b1f", "size": "3524...
{ 'name': 'Point of Sale Discounts', 'version': '1.0', 'category': 'Point of Sale', 'sequence': 6, 'summary': 'Simple Discounts in the Point of Sale ', 'description': """ ======================= This module allows the cashier to quickly give a percentage sale discount to a customer. """, ...
{ "content_hash": "8f5b851eb7d400ace3d6d965359a9daf", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 65, "avg_line_length": 24.423076923076923, "alnum_prop": 0.5858267716535434, "repo_name": "cristianquaglio/odoo", "id": "dd40ffe0eb2026d8574a6b38a7fb293962927f24", "size": ...
'''This example demonstrates how to: * Modify the Toolbar * Create tools * Add tools * Remove tools Using `matplotlib.backend_managers.ToolManager` ''' from __future__ import print_function import matplotlib matplotlib.use('GTK3Cairo') matplotlib.rcParams['toolbar'] = 'toolmanager' import matplotlib.pyplot as plt fro...
{ "content_hash": "33496a5cf1f254e4b215a3a8387135e5", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 77, "avg_line_length": 31.293478260869566, "alnum_prop": 0.5970823202500868, "repo_name": "bundgus/python-playground", "id": "5240bab239c2427d928f129fd02029b8523225ba", "si...
import logging from ._filter import Filter from ._logger import Logger from .formatters import Formatter, SimpleFormatter __all__ = ("Logger", "Filter", "Formatter", "SimpleFormatter") # Set custom Logger class _old_logger_class = logging.getLoggerClass() logging.setLoggerClass(Logger) # Register Loggers logger:...
{ "content_hash": "8c4ce7986feec22552c79917bf5f40c8", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 70, "avg_line_length": 19.63157894736842, "alnum_prop": 0.7707774798927614, "repo_name": "nikitanovosibirsk/jj", "id": "e4ef1a33e3dace45b751daf1e6d76a7a4c8490d3", "size": "...
import sys from datetime import date import pytest from commitizen import cli, git from commitizen.commands.changelog import Changelog from commitizen.exceptions import ( DryRunExit, NoCommitsFoundError, NoRevisionError, NotAGitProjectError, ) from tests.utils import create_file_and_commit @pytest.m...
{ "content_hash": "9fb805f0ae1cc96cc665d031bc7979c8", "timestamp": "", "source": "github", "line_count": 516, "max_line_length": 777, "avg_line_length": 33.52906976744186, "alnum_prop": 0.6470146234321715, "repo_name": "Woile/commitizen", "id": "02e0e74644617d07562d3bd8198e1c4206443fce", "size": "17...
""" Tools for IO coder: * Creating RecordingChannel and making links with AnalogSignals and SPikeTrains """ import collections import numpy as np from neo.core import (AnalogSignal, Block, Epoch, Event, IrregularlySampledSignal, ChannelIndex, ...
{ "content_hash": "042d5faf96f12e3cd78e7f245ea5b840", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 77, "avg_line_length": 33.38095238095238, "alnum_prop": 0.588546973711025, "repo_name": "mgr0dzicki/python-neo", "id": "4aa6cf7a83b74ca25bb36d73043c3d14a0d3cb46", "size": ...
"""Test for allowing TF ops to work with Keras Functional API.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import time from absl.testing import parameterized import numpy as np from tensorflow.python import keras from tensorflow.python.eager import ...
{ "content_hash": "91fb16ec7605dffd89d540777d38de84", "timestamp": "", "source": "github", "line_count": 746, "max_line_length": 80, "avg_line_length": 34.242627345844504, "alnum_prop": 0.6550009786651008, "repo_name": "petewarden/tensorflow", "id": "19815805b2d3016782feb5d15b88c5545730a07b", "size"...
import json from copy import deepcopy from django import forms from django.core.files.storage import default_storage as storage import mock from nose.plugins.attrib import attr from nose.tools import eq_, ok_ from pyquery import PyQuery as pq import waffle import amo import amo.tests from addons.models import Addon,...
{ "content_hash": "28114a68ff88a74221e8dbc8d2dbcea2", "timestamp": "", "source": "github", "line_count": 896, "max_line_length": 79, "avg_line_length": 41.215401785714285, "alnum_prop": 0.5687941726014785, "repo_name": "kmaglione/olympia", "id": "bc81e682a982b4a92d51dd7b9465d306e3c8f28b", "size": "3...
import re import functools import jsl import json import jsonschema import pyparsing as pp import math import operator from sqlalchemy.sql import and_, or_ class FormularEvaluationException(Exception): def __init__(self, message): self.message = message # The Expression Parser for mathematical formular...
{ "content_hash": "f9cddd10d3cfd4e5fef2f66f97350660", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 121, "avg_line_length": 34.20955882352941, "alnum_prop": 0.55368081676518, "repo_name": "ActiDoo/gamification-engine", "id": "9c9fa45143c5e0c8bc0cee8be4e57bad0f6cd69b", "s...
__author__ = 'walter' from email_reporter import EmailReporter Reporters = dict(email=EmailReporter)
{ "content_hash": "aa844fcf711f26dbd9d9301b0a49667b", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 40, "avg_line_length": 25.25, "alnum_prop": 0.7821782178217822, "repo_name": "devilicecream/Claire", "id": "8e00dda54673bf04a430c4a32ff17d694339abae", "size": "101", "bina...
import datetime from django.db import models from django.utils import timezone from django.contrib.auth.models import User class Question(models.Model): question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __str__(self): # __unicode__ on Pytho...
{ "content_hash": "7d29922b3effc9acdce510343465cf31", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 71, "avg_line_length": 29.258064516129032, "alnum_prop": 0.6444321940463065, "repo_name": "wcybxzj/django_xadmin17", "id": "b10ca0d6e1056826a521f38904284a06d532cc29", "size...
""" The contents of this module do not have a stable API and are subject to change """ from time import time, sleep import couchbase._libcouchbase as LCB import couchbase.exceptions as E from couchbase.user_constants import FMT_JSON from couchbase._pyport import ulp METHMAP = { 'GET': LCB.LCB_HTTP_METHOD_GET, ...
{ "content_hash": "95b0175be05645ca85e4d8fc8eae2008", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 82, "avg_line_length": 38.49006622516556, "alnum_prop": 0.5855127322780455, "repo_name": "mnunberg/couchbase-python-client", "id": "c5b1b8d632d84cd3703c213f44a3a1507fe63618"...
<<<<<<< HEAD <<<<<<< HEAD import unittest from unittest.test.support import LoggingResult class Test_FunctionTestCase(unittest.TestCase): # "Return the number of tests represented by the this test object. For # TestCase instances, this will always be 1" def test_countTestCases(self): test = unit...
{ "content_hash": "3201a4fa68fe57c89c4a6ec03565a5d7", "timestamp": "", "source": "github", "line_count": 450, "max_line_length": 78, "avg_line_length": 37.24444444444445, "alnum_prop": 0.6390811455847255, "repo_name": "ArcherSys/ArcherSys", "id": "ff66cad2b9ba46bf6f9e2f219b7279522adf5b3d", "size": "...
from datetime import datetime from model import * from utils import * from google.appengine.api import images from google.appengine.runtime.apiproxy_errors import RequestTooLargeError import indexing import prefix from django.utils.translation import ugettext as _ MAX_IMAGE_DIMENSION = 300 def validate_date(string):...
{ "content_hash": "4f7a16ee99c95df7405b64c14ab8c7df", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 170, "avg_line_length": 44.532967032967036, "alnum_prop": 0.5988895743368291, "repo_name": "pet-finder/pet-finder", "id": "d31cd7464bdd8939d21b44bed825d3b627f50436", "size...
import bitfield.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('zerver', '0039_realmalias_drop_uniqueness'), ] operations = [ migrations.AddField( model_name='realm', name='authentication_methods', field...
{ "content_hash": "4066fdbbc0374f9ff11486c0d2a4a589", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 123, "avg_line_length": 27.75, "alnum_prop": 0.6126126126126126, "repo_name": "tommyip/zulip", "id": "3e453b16af96676e51e3ba1667d325819aef80a9", "size": "469", "binary": ...
import datetime import math import random class Ordine: #costruttore def __init__(self, id_es, num_ord, id_ttl, qta, prezzo): self.id_es=id_es self.num_ord=num_ord self.id_ttl=id_ttl self.qta=qta self.qta_eff=0 self.prezzo=prezzo now = datetime.datetime.no...
{ "content_hash": "14cef924ff90d6859fece05e72c328c4", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 195, "avg_line_length": 31.34090909090909, "alnum_prop": 0.5866569978245105, "repo_name": "DrFr4nk/Agent_Base_Market_Simulator", "id": "e95d015a42c4abe482aa481f73a7c2e96fd7b8...
""" An auto-completion window for IDLE, used by the AutoComplete extension """ from Tkinter import * from idlelib.MultiCall import MC_SHIFT from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>" HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>") KEYPR...
{ "content_hash": "e81d2e3e1a999bb151766793f2fb1b31", "timestamp": "", "source": "github", "line_count": 407, "max_line_length": 80, "avg_line_length": 42.55036855036855, "alnum_prop": 0.5677329945721215, "repo_name": "sometallgit/AutoUploader", "id": "205a29be6cecf542fceeef1278247216f258a5af", "siz...
"""Python3 compatible logging setup module to be used as point-of-entry to a program.""" import argparse import json import logging import logging.config import os import example_package.example_module # We imported example_module before setting logging configuration. # This can cause issues, see the module for expla...
{ "content_hash": "cf65d43ec89aeb3e4f5b92809bf3d01c", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 85, "avg_line_length": 30.577464788732396, "alnum_prop": 0.6775679410409949, "repo_name": "adammartinez271828/logging_examples", "id": "cac7c5da2013548a63910fa9110557c64a3ccb...
from tempfile import NamedTemporaryFile import zipfile import requests __author__ = 'selimnairb@gmail.com' """ Tastypie REST API tests for resources modeled after: http://django-tastypie.readthedocs.org/en/latest/testing.html """ from tastypie.test import ResourceTestCase from tastypie.test import TestApiClient from...
{ "content_hash": "c5742ab1467d319d1173205e842cc479", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 114, "avg_line_length": 33.103092783505154, "alnum_prop": 0.6393646838990968, "repo_name": "hydroshare/hydroshare_temp", "id": "4a5f68b78501e9afd4662402093ba74866af8e9b", "...
""" Lob The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 The version of the OpenAPI document: 1.3.0...
{ "content_hash": "df7bcf1da8da6e2001527f4ca2466f17", "timestamp": "", "source": "github", "line_count": 738, "max_line_length": 357, "avg_line_length": 37.19376693766937, "alnum_prop": 0.48500856133192466, "repo_name": "lob/lob-python", "id": "7deadfaa65e32a6bedb388da28e80f5661749acf", "size": "274...
from __future__ import absolute_import from fobi.base import form_element_plugin_registry from .base import DurationInputPlugin __title__ = 'fobi.contrib.plugins.form_elements.fields.duration.' \ 'fobi_form_elements' __author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>' __copyright__ = '2014-2017 ...
{ "content_hash": "bb8b9f6f2f2e87b56cae18d3e04e2b53", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 67, "avg_line_length": 31.133333333333333, "alnum_prop": 0.7259100642398287, "repo_name": "mansonul/events", "id": "85c3bfcecb497ed365858c8bd1eb0e23ee0a3021", "size": "467"...
import unittest from mock import Mock import numpy as np from GPyOpt.acquisitions import AcquisitionEI_MCMC from GPyOpt.core.task.space import Design_space class TestEImcmcAcquisition(unittest.TestCase): def setUp(self): self.mock_model = Mock() self.mock_optimizer = Mock() domain = [{'na...
{ "content_hash": "27c365a7e05b9c16ce633b9956cddbb1", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 126, "avg_line_length": 48.885245901639344, "alnum_prop": 0.6951710261569416, "repo_name": "SheffieldML/GPyOpt", "id": "a07e12c01a5078e2ad560b0ed116bf5c9be1db84", "size": "...
"""Windowing concepts. A WindowInto transform logically divides up or groups the elements of a PCollection into finite windows according to a windowing function (derived from WindowFn). The output of WindowInto contains the same elements as input, but they have been logically assigned to windows. The next GroupByKey(...
{ "content_hash": "9007d9e05540b2bc7c51b738d4f9c7ff", "timestamp": "", "source": "github", "line_count": 574, "max_line_length": 100, "avg_line_length": 32.4808362369338, "alnum_prop": 0.6839197597082172, "repo_name": "RyanSkraba/beam", "id": "b16d00c134c184a1d09a40cb4aa764d3a8385544", "size": "1942...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('checkout', '0002_auto_20171220_1336'), ] operations = [ migrations.AddField( model_name='item', name='transaction_kind', ...
{ "content_hash": "515e7a46c05fcff85768b29c77a9ea9c", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 200, "avg_line_length": 30.05263157894737, "alnum_prop": 0.5954465849387041, "repo_name": "CoutinhoElias/danibraz", "id": "b6a831a8aa46b544716bfc476d614607855b2698", "size"...
from a10sdk.common.A10BaseClass import A10BaseClass class RateLimit(A10BaseClass): """ :param maxPktNum: {"description": "Max number of packets", "format": "number", "default": 10000, "optional": true, "maximum": 100000, "minimum": 1000, "type": "number"} :param rl_type: {"optional": true, "enum": ["c...
{ "content_hash": "02c0584727fba6c8c9584407be03c995", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 182, "avg_line_length": 35.94871794871795, "alnum_prop": 0.6219686162624821, "repo_name": "a10networks/a10sdk-python", "id": "929ad6636bdb4d3038f3d89fee75dae645facb41", "si...
import time from nose.tools import raises from testkit.timeouts import timeout @raises(AssertionError) @timeout(0.05) def test_timeout(): time.sleep(0.1) @raises(AssertionError) @timeout(0.05) def test_timeout_with_infinite_loop(): while True: time.sleep(0.001) @timeout(0.5) def test_timeout_no_er...
{ "content_hash": "384628f4bb2f4e9e2d09472406088d11", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 38, "avg_line_length": 16.476190476190474, "alnum_prop": 0.7023121387283237, "repo_name": "ravenac95/testkit", "id": "082a5796eb6bbf8241523293786200222e296c32", "size": "34...
"""A task to measure violence in completions with prompts about Muslims.""" import bigbench.api.task as task import numpy as np class MuslimViolenceBiasTask(task.Task): """A task to measure violence in completions with prompts about Muslims.""" def __init__(self): """Defines a simple task to measure Muslim-v...
{ "content_hash": "59d47a4836d4c16929678ab3e16ca9ac", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 118, "avg_line_length": 42.447154471544714, "alnum_prop": 0.5937559854434017, "repo_name": "google/BIG-bench", "id": "3763c20b4caf87cae8e0313c3cf1709eaf3cdb9c", "size": "5...
from sqlalchemy.testing import fixtures from sqlalchemy.testing.util import gc_collect from sqlalchemy.testing import assert_raises_message, is_, eq_ from sqlalchemy import exc, MetaData from sqlalchemy.ext.declarative import clsregistry import weakref class MockClass(object): def __init__(self, base, name): ...
{ "content_hash": "557d9328f744a8a2ebe85fa18cafd340", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 72, "avg_line_length": 32.82127659574468, "alnum_prop": 0.5782445222351873, "repo_name": "alex/sqlalchemy", "id": "e78a1abbe0caef6fc6ed7c39b84e0388b0e6d391", "size": "7713...
project = 'Ponos' copyright = '2021, filipecn' author = 'filipecn' # The full version, including alpha/beta/rc tags release = '0.0.1' # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (...
{ "content_hash": "28de8b2f12d592840383ba33a4c638d8", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 78, "avg_line_length": 30.630434782608695, "alnum_prop": 0.6770759403832506, "repo_name": "filipecn/Ponos", "id": "06790713bdccf6ca2ce961d58073645956a45660", "size": "2112"...
import mock from oslo_serialization import jsonutils import testtools from heatclient.tests.unit import fakes from heatclient.v1 import build_info class BuildInfoManagerTest(testtools.TestCase): def setUp(self): super(BuildInfoManagerTest, self).setUp() self.client = mock.Mock() self.clie...
{ "content_hash": "e74d62e3632f75754d8e1d8e24c512f0", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 63, "avg_line_length": 31.85185185185185, "alnum_prop": 0.663953488372093, "repo_name": "tcpcloud/python-heatclient", "id": "9ee93da17d467bbc641fb5184323b5b2265893e6", "siz...
""" .. module:: pytfa :platform: Unix, Windows :synopsis: Thermodynamics-based Flux Analysis .. moduleauthor:: pyTFA team Variability analysis """ from copy import deepcopy from functools import partial from multiprocessing import cpu_count from multiprocessing.pool import Pool import pandas as pd from cobra...
{ "content_hash": "6c3c80434bf09e0273e63a6a88dbd37f", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 90, "avg_line_length": 30.186915887850468, "alnum_prop": 0.606656346749226, "repo_name": "EPFL-LCSB/pytfa", "id": "6a91efd2daf4b1eb77ee6eb3e033669e92f27e3e", "size": "6484...
from __future__ import division import ast import re import sys from xml.etree import ElementTree as ET import docutils.core import docutils.nodes from itertools import izip import inspect import matplotlib matplotlib.use('Qt4Agg') import matplotlib.docstring def new_call(self, func): return func matplotlib.docst...
{ "content_hash": "1664f3b322628bfbdd68a5b8be3e468a", "timestamp": "", "source": "github", "line_count": 939, "max_line_length": 304, "avg_line_length": 39.81150159744409, "alnum_prop": 0.4991306208704491, "repo_name": "hjanime/VisTrails", "id": "dbf7ef118a33388448c38b34b05d0afb67fb2450", "size": "3...
from plumbery.engine import PlumberyEngine PlumberyEngine('fittings.yaml').start_nodes('control')
{ "content_hash": "f3d74f1f4b58918083229ea1e484adcf", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 54, "avg_line_length": 13, "alnum_prop": 0.7788461538461539, "repo_name": "jalbin/plumbery", "id": "8ade1d1f50be9e2936ec2da377c5bf4227d1ac4d", "size": "104", "binary": fal...
"""Compile Android resources into an intermediate APK. This can also generate an R.txt, and an .srcjar file containing the proper final R.java class for all resource packages the APK depends on. This will crunch images with aapt2. """ import argparse import collections import contextlib import filecmp import hashlib...
{ "content_hash": "fba3773bc2b430b0cfcc1f81bf67b227", "timestamp": "", "source": "github", "line_count": 1228, "max_line_length": 83, "avg_line_length": 37.40390879478827, "alnum_prop": 0.683227379604633, "repo_name": "endlessm/chromium-browser", "id": "2ca4ec781c8c1a8c4fcb40cd64ed478840a5dcef", "si...
""" @brief test log(time=1s) You should indicate a time in seconds. The program ``run_unittests.py`` will sort all test files by increasing time and run them. """ import os import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.pycode import ExtTestCase from pyensae.sql.database_helper import...
{ "content_hash": "07be384078b3712e56a7924db40ac202", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 71, "avg_line_length": 29.441860465116278, "alnum_prop": 0.590047393364929, "repo_name": "sdpython/pyensae", "id": "9e9a15120253b3b599fe3c75fd9e02366cd56c15", "size": "1266...
import logging import os import re import socket import sys import tempfile import time import uuid from datetime import datetime from functools import wraps, partial from os import urandom from os.path import basename, isfile from random import randint, choice from StringIO import StringIO from textwrap import dedent ...
{ "content_hash": "9553291f448f94d9356257629caa9c0e", "timestamp": "", "source": "github", "line_count": 685, "max_line_length": 79, "avg_line_length": 34.04671532846715, "alnum_prop": 0.6042792213360775, "repo_name": "guidow/pyfarm-agent", "id": "0d69fb299a170dc53284a2d2aa06394413771d31", "size": "...
import click from globus_cli.login_manager import LoginManager from globus_cli.parsing import IdentityType, ParsedIdentity, command from globus_cli.termio import Field, TextMode, display APPROVED_USER_FIELDS = [ Field("Group ID", "group_id"), Field("Approved User ID", "identity_id"), Field("Approved User ...
{ "content_hash": "1dae51095589f88e6729abb148ae611a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 86, "avg_line_length": 39.093023255813954, "alnum_prop": 0.6900654372397382, "repo_name": "globus/globus-cli", "id": "56b274520c9fc98a68f200ba8acf5134cd54f314", "size": "16...
"""Loads plugins defining worker processes and task functions. Starts and manages the pool of worker processes to execute tasks as the come in. """ from __future__ import absolute_import, print_function import sys import time import logging import signal import resource import os.path from optparse import OptionPars...
{ "content_hash": "1072b787a5ac14f96426ad498c738e21", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 78, "avg_line_length": 27.830882352941178, "alnum_prop": 0.6412153236459709, "repo_name": "icgood/provoke", "id": "5eedf193da6e64b8eebd29f8f6cfd7ffaf617f5c", "size": "4901...
""" Copyright 2015 Laszlo Zsolt Nagy 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 writi...
{ "content_hash": "f443a32eb6aa33470c8f56d1fc15600a", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 119, "avg_line_length": 39.21860465116279, "alnum_prop": 0.5916745730550285, "repo_name": "santosfamilyfoundation/TrafficCloud", "id": "a9585067442638a0e7271c07c4a8adca424b4...
""" Copyright (c) 2016, Battelle Memorial Institute All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions a...
{ "content_hash": "1411850a8d6c02d6a0b0fb15fc8f8de7", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 108, "avg_line_length": 48.36333333333334, "alnum_prop": 0.6207870976635192, "repo_name": "hlngo/volttron-applications", "id": "597d5bdb27218fe4923ac8f99e72a255afae6f7a", ...
from setuptools import setup description = "Modern pure python CouchDB Client." try: from distutils.command.build_py import build_py_2to3 as build_py except ImportError: from distutils.command.build_py import build_py import pycouchdb VERSION = pycouchdb.__version__ setup( name="pycouchdb", url="htt...
{ "content_hash": "3efe7a1a7f34d2775f8590c3c01fc9fb", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 68, "avg_line_length": 29.208333333333332, "alnum_prop": 0.6176890156918687, "repo_name": "bmihelac/py-couchdb", "id": "948a59a48b58a9dc291d2a80e1b3ec4fd917d53a", "size": "...
import os from VolumeProcessing import * from PseudoVols import * n=2 maxdegree=18 PSEUDO_VOLUME_FILENAME='pseudo_volumes_n='+str(n)+'_nice.csv' def all_fields(polynomial,trace_field,n): return True # Create pseudo-volume file if not os.path.exists(PSEUDO_VOLUME_FILENAME): prepare_pvolume_file(iter(Orientabl...
{ "content_hash": "c97293476478e009212f7d960efb0f87", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 76, "avg_line_length": 30.275, "alnum_prop": 0.6754748142031379, "repo_name": "s-gilles/maps-reu-code", "id": "2029d93383b3cd4f2d428c48057a71d5890f85dc", "size": "1230", ...
"""Python utilities required by Keras.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import marshal import os import sys import time import types as python_types import numpy as np import six from tensorflow.python.util import tf_decorator from tensor...
{ "content_hash": "f7defb00052151c11142cf44a29c9d99", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 88, "avg_line_length": 30.878186968838527, "alnum_prop": 0.6205504587155963, "repo_name": "mavenlin/tensorflow", "id": "3428476b173f4ca7987a3561ca4502c44364c6f1", "size": ...
import sys, os try: import rpython except ImportError: print("Cannot import rpython. Put PyPy source tree in PYTHONPATH.") sys.exit(1) sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) def dump_bytecode(bc): def dump_idx_list(label, ls): print(" %s:" % label) ...
{ "content_hash": "21c83818bffa0292c62e10fd6a452f46", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 79, "avg_line_length": 26.855072463768117, "alnum_prop": 0.5785213167835942, "repo_name": "xhava/hippyvm", "id": "839cecef3aa9905f7f8e8a9d4ed57364fd1cba75", "size": "1924",...
import pytest from .factories import GameFactory, PlatformFactory from ..models import Game, Platform pytestmark = pytest.mark.django_db def test_game_factory(): factory = GameFactory() assert isinstance(factory, Game) def test_platform_factory(): factory = PlatformFactory() assert isinstance(fact...
{ "content_hash": "5a47f3eb7596f2f243f0712753d99533", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 51, "avg_line_length": 20.9375, "alnum_prop": 0.7492537313432835, "repo_name": "bryanveloso/avalonstar-tv", "id": "8457fcd74dbcbf7fea25b96170fceac053c421cd", "size": "359",...
def anagram(s1, s2): print '"' + s1 + '" is', if ''.join(sorted(s1.replace(" ","").lower())) != ''.join(sorted(s2.replace(" ","").lower())): print 'NOT', print 'an anagram of "' + s2 + '"' anagram("Clint Eastwood", "Old West Action") anagram("parliament", "partial man") anagram("wisdom", "mid sow") anagram("Set...
{ "content_hash": "6d57022471417d827e22d8f907415724", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 95, "avg_line_length": 33.4375, "alnum_prop": 0.6373831775700934, "repo_name": "brendanwr/DailyProgrammer", "id": "0b2b6526c6acdd754dc16bd0775852259b960274", "size": "695",...
""" Overview ======== Used to spawn processes and send/receive data. It is useful to talk with extern processes like interpreters. Key-Commands ============ Namespace: shell Mode: NORMAL Event: <F1> Description: Send the cursor line to the process. Mode: INSERT Event: <F1> Description: Send the cursor line to the ...
{ "content_hash": "079694345b7e3b2a5b896b56ceb21575", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 108, "avg_line_length": 27.569620253164558, "alnum_prop": 0.6648301193755739, "repo_name": "iogf/vy", "id": "a11767e9b8dfb83619b069d8c4298afebb26ffa6", "size": "2178", "b...
from __future__ import absolute_import from .vncoincheck import TradeApi, DataApi
{ "content_hash": "9b1aecddd0bddcf60f5d3470c1232ad4", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 42, "avg_line_length": 40.5, "alnum_prop": 0.8148148148148148, "repo_name": "harveywwu/vnpy", "id": "88a1aa53b695fb3f9f86dad59b8b0b4bef86880d", "size": "100", "binary": fa...
import datetime import typing import pandas import pytest from tribble import transform class DataTemplate: def __init__(self, default: typing.Dict[str, typing.Any]) -> None: self._default = default def _generate_rows(self, overrides: typing.List[typing.Dict[str, typing.Any]] ...
{ "content_hash": "9dbea23f8aadfd3c2e9e4e18e9427ee3", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 120, "avg_line_length": 38.70464135021097, "alnum_prop": 0.5776736073258476, "repo_name": "GoC-Spending/fuzzy-tribble", "id": "c9da50ceec751304fe08c8f9a23376fad011b73b", "...
""" HTML Widget classes """ import datetime from itertools import chain import time from urlparse import urljoin from util import flatatt import airy.utils.copycompat as copy from airy.core.conf import settings from airy.utils.datastructures import MultiValueDict, MergeDict from airy.utils.html import escape, conditio...
{ "content_hash": "31c280d8cc65059c8fc9897d8cbe17c7", "timestamp": "", "source": "github", "line_count": 854, "max_line_length": 117, "avg_line_length": 38.69789227166277, "alnum_prop": 0.5975248123940934, "repo_name": "letolab/airy", "id": "b93ba5be907695468ff62dc747da450d6dda5969", "size": "33048"...
from flask import Flask from .view_classes import DecoratedView from .view_classes import DecoratedBoldListView from .view_classes import DecoratedBoldItalicsListView from .view_classes import DecoratedListMemberView from .view_classes import DecoratedListFunctionAttributesView from .view_classes import DecoratedListMe...
{ "content_hash": "4a37685016133f34cc3edd00923a5344", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 79, "avg_line_length": 33.28636363636364, "alnum_prop": 0.6543766216031681, "repo_name": "teracyhq/flask-classy", "id": "3984b04abac30a82f29530c24c2e9abebc248232", "size":...
import getpass import xmlrpclib import os import sys import re SESSION_DIR=os.environ['HOME'] + "/.ssh" SESSION_FILE=SESSION_DIR + "/ssh_mlab_session" API_URL = "https://boot.planet-lab.org/PLCAPI/" VERBOSE=False DEBUG=False SEVEN_DAYS=60*60*24*7 class API: """ API is a wrapper class around the PlanetLab API's xm...
{ "content_hash": "52d8909e3a9c0e5cbdd84594d041b022", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 82, "avg_line_length": 36.728900255754475, "alnum_prop": 0.5932734489241697, "repo_name": "m-lab/mlab-ops", "id": "24131f6a634937f9edd7a6059d14139bffe82a14", "size": "1438...
"""Tests for bsuite.baselines.replay. Branched from bsuite: https://github.com/deepmind/bsuite. """ from absl.testing import absltest from neural_testbed.bandit import replay as replay_lib import numpy as np class BasicReplayTest(absltest.TestCase): def test_end_to_end(self): shapes = (10, 10, 3), () ca...
{ "content_hash": "e3d09ae31f9ee597b4099b9915762822", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 74, "avg_line_length": 27.644444444444446, "alnum_prop": 0.6567524115755627, "repo_name": "deepmind/neural_testbed", "id": "27296564d891b3f13be74b00e4b2852f4ca8b33c", "size...
"""Added functionality to load from pipeline config for lstm framework.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf from google.protobuf import text_format from lstm_object_detection.protos import input_reader_googl...
{ "content_hash": "faf0f249574b461d80e001652e7c98b7", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 97, "avg_line_length": 40.42857142857143, "alnum_prop": 0.7042674639847785, "repo_name": "tombstone/models", "id": "d46d2d703c4f6439a5eb3173fa642941df80d39b", "size": "4369...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ArticleTranslation.publication_date' db.add_column('articles_articletranslation', 'publication_date', se...
{ "content_hash": "c57a9a02e69261db9b338a945f722899", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 176, "avg_line_length": 67.01123595505618, "alnum_prop": 0.5650570087189806, "repo_name": "platypus-creation/django-articles", "id": "5587dcb6364237dc060c553bc3c091b387df11d2...
import itertools from xml.sax.saxutils import escape from math import log10, floor, ceil import numpy as np from AnyQt.QtCore import Qt, QObject, QEvent, QRectF, QPointF, QSize from AnyQt.QtGui import ( QStaticText, QColor, QPen, QBrush, QPainterPath, QTransform, QPainter) from AnyQt.QtWidgets import QApplication...
{ "content_hash": "e40279a242f0a9f90c0b0ef2e50bff43", "timestamp": "", "source": "github", "line_count": 1078, "max_line_length": 98, "avg_line_length": 35.975881261595546, "alnum_prop": 0.5719921613119489, "repo_name": "cheral/orange3", "id": "959a4a7c07d579c3ddd14645b7282ba3949dfc81", "size": "387...
""" Driver for Linux servers running LVM. """ import math import os import socket from oslo.config import cfg from cinder.brick import exception as brick_exception from cinder.brick.local_dev import lvm as lvm from cinder import exception from cinder.image import image_utils from cinder.openstack.common import file...
{ "content_hash": "cc6af231c377e7de1644ea4ed4baf89a", "timestamp": "", "source": "github", "line_count": 616, "max_line_length": 79, "avg_line_length": 40.69805194805195, "alnum_prop": 0.5615476665337056, "repo_name": "theanalyst/cinder", "id": "bdfe12d2413c9b4d7808bddfabfc6e8af35fe2ae", "size": "25...
from gem import vector class SimplexVerts(object): def __init__(self): self.p1 = vector.Vector(2) self.p2 = vector.Vector(2) self.p = vector.Vector(2) self.u = 1 self.index1 = 0 self.index2 = 0 def copy(self, v): self.p1 = v.p1 self.p2 = v.p2 ...
{ "content_hash": "e32d76b00379af3e4a81f307f680d616", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 156, "avg_line_length": 33.904545454545456, "alnum_prop": 0.5507440675693793, "repo_name": "explosiveduck/ed2d", "id": "c6dbe79c1504eebf3889d8c9a8a8480d7078f289", "size": ...
""" This module includes a fast iterator-based XML parser. """ from __future__ import (absolute_import, division, print_function, unicode_literals) from ...extern import six # STDLIB import contextlib import io import sys # ASTROPY from .. import data __all__ = ['get_xml_iterator', 'get_xml_...
{ "content_hash": "b1c299a8dae22ff29cd8893380f37ec5", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 78, "avg_line_length": 26.869767441860464, "alnum_prop": 0.5906179678033582, "repo_name": "kelle/astropy", "id": "c66dba6ce3b1f3ddb8b7f5c271f8b22c5b06a88b", "size": "5841"...
import os from expects import expect, contain, have_keys, equal from mamba import before, it, context, description from sdcclient import SdScanningClient from specs import be_successful_api_call with description("Query Image Content", "integration") as self: with before.each: self.client = SdScanningClie...
{ "content_hash": "d585078c2e2ebe5626d51b9d3d7ef110", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 118, "avg_line_length": 44.233333333333334, "alnum_prop": 0.6281085154483798, "repo_name": "draios/python-sdc-client", "id": "4b224dd192df7a3c780b46118bc1678c77c420de", "si...
"""Map implements classes for levels and Tiles of which levels are made The hero travels down next levels and on each of them explores different Tiles""" from itertools import product from ..characters.monster import MONSTER_COLLECTION from random import choice, randint from ..characters.hero import Hero from ..misc.c...
{ "content_hash": "695d9a1fd28b5f4563ec67540279579e", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 109, "avg_line_length": 30.34246575342466, "alnum_prop": 0.6255831452219714, "repo_name": "wilk16/rpggame", "id": "29e8604455dcce2cce31d2c74c072e7e0eb7506e", "size": "6645...
__version__ = '0.5' __author__ = 'Amr Hassan' __copyright__ = "Copyright (C) 2008-2010 Amr Hassan" __license__ = "apache2" __email__ = 'amr.hassan@gmail.com' import hashlib from xml.dom import minidom import xml.dom import time import shelve import tempfile import sys import collections import warnings def _dep...
{ "content_hash": "fb0c04cdc3d80cdccc4c223e0a7b17ff", "timestamp": "", "source": "github", "line_count": 3982, "max_line_length": 196, "avg_line_length": 33.329482672024106, "alnum_prop": 0.5398137404120014, "repo_name": "certator/pylast", "id": "06c95fd07ef1b280a1fc40425a8cbc464c5d45ef", "size": "1...
"""A number of common glslc result checks coded in mixin classes. A test case can use these checks by declaring their enclosing mixin classes as superclass and providing the expected_* variables required by the check_*() methods in the mixin classes. """ import os.path import re from glslc_test_framework import GlslCT...
{ "content_hash": "4411f9cc2dee4d5571ff09764417a8a4", "timestamp": "", "source": "github", "line_count": 437, "max_line_length": 89, "avg_line_length": 40.48283752860412, "alnum_prop": 0.6221807698829913, "repo_name": "AWoloszyn/shaderc", "id": "0749c5d5bd4ec876bc404399c3849943ab004d2a", "size": "18...
""" Various utilities that don't have another home. """ global_symbols = ['info','factorial','factorial2','factorialk','comb','who', 'lena','central_diff_weights', 'derivative', 'pade', 'source']
{ "content_hash": "f4d5123d057200cb345326084e8e0c3e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 80, "avg_line_length": 35.833333333333336, "alnum_prop": 0.6232558139534884, "repo_name": "stefanv/scipy3", "id": "72144e9e830d430f1adea4bb69fdbe744a75e39e", "size": "216", ...
""" Histology analyser GUI """ import logging logger = logging.getLogger(__name__) import sys import os.path as op path_to_script = op.dirname(op.abspath(__file__)) # sys.path.append(os.path.join(path_to_script, "../extern/dicom2fem/src")) import traceback from PyQt4 import QtCore, QtGui from PyQt4.QtCore import py...
{ "content_hash": "3c6d7c2c90f90b8986c24b61ec4d838f", "timestamp": "", "source": "github", "line_count": 997, "max_line_length": 151, "avg_line_length": 34.29689067201605, "alnum_prop": 0.5949581797976253, "repo_name": "mjirik/quanta", "id": "9c967d404bd2228f7a4768a4f92322aa7db9994e", "size": "34238...
import os import pathlib import warnings import py import pytest from cookiecutter.generate import generate_context from cookiecutter.main import cookiecutter from cookiecutter.prompt import prompt_for_config USER_CONFIG = u""" cookiecutters_dir: "{cookiecutters_dir}" replay_dir: "{replay_dir}" """ class Result(obj...
{ "content_hash": "6297bbcedaf00109d0b606a013846938", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 84, "avg_line_length": 28.834146341463416, "alnum_prop": 0.6154626966672306, "repo_name": "hackebrot/pytest-cookies", "id": "6e077c5bfcd4252787ba5615af603713fda9497d", "si...
import json from dateutil import parser from plenario.api.common import make_fragment_str, extract_first_geometry_fragment from plenario.models import MetaTable from marshmallow import utils from marshmallow.fields import Field, List from marshmallow.exceptions import ValidationError class DateTime(Field): def ...
{ "content_hash": "17e9a0ee99051083538ef34eb7bb0468", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 82, "avg_line_length": 28.454545454545453, "alnum_prop": 0.6220903696942036, "repo_name": "UrbanCCD-UChicago/plenario", "id": "3db06a807b264d867542c3e9b52d940610a3c859", "s...
from django.apps import AppConfig class FooappConfig(AppConfig): name = 'fooapp'
{ "content_hash": "9f3b29e1fb6a75d6f8d52754bbae01df", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 17.4, "alnum_prop": 0.7471264367816092, "repo_name": "fijal/django-perf-tester", "id": "61d65c41e0e44ecefd3ba26cb2843a1e3b78d85f", "size": "87", "bi...
""" Test utilities in pulsar.main """ from os.path import join from .test_utils import temp_directory from pulsar import main def test_pulsar_config_builder_defaults(): with temp_directory() as mock_root: __write_mock_ini(join(mock_root, "server.ini")) config = main.PulsarConfigBuilder(config_dir=...
{ "content_hash": "e3b2fc9c761ecc0f78efa96d256a4d5a", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 127, "avg_line_length": 36.20792079207921, "alnum_prop": 0.6343997812414548, "repo_name": "natefoo/pulsar", "id": "7c9397f35596cb83395a3b0dbdd756b45283c642", "size": "3657...
from mailchimp import Mailchimp, ListAlreadySubscribedError from madmimi import MadMimi import mailerlite from django.conf import settings class AlreadySubscribedError(Exception): def __init__(self, message, uuid, *args, **kwargs): super(Exception, self).__init__(message, *args, **kwargs) self....
{ "content_hash": "7c615b5cb42a48acad56c30eedf9b21b", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 79, "avg_line_length": 38.108695652173914, "alnum_prop": 0.5778665145464917, "repo_name": "rogerhil/flaviabernardes", "id": "8552f234f81b9e8c06a209432ad7524efb8643fe", "siz...
from __future__ import print_function import contextlib import json import optparse import os import pwd import sys import six from six.moves.urllib.request import urlopen import hacheck.spool def up(): return main('up') def down(): return main('down') def halist(): return main('list') def status...
{ "content_hash": "c6a9019c829d4e1c34d5c727dd82e6d0", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 91, "avg_line_length": 28.615384615384617, "alnum_prop": 0.5557184750733137, "repo_name": "fx19880617/hacheck", "id": "3a5dcdee01796976bba51595a5815c922fea460e", "size": "...
from a10sdk.common.A10BaseClass import A10BaseClass class DnssecDnskey(A10BaseClass): """ :param action: {"optional": true, "enum": ["create", "import", "export", "copy", "rename", "check", "replace", "delete"], "type": "string", "description": "'create': create; 'import': import; 'export': export; 'copy'...
{ "content_hash": "1bed80340ad1cef9828eca95172ce0aa", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 327, "avg_line_length": 45.906976744186046, "alnum_prop": 0.6291793313069909, "repo_name": "a10networks/a10sdk-python", "id": "65cd78e925644f61cd40ae66a80bb8cda1591741", "s...
''' lottery-gov-dlt http://www.lottery.gov.cn/historykj/history_{0}.jspx?_ltype=dlt @Author Aaric @since 1.0 ''' import os import threading
{ "content_hash": "ac0b3e0ebe88c402bd8d3a5be592660e", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 63, "avg_line_length": 14.2, "alnum_prop": 0.7183098591549296, "repo_name": "cooggo/cooggo_dataplus", "id": "bb16957b00c285e6c5dc411975958b75494fe18b", "size": "184", "bi...
from __future__ import absolute_import from collections import defaultdict import copy import logging import socket from . import ConfigResourceType from kafka.vendor import six from kafka.client_async import KafkaClient, selectors import kafka.errors as Errors from kafka.errors import ( IncompatibleBrokerVersio...
{ "content_hash": "f8cb3d5267074e24926572bb94bb242e", "timestamp": "", "source": "github", "line_count": 1246, "max_line_length": 162, "avg_line_length": 46.348314606741575, "alnum_prop": 0.6192034632034632, "repo_name": "mumrah/kafka-python", "id": "d0fa845601d4dc339f92e5371b48b19bd92b89bb", "size"...