text
stringlengths
4
1.02M
meta
dict
in_chat_with_support = [] waiting_support_approval = [] @bot.message_handler(commands=['support']) def support(message): userlang = redisserver.get("settings:user:language:" + str(message.from_user.id)) userid = message.from_user.id banlist = redisserver.sismember('zigzag_banlist', '{}'.format(userid)) if banl...
{ "content_hash": "a9e9a65980666395179d05c36e90dcce", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 223, "avg_line_length": 51.48837209302326, "alnum_prop": 0.6933152664859982, "repo_name": "WebShark025/TheZigZagProject", "id": "001d3a37dadc9c182f92378b070aded3a4a58452", ...
__title__ = 'sparx' __description__ = 'Simplified Data Munging, Wrangling and Preparing Library' __url__ = 'http://cleverinsight.co' __version__ = (0, 0, 1) __build__ = 0 __author__ = 'Bastin Robins J' __author_email__ = 'robin@cleverinsight.co' __license__ = 'Proprietary' __copyright__ = 'Copyright 2017 CleverInsight'
{ "content_hash": "c39615cd174eac50c384af8f9a9790bc", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 76, "avg_line_length": 35.55555555555556, "alnum_prop": 0.659375, "repo_name": "CleverInsight/sparx", "id": "d54744d4b5cd1e14fdf3bc2fbd3eb58176b44c16", "size": "320", "bin...
from groupflow_shared import * from mininet.net import * from mininet.node import OVSSwitch, UserSwitch from mininet.link import TCLink from mininet.log import setLogLevel from mininet.cli import CLI from mininet.node import Node, RemoteController from scipy.stats import truncnorm from numpy.random import randint, unif...
{ "content_hash": "4ac3841f66c2b843225f6e63a23bdf4b", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 176, "avg_line_length": 37.093525179856115, "alnum_prop": 0.6274243599689682, "repo_name": "alexcraig/GroupFlow", "id": "1ebfa46c9d5d54074a8f67c915a8b28c9de17735", "size":...
from heat.engine import clients from heat.openstack.common import log as logging from heat.engine import properties from heat.engine.resources.neutron import neutron from heat.engine.resources.neutron import router if clients.neutronclient is not None: from neutronclient.common.exceptions import NeutronClientExcep...
{ "content_hash": "16331a13f73cb92586c1e13f1d52a5a1", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 79, "avg_line_length": 35.8705035971223, "alnum_prop": 0.594263939029282, "repo_name": "ntt-sic/heat", "id": "b86e3c47b8ca716e658ea704eed4d21b5f073907", "size": "5606", ...
""" Code for generating an ensemble submission for the SeeClickFix contest hosted on Kaggle. It loads base submission files generated by our team's (Bryan Gregory and Miroslaw Horbal) individual models then combines them using segment based averaging. Ensemble weights for each segment of data are stored in SETTI...
{ "content_hash": "8756884aed85ed6a1e0921b07ab72096", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 119, "avg_line_length": 45.771929824561404, "alnum_prop": 0.6487159831353009, "repo_name": "theusual/kaggle-seeclickfix-ensemble", "id": "7dfc412b6202ea5b8604de6e69690a98084...
import tfmpl.plots.confusion_matrix
{ "content_hash": "817ccb3d65cab10559f43ccb2178b406", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 35, "avg_line_length": 35, "alnum_prop": 0.8857142857142857, "repo_name": "cheind/tf-matplotlib", "id": "41a07b36d7d4fed1de9e6b810d0e192385848aec", "size": "35", "binary":...
from setuptools import setup, find_packages with open('README.txt') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='Implot', version='1.0.0', description='Implot Driver', long_description=readme, author='Imperial Creaitivy Laboratories', author_emai...
{ "content_hash": "424247288541737fe5b3e009906bde45", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 53, "avg_line_length": 21.8, "alnum_prop": 0.6536697247706422, "repo_name": "aelbouchti/Implot", "id": "c10e769753902a54780fe1cb7cdef492dbd0ef96", "size": "461", "binary"...
""" For creating healpix maps from catalogs. """ import os from os.path import join import shutil import tempfile import subprocess from collections import Counter from collections import OrderedDict as odict import fitsio import numpy as np import numpy.lib.recfunctions as recfuncs import healpy as hp from scipy.inte...
{ "content_hash": "982800764ef205b091055c9e811b1d1e", "timestamp": "", "source": "github", "line_count": 338, "max_line_length": 100, "avg_line_length": 39.642011834319526, "alnum_prop": 0.5916113142771848, "repo_name": "kadrlica/ugali", "id": "0b1b2454b1bcfdd70e7a03d9cf2133a8e9c4a076", "size": "134...
__author__ = 'sulantha' from Utils.DbUtils import DbUtils import Config.PipelineConfig as pc from Pipelines.ADNI_T1.ADNI_T1_Helper import ADNI_T1_Helper from Utils.PipelineLogger import PipelineLogger import distutils.dir_util import distutils.file_util import shutil import subprocess from Manager.QSubJob import QSubJ...
{ "content_hash": "e25f34eb5a73ed457933983a09334494", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 329, "avg_line_length": 58.21848739495798, "alnum_prop": 0.6134526558891455, "repo_name": "sulantha2006/Processing_Pipeline", "id": "e2b3a599c2543242b038d85a840f2d788ca4a534...
from base import BaseHandler from models import * class RatePostHandler(BaseHandler): """Blog handler that is used to render blog posts and to add blog comments""" def get(self, direction, post_id): have_error = False self.post = Post.by_id(int(post_id)) if not self.user: ...
{ "content_hash": "d0b4939ff82dfbe631ced8903df51f41", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 61, "avg_line_length": 26.36842105263158, "alnum_prop": 0.5129740518962076, "repo_name": "kevink1986/my-first-blog", "id": "8eef1d18881cb39dd550e8d679c5ab8396af2a02", "size...
"""Classes and functions for accessing Helsinki area traffic data for more info see http://developer.reittiopas.fi/pages/en/http-get-interface.php""" # -*- coding: utf-8 -*- from collections import defaultdict from datetime import datetime from pytz import timezone from requests import get, exceptions class HslUrls(...
{ "content_hash": "5b3c9ea9e6c71e11b76cca69aeb0f23b", "timestamp": "", "source": "github", "line_count": 459, "max_line_length": 91, "avg_line_length": 32.06318082788671, "alnum_prop": 0.5492287830400218, "repo_name": "timokoola/timoechobot", "id": "46334ab3160d4066068e0758add57d5cc36cc8fa", "size":...
painting_possible = True try: from skimage.filter import sobel except Exception: try: from scipy.ndimage.filters import sobel except Exception: painting_possible = False # ----------------------------------------------------------------------- import numpy as np def to_painting(image, sa...
{ "content_hash": "0060abae33e442084ccfe1e376b3c624", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 78, "avg_line_length": 32, "alnum_prop": 0.5922619047619048, "repo_name": "kerstin/moviepy", "id": "c1411387463bd3be0a41ebecc8c9f489b4424de8", "size": "1418", "binary": f...
""" A Printer which converts an expression into its LaTeX equivalent. """ from sympy.core import S, C, Basic, Add, Mul, Wild, var from printer import Printer from conventions import split_super_sub from sympy.simplify import fraction from sympy import Interval import sympy.mpmath.libmp as mlib from sympy.mpmath.libmp...
{ "content_hash": "14eb5dc77a15328f3fdc4b88739d143a", "timestamp": "", "source": "github", "line_count": 757, "max_line_length": 84, "avg_line_length": 33.51651254953765, "alnum_prop": 0.4717799148667823, "repo_name": "pernici/sympy", "id": "b08c3d85303ca6b527cf6a20fff42902a1bdfec3", "size": "25372"...
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 'Video.autoPublish' db.add_column('portal_video', 'autoPublish', self.gf('django.db.models.fiel...
{ "content_hash": "c9badfe109cfdc20926f1deb89ac69ac", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 182, "avg_line_length": 76.5, "alnum_prop": 0.5459884436866534, "repo_name": "LambdaCast/LambdaCast", "id": "3f6a001c3aabd7393e641cb22f4f4a468a27944f", "size": "10581", ...
""" Form utilities. `TrimCharField` - a char field which truncates it's value to max_length before validation. """ from __future__ import unicode_literals from django.forms import CharField from django.forms import ModelForm from django.forms.models import ModelFormMetaclass from django.core.exceptions import Imprope...
{ "content_hash": "071201e1c601ca3bac693ba2654872bf", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 80, "avg_line_length": 35.45054945054945, "alnum_prop": 0.6053936763794172, "repo_name": "ivanyu/django-juice", "id": "c9bd9655378e02742397d031f5a9326319178352", "size": "3...
""" Font Bakery reporters/serialize can report the events of the Font Bakery CheckRunner Protocol to a serializeable document e.g. for usage with `json.dumps`. Separation of Concerns Disclaimer: While created specifically for checking fonts and font-families this module has no domain knowledge about fonts. It can be u...
{ "content_hash": "7c72cab746f2f4a434e6e04ded34d566", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 95, "avg_line_length": 39.49122807017544, "alnum_prop": 0.5239152969050792, "repo_name": "googlefonts/fontbakery", "id": "87fe7a3c38dc83a263b64167553248442c5de2c2", "size"...
"""Constants for the DLNA MediaServer integration.""" from __future__ import annotations from collections.abc import Mapping import logging from typing import Final from homeassistant.components.media_player import const as _mp_const LOGGER = logging.getLogger(__package__) DOMAIN: Final = "dlna_dms" DEFAULT_NAME: F...
{ "content_hash": "0a1ec256a4ce221ca04715dec571dd21", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 85, "avg_line_length": 46.166666666666664, "alnum_prop": 0.7256317689530686, "repo_name": "GenericStudent/home-assistant", "id": "8c260272d5fa780dc75c83cb50adfce2b2ae12f5", ...
"""BiasOnly algorithm, where the compress bias only.""" from typing import List import tensorflow as tf from tensorflow_model_optimization.python.core.common.keras.compression import algorithm # TODO(tfmot): This algorithm is showcase for bias only compression. if we find # better algorithm that can show better com...
{ "content_hash": "19977d1b90633fa328c98361503622a2", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 88, "avg_line_length": 39.09722222222222, "alnum_prop": 0.7023090586145648, "repo_name": "tensorflow/model-optimization", "id": "c5e0929ba67bceecd71ef60fab346dd19ee7fe52", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import modelcluster.contrib.taggit import modelcluster.fields import wagtail.core.blocks import wagtail.core.fields class Migration(migrations.Migration): initial = True dependencies = [ ...
{ "content_hash": "370c499151b68bd492a80cfdde2315fc", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 227, "avg_line_length": 44.772277227722775, "alnum_prop": 0.5919946926138877, "repo_name": "Taywee/amberherbert.com", "id": "40dd267a27f2c9ea24248ec20e95a3f5b93d7d06", "si...
import logging from conary import dbstore from mint.scripts.db2db import db2db log = logging.getLogger(__name__) def switchToPostgres(cfg): if cfg.dbDriver in ('postgresql', 'pgpool'): return sourceTuple = (cfg.dbDriver, cfg.dbPath) destTuple = ('postgresql', 'postgres@localhost:5439/mint') ...
{ "content_hash": "a15b58903e9b4de5ef55427a036501fa", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 72, "avg_line_length": 29.84, "alnum_prop": 0.6890080428954424, "repo_name": "sassoftware/mint", "id": "afdc5e6b8c7e5fbbd8c90072b442896b700fb8a1", "size": "1351", "binary...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('press_links', '0001_initial'), ] operations = [ migrations.CreateModel( name='EntryTranslation', fields=[ ('...
{ "content_hash": "1fc5c21d39e886e9eedc73650f056ed9", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 126, "avg_line_length": 39.294871794871796, "alnum_prop": 0.5314845024469821, "repo_name": "iberben/django-press-links", "id": "1eae2d685ed29ce00e6ac4ef7707d261337035be", "...
from unittest import TestCase from mock import MagicMock, patch from api.probe_results.models import ProbeResult class TestProbeResult(TestCase): def setUp(self): self.type = "type" self.name = "name" self.doc = MagicMock() self.status = 1 self.file_web = MagicMock() ...
{ "content_hash": "7fc1076cf6f60ca17a0f160cacfeef2e", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 70, "avg_line_length": 34.46666666666667, "alnum_prop": 0.6450676982591876, "repo_name": "quarkslab/irma", "id": "b87fff7fe144ccec8a13be5e2bbeb4c7023aecca", "size": "1034",...
from __future__ import absolute_import from __future__ import unicode_literals from setuptools import setup, find_packages def _requires_from_file(filename): return open(filename).read().splitlines() try: with open('README.rst') as f: readme = f.read() except IOError: readme = '' setup( na...
{ "content_hash": "418159af7d199048cc4af566bf930b4f", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 85, "avg_line_length": 30.07894736842105, "alnum_prop": 0.6465441819772528, "repo_name": "nkmrtty/trie-search", "id": "5e31eb93ee9d7c7e010dd6e66a943ca5d8461e19", "size": "1...
from beritest_tools import BaseBERITestCase from nose.plugins.attrib import attr class test_tlb_store_protected(BaseBERITestCase): @attr('tlb') def test_epc_correct(self): self.assertRegisterEqual(self.MIPS.a7, 0, "EPC not set to address of illegal store instruction.") @attr('tlb') def test_c...
{ "content_hash": "a3b647e9fe78c2ea544ecf0e95364c59", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 108, "avg_line_length": 37.25, "alnum_prop": 0.7087248322147651, "repo_name": "8l/beri", "id": "ab7611a2891b21cfcce41741049cc00930b88411", "size": "1672", "binary": false...
import logging import os from scli.constants import EbLocalDir, OptionSettingFile, ParameterName, \ ParameterSource, ServiceRegion, ServiceDefault from scli.resources import ValidationMessage from scli.exception import ValidationError log = logging.getLogger("cli") class Parameter(object): ''' Parameter...
{ "content_hash": "f43ec63869a4eb10fb1848f861fc1127", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 87, "avg_line_length": 36.27472527472528, "alnum_prop": 0.5874987377562355, "repo_name": "JoaoVasques/aws-devtool", "id": "25d942784748313cf201395412176225a7db64ef", "size...
from google.cloud import webrisk_v1 def sample_search_hashes(): # Create a client client = webrisk_v1.WebRiskServiceClient() # Initialize request argument(s) request = webrisk_v1.SearchHashesRequest( threat_types="SOCIAL_ENGINEERING_EXTENDED_COVERAGE", ) # Make the request respon...
{ "content_hash": "7d9b93dddafd2589b016e4a423310d6c", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 61, "avg_line_length": 24.894736842105264, "alnum_prop": 0.7167019027484144, "repo_name": "googleapis/python-webrisk", "id": "bcbf772c9043558c299a7e267bced7f2c610061a", "si...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest from mock import ANY from ansible.module_utils.network.fortios.fortios import FortiOSHandler try: from ansible.modules.network.fortios import fortios_system_vdom_radius_server except ImportE...
{ "content_hash": "744cf588a9ecf4a7b81f803ce2fcac71", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 142, "avg_line_length": 37.5615763546798, "alnum_prop": 0.648, "repo_name": "thaim/ansible", "id": "ea96bca2947a110a89203afa4998c33b18a0f0b1", "size": "8321", "binary": ...
import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION if sys.version_info >= (3, 8): from typing i...
{ "content_hash": "b70e7df11a5ad7de822c76e2703709b3", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 116, "avg_line_length": 52.5625, "alnum_prop": 0.724435196195006, "repo_name": "Azure/azure-sdk-for-python", "id": "88eada53ff687700a98af8b5449fdf5b2f4b082d", "size": "3832...
import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0100_usermessage_remove_is_me_message'), ] operations = [ migrations.CreateModel( name='MutedTopic', ...
{ "content_hash": "f0ea9f372810487928a7557bfeac9308", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 126, "avg_line_length": 39.25, "alnum_prop": 0.6096451319381255, "repo_name": "shubhamdhama/zulip", "id": "bdb956993ed3a2bb0c6a7b830cfc847f427d0f09", "size": "1148", "bin...
from handsome.MicropolygonMesh import MicropolygonMesh, Vertex, Position from handsome.Pixel import FloatPixel, array_view, pixel_view from handsome.Tile import Tile from handsome.TileCache import TileCache from handsome.util import point, render_mesh from handsome.capi import generate_numpy_begin, generate_numpy_span ...
{ "content_hash": "c76a37c0540d58955f3d117a07f2bf9e", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 93, "avg_line_length": 26.80655737704918, "alnum_prop": 0.6175391389432485, "repo_name": "bracket/handsome", "id": "8e33b04dc90afff8aa468d51ef90fc7bb85d42e8", "size": "817...
sizeof_workid = 8 import base58 as _base58 from binascii import b2a_hex as _b2a_hex from hashlib import sha256 as _sha256 from struct import pack as _pack from time import time as _time from blktemplate import _Transaction, request as _request MAX_BLOCK_VERSION = 4 coinbase_size_limit = 100 def _dblsha256(data): ...
{ "content_hash": "b338b5417fb580e05c0439b990402093", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 146, "avg_line_length": 27.736263736263737, "alnum_prop": 0.6835380348652932, "repo_name": "luke-jr/python-blkmaker", "id": "c1324bbf2f0e1f9b07a7a43102d7316fbcd9a39c", "si...
try: range = xrange except NameError: pass class MatrixPointer: def __init__(self, data, size=None, offset=(0,0), transpose=False): """Create a matrix pointer. Keyword arguments: data -- array, matrix of matrix pointer; size -- tuple (width, height) with size of current ...
{ "content_hash": "b38cc95e94d98b5df92c4bda75ef561c", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 80, "avg_line_length": 34.389162561576356, "alnum_prop": 0.5489184930525712, "repo_name": "char-lie/patterns_recognition", "id": "670803a3e8a91214565575b7370e2880572f45d7", ...
def convertTabs(code, x): return code.replace('\t', ' ' * x)
{ "content_hash": "f297299436cd4ad88b09e22238c62ad0", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 38, "avg_line_length": 32.5, "alnum_prop": 0.5846153846153846, "repo_name": "RevansChen/online-judge", "id": "825403d237ce3b1c7dd052ca41920ca1a670456d", "size": "100", "bi...
import base64 import mock import re import os from collections import defaultdict from typing import Any, Dict, Iterable, List, Optional, Tuple from django.test import TestCase from django.http import HttpResponse, HttpRequest from django.conf import settings from zerver.forms import OurAuthenticationForm from zerve...
{ "content_hash": "54fd56b009d5d27a54950b52756feb09", "timestamp": "", "source": "github", "line_count": 1906, "max_line_length": 128, "avg_line_length": 40.93126967471144, "alnum_prop": 0.5907453694802282, "repo_name": "tommyip/zulip", "id": "df70f7f053ce29cfecb985e604a839967e90d76e", "size": "7803...
"""Basic message object for the email package object model.""" __all__ = ['Message'] import re import uu import base64 import binascii from io import BytesIO, StringIO # Intrapackage imports from email import utils from email import errors from email._policybase import compat32 from email import charset as _charset ...
{ "content_hash": "d60450cf9e3b20e436eee54eab8ac8e6", "timestamp": "", "source": "github", "line_count": 875, "max_line_length": 96, "avg_line_length": 39.62285714285714, "alnum_prop": 0.5888952985289876, "repo_name": "MalloyPower/parsing-python", "id": "3feab52799a43c52e54d9592f8fb9d1f06fc9758", "s...
ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: f5bigip_ltm_monitor_radius short_description: BIG-IP ltm monitor radius module description: - Configures a Remote Access Dial-in User Service (RADIUS) monitor. version_ad...
{ "content_hash": "27514e2140f28cc31a22d96a652a0152", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 120, "avg_line_length": 34.23952095808383, "alnum_prop": 0.6376355369010144, "repo_name": "erjac77/ansible-module-f5bigip", "id": "9aaa54de82a96a289010ed66bde654e017f64c35",...
""" Tests of neo.io.blackrockio """ # needed for python 3 compatibility from __future__ import absolute_import import unittest import warnings from numpy.testing import assert_equal import numpy as np import quantities as pq from neo.io.blackrockio import BlackrockIO from neo.test.iotest.common_io_test import Bas...
{ "content_hash": "b65df7455a948b2be42b8cffe6f10e7b", "timestamp": "", "source": "github", "line_count": 490, "max_line_length": 98, "avg_line_length": 46.46734693877551, "alnum_prop": 0.6195704686196144, "repo_name": "rgerkin/python-neo", "id": "f102d280dc4a7e6b5ed7167c767ec89ee644dd64", "size": "2...
from __future__ import unicode_literals import json import re import itertools from .common import InfoExtractor from ..compat import ( compat_HTTPError, compat_str, compat_urlparse, ) from ..utils import ( determine_ext, ExtractorError, InAdvancePagedList, int_or_none, NO_DEFAULT, ...
{ "content_hash": "a75f435da07aeb422bd2d22d27a97dfb", "timestamp": "", "source": "github", "line_count": 1019, "max_line_length": 137, "avg_line_length": 41.2855740922473, "alnum_prop": 0.5135250772521988, "repo_name": "bosstb/HaberPush", "id": "61cc469bf27b58bfc70eb8bd036737ec0a4cb66c", "size": "42...
import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties from mpl_toolkits.mplot3d import Axes3D FONT = FontProperties(fname=("LaserQt_Font/wqy-microhei.ttc"), size=10) dataframe = pd.read_csv('data.txt', header=None) dataframe.dropna() matrix = datafra...
{ "content_hash": "0ecfddfb03505b21d2f76412fe203588", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 72, "avg_line_length": 33.758620689655174, "alnum_prop": 0.710929519918284, "repo_name": "IamLJT/LaserQt", "id": "6ff6711ec4c8da3b78ed61b24a642451e8d11293", "size": "1033",...
import re from unittest import skip from social_auth.utils import setting from social_auth.tests.base import SocialAuthTestsCase, FormParserByID from django.contrib.sites.models import Site class FacebookTestCase(SocialAuthTestsCase): SERVER_NAME = 'myapp.com' SERVER_PORT = '8000' def __init__(self, me...
{ "content_hash": "e96abd2a0297d3877c030fd589318880", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 116, "avg_line_length": 39.04545454545455, "alnum_prop": 0.6292200232828871, "repo_name": "sk7/django-social-auth", "id": "092d7e95aeb8247558aba09433f1166705d7332b", "size"...
from __future__ import absolute_import from __future__ import print_function import json import os import stat from twisted.internet import defer from twisted.python import log from buildbot import config from buildbot.interfaces import WorkerTooOldError from buildbot.process import remotecommand from buildbot.proce...
{ "content_hash": "52a88c5af998416cd83c68503f42a505", "timestamp": "", "source": "github", "line_count": 658, "max_line_length": 101, "avg_line_length": 35.20820668693009, "alnum_prop": 0.5970561574653602, "repo_name": "Alecto3-D/testable-greeter", "id": "8c8cf4fd1df6b9dd7c8ff6983772959a6086a8a9", "...
from PyObjCTools.TestSupport import * from Foundation import * try: unicode except NameError: unicode = str try: bytes except NameError: bytes = str class Behaviour (NSObject): def exceptionDuringOperation_error_leftOperand_rightOperand_(self, exc, err, l, r): pass class TestNSDecimalN...
{ "content_hash": "a16bb81d0a393eb16be3902ca77b0baf", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 169, "avg_line_length": 44.05194805194805, "alnum_prop": 0.7632665094339622, "repo_name": "Khan/pyobjc-framework-Cocoa", "id": "00fbb865b5fb8216b06aff5e3abca8cf3035a8e7", "...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys import unittest im...
{ "content_hash": "3ee6df26ed80097ef148489f29cdf632", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 105, "avg_line_length": 21.65, "alnum_prop": 0.6997690531177829, "repo_name": "skuda/client-python", "id": "cf4bec523598d8e6d7fab653f4477bbcc8e9b46e", "size": "883", "bin...
"""irc2 general utilities""" import asyncio import collections import time class IStr(str): """ IStr is a string which follows RFC1459 casing rules, and allows for case-insensitive equality testing. >>> IStr("Hello World") == "HELLO world" True >>> IStr("Hello[] World~") == "hello{] WORLD^" ...
{ "content_hash": "7b6e354c0ccf53bfd6c76adcdf01e038", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 113, "avg_line_length": 27.0625, "alnum_prop": 0.5452270977675134, "repo_name": "fwilson42/irc2", "id": "b1912c4f7b4f1af5599006ea91552319ff9c5854", "size": "5196", "bina...
from PyQt4.QtCore import * from PyQt4.QtGui import * from froi.algorithm import imtool def inverse_image(model): """Inverse current selected image by multiplying with -1.""" # get data and name from current selected image current_row = model.currentIndex().row() source_vol = model.data(model.index(cu...
{ "content_hash": "425ebb9ecd2aea0a738b3cb44a71ddba", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 70, "avg_line_length": 35.27272727272727, "alnum_prop": 0.6675257731958762, "repo_name": "liuzhaoguo/FreeROI-1", "id": "9f6e924559ccdfdbaab47644a9200b40a0dbb7ac", "size": "...
import os import sys sys.path.append(os.path.join(os.getcwd(), 'tools'))
{ "content_hash": "25486d28a4ee44d16ef4dece39ff8a45", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 51, "avg_line_length": 18.5, "alnum_prop": 0.7162162162162162, "repo_name": "savi-dev/quantum", "id": "8e233bcf4234451fcab777204729d542c64b2d16", "size": "788", "binary": ...
import random def count_the_rands(target=1, floor=1, ceiling=1000): count = 0 # how many random numbers generated numbers = {} # keeping track of the numbers generated number = None # the number we generate each cycle while number != target: number = random.randint(floor, ceiling) count...
{ "content_hash": "44193719264ef738654779d38cac750d", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 81, "avg_line_length": 38.06666666666667, "alnum_prop": 0.5980735551663747, "repo_name": "bandarji/lekhan", "id": "cd309353df0f460785b7e06412df7cf983ebc517", "size": "1165"...
import json from django.test import SimpleTestCase, TestCase from django.urls import reverse from django.utils import translation from wagtail.contrib.table_block.blocks import DEFAULT_TABLE_OPTIONS, TableBlock from wagtail.core.models import Page from wagtail.tests.testapp.models import TableBlockStreamPage from wag...
{ "content_hash": "f8272d673ba13e1431ecd7ab8c81e3a1", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 141, "avg_line_length": 39.930952380952384, "alnum_prop": 0.5395027130165166, "repo_name": "mikedingjan/wagtail", "id": "63967d32b180f15d2c4ae4ec92155248e385755c", "size":...
__all__ = [ 'Response', 'ResponseParser', ] from kitsu.http.errors import * from kitsu.http.headers import Headers from kitsu.http.parsers import LineParser class Response(object): def __init__(self, version=(1,1), code=200, phrase='OK', headers=(), body=None): self.version = version self....
{ "content_hash": "21b104926b65ab67ed0c8f22d0aa4722", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 105, "avg_line_length": 32.734939759036145, "alnum_prop": 0.548398969451601, "repo_name": "snaury/kitsu.http", "id": "f076d48fcef201428b13082093cc9ceaa08a40f4", "size": "27...
import sys, os, warnings warnings.simplefilter("ignore", DeprecationWarning) from ncclient import manager def demo(host, user): with manager.connect(host=host, port=22, username=user, hostkey_verify=False) as m: c = m.get_config(source='running').data_xml with open("%s.xml" % host, 'w') as f: ...
{ "content_hash": "e39fffe696dcb350a10c06c55c8324d6", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 87, "avg_line_length": 33.916666666666664, "alnum_prop": 0.6388206388206388, "repo_name": "sysbot/ncclient", "id": "5f3ba47c9faf36e45985a9c9a0951c0e7fab60a9", "size": "598"...
""" Recover the toy dataset generated by example/generate_toy/bnmf/generate_bnmtf.py using ICM, and plot the MSE against timestamps. We can plot the MSE, R2 and Rp as it converges, on the entire dataset. We have I=100, J=80, K=5, L=5, and no test data. We give flatter priors (1/10) than what was used to generate the ...
{ "content_hash": "1886938b2087de3b9ce91f56609cc8ab", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 114, "avg_line_length": 28.065934065934066, "alnum_prop": 0.7106499608457322, "repo_name": "ThomasBrouwer/BNMTF", "id": "3006225bb46b02cf622f97b54d35234cb19a5f35", "size": ...
""" Abstraction around a package index. """ from abc import ABCMeta, abstractmethod class Index(object): """ Abstract interface for managing PyPI data. """ __metaclass__ = ABCMeta @abstractmethod def get_projects(self): """ Get the list of hosted projects. :returns: a...
{ "content_hash": "99fdd153ca5555cd7ebf2d976423c909", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 81, "avg_line_length": 25.25581395348837, "alnum_prop": 0.6109576427255985, "repo_name": "jessemyers/cheddar", "id": "80f9086a4c308613448eddb2ab341bd8a3570750", "size": "21...
from __future__ import unicode_literals from django.apps import AppConfig class ContactsConfig(AppConfig): name = 'contacts'
{ "content_hash": "25923e001b3039cc7c2641b066119872", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 18.857142857142858, "alnum_prop": 0.7575757575757576, "repo_name": "Zombusters/zchat-lambdas", "id": "65098afd914362501df7e310a69b5267f61cd396", "size...
from asyncio import wait_for from aiojobs import create_scheduler from aioredis import Redis from virtool.dispatcher.client import DispatcherClient async def test_client(loop, redis: Redis): """ Test that the client can successfully publish a Pub/Sub message to the dispatch Redis channel. """ (chan...
{ "content_hash": "1a3c8bb3abd4c5bf3e32a791774b2cbf", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 98, "avg_line_length": 25.633333333333333, "alnum_prop": 0.6736020806241872, "repo_name": "virtool/virtool", "id": "037e202ca1a30ba7f3f11b74271cd8d03e36810b", "size": "769"...
""" Test functions for rbf module """ import numpy as np from numpy.testing import (assert_, assert_array_almost_equal, assert_almost_equal, run_module_suite) from numpy import linspace, sin, random, exp, allclose from scipy.interpolate.rbf import Rbf FUNCTIONS = ('multiquadric', 'inverse m...
{ "content_hash": "3217f29cff6bc4974bb8c0866f8721ff", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 78, "avg_line_length": 30.892307692307693, "alnum_prop": 0.588894422310757, "repo_name": "teoliphant/scipy", "id": "a4045dc708bb82b0037a743813d6cc1e399e9760", "size": "408...
"""MySQL Connector/Python version information The file version.py gets installed and is available after installation as mysql.connector.version. """ VERSION = (2, 0, 3, '', 0) if VERSION[3] and VERSION[4]: VERSION_TEXT = '{0}.{1}.{2}{3}{4}'.format(*VERSION) else: VERSION_TEXT = '{0}.{1}.{2}'.format(*VERSION[...
{ "content_hash": "e2226d07f14279bbeb56ffceeb59fea4", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 70, "avg_line_length": 28.733333333333334, "alnum_prop": 0.6774941995359629, "repo_name": "lowitty/selenium", "id": "c2a8150029d23950a1129b4d65dd172f1082baa3", "size": "156...
from django.conf import settings from django.contrib.auth.models import User from django.core.cache import cache from django.db import models from django.core.urlresolvers import reverse from django.db.models.signals import pre_delete, post_save from django.dispatch import receiver from cloudinary import api from clou...
{ "content_hash": "6cd1f378b743c3248b63e70736a6503b", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 91, "avg_line_length": 31.05128205128205, "alnum_prop": 0.6694192127718139, "repo_name": "plankter/augeo-cloud", "id": "b0462d4d0eebafdf597e1342c16e835bd208661f", "size": ...
import optparse, os, re import math import glob import inspect import m5 from m5.objects import * from m5.util import addToPath addToPath('../') from ruby import Ruby from common import Options from common import Simulation from common import GPUTLBOptions, GPUTLBConfig ########################## Script Options ##...
{ "content_hash": "eb4333ca493783886868bc1a1ae95b56", "timestamp": "", "source": "github", "line_count": 545, "max_line_length": 96, "avg_line_length": 42.61834862385321, "alnum_prop": 0.62569423515736, "repo_name": "SanchayanMaity/gem5", "id": "5ec3289d25f7fe69d6e319e791dab2fad03422f4", "size": "24...
from __future__ import print_function """ FileType.py - Base class for all file types Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. This abstract class defines the interface that must be used to extend acq4 to support more file types. The classes are not meant...
{ "content_hash": "7a6a380f9fb7d2556e4327e3a35b2d29", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 98, "avg_line_length": 37.796875, "alnum_prop": 0.6440677966101694, "repo_name": "acq4/acq4", "id": "54375c75948b208fb25594971df610ded016fc8d", "size": "2443", "binary": ...
import setuptools import versioneer with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="PcbDraw", version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), python_requires=">=3.7", author="Jan Mrázek", author_email="email@honzamrazek.cz", ...
{ "content_hash": "2ee4accbfa729717a228760f0a7d8300", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 75, "avg_line_length": 27.78, "alnum_prop": 0.5867530597552196, "repo_name": "yaqwsx/PcbDraw", "id": "061452f317c0d835271208adba55877f42a66ffe", "size": "1415", "binary":...
"""irclib -- Internet Relay Chat (IRC) protocol client library. This library is intended to encapsulate the IRC protocol at a quite low level. It provides an event-driven IRC client framework. It has a fairly thorough support for the basic IRC protocol, CTCP, DCC chat, but DCC file transfers is not yet supported. I...
{ "content_hash": "4711eeb964b9d01ae1c59c86af303f9f", "timestamp": "", "source": "github", "line_count": 1578, "max_line_length": 79, "avg_line_length": 30.55576679340938, "alnum_prop": 0.5576871227990128, "repo_name": "rconradharris/pyhole", "id": "4165e42915ef9214b0211de81dd2e131759fcfba", "size":...
import _plotly_utils.basevalidators class BorderwidthValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="borderwidth", parent_name="parcats.line.colorbar", **kwargs ): super(BorderwidthValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "2fe8f0ad4987f65f415980c06cbbbf3b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 86, "avg_line_length": 34.285714285714285, "alnum_prop": 0.6083333333333333, "repo_name": "plotly/plotly.py", "id": "f46671833c0daaf0aff102152fbd3277675635f6", "size": "480...
import sys import os import csv import json import re import math from decimal import Decimal from django.core.management.base import BaseCommand, CommandError field_types = { 'date_ymd': 'DateField', 'number': 'FloatField', 'integer': 'IntegerField', 'email': 'EmailField', 'text': 'C...
{ "content_hash": "1cad5d73b339dfe1115f0d79b62144f5", "timestamp": "", "source": "github", "line_count": 556, "max_line_length": 79, "avg_line_length": 42.93884892086331, "alnum_prop": 0.45522325542431097, "repo_name": "swanijam/django-redcap", "id": "a9a7c2dfde259c282dcf86e8f4a3900fab7f72a5", "size...
from __future__ import unicode_literals # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. try: import sphinxcontrib.gist # NOQA extensions = ['sphinxcontrib.gist'] except ImportError: extensions = [] # Add a...
{ "content_hash": "e618913c706200e16d186969605dc56d", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 79, "avg_line_length": 31.435146443514643, "alnum_prop": 0.7005191002262745, "repo_name": "berezovskyi/nikola", "id": "7d9db7a7b3546c8c9a9e86247e9dbf51a736db82", "size": "...
import logging import os import time from tempfile import gettempdir from typing import Iterable from sqlalchemy import Table, exc, func, inspect, or_, text from airflow import settings from airflow.configuration import conf from airflow.jobs.base_job import BaseJob # noqa: F401 from airflow.models import ( # noqa:...
{ "content_hash": "8cfadd162ef270963762ecc9fe32572e", "timestamp": "", "source": "github", "line_count": 925, "max_line_length": 109, "avg_line_length": 29.635675675675675, "alnum_prop": 0.536096012840623, "repo_name": "apache/incubator-airflow", "id": "16247e0965ed4a99ee4612e63e9e9b8353dca0f2", "si...
import os import pytest import compas from compas.datastructures import Mesh from compas.files import STL compas.PRECISION = "12f" BASE_FOLDER = os.path.dirname(__file__) @pytest.fixture def binary_stl_with_ascii_header(): return os.path.join(BASE_FOLDER, "fixtures", "stl", "binary-1.stl") @pytest.fixture d...
{ "content_hash": "a4000e844607548cd77683332ab69de8", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 79, "avg_line_length": 23.91304347826087, "alnum_prop": 0.6881818181818182, "repo_name": "compas-dev/compas", "id": "ae4a87aaf89ec25e334cee1c0484a98d28d04c9d", "size": "110...
from functools import wraps from flask import session, request from .exception import AuthorticationException def login_required(func): @wraps(func) def wrapper(*args, **kwargs): user_id = request.cookies.get('user_id') or session.get('user_id') if user_id: session['user_id'] = user_id return func(*args, ...
{ "content_hash": "a34f660d70d6a3931743d9db95be717d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 68, "avg_line_length": 25, "alnum_prop": 0.7244444444444444, "repo_name": "flreey/private-navigation", "id": "4c70ec8898e3004fc6d94b8298398309de836db1", "size": "450", "b...
import os import subprocess import argparse MAJOR = 1 MINOR = 9 MICRO = 0 ISRELEASED = False IS_RELEASE_BRANCH = False VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) def get_version_info(source_root): # Adding the git rev number needs to be done inside # write_version_py(), otherwise the import of scipy.versi...
{ "content_hash": "9268a1b59ec064c557c4da159a68f261", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 83, "avg_line_length": 33.973214285714285, "alnum_prop": 0.5992115637319316, "repo_name": "vigna/scipy", "id": "c5c5cbe7754949f1c0618e48a7c0bb2121ff8fef", "size": "3805", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("wagtaildocs", "0009_document_verbose_name_plural"), ] operations = [ migrations.AddField( model_name="document", name="file_hash", field=models.CharField...
{ "content_hash": "a8ee32cdacf9f7cb8118e7e8a0e49b85", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 23.875, "alnum_prop": 0.599476439790576, "repo_name": "zerolab/wagtail", "id": "bc7fc9b2971a7a00b3bdc9e3227dd94f95017c3e", "size": "431", "binary":...
from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name=...
{ "content_hash": "52ac321482ab9a4e17bacea1250c9f5f", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 354, "avg_line_length": 46.73026315789474, "alnum_prop": 0.5220329438265522, "repo_name": "Igelinmist/etools", "id": "48918844a88c4616ca2ca5f999be7e2be0714454", "size": "7...
def nested_item(depth, value): if depth <= 1: return [value] else: return [nested_item(depth - 1, value)] def nested_list(n): """Generate a nested list where the i'th item is at depth i.""" lis = [] for i in range(n): if i == 0: lis.append(i) else: ...
{ "content_hash": "e720fe023837b7470ca52ce54f11f142", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 74, "avg_line_length": 23.53846153846154, "alnum_prop": 0.5446623093681917, "repo_name": "ActiveState/code", "id": "f26367656516c0e17bef784cb463e9c2dfb10031", "size": "968"...
from django.conf.urls import url, patterns, include from django.contrib import admin from django.views.generic import TemplateView admin.autodiscover() urlpatterns = patterns( '', url(r'^$', TemplateView.as_view(template_name='index.html')), # Administrative components url(r'^admin/', include(admin....
{ "content_hash": "addabacc9e574393fadd4d59ee9e44d4", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 65, "avg_line_length": 23.928571428571427, "alnum_prop": 0.7223880597014926, "repo_name": "bruth/wicked-django-template", "id": "8ba0d35ffc844f5105bc238e3e342977288156a2", ...
"""Spike sorting and ephys data analysis for 1000 channels and beyond.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import logging import os.path as op import sys from six import StringIO ...
{ "content_hash": "c6f96f0e130c98c9b80fe76ba6afd8ad", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 27.384615384615383, "alnum_prop": 0.5758426966292135, "repo_name": "rossant/phy", "id": "0890d54630703d76e6034502ac0c3b33fe6ba87c", "size": "2532", ...
"""The tests for the demo weather component.""" from homeassistant.components import weather from homeassistant.components.weather import ( ATTR_FORECAST, ATTR_FORECAST_CONDITION, ATTR_FORECAST_PRECIPITATION, ATTR_FORECAST_PRECIPITATION_PROBABILITY, ATTR_FORECAST_TEMP, ATTR_FORECAST_TEMP_LOW, ...
{ "content_hash": "e7afa43a01c46cf8f7e2846bf45980b1", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 88, "avg_line_length": 41.49090909090909, "alnum_prop": 0.71034180543383, "repo_name": "w1ll1am23/home-assistant", "id": "8c93219f8e69ad16af1a6845e63ebfef03c99a03", "size":...
""" Presence analyzer unit tests. """ import os.path import json import datetime import unittest from presence_analyzer import main, views, utils TEST_DATA_CSV = os.path.join( os.path.dirname(__file__), '..', '..', 'runtime', 'data', 'test_data.csv' ) # pylint: disable=maybe-no-member, too-many-public-methods ...
{ "content_hash": "ba203a205486d658c0b42a47affe5e02", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 79, "avg_line_length": 31.15918367346939, "alnum_prop": 0.5331412103746398, "repo_name": "stxnext-kindergarten/presence-analyzer-rbast", "id": "f6e2c5910d1ac0de323a08856264c...
""" User commands for multi commands example. """ from argparseinator import class_args, arg, ArgParseInated @class_args class User(ArgParseInated): """ User commands. """ __cmd_name__ = "user" @arg() def files(self): """ List files. """ self.writeln("Listi...
{ "content_hash": "10bddeb1ded35a81e66cab8aa3d59147", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 58, "avg_line_length": 21.033333333333335, "alnum_prop": 0.5388272583201268, "repo_name": "ellethee/argparseinator", "id": "60f58335a3cccd0103c526f5981e27b0b516eb06", "size...
from flask import Flask, request, abort import json from ReverseProxied import ReverseProxied app = Flask(__name__) app.wsgi_app = ReverseProxied(app.wsgi_app) with open("intervals.json") as b: data = json.load(b) def intersects(interval, min_age, max_age): if interval["lag"] <= min_age <= interval["eag"]: ...
{ "content_hash": "a09b8f4f5d2f326bb76103cc8d5a4712", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 92, "avg_line_length": 25.333333333333332, "alnum_prop": 0.6425438596491229, "repo_name": "tetherless-world/dtdi-geologic-time-resolver", "id": "f3bbedea60f7d9d40338c8346619c...
import GafferUI QtCore = GafferUI._qtImport( "QtCore" ) ## PyQt and PySide differ in their bindings of functions using the # QVariant type. PySide doesn't expose QVariant and instead uses # the standard python types, whereas PyQt binds and uses the QVariant type. # This class provides functions to help with writing c...
{ "content_hash": "666bd585c61f31b9b9c97bdd1c06914e", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 79, "avg_line_length": 30.391304347826086, "alnum_prop": 0.7031473533619457, "repo_name": "chippey/gaffer", "id": "c7acea0628264998bef47580f2f2f77478c11fcf", "size": "3258"...
import curses from curses import panel def run_menu(menu_items,x=0,y=0,name=None,border=True): """ Display menu at x,y on a newly created window params: x(int) - x coordinate to create window y(int) - y coordinate to create window name(str) - optional title for menu border(bool) - d...
{ "content_hash": "dc8f42cb22fba49d8035a81ee3fcd1e3", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 66, "avg_line_length": 26.21212121212121, "alnum_prop": 0.545664739884393, "repo_name": "bcicen/statsquid", "id": "7fa595b8ea371b7d6b3c2bb95d05f79a03da4bdc", "size": "1730"...
from django.shortcuts import render from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_protect from user_profile.forms import * from django.template import RequestContext fro...
{ "content_hash": "d6693f6d7a8710c1cc97f7a5b51af867", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 127, "avg_line_length": 38.092592592592595, "alnum_prop": 0.6937287311618863, "repo_name": "bitsnbytes7c8/django-site", "id": "bd622610c7ca4df4d3182257d4aa6389768fe2be", "s...
import pytest from indico.modules.events.payment.models.transactions import PaymentTransaction, TransactionStatus @pytest.fixture def create_transaction(): """Return a callable which lets you create transactions.""" def _create_transaction(status, **params): params.setdefault('amount', 10) p...
{ "content_hash": "7630cae2a501c010efb3897b837f76ce", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 99, "avg_line_length": 30.91304347826087, "alnum_prop": 0.7243319268635724, "repo_name": "DirkHoffmann/indico", "id": "04c80f6cb698af265b54fd3876b8240b966cadc8", "size": "9...
from .stochastic_gradient import (SGDRegressor, ElasticNet, Lasso, Ridge, LinearRegression, L1Regression, SGDClassifier, LogisticRegression, LinearSVC, SGDMultiClassifier, SoftmaxRegre...
{ "content_hash": "0dbc904504d118e3c4e1ef1eaae324fc", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 73, "avg_line_length": 36.94117647058823, "alnum_prop": 0.47929936305732485, "repo_name": "hduongtrong/hyperemble", "id": "167601a85072432882b75c950da47cb75a8effe8", "size"...
from south.utils import datetime_utils as 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 'Project.project_type' db.add_column(u'ide_project', 'project_type', ...
{ "content_hash": "387620550d9e0442cbba158cb15ee8ac", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 195, "avg_line_length": 81.31724137931035, "alnum_prop": 0.5507590535153931, "repo_name": "math-foo/cloudpebble", "id": "1fc7e66250250f57ff40abe54857a439cd14942e", "size":...
from datetime import datetime, timedelta from itertools import chain, cycle from django.shortcuts import render_to_response from django.utils.translation import ugettext, ugettext_lazy as _ from django.http import HttpResponseRedirect, Http404 from django import forms from django.views.decorators.http import require_P...
{ "content_hash": "a57c4d5f958245271c90e982f3eade03", "timestamp": "", "source": "github", "line_count": 507, "max_line_length": 163, "avg_line_length": 37.429980276134124, "alnum_prop": 0.6337671918638351, "repo_name": "ella/ella-polls", "id": "b5dddd20b0cb97e7c43ab440a2f286ccc367ed02", "size": "18...
import hail as hl from .resources import * from .utils import benchmark import gzip def read_gunzip(path): with gzip.open(path) as f: for line in f: pass @benchmark(args=many_ints_table.handle('tsv')) def sentinel_read_gunzip_1(path): read_gunzip(path) @benchmark(args=many_ints_table....
{ "content_hash": "d218453d30f00597e4b0279dcfbd9d59", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 46, "avg_line_length": 16.92, "alnum_prop": 0.6264775413711584, "repo_name": "hail-is/hail", "id": "296ec4e61045ba2df88b05c0d22f7370d2c1e7f1", "size": "846", "binary": fa...
""" Range of durations """ import datetime import pscheduler class DurationRange(): "Range of durations" def __init__(self, drange): """Construct a range from a JSON DurationRange.""" # TODO: Would be nice if this class could treat missing # lower/upper as zero or infinity. ...
{ "content_hash": "d5828470a20ed154e36cc51eafb39336", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 80, "avg_line_length": 30.608695652173914, "alnum_prop": 0.5404829545454546, "repo_name": "mfeit-internet2/pscheduler-dev", "id": "9b537189051d39d540ac5b41c0746244bcd8ad5b", ...
''' test_avltree.py This python scripts tests methods in avltree.py that the authors did not leave clues for. - insert() - adjustBalances() - case1() - case2() - case3() ''' import unittest import avltree import stack class AVLTreeTestsFromStarter(unittest.TestCase):...
{ "content_hash": "c5396b9d788077f5d2c6a4476bc386c3", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 76, "avg_line_length": 30.30496453900709, "alnum_prop": 0.5965363912941727, "repo_name": "kyspencer/3D_Empirical_Attainment_Function", "id": "7d7ca821ef7c1c88180e065329cbbad...
import unittest from unittest import mock import subprocess from chaser import pacman class TestPacman(unittest.TestCase): def test_exists_true(self): subprocess.check_output = lambda x, **_: "test" self.assertEquals("test", pacman.exists("test")) def test_exists_false(self): subproc...
{ "content_hash": "dd1088bf63f2786ef04adb969f29e944", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 67, "avg_line_length": 31.964285714285715, "alnum_prop": 0.6536312849162011, "repo_name": "rshipp/chaser", "id": "e4d5906738d2f4a5cce82ae013f0bb703c576fdd", "size": "895", ...
DEBUG = True # DEBUG = False # TEMPLATE_DEBUG = True TEMPLATE_DEBUG = False # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SESSION_COOKIE_AGE = 365*24*60*60 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.pos...
{ "content_hash": "5ca1878de8c9c9d0242319a7a9628a95", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 100, "avg_line_length": 30.31896551724138, "alnum_prop": 0.6849587716804094, "repo_name": "leephillips/FOTPweb", "id": "cbca69b7d6f800b820ff7fab58537770e23652c1", "size": ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Team', fields=[ ('id', models.AutoField(auto_create...
{ "content_hash": "94d69a480abc45c0df01c8306362a30e", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 291, "avg_line_length": 44.45161290322581, "alnum_prop": 0.5849056603773585, "repo_name": "neldom/qessera", "id": "147dbb30f7c8eaaf76df813eb330c7422fa04093", "size": "1451"...
""" component_control.py Class instance for control variables shared between components. """ # Load the needed packages from functools import partial from ..core import Variable, Component, QtGui, QtCore, common, componentsList class LinkPlugins(Component): ''' Class instance for control variables shared b...
{ "content_hash": "a9f22bc7111de648d40f2c44d00339f3", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 78, "avg_line_length": 35.34825870646766, "alnum_prop": 0.611118930330753, "repo_name": "jjhelmus/artview", "id": "908d4e8e1648220160cacce7687b354a07318497", "size": "7105...
from sqlalchemy import Column from sqlalchemy import DateTime from sqlalchemy import Index from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import String from sqlalchemy import Table from sqlalchemy import UniqueConstraint def upgrade(migrate_engine): meta = MetaData(bind=migrate_eng...
{ "content_hash": "a61d2ac897c5b4b60017f96f5a23dbbd", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 66, "avg_line_length": 32.956043956043956, "alnum_prop": 0.5985328442814272, "repo_name": "pkilambi/ceilometer", "id": "4f8a4c8af8e822ffdc457de9996002cd3a1c2e89", "size": "...
from flask.ext.testing import TestCase class TestUser(TestCase): def create_app(self): from core import app return app def test_user_password(self): from identity.models.user import User email = 'bob@gmail.com' password = '123' not_password = '321' us...
{ "content_hash": "061d96532521f3a4fd4a71a75b21edfb", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 57, "avg_line_length": 24.157894736842106, "alnum_prop": 0.6339869281045751, "repo_name": "vernikov/distribution", "id": "3c48bf88ea554272789a467608aca3456a1b8bf2", "size":...
''' Internal utility functions and classes for implementing ``bokeh.colors``. ''' #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- from __future__ import absolute_import, division, print_function...
{ "content_hash": "386b7c07b77b616399f9282034e988fa", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 95, "avg_line_length": 30.8, "alnum_prop": 0.41194805194805195, "repo_name": "stonebig/bokeh", "id": "168ae4f83f6c7b5e02e5d5a549e30a6610333d56", "size": "4181", "binary"...
from twisted.internet import defer from twisted.python import failure, util """ """ class Counter(object): num = 0 let = 'a' def incrLet(cls): cls.let = chr(ord(cls.let) + 1) incrLet = classmethod(incrLet) def handleFailure(f): print "errback" print "we got an exception: %s" ...
{ "content_hash": "7039c38dd0ac96d0dacc4217931b03e7", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 57, "avg_line_length": 21.333333333333332, "alnum_prop": 0.5758928571428571, "repo_name": "hortonworks/hortonworks-sandbox", "id": "68f24ab5fa83351b5b79cfeac7f97806fbc839fd",...
import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command # Package meta-data. NAME = 'journal_club' DESCRIPTION = 'Weighted scheme to choose a person to present in a Journal Club' URL = 'https://github.com/philastrophist/journal_club' EMAIL = 'shaun.c.read@gmail.co...
{ "content_hash": "5320ddc27b392e97078f00d18dcb71b5", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 86, "avg_line_length": 30.925233644859812, "alnum_prop": 0.6273798730734361, "repo_name": "philastrophist/journal_club", "id": "f940b4676690221784d533fd3151b694eae211a9", ...
""" Models use to define the database The database is not initiated here, but a pointer is created named db. This is to be passed to the app creator within the Flask blueprint. """ __author__ = 'J. Elliott' __maintainer__ = 'J. Elliott' __copyright__ = 'ADS Copyright 2015' __version__ = '1.0' __email__ = 'ads@cfa.har...
{ "content_hash": "10fd809bc61b8b7e09b16ec75b567aaa", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 80, "avg_line_length": 28.607407407407408, "alnum_prop": 0.6043500776799585, "repo_name": "jonnybazookatone/gut-service", "id": "b44b8f2d903386410519f445df74d860fccfbb24", ...
import os from textgrid import TextGrid, IntervalTier from .textgrid import TextgridParser from ..types.parsing import OrthographyTier from polyglotdb.exceptions import TextGridError from ..helper import find_wav_path, get_n_channels from .base import DiscourseData class FaveParser(TextgridParser): def _is_v...
{ "content_hash": "27ccb9b3396727daecfaa1bad63d8f34", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 100, "avg_line_length": 33.82142857142857, "alnum_prop": 0.5013199577613516, "repo_name": "samihuc/PolyglotDB", "id": "01053a8f6688c7c8ba9465d2fbca89afb44fa8c3", "size": "...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('tags', '0002_tag_author'), ] operations = [ migrations.AddField( model_name='tag', name='slug', field=models.Slu...
{ "content_hash": "1093041de62af8024828f26704ab7126", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 51, "avg_line_length": 20.894736842105264, "alnum_prop": 0.5692695214105793, "repo_name": "giantryansaul/easy_blog_django", "id": "3de0acabef1d7ab27e0f5d974997c64487c93fe6", ...
def extractProphetswordStarmvsCom(item): ''' Parser for 'prophetsword.starmvs.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Lonely Loser', 'Lonely Loser, I’ll Become Blonde Frivolou...
{ "content_hash": "10445b6995d297658c46666a27f33832", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 124, "avg_line_length": 32.476190476190474, "alnum_prop": 0.624633431085044, "repo_name": "fake-name/ReadableWebProxy", "id": "f879d3b843bd386eb3becbb5497d9559523d98c1", "s...