text
stringlengths
4
1.02M
meta
dict
""" holdtime.py Created by Thomas Mangin on 2012-07-17. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import pack # =================================================================== HoldTime class HoldTime (int): def pack (self): return pack('!H',self) def keepalive (self): ret...
{ "content_hash": "3a8ed23130d4ab53c0382bc272110031", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 78, "avg_line_length": 18.45, "alnum_prop": 0.5528455284552846, "repo_name": "lochiiconnectivity/exabgp", "id": "36e3222320447a354a43177c2204c228bcdf4884", "size": "387", ...
"""Deep Evolution solver. Uses a neural net to predict the position and mutation function to apply to a string. Neural net takes the string and predicts 1) [Batch x length] logits over positions in the string 2) [Batch x length x n_mutations] logits over mutation function for every position in the string. First, we sa...
{ "content_hash": "fceafbb368496d7a2f7ef0b3d3a70e4e", "timestamp": "", "source": "github", "line_count": 963, "max_line_length": 135, "avg_line_length": 34.48494288681204, "alnum_prop": 0.6573820349905146, "repo_name": "google-research/google-research", "id": "8e13469b68c5106432001be3f0eb73a8496100c0"...
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('sites', '0001_initial'), ('webquills', '0001_initial'), ] operations = [ migrations.AddField( model_name='site', ...
{ "content_hash": "f18074db0d347e9eed5168d6a26536f4", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 219, "avg_line_length": 29.05, "alnum_prop": 0.6333907056798623, "repo_name": "veselosky/webquills", "id": "0d153b77c0912822c264418e66101b556dfd983e", "size": "628", "bin...
import unittest import mock from ...haystack.utils import AsyncIndexAdapter class AsyncIndexAdapterTestCase(unittest.TestCase): @mock.patch('libs.haystack.utils.get_identifier') @mock.patch('libs.haystack.utils.HaystackActionTask') def test_remove_object_should_call_haystack_action_task_delay_with_remove...
{ "content_hash": "6de6a7c36b6a301cbd3a12f294015f0f", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 104, "avg_line_length": 39.22222222222222, "alnum_prop": 0.6805949008498584, "repo_name": "hellhound/dentexchange", "id": "a5dea2072d81ee9b50ae936fab03c5cf0b047e3d", "size"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("proposals", "0027_auto_20200502_0540"), ] operations = [ migrations.AlterField( model_name="historicalproposal", name="video...
{ "content_hash": "f8bbba45536699d6b7670593b692f076", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 69, "avg_line_length": 25.903225806451612, "alnum_prop": 0.5093399750933998, "repo_name": "pythonindia/junction", "id": "2fea0f83bd9fbda31d0c3ae5d0d65dcf09c9d92b", "size": ...
""" Response functions and CFProjection response functions (see projfn.py) written in C to optimize performance. Requires the weave package; without it unoptimized versions are used. $Id$ """ __version__='$Revision$' import param from topo.base.functionfamily import ResponseFn,DotProduct from topo.base.cf import CF...
{ "content_hash": "55ee6bb0716e31783b36ff4ae14084b1", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 106, "avg_line_length": 36.505050505050505, "alnum_prop": 0.5302988378527946, "repo_name": "ioam/svn-history", "id": "94b285525d6dcfb2ad75cecea8f0395ff0b8a50c", "size": "7...
from marshmallow import Schema, fields class MovieSchema(Schema): pk = fields.Str(dump_only=True) title = fields.Str(required=True) likes = fields.Int(dump_only=True) movie_schema = MovieSchema() movies_schema = MovieSchema(many=True)
{ "content_hash": "02ca8a65dcb06fccca0f0edfbb22d534", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 38, "avg_line_length": 22.818181818181817, "alnum_prop": 0.7290836653386454, "repo_name": "pragmaticcoders/horse", "id": "fa9c4607a118785de5d231dc1ccadeec1264839d", "size":...
import os import sys import unittest2 import stripe from mock import patch from stripe.test.helper import (StripeTestCase, NOW, DUMMY_CHARGE, DUMMY_CARD) class FunctionalTests(StripeTestCase): request_client = stripe.http_client.Urllib2Client def setUp(self): super(FunctionalTests, self).setUp() ...
{ "content_hash": "5dc5701bed759cb07d20311543ef7da3", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 79, "avg_line_length": 34.12, "alnum_prop": 0.6295427901524033, "repo_name": "colehertz/Stripe-Tester", "id": "b1f5a124f57403ca5247a58cd9869190db30e6ca", "size": "5997", ...
from rx import Lock from rx.abstractobserver import AbstractObserver from rx.disposables import SerialDisposable class ScheduledObserver(AbstractObserver): def __init__(self, scheduler, observer): super(ScheduledObserver, self).__init__(self._next, self._error, self._completed) self.scheduler = s...
{ "content_hash": "d2a0dd37668309964b40fbf39d4095ad", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 89, "avg_line_length": 27.65714285714286, "alnum_prop": 0.574896694214876, "repo_name": "dbrattli/RxPY", "id": "e3b7e2bc91b90d1231b823754ffd8ae477425577", "size": "1936", ...
import requests from registryctl.common.exceptions import * REGISTRY_HEADER_V2 = 'application/vnd.docker.distribution.manifest.v2+json' class AuthClient(object): def __init__(self, url, auth=None, commands=None): self._url = url self._session = requests.Session() self._basic_auth = auth ...
{ "content_hash": "d6e1f1cd0bfbeb433f479ed3b25fcdfc", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 34.07692307692308, "alnum_prop": 0.5948081264108352, "repo_name": "Flav35/registryctl", "id": "c20499f7cfe77b52b076738b27e824998ad8bffb", "size": "88...
class RelationPredictionOracle: def __init__(self): pass def initialize(self): pass def update(self, batch): return 0 def predict_batch(self, batch): predictions = batch.get_relation_class_labels() return predictions
{ "content_hash": "5ab543151589b1599174831f47c14710", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 55, "avg_line_length": 18.466666666666665, "alnum_prop": 0.6101083032490975, "repo_name": "MichSchli/QuestionAnsweringGCN", "id": "66772bdedc7d9fbc7df77aa48036f23a69b7b455", ...
def numberChain(x): '''A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. for example, 44 -> 32 -> 13 -> 10 -> 1 85 -> 89 -> 145 -> 42 -> 20 -> 4 -> 16 -> 37 -> 58 -> 89 Therefore any chain that arrives at...
{ "content_hash": "6712cbdd8d7678ae40a55e6c216b4ace", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 80, "avg_line_length": 27.52, "alnum_prop": 0.5625, "repo_name": "boarpig/math", "id": "910aa09d52873a1a4dcec9f9f7cb3d4dc102029b", "size": "707", "binary": false, "copi...
""" Allows you to test unimplemented code in a development environment by specifying a default argument as an argument to the decorator (or you can leave it off to specify None to be returned. """ # Annotation wrapper annotation method def unimplemented(defaultval): print type(unimplemented) print type(defaultv...
{ "content_hash": "3ccbb525f5282453df39cac8bcefd650", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 73, "avg_line_length": 23.926829268292682, "alnum_prop": 0.6503567787971458, "repo_name": "t10471/python", "id": "4203f6657b06790fd34dcef7c6d411b62ad2c64c", "size": "1006",...
""" Django settings for www project. Generated by 'django-admin startproject' using Django 1.9.4. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # Bui...
{ "content_hash": "f07d978ae883d4875bf8799809472fbb", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 91, "avg_line_length": 25.120805369127517, "alnum_prop": 0.6927598183275447, "repo_name": "gmoulard/OpenStack_Tenant_Doc", "id": "b633fd8f8f7c83dcc620845dbba322903e1f8063", ...
""" Unit Tests for :py:class:`ironic.conductor.rpcapi.ConductorAPI`. """ import copy import mock from oslo_config import cfg import oslo_messaging as messaging from oslo_messaging import _utils as messaging_utils from ironic.common import boot_devices from ironic.common import exception from ironic.common import sta...
{ "content_hash": "2310c62f0280bafb2769a1d4895d2638", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 78, "avg_line_length": 40.1839378238342, "alnum_prop": 0.5072529172845077, "repo_name": "bacaldwell/ironic", "id": "99f57f3643f1c4c3470c66d4c68f8bb249e131c6", "size": "161...
from __future__ import print_function import os import sys import hashlib import hmac import json import base64 import time import boto3 # Add the lib directory to the path for Lambda to load our libs sys.path.append(os.path.join(os.path.dirname(__file__), 'lib')) from requests import Session, HTTPError # NOQA from ...
{ "content_hash": "afdd16e9d37887b8b610ab714dece064", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 93, "avg_line_length": 33.663366336633665, "alnum_prop": 0.5620588235294117, "repo_name": "pristineio/lambda-webhook", "id": "49d4019d9f7d76e2d0f16a2040e5e3e9a8bf6e58", "s...
import mock import unittest from cloudbaseinit.plugins.windows import userdata_plugins class MultipartUserDataPluginTest(unittest.TestCase): def setUp(self): fake_path = 'fake path' self._userdata = userdata_plugins.PluginSet(fake_path) @mock.patch('glob.glob') @mock.patch('cloudbaseini...
{ "content_hash": "cec0467b579da6afc31af51098712e8e", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 36.15384615384615, "alnum_prop": 0.6340425531914894, "repo_name": "telerik/cloudbase-init", "id": "fe0b9cba888f3ef11336c7294aae2c038a6cd1f1", "size":...
RAWDATA_DIR = '/home/cmb-06/as/skchoudh/dna/Oct_10_2016_HuR_Human_Mouse_Liver/rna-seq/Penalva_L_08182016/mouse' ## Output directory OUT_DIR = '/home/cmb-06/as/skchoudh/dna/Oct_10_2016_HuR_Human_Mouse_Liver/RNA-Seq_mouse' ## Absolute location to 're-ribo/scripts' directory SRC_DIR = '/home/cmb-panasas2/skchoudh/gith...
{ "content_hash": "91be911f4f42c531d8328e1495cffdc6", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 145, "avg_line_length": 35.859375, "alnum_prop": 0.738562091503268, "repo_name": "saketkc/ribo-seq-snakemake", "id": "3eb5cc3328bea5ded0ea12f76b0eff6834c67b0a", "size": "23...
import numpy as np import pytest from natural_bm.preprocessing import make_PCA_matrix, make_ZCA_matrix import natural_bm.backend.theano_backend as BTH import natural_bm.backend.numpy_backend as BNP #%% Test prep for tests def _diag_non_diag(x): diag = np.copy(np.diag(x)) index = np.where(~np.eye(x.shape[0], ...
{ "content_hash": "fae319c550b63d0881dc6c27e1fc2438", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 73, "avg_line_length": 25.98, "alnum_prop": 0.596612779060816, "repo_name": "alexhunterlang/natural_bm", "id": "1a67e7fcbbb934434c0f0bb5ba13874a24c3b36a", "size": "2602", ...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base.version import Version from twilio.rest.lookups.v2.phone_number import PhoneNumberList class V2(Version): def __init__(self, domain): """ Initialize the V2 version of Lookups...
{ "content_hash": "3a4c7bac418aba95a44128c8d9ff0cad", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 67, "avg_line_length": 24.121951219512194, "alnum_prop": 0.5551061678463094, "repo_name": "twilio/twilio-python", "id": "c09cb2a4b22965a2cb18204ce5879350da031733", "size": ...
""" Time taking. Mostly for measurements of Nuitka of itself, e.g. how long did it take to call an external tool. """ from timeit import default_timer as timer from nuitka.Tracing import general class StopWatch(object): __slots__ = ("start_time", "end_time") def __init__(self): self.start_time = N...
{ "content_hash": "9d7915a39a2187e8d193657a31ca7bd2", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 81, "avg_line_length": 24.363636363636363, "alnum_prop": 0.597547974413646, "repo_name": "kayhayen/Nuitka", "id": "d9bc198d8b9439c88cee1701ed2886c3e3ebb1d7", "size": "2656"...
"""The Risco integration.""" import asyncio from datetime import timedelta import logging from pyrisco import CannotConnectError, OperationError, RiscoAPI, UnauthorizedError from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( CONF_PASSWORD, CONF_PIN, CONF_SCAN_INTERVAL, ...
{ "content_hash": "1279f3c9e12fa7b2e76456c912e459b7", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 88, "avg_line_length": 32.73202614379085, "alnum_prop": 0.6615415335463258, "repo_name": "adrienbrault/home-assistant", "id": "eec30553870f93c2438e027ac20e7b63755bad35", "...
import os from awscli.customizations.commands import BasicCommand from awscli.customizations.configure.writer import ConfigFileWriter from . import PREDEFINED_SECTION_NAMES class ConfigureSetCommand(BasicCommand): NAME = 'set' DESCRIPTION = BasicCommand.FROM_FILE('configure', 'set', ...
{ "content_hash": "679612e4d8a515be0164aaba4712c335", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 79, "avg_line_length": 44.94444444444444, "alnum_prop": 0.5500618046971569, "repo_name": "mnahm5/django-estore", "id": "35300d8c3c12b0fe7471ab6fcea14cc592aa9667", "size": "...
import os import re import socket import struct from email.utils import parseaddr from functools import wraps import idna from django.conf import settings from django.contrib.auth.views import redirect_to_login from django.urls import reverse from django.utils.translation import ugettext as _ from modoboa.admin impo...
{ "content_hash": "1513ac8057bbab6883bfd0137a792416", "timestamp": "", "source": "github", "line_count": 437, "max_line_length": 77, "avg_line_length": 34.24713958810069, "alnum_prop": 0.5827208338901511, "repo_name": "modoboa/modoboa-amavis", "id": "e54ce0b9b9085d595ad9e79b215554a4eeb0591b", "size"...
from __future__ import unicode_literals import django.contrib.postgres.fields from django.db import migrations, models import project.fields.datetime_aware_jsonfield class Migration(migrations.Migration): dependencies = [("studies", "0003_auto_20170615_1404")] operations = [ migrations.RenameField...
{ "content_hash": "ad0b54729682585ee174b805ac11126b", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 81, "avg_line_length": 29.847826086956523, "alnum_prop": 0.5644573925710124, "repo_name": "CenterForOpenScience/lookit-api", "id": "60d1ee886777f96c0aff449821badcd50c69b1af",...
import Tkinter as tk import tkFont import re from uuid import uuid4 from collections import Counter from generic import Point, Size, color_variant, distance from area import Area import things AREA_HEIGHT = 630 THING_COUNT = 5 SHADOW_COLOR = (0, 0, 0) INVENTORY = Size(60, AREA_HEIGHT) class NotWideEnoughException(E...
{ "content_hash": "e065d6de2e7833cb3b78ccec1368c176", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 78, "avg_line_length": 24.14487632508834, "alnum_prop": 0.6572515732474755, "repo_name": "evuez/disclosure", "id": "763b08d28e01a4e8fb2ea66ddf5ce455016f059e", "size": "685...
from __future__ import print_function, division, absolute_import import os.path import types from app.libs.utils import load_module_attrs def _filter(module): if hasattr(module, 'urls') and isinstance(module.urls, types.ListType): return getattr(module, 'urls') path = os.path.abspath(os.path.dirname(_...
{ "content_hash": "295612b64eac7f9e68e88fae76187521", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 75, "avg_line_length": 23.294117647058822, "alnum_prop": 0.702020202020202, "repo_name": "Damnever/2L", "id": "8bb5abee37cb48883249bb0ab8d1b68fb0c2c528", "size": "421", "...
""" [2018-01-19] Challenge #347 [Hard] Hue Drops Puzzle https://www.reddit.com/r/dailyprogrammer/comments/7riu6p/20180119_challenge_347_hard_hue_drops_puzzle/ # Description I found the game [Hue Drops](https://apkpure.com/hue-drops/aero.woi.huedrops) on a recent flight, turns out it's also a mobile game. [One reviewe...
{ "content_hash": "4de05639c41a1550a02cee1a8dbb2e1b", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 119, "avg_line_length": 42.25, "alnum_prop": 0.7066779374471682, "repo_name": "DayGitH/Python-Challenges", "id": "f3a92d135a14edfe3899334665368b2b255d1c9a", "size": "2366",...
import logging import telegram import urllib def main(): logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') bot = telegram.Bot('136940855:AAGaZVK07Mocwz4NVabKysOuWEvJwGvEpT0') # Telegram Bot Authorization Token LAST_UPDATE_ID = bot.getUpdates()[-1].update_id # Ge...
{ "content_hash": "dc7048d7d937c56a6103087a6a4798c0", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 107, "avg_line_length": 30.035714285714285, "alnum_prop": 0.6076099881093936, "repo_name": "asivokon/ailas", "id": "b31f679c0a7fc4048fdde15043a7c6e3bb87893e", "size": "842"...
from six import with_metaclass from django import template from oscar.core.loading import get_model register = template.Library() Category = get_model("catalogue", "category") class PassThrough(object): def __init__(self, name): self.name = name def __get__(self, obj, objtype): if obj is Non...
{ "content_hash": "7bae28e83cfa1e4c085ed05786a21c0a", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 84, "avg_line_length": 29.398496240601503, "alnum_prop": 0.6153452685421995, "repo_name": "sasha0/django-oscar", "id": "69acaf23e6b0ae9bbdc0a0d1262da608ae2b7922", "size": ...
from collections import OrderedDict from conans.errors import ConanException from conans.model.ref import ConanFileReference import six class Requirement(object): """ A reference to a package plus some attributes of how to depend on that package """ def __init__(self, conan_reference, private=False, o...
{ "content_hash": "721307a305fa3eda307cc4d5260f1f68", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 95, "avg_line_length": 39.79754601226994, "alnum_prop": 0.5729921381223987, "repo_name": "mropert/conan", "id": "5c7a221262e4ddbfdd1ee7265d7928becc4ff24c", "size": "6487",...
import logging; log = logging.getLogger(__name__) # Try to load JSON libraries in this order: # ujson -> simplejson -> json try: import ujson as json except ImportError: try: import simplejson as json except ImportError: import json import cStringIO as StringIO import inspect import math i...
{ "content_hash": "2169a718b4aee81f7b1a59d95f3a3379", "timestamp": "", "source": "github", "line_count": 890, "max_line_length": 122, "avg_line_length": 41.45168539325843, "alnum_prop": 0.5987476959774477, "repo_name": "CzechHackathon2014/juice-my-device", "id": "e788535c9f99a0560bcc741ff88b748fbfdb9f...
"""Email pipeline for scanner summary.""" # TODO: Investigate improving so we can avoid the pylint disable. # pylint: disable=line-too-long import collections from google.cloud.security.common.util import log_util from google.cloud.security.common.util.email_util import EmailUtil from google.cloud.security.common.gcp...
{ "content_hash": "0f57b92d4f3ca1b3f657d26093096e2c", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 86, "avg_line_length": 41.791666666666664, "alnum_prop": 0.5625979205241418, "repo_name": "thenenadx/forseti-security", "id": "a61b168a9c45992b19a311d4a90897178951a797", "...
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 model 'Image' db.create_table('image_image', ( ('id', self.gf('django.db.models.fields.AutoField')(prim...
{ "content_hash": "fb2201f029a23f228a67119321c9e9de", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 119, "avg_line_length": 45.19047619047619, "alnum_prop": 0.5748155953635405, "repo_name": "servee/django-servee-oldcontrib", "id": "cfe695bbdccdea39151252ed97ab25b6c03aa282",...
#################################################################### # Imports #################################################################### import os import pandas as pd import sqlite3 as sqlite from pandas.io import sql #################################################################### # Connect ...
{ "content_hash": "c22057ff9095cd3e0062705c6dd817cd", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 137, "avg_line_length": 46.84848484848485, "alnum_prop": 0.6289964886342635, "repo_name": "oshadatasci/tsoan", "id": "da852aa1637b109622b79050216bc598d493cd2c", "size": "1...
""" Pluggable system for TaskWarrior hooks Adapted from https://github.com/tbabej/taskpirate by Gabriel Alcaras """ import glob import importlib.util as lib import os def find_hooks(file_prefix): """ Find all files in subdirectories whose names start with <file_prefix> """ file_pattern = os.path.dir...
{ "content_hash": "98832a0f1c8a5df65b7990d1d94e48cc", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 76, "avg_line_length": 28.441860465116278, "alnum_prop": 0.6255110384300899, "repo_name": "gaalcaras/dotfiles", "id": "5918a4302a2908acd534dacbb9c0dd0ee237c983", "size": "1...
from libpymux.session import Session from libpymux.log import logger from libpymux.window import Window from pymux.panes import BashPane import asyncio import concurrent class PyMuxSession(Session): def __init__(self): super().__init__() self.pane_executor = concurrent.futures.ThreadPoolExecutor...
{ "content_hash": "0ff31e0df4fd9c4c8e4fa4dfc015e25d", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 79, "avg_line_length": 29.9875, "alnum_prop": 0.5689870779491455, "repo_name": "jonathanslenders/python-vterm", "id": "46e759e48e5427bf20266078b327ccfbbbd10a02", "size": "2...
"""Tests for object_detection.core.box_coder.""" import tensorflow.compat.v1 as tf from object_detection.core import box_coder from object_detection.core import box_list from object_detection.utils import test_case class MockBoxCoder(box_coder.BoxCoder): """Test BoxCoder that encodes/decodes using the multiply-by-...
{ "content_hash": "1af641379b2cdaa9818ac2ebc73fb051", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 78, "avg_line_length": 31.404255319148938, "alnum_prop": 0.6334688346883469, "repo_name": "tombstone/models", "id": "52765a9d06c990c483aaf87dcba3ecfe604d7adc", "size": "216...
from django.shortcuts import get_object_or_404 from django.contrib.sites.models import Site from django.contrib.syndication.views import Feed, FeedDoesNotExist from django.core.urlresolvers import reverse from news.models import Article, Section class NewsFeed(Feed): _site = Site.objects.get_current() title =...
{ "content_hash": "4fb2046e538794f48e8638077c55998d", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 67, "avg_line_length": 27.90909090909091, "alnum_prop": 0.6767100977198697, "repo_name": "ilendl2/chrisdev-cookiecutter", "id": "0b8d64ad30a24a3f37407d206dd1da141a170a10", ...
import random import time from game.simon import Simon import os print('Dont forget to run:') print('roslaunch my_skeleton_markers markers.launch &') print('python skeleton_markers_reader.py') print('-------') #l = kinect.skeleton_markers_reader.kinect_listener() os.system('kinect/skeleton_markers_reader.py') # basic...
{ "content_hash": "dac3361bf4cce5041d15f2fd2c35573c", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 96, "avg_line_length": 33.666666666666664, "alnum_prop": 0.6489273927392739, "repo_name": "CuriosityLabTAU/physicial_curiosity", "id": "73e45b1b94b4d769893a7d1106d3d741187d8d...
from collections import Counter import sys import time import ray @ray.remote def gethostname(x): import platform import time time.sleep(0.01) return x + (platform.node(), ) def wait_for_nodes(expected): # Wait for all nodes to join the cluster. while True: num_nodes = len(ray.nodes(...
{ "content_hash": "8637a9a7afccca54af4eeb694deea365", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 78, "avg_line_length": 22.76595744680851, "alnum_prop": 0.5803738317757009, "repo_name": "pcmoritz/ray-1", "id": "6275ec87efb580e33a6b59e24be7f155ea7aaeec", "size": "1070",...
import os class ProgressBar: def __init__(self, task_number, bar_opening="[", bar_ending="]", empty_char="-", filled_char="=", update_rate=0, percent_precision=1, display_percent=True, display_absolute_progress=True, bar_length=0, enable_front_char=False, front_char=">", unit=''):...
{ "content_hash": "be0afea882cfec1d10dc854d2c353840", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 127, "avg_line_length": 45.10526315789474, "alnum_prop": 0.5750291715285881, "repo_name": "Rabyss/PyProgressBar", "id": "eaac547b0a82035489d7d52edcda447b80d8e412", "size": ...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 30, transform = "Difference", sigma = 0.0, exog_count = 0, ar_order = 12);
{ "content_hash": "663b6e1d6653909f6520d91222bab851", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 170, "avg_line_length": 38.57142857142857, "alnum_prop": 0.7111111111111111, "repo_name": "antoinecarme/pyaf", "id": "bb7028f70305cbe9ffd08d3d3a3c961f773e1cba", "size": "270...
from datetime import datetime, timedelta import json import unittest from urllib.parse import quote_plus from airflow import configuration from airflow.api.common.experimental.trigger_dag import trigger_dag from airflow.models import DagBag, DagRun, TaskInstance from airflow.settings import Session from airflow.www im...
{ "content_hash": "0bf6259cb82d8c656db96b7a74415d57", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 85, "avg_line_length": 37.93421052631579, "alnum_prop": 0.6042317030870621, "repo_name": "hamedhsn/incubator-airflow", "id": "dacee321ece668aee52a65354e3a052f365ab836", "s...
import vim from ycm import vimsupport from ycm.completers.completer import Completer OMNIFUNC_RETURNED_BAD_VALUE = 'Omnifunc returned bad value to YCM!' OMNIFUNC_NOT_LIST = ( 'Omnifunc did not return a list or a dict with a "words" ' ' list when expected.' ) class OmniCompleter( Completer ): de...
{ "content_hash": "c8a60f111e24521b2dbb32a6b3041c8e", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 80, "avg_line_length": 28.172043010752688, "alnum_prop": 0.6526717557251909, "repo_name": "TaDaa/.vim", "id": "66b6fff69491d68520e48baa0b289f818a201de5", "size": "3400", ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.eager import backprop from tensorflow.python.eager import context from tensorflow.python.eager import def_function from tensorflow.python.framework import constant_op from tensorflow.pyth...
{ "content_hash": "76addc534983987496c9dabe33eadfcb", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 80, "avg_line_length": 30.43946188340807, "alnum_prop": 0.6526222746022392, "repo_name": "renyi533/tensorflow", "id": "16d57ef36da9ef2cd1b3b68ef08cd9f6765167e1", "size": "...
""" @version: python.3.6 @author: zhangjiaheng @software: PyCharm @time: 2017/9/20 20:48 """ from models import myunit,function from test_case.page_obj import landlord_serach_page,landlord_nav_page,login_page import unittest from time import sleep class TestLandlordSerach(myunit.MyTest): '''搜索''' def test_date...
{ "content_hash": "70893a3086f1e9225aed85cd186c3d91", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 80, "avg_line_length": 31.04255319148936, "alnum_prop": 0.6360520904729267, "repo_name": "18701016443/mayi", "id": "bbc637f5a8f5e01763654636330ec921e6bf24da", "size": "1534...
from flask import request class WebSocket(object): def __init__(self, app=None, prefix='/ws'): self.app = app self.init_app(app) def init_app(self, app): app.add_url_rule(self.prefix, 'ws', self._handler) def on_message(self, msg): def decorator(fn): pass ...
{ "content_hash": "1b6ad2e5b80b84a906b546f39cddd250", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 58, "avg_line_length": 18.097560975609756, "alnum_prop": 0.48787061994609165, "repo_name": "bulbulpaul/flask-websocket", "id": "9e84fb114244f08c094c1affa500791160d2c91c", "...
from .app_session import APP_URL, ADMIN_CREDENTIALS, ROOT_CREDENTIALS, get_requests_app_cookies
{ "content_hash": "8d18f291e07b765bf36be05bc7e6f493", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 95, "avg_line_length": 95, "alnum_prop": 0.8210526315789474, "repo_name": "KorolevskyMax/TestFrameworkTemplate", "id": "eff8b0ee2cd269f4aa5e9f5f6cde6024d8a6b05e", "size": "9...
import json from pyspark.sql import Row from pyspark.sql.functions import lit from pyspark.sql.functions import udf from pyspark.sql.types import * import numpy as np import datetime class ConvertUtils(object): @staticmethod def convert_meas_value(df, destination): if destination == "measurements_cl...
{ "content_hash": "3d278292484f28dfc99b72451cf839bd", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 90, "avg_line_length": 39.8054054054054, "alnum_prop": 0.512221618685497, "repo_name": "epidataio/epidata-community", "id": "23fe93cf0ea3f12942a580f8e68b0d3f270da3f5", "si...
import cgi import os import pyauto_functional # Must be imported before pyauto import pyauto class InstantSettingsTest(pyauto.PyUITest): """Test Chrome Instant settings.""" def testEnableDisableInstant(self): """Test to verify default Chrome Instant setting. Check if the setting can be enabled and disa...
{ "content_hash": "294ded4429ca4f3828041ab2c6be3492", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 79, "avg_line_length": 40.23456790123457, "alnum_prop": 0.6854863455047561, "repo_name": "Crystalnix/house-of-life-chromium", "id": "abc108874791117723825dcc74c6e31c0e4a73ae...
from collections import namedtuple from datetime import datetime from scopus.classes import Retrieval class CitationOverview(Retrieval): @property def authors(self): """A list of namedtuples storing author information, where each namedtuple corresponds to one author. The information i...
{ "content_hash": "12c6f57bb5dd4496acb1d1dbed409ae3", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 94, "avg_line_length": 34.63959390862944, "alnum_prop": 0.5943728018757327, "repo_name": "scopus-api/scopus", "id": "7cfb19dc03b943ee876da79e64ee6355ef17eec7", "size": "68...
import sys, os import pygtk, gtk, gobject import pygst pygst.require("0.10") import gst class CamDesk(gtk.Window): def closeme(self, widget, event) : if event.keyval == gtk.keysyms.Escape : gtk.main_quit() def startme(self, widget, event) : if event.keyval == gtk.keysyms.F1 : self.player.set_state(gst...
{ "content_hash": "ae5b1f54ad0b2da099998b065696ca4d", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 94, "avg_line_length": 27.611842105263158, "alnum_prop": 0.6978794376935906, "repo_name": "arteymix/CamDesk", "id": "31856e8ed69122887da16ba5ac304a7300d906e5", "size": "42...
import argparse import sys import os import os.path import errno import xml.etree.ElementTree as ET from pkg_resources import resource_stream # XML file storing one or more paths to the XML file containing the API keys locations_filename = 'locations.xml' locations_file = resource_stream('slcli.resources', locations_f...
{ "content_hash": "ac5da3cfc5bc60c2a4079d02c6e2646f", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 141, "avg_line_length": 33.51111111111111, "alnum_prop": 0.5944960212201591, "repo_name": "Sebelino/SL-CLI", "id": "2bcf6302e6bc0e22884b3c49acdcffd675ce1f08", "size": "3071...
from __future__ import absolute_import from __future__ import with_statement import logging import sys from collections import defaultdict from kombu.tests.utils import redirect_stdouts from mock import patch from celery import beat from celery import platforms from celery.app import app_or_default from celery.bin ...
{ "content_hash": "ce2208418ced1da3cbff2c5f7240f7c9", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 72, "avg_line_length": 25.527173913043477, "alnum_prop": 0.6203959974451778, "repo_name": "mozilla/firefox-flicks", "id": "5fe35d3e89f89dc7784b0381848f64fd77d9a952", "size...
import json import os import subprocess import sys import tempfile import unittest class TestPlannerReLaunch(unittest.TestCase): def setUp(self): self.temp_dir = tempfile.TemporaryDirectory() def tearDown(self): self.temp_dir.cleanup() def test_relaunch_with_planner(self): from t...
{ "content_hash": "fdb846569a7f59515f92bff03a0ecb0b", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 74, "avg_line_length": 29.73134328358209, "alnum_prop": 0.5451807228915663, "repo_name": "PaddlePaddle/Paddle", "id": "16b6016458c38d2ee8ef96c774987618aeb27381", "size": "2...
import sys sys.path.insert(0, '../') import ply.lex as lex import ply.yacc as yacc from pymag_trees.buchheim import buchheim_layout from pymag_trees.gen import Tree import ctokens import cgrammar def lexer(text): clexer = lex.lex(module=ctokens) clexer.input(text) result = [] tok = clexer.token() while tok != N...
{ "content_hash": "04ef0ff733684946b062a371cc2f4edf", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 77, "avg_line_length": 22.229508196721312, "alnum_prop": 0.6541297935103245, "repo_name": "lusv/irunaround", "id": "8ee4c551a440354ab2006558729dba8a188b3ca5", "size": "1356...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1Resourc...
{ "content_hash": "32277706c1181e11c8115535b26e2a94", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 178, "avg_line_length": 27.394736842105264, "alnum_prop": 0.55283381364073, "repo_name": "mbohlool/client-python", "id": "3f625d9dac4db503515cb58d550a3c6a1edf0121", "size"...
""" #: 205 Title: Isomorphic Strings Description: ------ Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replaced with another character while preserving the order of characters. No two char...
{ "content_hash": "2a267b9b435a9e2796d4453dba2fb53a", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 90, "avg_line_length": 24.425925925925927, "alnum_prop": 0.5655799848369977, "repo_name": "RobinCPC/algorithm-practice", "id": "9e4ee3a208873385ebd0efcda33b1f8f6724ac5b", "...
import _plotly_utils.basevalidators class YaxisValidator(_plotly_utils.basevalidators.SubplotidValidator): def __init__(self, plotly_name="yaxis", parent_name="box", **kwargs): super(YaxisValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, dflt=...
{ "content_hash": "371f0075f3b802b27ad39e3480cb4db5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 73, "avg_line_length": 37.76923076923077, "alnum_prop": 0.5967413441955194, "repo_name": "plotly/python-api", "id": "4da8cac1afbbf9e36450e78701396556e1df32b2", "size": "491...
""" celery.loaders.default ~~~~~~~~~~~~~~~~~~~~~~ The default loader used when no custom app has been initialized. """ from __future__ import absolute_import import os import warnings from celery.datastructures import DictAttribute from celery.exceptions import NotConfigured from celery.utils import str...
{ "content_hash": "7a748c8a6d362f6c6d9f202e46e22df6", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 77, "avg_line_length": 32.829787234042556, "alnum_prop": 0.6409591704471809, "repo_name": "mozilla/firefox-flicks", "id": "f695538cba3eece9e2e5e3224596b873b852868f", "size"...
import re from datetime import datetime from itertools import izip_longest import html5lib from lxml import etree from cadorsfeed.cadorslib.xpath_functions import extensions from cadorsfeed.cadorslib.narrative import process_narrative from cadorsfeed.cadorslib.locations import LocationStore from cadorsfeed.aerodb imp...
{ "content_hash": "5d406bb4874a8d79cc34112722277300", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 79, "avg_line_length": 37.88, "alnum_prop": 0.5402021421028813, "repo_name": "kurtraschke/cadors-parse", "id": "d8cf5a9fcaf9a876266e5bec6a217438ca1fb80a", "size": "6629", ...
from django.views.generic import TemplateView, View from dash.access import (df, hostname, ip, issue, mem, numberofcores, w, ps, whereis, users, boot, loadavg, bandwidth, dnsmasq_leases, ping, date) from dash.utils import json_response class IndexView(TemplateView): templat...
{ "content_hash": "bc7d807f11d6ccb3de0fca6add001717", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 77, "avg_line_length": 32.85294117647059, "alnum_prop": 0.6947179946284691, "repo_name": "dongweiming/django-linux-dash", "id": "1b3e268c6c3fbe64b11f8b73f136b65cb67ddb44", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('halfwayapp', '0003_auto_20160222_2252'), ] operations = [ migrations.AlterField( model_name='participan...
{ "content_hash": "8459604976d9b41795cb383ef438835f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 129, "avg_line_length": 26.789473684210527, "alnum_prop": 0.6522593320235757, "repo_name": "cszc/meethalfway", "id": "ecc042bf17dc7485d553b06dde69773fc0c42bf8", "size": "58...
import BBB_QC # Written libraries for the Quadcopter import Adafruit_BBIO.GPIO as GPIO # Adafruit GPIO libraries import Adafruit_BBIO.PWM as PWM # Adafruit PWM libraries import sys # Libraries for system nature jobs import time # For times and delays import signal # detects inputs/interupts i...
{ "content_hash": "57cdb6adcbf41114c5112dffb420a807", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 70, "avg_line_length": 28.534246575342465, "alnum_prop": 0.6908305328852616, "repo_name": "ValRose/BBB_Quadcopter", "id": "61ad164078a7ef2a214a227946b32815d94e6891", "size"...
from carepoint import Carepoint from sqlalchemy import (Column, Integer, Numeric, ForeignKey, DateTime, String, ) class AccountActivity(Carepoint.BASE): __tablename__ = '...
{ "content_hash": "3dee62337708ccbc96cd2a435ff4565f", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 42, "avg_line_length": 23.45205479452055, "alnum_prop": 0.5175233644859814, "repo_name": "laslabs/Python-Carepoint", "id": "5c8cc6be1deda3fb5a0a598f3984638965c2f13d", "size...
import cassiopeia.dto.requests import cassiopeia.type.dto.stats def get_ranked_stats(summoner_id, season=None): """https://developer.riotgames.com/api/methods#!/1018/3452 summoner_id int the summoner to get ranked stats for season str the season to get ranked stat...
{ "content_hash": "9a1bc0d8940a3f09a1efc0854c71830b", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 136, "avg_line_length": 43, "alnum_prop": 0.6524547803617571, "repo_name": "MakersF/cassiopeia", "id": "3b303dc075fd438ff9f8e3977cad0f2a937679ce", "size": "1548", "binary...
from __future__ import absolute_import from setuptools import setup setup( name='Chong', version='0.1dev', author='Jeff Bradberry', author_email='jeff.bradberry@gmail.com', packages=['chong'], entry_points={ 'jrb_board.games': 'chong = chong.chong:Board', }, install_requires=['s...
{ "content_hash": "5450362ac1f5002037c22e8a6777d789", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 61, "avg_line_length": 25.8125, "alnum_prop": 0.6464891041162227, "repo_name": "jbradberry/chong", "id": "8b9593c2d913053396f0f671deffbfe6caa8851d", "size": "413", "binar...
import errno import os def check_pid(*filenames): try: for filename in filenames: if not os.path.exists(filename): continue with open(filename) as f: pid = int(f.read().strip()) break else: return False os.k...
{ "content_hash": "d0fd6357947061323b64ada8df46881b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 44, "avg_line_length": 22.85, "alnum_prop": 0.487964989059081, "repo_name": "dataflow/DataStage", "id": "f9048581c2c15061c85e112ab308d8fe7f8e9f86", "size": "1711", "binar...
import telebot import adminList as Admin from sqldata import db import keys import keyboards from loadSchedule import load_schedule from replacement import Replacement import json import datetime from session import Users, AntiCrash from const import HUD import messageGroup from notification_group import ...
{ "content_hash": "9197a976e9130b45ac4800485ebe78cf", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 94, "avg_line_length": 36.21666666666667, "alnum_prop": 0.6217211228716061, "repo_name": "uksivt-guys/schedule-bot", "id": "834eaa4e8cdf69f886ec8e95d9adb2c22d42d523", "siz...
import wx from ui.custom_checkbox import CustomCheckBox class CustomMenuBar(wx.Panel): def __init__(self, parent, *args, **kwargs): wx.Panel.__init__(self, parent, *args, **kwargs) self.parent = parent self.SetBackgroundColour(self.parent.GetBackgroundColour()) self.SetForegroundColo...
{ "content_hash": "a4fae958192b23c58b35d88047f341dd", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 114, "avg_line_length": 48.01851851851852, "alnum_prop": 0.6247589664481296, "repo_name": "jeff-alves/Tera", "id": "1ddbbf4e83de3538866dc6bdcb84dbabb9905fa5", "size": "2593...
"""Django test runner that invokes nose. You can use... :: NOSE_ARGS = ['list', 'of', 'args'] in settings.py for arguments that you want always passed to nose. """ from __future__ import print_function, unicode_literals import os import sys from optparse import make_option from types import MethodType import d...
{ "content_hash": "ab30760a616fcdb738027cc1b21b14e7", "timestamp": "", "source": "github", "line_count": 537, "max_line_length": 80, "avg_line_length": 39.13221601489758, "alnum_prop": 0.6073570000951747, "repo_name": "Deepomatic/django-nose", "id": "66209f7a45de50c84b462e95f2ed1002f135379a", "size"...
from django.db import models from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.sites.models import Site class FacebookProfile(models.Model): user = models.ForeignKey(User) site = models.ForeignKey(Site, default=Site.objects.get_current) uid = mode...
{ "content_hash": "caaa438c71df9cb8dd648f1f1a1ddce6", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 88, "avg_line_length": 33.338235294117645, "alnum_prop": 0.6749007498897222, "repo_name": "0101/django-socialregistration", "id": "9d692b798d7ad703aebb15ab00e769eae9aa6972", ...
import os import sys import shutil from bcbio.pipeline import config_utils from bcbio.distributed.transaction import file_transaction, tx_tmpdir from bcbio.utils import (safe_makedir, file_exists, is_gzipped) from bcbio.provenance import do from bcbio import bam, utils from bcbio.log import logger from bcbio.pipeline ...
{ "content_hash": "86d7e7abe137fabf87beca65740a6eb8", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 91, "avg_line_length": 42.36206896551724, "alnum_prop": 0.6202686202686203, "repo_name": "SciLifeLab/bcbio-nextgen", "id": "34eb5b2263504e4c38d048d5bb7ba3fff5129160", "siz...
"""This module defines an interface for finding named resources. Due to license restrictions, not all software dependences can be shipped with PerfKitBenchmarker. Those that can be included in perfkitbenchmarker/data, or perfkitbenchmarker/scripts and are loaded via a PackageResourceLoader. Users can specify additio...
{ "content_hash": "170ab2ec822487aa0e9b685678bcacff", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 79, "avg_line_length": 30.622222222222224, "alnum_prop": 0.6882438316400581, "repo_name": "GoogleCloudPlatform/PerfKitBenchmarker", "id": "d4f124bfaf6fbf17dd8397486324c7a9d1...
""" Copyright (C) 2012 Legoktm Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublic...
{ "content_hash": "71bb682aee95f8268e8298364008776a", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 200, "avg_line_length": 34.6953125, "alnum_prop": 0.5935600090069804, "repo_name": "legoktm/pywikipedia-scripts", "id": "a1b0d27477cc8f0a078db48fc419485883a72702", "size":...
""" SQLAlchemy-i18n --------------- Internationalization extension for SQLAlchemy models. """ import os import re import sys from setuptools import setup PY3 = sys.version_info[0] == 3 HERE = os.path.dirname(os.path.abspath(__file__)) def get_version(): filename = os.path.join(HERE, 'sqlalchemy_i18n', '__init_...
{ "content_hash": "40bc2606d448e8729143709894c35530", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 72, "avg_line_length": 26.48611111111111, "alnum_prop": 0.5862611431567908, "repo_name": "kvesteri/sqlalchemy-i18n", "id": "9971cc06efd0dd2576f641f1aecade1b650c80a9", "size...
"""Clustering Operations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.framework impo...
{ "content_hash": "8a2a9e0bb012585f72e165236b037626", "timestamp": "", "source": "github", "line_count": 763, "max_line_length": 83, "avg_line_length": 46.61992136304063, "alnum_prop": 0.6632369064687527, "repo_name": "frreiss/tensorflow-fred", "id": "2b04df177c31a641e38d8729a357f02927666f58", "size...
from typing import Dict, Optional, Tuple import torch def _calculate_bin_centers(boundaries: torch.Tensor): step = boundaries[1] - boundaries[0] bin_centers = boundaries + step / 2 bin_centers = torch.cat([bin_centers, (bin_centers[-1] + step).unsqueeze(-1)], dim=0) return bin_centers def _calculat...
{ "content_hash": "4743062baf78ec7d4b96a86487751581", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 96, "avg_line_length": 33.977777777777774, "alnum_prop": 0.6635055591890124, "repo_name": "huggingface/transformers", "id": "4d60b1049137c5ceabfe9f60c6192c2af2895eef", "siz...
""" Module: Barcode Printer URLS Project: Django BCP Copyright: Adlibre Pty Ltd 2012 License: See LICENSE for license information """ try: from django.conf.urls.defaults import * except: from django.conf.urls import patterns, url #import mdtui.views urlpatterns = patterns('bcp.views', url(r'^(?P<barcode_t...
{ "content_hash": "52e30bb76d03f9fed5afd16778dbc0df", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 131, "avg_line_length": 34, "alnum_prop": 0.6795665634674922, "repo_name": "adlibre/django-bcp", "id": "d8f987fda296073ce6766e82f499734c1cc39db5", "size": "646", "binary"...
import os import pickle _config_database = None def _get_database_file_name(): home = os.path.expanduser("~") db_file_name = home + "/.remoter" return db_file_name def _load_database(): global _config_database if _config_database is not None: return _config_database # try: # ...
{ "content_hash": "af05ef8aacd8d6f42078e4a44fe95980", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 70, "avg_line_length": 21.45945945945946, "alnum_prop": 0.5554156171284634, "repo_name": "nsubtil/remoter", "id": "fda16e779f15f247c521db6f9e2704397e1815ba", "size": "1588"...
from __future__ import absolute_import from builtins import str from .base_monitor import BaseMonitor from kafka import KafkaProducer from kafka.common import KafkaUnavailableError from scutils.method_timer import MethodTimer from retrying import retry import json import sys import traceback class KafkaBaseMonitor(B...
{ "content_hash": "573273ecd31ba6b387139902fe7011dd", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 87, "avg_line_length": 36.58163265306123, "alnum_prop": 0.5564853556485355, "repo_name": "istresearch/scrapy-cluster", "id": "fa13ae72105b5d4d5545e0c72ff990b22fe229eb", "si...
import os import os.path import json import shutil from shutil import ignore_patterns import collections import errno import sys import codecs import subprocess def jwrite(src, key, value): try: jsonFile = open(src, 'r+') jsonData = json.load(jsonFile, object_pairs_hook=collections.OrderedDict) ...
{ "content_hash": "fad70a4743b41e08f939917807b0aabf", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 133, "avg_line_length": 35.504950495049506, "alnum_prop": 0.6048522030117122, "repo_name": "escapin/ElectionManager", "id": "64917cf5d248cef322142f582fa6604ae58c35c1", "si...
import os from datetime import timedelta # starterbot's ID as an environment variable BOT_ID = os.environ.get("BOT_ID") SLACK_BOT_TOKEN = os.environ.get('SLACK_BOT_TOKEN') # constants AT_BOT = "<@" + BOT_ID + ">" BOT_NAME = 'antibot' DEFAULT_DELETE_DELAY = 20.0 # Default is 180 seconds DB_NAME = "counter.db" # Skirm...
{ "content_hash": "f64a6a36dd8aac64c8466a12dda18037", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 56, "avg_line_length": 27.263157894736842, "alnum_prop": 0.7181467181467182, "repo_name": "TheAntimist/antibot", "id": "dffa588e7deab3d02b0e2b35d22250cfaef4a843", "size": "...
import rollbar import uvicorn from rollbar.contrib.starlette import ReporterMiddleware as RollbarMiddleware from starlette.applications import Starlette from starlette.responses import PlainTextResponse # Initialize Rollbar SDK with your server-side ACCESS_TOKEN rollbar.init( 'ACCESS_TOKEN', environment='stag...
{ "content_hash": "05e1605a61123af7087d3e860565c963", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 80, "avg_line_length": 29.282608695652176, "alnum_prop": 0.746844840386043, "repo_name": "rollbar/pyrollbar", "id": "24089263fbd096022185569502195b81f2cc1c00", "size": "169...
from __future__ import division, unicode_literals """ This module implements a FloatWithUnit, which is a subclass of float. It also defines supported units for some commonly used units for energy, length, temperature, time and charge. FloatWithUnit also support conversion to one another, and additions and subtractions...
{ "content_hash": "9c9d46cdaaad92aecae44de022d56adb", "timestamp": "", "source": "github", "line_count": 827, "max_line_length": 109, "avg_line_length": 31.808948004836758, "alnum_prop": 0.5395347069109708, "repo_name": "yanikou19/pymatgen", "id": "7a606adb62300c976b290bed1a8aa8473fd88ed2", "size": ...
__author__ = 'yuens' ################################### PART1 IMPORT ###################################### import logging import time import numpy as np import struct import decorator_of_function from class_painter_by_ndarray import * ################################### PART2 CLASS && FUNCTION ###################...
{ "content_hash": "a526c9a7d4cac1abf16bf34884835499", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 217, "avg_line_length": 46.219718309859154, "alnum_prop": 0.5997684056557777, "repo_name": "ysh329/my-first-cnn", "id": "53005a2388953d5d8adeba870bdac0fb68ca2760", "size":...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2016-2018 Dietrich Pescoller Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation...
{ "content_hash": "3747cca01f83670348aeaec9d0ceffec", "timestamp": "", "source": "github", "line_count": 525, "max_line_length": 99, "avg_line_length": 38.94285714285714, "alnum_prop": 0.5569087796527268, "repo_name": "Diti24/python-ivi", "id": "73fe65d7c157df1a3d7072dcb06888400ef750e3", "size": "20...
from __future__ import absolute_import, division, print_function import sys import utool as ut def run_tests(): # Build module list and run tests import sys ut.change_term_title('RUN IBEIS_CNN TESTS') exclude_doctests_fnames = set([ ]) exclude_dirs = [ '_broken', #'old', ...
{ "content_hash": "9e76d3de1c213405b21855b2295ec958", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 72, "avg_line_length": 26.512820512820515, "alnum_prop": 0.5986460348162476, "repo_name": "bluemellophone/ibeis_cnn", "id": "e5358f0922c010f0ebf923b61581aa0f5e269f76", "siz...
""" Calculate and manipuate kmer """ import re import itertools import math from collections import deque from collections import Counter import numpy as np import Bio.SeqIO as SeqIO # Global variable KMER_ARR = ["A", "C", "G", "T"] KSIZE_LIMIT = 31 # Regex to clean sequence data NUCLEOTIDE_REGEX = re.compile("[^AT...
{ "content_hash": "e92bf38beeba618014abc97509e60c36", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 118, "avg_line_length": 23.049079754601227, "alnum_prop": 0.5765238221985627, "repo_name": "yumyai/ksiga", "id": "af5f92a72cdf99366205a94917dee5f264bea70a", "size": "3804"...
""" Created on Mar 09, 2016 @author: Tyranic-Moron """ import re from IRCMessage import IRCMessage from IRCResponse import IRCResponse, ResponseType from CommandInterface import CommandInterface class Var(CommandInterface): triggers = ['var'] help = "var <varname> <value> - sets <varname> to <value>, which c...
{ "content_hash": "9b765c4fe61fc955abaccdb9a079f28e", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 136, "avg_line_length": 35.407407407407405, "alnum_prop": 0.6631799163179917, "repo_name": "Heufneutje/PyMoronBot", "id": "f65d30044c165843808796d710c41b85a041f643", "size"...
"""Settings that need to be set in order to run the tests.""" import os DEBUG = True SITE_ID = 1 APP_ROOT = os.path.abspath( os.path.join(os.path.dirname(__file__), '..')) LANGUAGE_CODE = 'en' LANGUAGES = [ ('en', 'English'), ('de', 'Deutsch'), ] DATABASES = { 'default': { 'ENGINE': 'dja...
{ "content_hash": "c420d88c68109afa1105da3a5c815210", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 65, "avg_line_length": 23.2027027027027, "alnum_prop": 0.615608619685498, "repo_name": "bitmazk/django-multilingual-tags", "id": "13c8b04deaa518ad9357cbd66897d00f70b4d571", ...
import unittest from os.path import join from unittest import mock from tests.recipes.recipe_lib_test import RecipeCtx class TestPandasRecipe(RecipeCtx, unittest.TestCase): """ TestCase for recipe :mod:`~pythonforandroid.recipes.pandas` """ recipe_name = "pandas" @mock.patch("pythonforandroid.r...
{ "content_hash": "cf628adb883f09769a50e4476b125401", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 82, "avg_line_length": 32.64705882352941, "alnum_prop": 0.639039039039039, "repo_name": "PKRoma/python-for-android", "id": "3ac34d1d3b640456532027b361c88b567161b2b4", "size...
""" manage.py, copyright (c) 2015 by Stefan Lehmann, licensed under the MIT license """ import sys import eventlet import os from app import create_app, db from app.models import TempCtrlSettings, ProcessData, Step, Receipe from app.control import tempcontroller from flask_script import Manager, Shell from flask_migr...
{ "content_hash": "51f0b21e117359ead583a14e2efa55e9", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 71, "avg_line_length": 23.11111111111111, "alnum_prop": 0.6936813186813187, "repo_name": "MrLeeh/brewctrl", "id": "f88b34b5892db0e2c0d31d9e522a052834eb32c2", "size": "1480"...
from integration_tests.framework import env def setup_package(): env.create_env(env.ManagerTestEnvironment) def teardown_package(): env.destroy_env()
{ "content_hash": "911d47ecc41373b917f67084a7bfdbef", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 46, "avg_line_length": 18, "alnum_prop": 0.7469135802469136, "repo_name": "isaac-s/cloudify-manager", "id": "1ac3c6bf0ad097e65c1da63056f20e66af8c0061", "size": "791", "bin...
from __future__ import unicode_literals from os.path import join, dirname from textx import metamodel_from_str from textx.export import metamodel_export, model_export grammar = ''' Calc: assignments*=Assignment expression=Expression; Assignment: variable=ID '=' expression=Expression ';'; Expression: op=Term (op=PlusOr...
{ "content_hash": "ad49bf61c9ec0243311b52febb2383a4", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 74, "avg_line_length": 27.480314960629922, "alnum_prop": 0.5727793696275072, "repo_name": "igordejanovic/textX", "id": "71d13b884ded2c85762372ecf3706c4128439547", "size": ...
from __future__ import unicode_literals from server.models import * from django.db import models, migrations import plistlib def enable_plugins(apps, schema_editor): Machine = apps.get_model("server", "Machine") InstalledUpdate = apps.get_model("server", "InstalledUpdate") Report = apps.get_model("serve...
{ "content_hash": "89e3dcc0d14c3c9d466288a015a570eb", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 65, "avg_line_length": 24.64516129032258, "alnum_prop": 0.6570680628272252, "repo_name": "erikng/sal", "id": "3a9bea2d8ef684e88b8ea3d59f34f17f21077e0b", "size": "788", "b...
import logging import os import mysql.connector logging.basicConfig(level=logging.DEBUG,format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s',datefmt='%a, %d %b %Y %H:%M:%S') class DB(object): """ :Some operations about databases """ def __init__(self): logging.debug(...
{ "content_hash": "2105d09dc7c78a3ef2f54ab4d0734f81", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 149, "avg_line_length": 28.081632653061224, "alnum_prop": 0.5079941860465116, "repo_name": "bc-dcos/autoscaling", "id": "a21e76ccffd39514279194be0c4a60163bfbf90c", "size": ...
import _plotly_utils.basevalidators class MetaValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="meta", parent_name="funnelarea", **kwargs): super(MetaValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, array_o...
{ "content_hash": "84b43bfd9b99ca67205df3619eff0088", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 37.15384615384615, "alnum_prop": 0.5921325051759835, "repo_name": "plotly/python-api", "id": "3fa079924fa3f29a5ef69895fd0477c2917181f7", "size": "483...
from django.conf.urls import patterns, url from applications.assets import views urlpatterns = patterns( '', url(r'^equipment/$', views.EquipmentViewList.as_view(), name='equipment_list'), url(r'^equipment/create/$', views.EquipmentViewCreate.as_view(), name='equipment_create'), url(r'^equipment/(?P<pk...
{ "content_hash": "317bfecb53a13bb03190e4e230ec199c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 105, "avg_line_length": 62.705882352941174, "alnum_prop": 0.6838649155722326, "repo_name": "awwong1/apollo", "id": "2041493dbf879fdca54dd1edac169c6a0380f5e5", "size": "1066...