text
stringlengths
4
1.02M
meta
dict
from __future__ import print_function def task(*fn, **kwargs): # decorator without parameters if fn: function = fn[0] function.task_metadata = {} return function # decorator with parameters def wrap(function): function.task_metadata = kwargs return function ...
{ "content_hash": "43b988278e330dbd26e6fe6721978b98", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 70, "avg_line_length": 21.62162162162162, "alnum_prop": 0.6075, "repo_name": "wangpanjun/doit", "id": "205fb81e16489df426fa554f160a8064a546e79b", "size": "800", "binary":...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import talib from pyalgotrade import strategy, plotter from pyalgotrade.broker.backtesting import TradePercentage, Broker from pyalgotrade.broker import Order from pyalgotrade.barfeed import yahoofeed from pyalgotrade.broker.slippage import NoSlipp...
{ "content_hash": "c00e3eb98b84a7bd5d43b518aa9faf16", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 147, "avg_line_length": 37.35906040268456, "alnum_prop": 0.6288511632084793, "repo_name": "Ernestyj/PyStudy", "id": "979517250bd22ade8dc76dab3e76886788290d70", "size": "11...
from setuptools import setup, find_packages import os version = '0.3.2' setup(name='django-moderation', version=version, description="Generic Django objects moderation application", long_description=open("README.rst").read() + "\n" + open(os.path.join("docs", "HISTORY.txt")).r...
{ "content_hash": "53b6f6e9198e3de6b14013246cd4ba4f", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 72, "avg_line_length": 31.636363636363637, "alnum_prop": 0.5823754789272031, "repo_name": "ebrelsford/django-moderation", "id": "ac21d6f0f3d317ec23c9a7155dc4ae7490394b63", ...
'''OpenGL extension EXT.shader_integer_mix This module customises the behaviour of the OpenGL.raw.GL.EXT.shader_integer_mix to provide a more Python-friendly API Overview (from the spec) GLSL 1.30 (and GLSL ES 3.00) expanded the mix() built-in function to operate on a boolean third argument that does not interp...
{ "content_hash": "63d48813965e85266b8c2de0112c6803", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 71, "avg_line_length": 34.46666666666667, "alnum_prop": 0.7823984526112185, "repo_name": "alexus37/AugmentedRealityChess", "id": "c73a95cb3b41f93c436357b2ba406310170ebbd7", ...
import sys import random from birdfish.input.midi import MidiDispatcher from birdfish.input.osc import OSCDispatcher from birdfish.lights import RGBLight, LightShow from birdfish.output.lumos_network import LumosNetwork # create a light show - manages the updating of all lights show = LightShow() # Create a network...
{ "content_hash": "f19c8077b0c874c172a6fb43aa6a663a", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 83, "avg_line_length": 25.85333333333333, "alnum_prop": 0.7106756059824652, "repo_name": "ptone/BirdFish", "id": "9828cbca28bd832409b002cbf7bb5c6c22ecc868", "size": "1939",...
from .expectations import Expectation from .spy import Method, Object from .matchers import Base as MatcherBase, add from .any import Any def expect(actual, *args, **kwargs): return Expectation(actual, *args, **kwargs) def spyOn(target, methodName, **kwargs): originalMethod = getattr(target, methodName, Non...
{ "content_hash": "ea78ca3e4f2257741a15526c79fe62dc", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 70, "avg_line_length": 22.142857142857142, "alnum_prop": 0.7306451612903225, "repo_name": "endeepak/pungi", "id": "14ff094311f125cca23526e1049c1f83b3178870", "size": "620",...
import gzip import click import os from functools import wraps def gzips(file_function): @wraps(file_function) def wrapper(*args, **kwargs): output_file = file_function(*args, **kwargs) if isinstance(output_file, list): for o in output_file: zipup(o) else: ...
{ "content_hash": "24d5e4558bbb5ca17147595aa3b4c520", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 63, "avg_line_length": 25.423076923076923, "alnum_prop": 0.5514372163388804, "repo_name": "biolink/ontobio", "id": "0c57dea2e0ad880fce1091b0fc288c98974b1f56", "size": "1322...
""" mbed SDK Copyright (c) 2016 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so...
{ "content_hash": "d536c4c903abd3e2bbd28fb7af5d4339", "timestamp": "", "source": "github", "line_count": 508, "max_line_length": 185, "avg_line_length": 54.71653543307087, "alnum_prop": 0.6416031083609153, "repo_name": "Neuromancer2701/mbedROS2_STF7", "id": "905bc20b6e4bf6ee34b52c9295feb9735ccc0614", ...
from __future__ import absolute_import from zerver.models import get_client from zerver.lib.actions import check_send_message from zerver.lib.response import json_success, json_error from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view import ujson CODESHIP_SUBJECT_TEMPLATE = '{project_...
{ "content_hash": "f1884c6eee9472d794ca9c07c7b53f11", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 107, "avg_line_length": 33.55769230769231, "alnum_prop": 0.712893982808023, "repo_name": "dwrpayne/zulip", "id": "d706ed1fb2fda85a48eeea73b95f4c62609b464e", "size": "1783",...
from Base import * from Drawing import * from Math import *
{ "content_hash": "de251864a8cba4bd9cdbfcbd1f0abfbc", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 21, "avg_line_length": 20, "alnum_prop": 0.75, "repo_name": "kgn/pygml", "id": "e6cf5010dd0b58ec15b50183b49e28654837f9e3", "size": "60", "binary": false, "copies": "1", ...
from tempest.services.compute.json import hypervisor_client from tempest.tests import fake_auth_provider from tempest.tests.services.compute import base class TestHypervisorClient(base.BaseComputeServiceTest): hypervisor_id = "1" hypervisor_name = "hyper.hostname.com" def setUp(self): super(Test...
{ "content_hash": "41cd51b639f0671070ef7648e2564a7e", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 68, "avg_line_length": 37.3202614379085, "alnum_prop": 0.5709281961471103, "repo_name": "rakeshmi/tempest", "id": "441e7e6348b4e7eaf25b08de2086ddb7791827eb", "size": "6312...
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import models from django.utils.translation import ugettext_lazy as _ if 'countries' not in settings.INSTALLED_APPS: raise ImproperlyConfigured("The address extension requires incuna-countries (http://github.co...
{ "content_hash": "c2ed4c53dce643409ae6ab8fac1223f4", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 184, "avg_line_length": 58.37931034482759, "alnum_prop": 0.6822209096278795, "repo_name": "incuna/django-extensible-profiles", "id": "b4be388fecd613c4127988f035eb5e72b568e59d...
import logging from django.template import defaultfilters as filters from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy from horizon import tables from openstack_dashboard.api import sahara as saharaclient LOG = logging.getLogger(__name__) class NodeGroupTem...
{ "content_hash": "d3b90ee8a1989c2a9b940a959e1bae8e", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 75, "avg_line_length": 32.876288659793815, "alnum_prop": 0.6083411727814362, "repo_name": "yjxtogo/horizon", "id": "cfa7a189122b0b46bc2c01d2a16f4c3bb7019deb", "size": "3735...
import unittest import config import thread_cert from pktverify.consts import MLE_CHILD_ID_RESPONSE, MLE_DATA_RESPONSE, MGMT_PENDING_SET_URI, MGMT_ACTIVE_SET_URI, MGMT_DATASET_CHANGED_URI, COAP_CODE_ACK, ACTIVE_OPERATION_DATASET_TLV, ACTIVE_TIMESTAMP_TLV, PENDING_TIMESTAMP_TLV, NM_CHANNEL_TLV, NM_CHANNEL_MASK_TLV, NM_...
{ "content_hash": "e599dc63f364e0f49dc565ab8e26fc25", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 605, "avg_line_length": 50.914572864321606, "alnum_prop": 0.6607777339123568, "repo_name": "openthread/openthread", "id": "0460f1dc2a5f788b7820af32da75e358524abd02", "size...
from ..azure_common import BaseTest, arm_template, cassette_name from c7n_azure.resources.key_vault import (KeyVaultUpdateAccessPolicyAction, WhiteListFilter, KeyVaultFirewallRulesFilter, KeyVaultFirewallBypassFilter) from c7n_azure.s...
{ "content_hash": "ed81458a31da1c92ea6e3db4e1960b80", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 99, "avg_line_length": 37.779329608938546, "alnum_prop": 0.4978927911275416, "repo_name": "thisisshi/cloud-custodian", "id": "ff6ca89ef0583f67779ea60b2bc7f47accd83b3d", "s...
""" Unit Tests for `pdb_delresname`. """ import os import sys import unittest from config import data_dir from utils import OutputCapture class TestTool(unittest.TestCase): """ Generic class for testing tools. """ def setUp(self): # Dynamically import the module name = 'pdbtools.pdb...
{ "content_hash": "6a2a682b261fd053f8af29058991ce6e", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 82, "avg_line_length": 27.928571428571427, "alnum_prop": 0.5659149035108114, "repo_name": "JoaoRodrigues/pdb-tools", "id": "156ba905d28557292c04782e3a67d90b299c3c8e", "siz...
__author__ = 'richard' import numpy as np from roboskeeter.math import math_toolbox class Flight(): def __init__(self, random_f_strength, stim_f_strength, damping_coeff): self.random_f_strength = random_f_strength self.stim_f_strength = stim_f_strength # TODO: separate surge strength, cast streng...
{ "content_hash": "9c10c9cc9e2124321df38a9725ce0d9e", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 113, "avg_line_length": 30.135593220338983, "alnum_prop": 0.5292463442069741, "repo_name": "isomerase/mozziesniff", "id": "f98be204f03bcfe5f6497a4f18b5966718223a1a", "size...
""" Defines data types and models required specifically for VRF (for IPv6 Flow Specification) support. Represents data structures for VRF not VPN/global. (Inside VRF you have IPv6 Flow Specification prefixes and inside VPN you have VPNV6 Flow Specification prefixes) """ import logging from ryu.lib.packet.bgp imp...
{ "content_hash": "5d4c296b7964bcabee4c8cedf152edfa", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 74, "avg_line_length": 33.2, "alnum_prop": 0.7817938420348058, "repo_name": "lagopus/ryu-lagopus-ext", "id": "17b8ce57f22374f9482b0d97fd82b947dbe50d44", "size": "2107", "...
from .interpreter import start_eval
{ "content_hash": "3f0cfc01c59664a87d6209724548588a", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 35, "avg_line_length": 36, "alnum_prop": 0.8333333333333334, "repo_name": "pdarragh/Viper", "id": "bb276efdf4b8a8f2ae9c901c39fa90dc7f8385db", "size": "36", "binary": false...
from msrest.serialization import Model class AppInsightsReference(Model): """Specifies Azure Application Insights information for performance counters reporting. All required parameters must be populated in order to send to Azure. :param component: Required. Specifies the Azure Application Insights ...
{ "content_hash": "474a46cdcf433c40b538a234d861013b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 128, "avg_line_length": 43.38461538461539, "alnum_prop": 0.7198581560283688, "repo_name": "lmazuel/azure-sdk-for-python", "id": "2ce8077641215e832e4dafaa02b4b6e56e90568e", ...
import logging import os import tempfile from os.path import join import pygame from entrypoint2 import entrypoint from genimg import generate_image from pygame.locals import K_ESCAPE, KEYDOWN log = logging.getLogger(__name__) def fillscreen_pygame(fimage): # DBus org.kde.kwin.Screenshot disappears on Kubuntu 2...
{ "content_hash": "c96bb6a4fd4f264837175a1f9f9cf89d", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 86, "avg_line_length": 30.35593220338983, "alnum_prop": 0.638749302065885, "repo_name": "ponty/pyscreenshot", "id": "b545d8afc2a761edd04b583b1c45de3d3a6405bc", "size": "179...
import ast import falcon import json from oslo_config import cfg import re from stevedore import driver import uuid from kiloeyes.common import es_conn from kiloeyes.common import namespace from kiloeyes.common import resource_api from kiloeyes.openstack.common import log NOTIFICATION_METHOD_OPTS = [ cfg.StrOpt(...
{ "content_hash": "1ed0a663484da1036c96b71f5bc27094", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 77, "avg_line_length": 36.1294964028777, "alnum_prop": 0.5649143767423337, "repo_name": "litong01/python-monasca", "id": "7e58af8d9af4004365d573223a3ffa23c58599ae", "size"...
from django import forms from django.conf import settings from django.utils.translation import ugettext_lazy as _ from django.utils.safestring import mark_safe from satchmo_utils.thumbnail.utils import make_admin_thumbnail class AdminImageWithThumbnailWidget(forms.FileInput): """ A FileField Widget that shows ...
{ "content_hash": "d1b37b95d814d80f9cc39d0a00bce51e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 92, "avg_line_length": 41.73913043478261, "alnum_prop": 0.6416666666666667, "repo_name": "grengojbo/satchmo", "id": "db2ade3dd439425d18e7fa6de43b49f880f04c32", "size": "960...
""" Management class for basic VM operations. """ import os import uuid from nova.api.metadata import base as instance_metadata from nova import exception from nova.openstack.common import cfg from nova.openstack.common import lockutils from nova.openstack.common import log as logging from nova import utils from nova....
{ "content_hash": "a9b9d37548906adca0b9084b651fbee7", "timestamp": "", "source": "github", "line_count": 587, "max_line_length": 79, "avg_line_length": 43.262350936967636, "alnum_prop": 0.5713329395550305, "repo_name": "fajoy/nova", "id": "43c6e6af538b0373cce4ef21e7ea0dbc22c0da65", "size": "26079", ...
__author__ == "ttn6ew" import csv import psycopg2 PG_USER = "postgres" PG_USER_PASS = "cs3240" PG_HOST_INFO = "" def load_course_database(db_name, csv_filename): conn = psycopg2.connect("dbname=" + db_name + " user=" + PG_USER + " password=" + PG_USER_PASS + PG_HOST_INFO) print("** Connected to database.") ...
{ "content_hash": "c9a3eafa255f1bb3d7d690b8c036efaf", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 117, "avg_line_length": 40.23076923076923, "alnum_prop": 0.48565965583174, "repo_name": "ttn6ew/cs3240-labdemo", "id": "c8bb2a532b9a9c848a5af4e3be1fd6149fc48fc6", "size": "...
import numpy, theano, unittest from theano.compile.pfunc import pfunc from theano.compile.sharedvalue import shared from theano import tensor from theano.tensor.nnet import sigmoid class NNet(object): def __init__(self, input=tensor.dvector('input'), target=tensor.dvector('target'), ...
{ "content_hash": "aeeda68cdc9d78c20645855fc8a59c34", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 81, "avg_line_length": 35.35, "alnum_prop": 0.5695426685525695, "repo_name": "rizar/attention-lvcsr", "id": "dbbb23371117d77f98235768307340cdecf7c847", "size": "2121", "b...
"""Network client for reading (and eventually writing) parameters.""" from makani.avionics.common import aio from makani.avionics.common import pack_avionics_messages from makani.avionics.firmware.params import codec SECTION_CONFIG = pack_avionics_messages.kParamSectionConfig SECTION_CALIB = pack_avionics_messages.kP...
{ "content_hash": "e557f543a1c06f4fc60b04cafd498063", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 76, "avg_line_length": 37.36507936507937, "alnum_prop": 0.6856414613423959, "repo_name": "google/makani", "id": "4d190573b05e620cd7d45ef6b66872af3ed82a72", "size": "2943", ...
__author__ = 'piratos' from django import template, templatetags register = template.Library() @register.filter(name='url_it') def url_it(value): return value.replace(' ', '_')
{ "content_hash": "a479d31b0346ec266eccec19965eae25", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 41, "avg_line_length": 25.857142857142858, "alnum_prop": 0.6961325966850829, "repo_name": "piratos/ctfbulletin", "id": "c140a83ae00879ee919b93da2d36d4c3b1c0b526", "size": "1...
from django.conf.urls import patterns, include, url urlpatterns = patterns('', # Examples: url(r'^$', 'catcurator.views.home', name='home'), )
{ "content_hash": "97c03b241efbbeddb496f8ecb36775c5", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 53, "avg_line_length": 25.333333333333332, "alnum_prop": 0.6578947368421053, "repo_name": "momamene/catcurator", "id": "982d956c9f9656e24f184ed0cbc2e2d33a00774f", "size": "1...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import sys ### import evaluation import check_tests as ct import features ### from sklearn.ensemble import GradientBoostingClassifier, RandomForestClassifier from sklearn.metrics import roc_curve, auc train = pd.read_csv('../data/training.csv', in...
{ "content_hash": "245307d13115f0d275fc1cad58e74334", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 79, "avg_line_length": 26.904761904761905, "alnum_prop": 0.7823008849557522, "repo_name": "ZahidP/tasty-physics", "id": "bf9352c311291330805c2167155eb243fa0c7cae", "size": ...
""" ======================= eJWST Dummy Tap Handler ======================= European Space Astronomy Centre (ESAC) European Space Agency (ESA) """ from astropy.table import Table import numpy as np from astroquery.utils.tap.model.job import Job class DummyTapHandler: def __init__(self): self.__invoked...
{ "content_hash": "61abc0aa36f1ab990f13c964516c3341", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 78, "avg_line_length": 39.95564516129032, "alnum_prop": 0.5747300433948935, "repo_name": "imbasimba/astroquery", "id": "d8e940cc7d6894204e246e86ba4a430c795ee365", "size": ...
""" Contains general node and attribute functions, as well as the main `PyNode` base class. For the rest of the class hierarchy, including `DependNode <pymel.core.nodetypes.DependNode>`, `Transform <pymel.core.nodetypes.Transform>`, and `Attribute <pymel.core.nodetypes.Attribute>`, see :mod:`pymel.core.nodetypes`. "...
{ "content_hash": "e0238e481266b2e49b33fecfd38d2bbd", "timestamp": "", "source": "github", "line_count": 6249, "max_line_length": 177, "avg_line_length": 37.46551448231717, "alnum_prop": 0.5622367825321841, "repo_name": "AtonLerin/pymel", "id": "9fe319dfb426fbbe6c9029c3f2d0b3bea0f09b32", "size": "23...
from .templates import (html_template, css_template)
{ "content_hash": "94400ba9f0565b49c0fafc36e2c8cf5f", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 52, "avg_line_length": 53, "alnum_prop": 0.7924528301886793, "repo_name": "lucashtnguyen/wqreports", "id": "448e382c80ea728eab07b1141e36059bce4e60f6", "size": "53", "binar...
import serial import time import platform import csv import threading import zephyr.protocol import zephyr.message def callback(x): print x def reading_thread(protocol): start_time = time.time() while time.time() < start_time + 120: protocol.read_and_handle_byte() ...
{ "content_hash": "f861557538f5280ac89e51116a67861a", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 144, "avg_line_length": 24.3, "alnum_prop": 0.5802469135802469, "repo_name": "jpaalasm/zephyr-bt", "id": "42d932884e2323baab1e285c80bd18e516039194", "size": "1215", "bina...
import unittest from lib.relay import Relay from .dev4testing import Dev class Test_relay(unittest.TestCase): def setUp(self): self.dev = Dev() self.relay = Relay(self.dev) def test_on(self): self.relay.on() self.assertEqual(self.dev.pop(), bytes((85,)) + b'\x01;') def t...
{ "content_hash": "131c0962d3be82f8eb79b3fdaadf69aa", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 65, "avg_line_length": 27.6, "alnum_prop": 0.5610766045548654, "repo_name": "icve/liv-Ard", "id": "01d0aaf54c7c5de3b045ce59399f93f0dd1c3ca7", "size": "966", "binary": fal...
from Board import Board from copy import copy from copy import deepcopy from dfs import dfs_wrapper from BestFirstSolitaire import BestFirstSolitaire class DFSAgent: def __init__(self): self.sol = BestFirstSolitaire() def getPath(self, source = None, isPrint = False): return self.getMoves(sour...
{ "content_hash": "ee6efac873157bac3873f0a7ef735f47", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 74, "avg_line_length": 33, "alnum_prop": 0.5470219435736677, "repo_name": "davidxk/SolitaireBot", "id": "b7d1131fbe80cea78fe9b5d4fd05f1b30a0d686c", "size": "1914", "binar...
import argparse import os import re import shlex import sys from subprocess import run, SubprocessError, DEVNULL, PIPE from tempfile import NamedTemporaryFile DESC = """ A `csmith` fuzzing driver for `bindgen`. Generates random C source files with `csmith` and then passes them to `bindgen` (via `predicate.py`). If `...
{ "content_hash": "149b7a9df475dc6d38a0b75c828e49bd", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 114, "avg_line_length": 27.875886524822697, "alnum_prop": 0.5599796463554255, "repo_name": "emilio/rust-bindgen", "id": "1d3af540fd8adba6d2e02cd0a8511563f5cc0917", "size":...
from .methods import new, new_component, new_pb
{ "content_hash": "188f8baed76ef17800dd35555e4c69e2", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 47, "avg_line_length": 48, "alnum_prop": 0.7708333333333334, "repo_name": "Python-Tools/pmfp", "id": "6f316dba6043af69a4506bd0e496cc4591907723", "size": "48", "binary": fa...
from django.db import models import datetime class Record(models.Model): price = models.DecimalField('the price of ltc', max_digits=6, decimal_places=2) timestamp = models.IntegerField('date of record', db_index=True) count = models.IntegerField('fetch times', default = 0) class Meta: ...
{ "content_hash": "c28f2f91923d483198fc2bd24413775d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 88, "avg_line_length": 34.45454545454545, "alnum_prop": 0.6051011433597185, "repo_name": "yiplee/ltc-huobi", "id": "0e00a2b0e0d8ae717fcb5e2ba3515da708a40052", "size": "1143...
import amo def match_rules(rules, app, action): """ This will match rules found in Group. """ for rule in rules.split(','): rule_app, rule_action = rule.split(':') if rule_app == '*' or rule_app == app: if (rule_action == '*' or rule_action == action ...
{ "content_hash": "d05e678330f6f33026925df7cc2ce452", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 78, "avg_line_length": 35.28865979381443, "alnum_prop": 0.6099912357581069, "repo_name": "ngokevin/zamboni", "id": "2002736e7a642bd84d80b8dc7f8f6f9fe60782e1", "size": "3423...
from setuptools import setup setup(name="ransac", version='0.1', description='Robust method for fitting a model to observed data.', author='Fredrik Appelros, Carl Ekerot', author_email='fredrik.appelros@gmail.com, kalle@implode.se', url='https://github.com/FredrikAppelros/ransac', p...
{ "content_hash": "410d44d697597606d1b36a7e14ba9718", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 72, "avg_line_length": 31.583333333333332, "alnum_prop": 0.6701846965699209, "repo_name": "FredrikAppelros/ransac", "id": "731bdcd79f7ab28a543a1997629be6fc9a6670ef", "size"...
from flask import render_template, redirect, request, url_for, flash from flask.ext.login import login_user, logout_user, login_required, \ current_user from . import auth from .. import db from ..models import User from ..email import send_email from .forms import LoginForm, RegistrationForm, ChangePasswordForm,\ ...
{ "content_hash": "d26ae5c10a59f914e6b3fa6c6ea1a1bc", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 78, "avg_line_length": 39, "alnum_prop": 0.63904052936311, "repo_name": "MozzieChou/FlaskDemo", "id": "b338bf599f182fe9f76b2f496025ea01eb5828d8", "size": "6071", "binary...
import unittest from telemetry.story import expectations from telemetry.testing import fakes class MockState(object): def __init__(self): self.platform = fakes.FakePlatform() class MockStory(object): def __init__(self, name): self._name = name @property def name(self): return self._name clas...
{ "content_hash": "af60fda69f6e7f34d16de12025783856", "timestamp": "", "source": "github", "line_count": 408, "max_line_length": 80, "avg_line_length": 38.43872549019608, "alnum_prop": 0.6444557801441051, "repo_name": "catapult-project/catapult-csm", "id": "41a05f9ded0efe85bc4406898d04620e9b149034", ...
""" ========================================================== Adjustment for chance in clustering performance evaluation ========================================================== The following plots demonstrate the impact of the number of clusters and number of samples on various clustering performance evaluation me...
{ "content_hash": "33e469fea03b70c13844a79e29ee7437", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 78, "avg_line_length": 35.16260162601626, "alnum_prop": 0.67121387283237, "repo_name": "maxlikely/scikit-learn", "id": "ef78b9f6fb06e0daf18ca8c55435fce1523b369e", "size": ...
import os import sys def cur_file_dir(): #获取脚本路径 path = sys.path[0] #判断为脚本文件还是py2exe编译后的文件,如果是脚本文件,则返回的是脚本的目录, #如果是py2exe编译后的文件,则返回的是编译后的文件路径 if os.path.isdir(path): return path elif os.path.isfile(path): return os.path.dirname(path) # 用于生成版本代码的模板 _code_template = os.path.join(...
{ "content_hash": "7f66ea913ba677550fef122a66979a4d", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 83, "avg_line_length": 28.028301886792452, "alnum_prop": 0.6095590710198586, "repo_name": "jiangerji/svn-tools", "id": "f577db97fd52ec019dab9b56c43b861c2468fd2c", "size": ...
import threading import time import serial from PyQt4 import QtCore from tradutor import Tradutor class ReaderThread(QtCore.QThread): def __init__(self, texto, config): QtCore.QThread.__init__(self) #threading.Thread.__init__(self) self.config = config self.texto = texto self.lista = texto.split() self.tr...
{ "content_hash": "9fc1b48cdefaed6732f1c3586adea743", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 111, "avg_line_length": 31.862385321100916, "alnum_prop": 0.6331701698819464, "repo_name": "jimmyskull/Pirarucu", "id": "da44381c974018b114c94fdfbc83160421b6b8b6", "size":...
"""This module is deprecated. Please use `airflow.providers.apache.cassandra.hooks.cassandra`.""" import warnings # pylint: disable=unused-import from airflow.providers.apache.cassandra.hooks.cassandra import CassandraHook # noqa warnings.warn( "This module is deprecated. Please use `airflow.providers.apache.ca...
{ "content_hash": "dafe950b8830ec287481a6e7e338e8df", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 98, "avg_line_length": 35.18181818181818, "alnum_prop": 0.7855297157622739, "repo_name": "Fokko/incubator-airflow", "id": "fb43077fb59442286ca855f25f12a7c2a403b677", "size"...
import random import operator import sys from utils import * # Judjes stallation by elite_fit_mean # `fitness_func` has sense "unfitness_func" while minimizing def minimize_until_stall(fitness_func, stall_precision, max_stalled_in_row, options): initial_population = _initial_population(options) print_the_...
{ "content_hash": "8a621f82619b9310edf924d5355596bf", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 108, "avg_line_length": 33.382165605095544, "alnum_prop": 0.5496088532722763, "repo_name": "fehu/min-dat--lin-regression", "id": "7a82a62f77d5a174dff74ee8f8e095b7e0773429", ...
import os import re import cx_Oracle class OracleHomeError(EnvironmentError): pass class FileNotFoundError(StandardError): pass class SIDNotFound(StandardError): pass class TnsOra(object): TNSNAMES_PATH = '/network/admin/tnsnames.ora' def __init__(self): self.services = {} self....
{ "content_hash": "80a28c341b45eaf2863a50426655e5dc", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 86, "avg_line_length": 26.05925925925926, "alnum_prop": 0.5466173962478681, "repo_name": "mshogin/django-plsql", "id": "c8ef9a9ca185e49fae8f9b666b562036e1dc5c40", "size": ...
import requests, urllib, urllib.request, re import os, sys, time from imgurpython import ImgurClient counter = 0 def getPosts(subreddit, postLimit): url = 'http://www.reddit.com/r/' + subreddit + '/.json?limit=' + str(postLimit) headers = { 'User-Agent': 'Reddit Image Scraper 1.1' } r = requests.get(url, header...
{ "content_hash": "e8da5e6372ad4fcb653b3f5d544cbfc8", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 102, "avg_line_length": 26.754901960784313, "alnum_prop": 0.6625137412971784, "repo_name": "stephencoetzee/personal-scripts", "id": "eb7d5a2f44e1181e16943c2d21f966bf962f98e6...
from django.db import models from django.contrib.auth.models import User from django_mysql.models import JSONField, Model, ListCharField # Create your models here. class UserProfile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True,) dateOfBirth = models.PositiveSmallI...
{ "content_hash": "4d84fe7d1bc12defe2befb539795addb", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 82, "avg_line_length": 37.76190476190476, "alnum_prop": 0.6973518284993695, "repo_name": "ClovisDj/Playconnect4", "id": "345e29e52b8882f20f93d1b1ffb23f4b2bbb4eac", "size": ...
import os import logging import clients import textwrap from persist import JsonObject from telegram.ext import Updater, MessageHandler, CommandHandler, Filters from webpreview import web_preview class TelegramBot(object): def __init__(self, token, reddit): self.chats = JsonObject('chats.json') s...
{ "content_hash": "7ee7d2d8276fc12c164763d96756058b", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 96, "avg_line_length": 35.45918367346939, "alnum_prop": 0.582158273381295, "repo_name": "diegor2/redditbot", "id": "8324a7f20972cf0e9fe10c6dfd470afa2dfc39c7", "size": "3475...
''' Beacon to monitor statistics from ethernet adapters .. versionadded:: 2015.5.0 ''' # Import Python libs from __future__ import absolute_import import logging # Import third party libs # pylint: disable=import-error try: import salt.utils.psutil_compat as psutil HAS_PSUTIL = True except ImportError: H...
{ "content_hash": "4ad5cca8c17c3fd21cc466f50b7ed101", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 96, "avg_line_length": 28.02836879432624, "alnum_prop": 0.5192307692307693, "repo_name": "stephane-martin/salt-debian-packaging", "id": "fb497cc344385116e1d74ad949d4198a461e...
import unittest import random from time import sleep import os from bingmaps import * class BingMapsTestError(Exception): """Bing Maps test exception""" def __init__(self, reason): self.reason = unicode(reason) def __str__(self): return self.reason # TODO: enter your key for testing api...
{ "content_hash": "94eeb404fe7533f81ad8f529c2b9e039", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 78, "avg_line_length": 29.82716049382716, "alnum_prop": 0.5802980132450332, "repo_name": "ckelly/pybingmaps", "id": "40ac4ec777b7bc387be14a996d46bdf5f0da5291", "size": "241...
"""The model definition for scores.""" from django.db import models from django.contrib.auth.models import User from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from apps.managers.cache_mgr import cache_mgr class ScoreSetting(models.Model): """score setti...
{ "content_hash": "597abb7a4497bf7995c1cd60aa2e9894", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 98, "avg_line_length": 35.57142857142857, "alnum_prop": 0.643239625167336, "repo_name": "KendyllD/boukenda-project", "id": "1791aa439719b1ecd122de904d6415d9e4ce1bef", "siz...
from __future__ import unicode_literals from django.db import models from django.utils.translation import gettext_lazy as _ class DummyModel(models.Model): """ Base for test models that sets app_label, so they play nicely. """ class Meta: app_label = "tests" abstract = True class B...
{ "content_hash": "32871b4c0437d72e33ca33b95e39e0ef", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 66, "avg_line_length": 22.136363636363637, "alnum_prop": 0.6406570841889117, "repo_name": "eamigo86/graphene-django-extras", "id": "e46617e2b46c840424d56f55aeb1869d6ccb9db4",...
from __future__ import print_function import MDAnalysis as mda import numpy as np from silicanet import SilicaNetwork if __name__ == '__main__': u = mda.Universe('SiO2_protein_0.17.pdb') ntw = SilicaNetwork(u.select_atoms('resname SIL')) ntw.set_connections(1.7) # generous bond distance between Si and O# ...
{ "content_hash": "9c52aa635e74e9a003e8c270b8526f18", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 112, "avg_line_length": 42.806451612903224, "alnum_prop": 0.6036171816126601, "repo_name": "jmborr/confinedBSA", "id": "b07400015e75d1444ce014155c64f25714d34763", "size": "...
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: fused_conv2d_bias_activation_op.cc """ import collections as _collections import six as _six from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow from tensorflow.python.eager import conte...
{ "content_hash": "b3f4d278df971dac8608d4b4011e56ef", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 863, "avg_line_length": 42.2, "alnum_prop": 0.6340256481739616, "repo_name": "ryfeus/lambda-packs", "id": "c3b19de22e9dbebbccf7469373c05f7ecd175686", "size": "14348", "b...
"""This file provides the opening handshake processor for the WebSocket protocol (RFC 6455). Specification: http://tools.ietf.org/html/rfc6455 """ # Note: request.connection.write is used in this module, even though mod_python # document says that it should be used only in connection handlers. # Unfortunately, we ha...
{ "content_hash": "b7a961d9469206fdf061517dc0da5efe", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 79, "avg_line_length": 36.71345029239766, "alnum_prop": 0.602899012424339, "repo_name": "olinux/twice", "id": "2883acbf856df718547e7fc967b56c264f05e0b6", "size": "14086", ...
if __name__ == '__main__': # {{{1 from scripts import StartConky import sys import argparse from scripts import SystemConkyConf from scripts import InfoConkyConf parser = argparse.ArgumentParser( prog='conky setting script', description='Automatic conky setting creation') p...
{ "content_hash": "542da79a46276adeb8621e857bb6462e", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 55, "avg_line_length": 27.823529411764707, "alnum_prop": 0.5898520084566596, "repo_name": "deresmos/conky-setting", "id": "c9cfd48f3204ca4bef44d8290bed6c55c8fbb39d", "size"...
import errno import filecmp import os import pty import re import socket import subprocess import sys import tempfile import threading import time from io import open XTENSA_ARGS = '--toolchain-prefix xtensa-esp32-elf-' RISCV_ARGS = '--decode-panic backtrace --target esp32c3 --toolchain-prefix riscv32-esp-elf-' test_...
{ "content_hash": "9d5a17b1e6bab45460dafacffca35b1a", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 147, "avg_line_length": 46.92270531400966, "alnum_prop": 0.5707814269535674, "repo_name": "espressif/esp-idf", "id": "ed4523a09834d7e1fa905c8ba7dea6b352157ae2", "size": "9...
""" Read and write SAS XPORT/XPT-format files. """ # Standard Library import functools import json import logging import logging.config import sys # Community Packages import click import yaml # Xport Modules import xport import xport.v56 import xport.v89 __all__ = [ 'cli', ] try: yaml.load = functools.par...
{ "content_hash": "f7234a5a253f25c7c6b6dc345203d654", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 97, "avg_line_length": 26.235294117647058, "alnum_prop": 0.6623318385650224, "repo_name": "selik/xport", "id": "5a97d769e3e545b5e7698d7ce955812031389f78", "size": "2230", ...
import time import fixtures from oslo_config import cfg from tempest.common.utils.linux import remote_client from tempest import config from tempest.lib import exceptions as lib_exc from tempest.tests import base from tempest.tests import fake_config SERVER = { 'id': 'server_uuid', 'name': 'fake_server', ...
{ "content_hash": "a446b071d77ccc67480777858a7a5050", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 79, "avg_line_length": 40.40952380952381, "alnum_prop": 0.6006363422107, "repo_name": "openstack/tempest", "id": "937f93a6fa86183be659f7d98c9bba9e9c419c8c", "size": "9088"...
"""InvenioStats views.""" from elasticsearch.exceptions import NotFoundError from flask import Blueprint, abort, jsonify, request from invenio_rest.views import ContentNegotiatedMethodView from .errors import InvalidRequestInputError, UnknownQueryError from .proxies import current_stats from .utils import current_use...
{ "content_hash": "ffe4c5e8c8f10b7ec3d759255fd4bf62", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 79, "avg_line_length": 34.64705882352941, "alnum_prop": 0.5500848896434635, "repo_name": "inveniosoftware/invenio-stats", "id": "be12bc5c8757d858491d4bdf78ceee7874157185", ...
import glob import os import sys import ah_bootstrap from setuptools import setup #A dirty hack to get around some early import/configurations ambiguities if sys.version_info[0] >= 3: import builtins else: import __builtin__ as builtins builtins._ASTROPY_SETUP_ = True from astropy_helpers.setup_helpers impor...
{ "content_hash": "8409219be006f47a13d6e4e259c35a56", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 79, "avg_line_length": 32.91228070175438, "alnum_prop": 0.7132196162046909, "repo_name": "mikelum/pyspeckit", "id": "51c16f3d140a1b5fff439483970dd76a34306519", "size": "38...
'''OpenGL extension NV.half_float Automatically generated by the get_gl_extensions script, do not edit! ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_NV_half_float' _DEPRECATED = False GL_HALF_FLOAT_NV = constan...
{ "content_hash": "ff0b9b1044668cde9e298027c0df5abf", "timestamp": "", "source": "github", "line_count": 475, "max_line_length": 105, "avg_line_length": 30.934736842105263, "alnum_prop": 0.7786851776235199, "repo_name": "Universal-Model-Converter/UMC3.0a", "id": "0c30778259babbfcff248accd0d43d3e744159...
SITE_URL = 'http://stage.takeyourmeds.co.uk' TWILIO_ENABLED = False
{ "content_hash": "ec1768ba052342d18150a350987ff967", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 44, "avg_line_length": 34, "alnum_prop": 0.7352941176470589, "repo_name": "takeyourmeds/takeyourmeds-web", "id": "46e270147aa03e8d5092d8e2b19e5fe1e085c585", "size": "68", ...
"""List firewalls.""" # :license: MIT, see LICENSE for more details. import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer import utils import click @click.command() @environment.pass_env def cli(env): """List firewalls.""" mgr = SoftLayer.FirewallManage...
{ "content_hash": "de15b2037627ab1e9f7df9231a33fd18", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 75, "avg_line_length": 30.188235294117646, "alnum_prop": 0.5288386593920499, "repo_name": "iftekeriba/softlayer-python", "id": "ff8f7c8e6a6abb36c58d6874ed3ffd510decf8ea", "...
from hvac.api.system_backend.system_backend_mixin import SystemBackendMixin from hvac.exceptions import ParamValidationError class Key(SystemBackendMixin): def read_root_generation_progress(self): """Read the configuration and process of the current root generation attempt. Supported methods: ...
{ "content_hash": "9c684c023c98d05941eff93dc86c7be4", "timestamp": "", "source": "github", "line_count": 407, "max_line_length": 120, "avg_line_length": 39.03931203931204, "alnum_prop": 0.6206180376361005, "repo_name": "ianunruh/hvac", "id": "16b86e785391b0582ed1162ddbb3b14ccd371f63", "size": "15889...
from behave import given, then, when from lastuser_core.models import User @given('we have a new user') def given_new_user(context): context.test_user = { 'fullname': 'Alyssa P Hacker', 'email': 'alyssa@hacker.com', 'password': 'alyssa', 'confirm_password': 'alyssa', } @when...
{ "content_hash": "3b010d2cbc1586afa83906710f253d27", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 74, "avg_line_length": 29.46875, "alnum_prop": 0.6786850477200425, "repo_name": "hasgeek/lastuser", "id": "74bcc842de009742a365f50d7a7363bb1fe9e140", "size": "967", "bina...
from .common import CustomAttribute, UserInfo from .document import Document from .document_service import ( CreateDocumentRequest, DeleteDocumentRequest, GetDocumentRequest, ListDocumentsRequest, ListDocumentsResponse, UpdateDocumentRequest, ) from .import_config import ( BigQuerySource, ...
{ "content_hash": "3e2c4b74b728673c408b1819ebaa42ba", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 78, "avg_line_length": 24.181818181818183, "alnum_prop": 0.7205513784461153, "repo_name": "googleapis/google-cloud-python", "id": "f605d812a34eee43281413e289dec9eec1a38190", ...
from __future__ import print_function import unittest import yaml import os from PyAnalysisTools.base.YAMLHandle import YAMLLoader as YL from PyAnalysisTools.base.YAMLHandle import YAMLDumper as YD from PyAnalysisTools.base import _logger class TestYAMLLoader(unittest.TestCase): def setUp(self): _logger.s...
{ "content_hash": "27a7727dc2b8e929bbad601be0542333", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 102, "avg_line_length": 33.104166666666664, "alnum_prop": 0.6482064191315292, "repo_name": "morgenst/PyAnalysisTools", "id": "5076b8dbd0ac8e3004d988ee7d7763dc2fc37bcb", "si...
from PyObjCTools.TestSupport import * from Foundation import * class TestNSNotificationQueue (TestCase): def testConstants(self): self.assertEqual(NSPostWhenIdle, 1) self.assertEqual(NSPostASAP, 2) self.assertEqual(NSPostNow, 3) self.assertEqual(NSNotificationNoCoalescing, 0) ...
{ "content_hash": "c9690290304baa2fb60e82424f392639", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 61, "avg_line_length": 26.61111111111111, "alnum_prop": 0.7077244258872651, "repo_name": "albertz/music-player", "id": "c431c6d148047c3e3760c1f8592fa0f0829769f0", "size": "...
import math from ds.vortex.core import baseNode from ds.vortex.core import plug as plugs class CosNode(baseNode.BaseNode): def __init__(self, name): """ :param name: str, the name of the node """ baseNode.BaseNode.__init__(self, name) def initialize(self): baseNode.Bas...
{ "content_hash": "5c81db7fe8a2f4d94639784b3d58c4d6", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 85, "avg_line_length": 28.94736842105263, "alnum_prop": 0.6454545454545455, "repo_name": "dsparrow27/vortex", "id": "0c9693ab3caee67dde9a7ecd520274f94434d7ce", "size": "110...
from netmiko.ssh_connection import SSHConnection import paramiko import time import socket import re import io from netmiko.netmiko_globals import MAX_BUFFER from netmiko.ssh_exception import NetMikoTimeoutException, NetMikoAuthenticationException class FortinetSSH(SSHConnection): def session_preparation(self): ...
{ "content_hash": "2101d19684af6237956ab9fbfd1c31e2", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 115, "avg_line_length": 39.52892561983471, "alnum_prop": 0.6203219736567008, "repo_name": "brutus333/netmiko", "id": "af6b1d88a51df999c6383edc65bf6e3078ca3644", "size": "4...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('photo', '0006_auto_20160324_2225'), ] operations = [ migrations.AlterField( model_name='frame', name='index', fi...
{ "content_hash": "3f49bfac8cca12f48cb8567d7290d8ec", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 45, "avg_line_length": 20.5, "alnum_prop": 0.5853658536585366, "repo_name": "rjhelms/photo", "id": "34bdbd01c5abe931afb95e26ebe49179234e9250", "size": "460", "binary": fa...
import numpy as np import re import cnf def parse(dimacs_data: str): lines = dimacs_data.split('\n') line_offset = 0 for line in lines: if line[0] == 'c': line_offset += 1 continue if line[0] == 'p': preamble = line.strip(' ') preamble = r...
{ "content_hash": "fae8ed3a37fdc4610175dd16308b38b6", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 85, "avg_line_length": 32.44444444444444, "alnum_prop": 0.6061643835616438, "repo_name": "camtotheron/genetic-3SAT", "id": "abbe17e80d86565da299b072a98c263c6a3ea9f4", "size...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('produto', '0012_produtoitem'), ] operations = [ migrations.AlterField( model_name='produto', ...
{ "content_hash": "657db040d183182c6c67accff3414c3d", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 157, "avg_line_length": 32.5, "alnum_prop": 0.6358974358974359, "repo_name": "anselmobd/fo2", "id": "29b892f20080397913a0f112f75a15c3f09826e3", "size": "855", "binary": f...
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the Lice...
{ "content_hash": "4f57b43627f01ed79f083f46e1984de6", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 151, "avg_line_length": 41.50666666666667, "alnum_prop": 0.6925795053003534, "repo_name": "andrewhart098/Lean", "id": "9315285fb54eef879a683623f0520c06a6c6cbd2", "size": "3...
import os import re import argparse from typing import Optional from . import blackarrow as ba def main(): args = get_args() processes, final_queue = ba.start_search(args) print_process = processes[-1] try: print_process.join() # Wait main thread until printer is done except (KeyboardInt...
{ "content_hash": "fc69ed2e07d8374c3329869badb4d65a", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 89, "avg_line_length": 24.848484848484848, "alnum_prop": 0.541869918699187, "repo_name": "willzfarmer/black-arrow", "id": "d0798ee4c0b06ed0165023af74de8e38906188d0", "size"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='BookPage', fields=[ ('id', models.AutoField(auto_cr...
{ "content_hash": "604675242466d0ec4102ac1c32e82a26", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 114, "avg_line_length": 27.652173913043477, "alnum_prop": 0.5644654088050315, "repo_name": "Pepedou/Famas", "id": "db77443ee9e825a184c6466d9eb46d12cbf5a7f4", "size": "709",...
from direct.directnotify import DirectNotifyGlobal import AttribDesc from direct.showbase.PythonUtil import mostDerivedLast class EntityTypeDesc: notify = DirectNotifyGlobal.directNotify.newCategory('EntityTypeDesc') output = None def __init__(self): self.__class__.privCompileAttribDescs(self.__cl...
{ "content_hash": "b70c0658fb101f0f249e1485bfd71e61", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 132, "avg_line_length": 34.98823529411764, "alnum_prop": 0.5689307330195024, "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "id": "7642dc0e839f5f6adf0bec033af8194b56d0...
import mock import six from heat.common import exception from heat.common.i18n import _ from heat.common import template_format from heat.engine import resource from heat.engine import rsrc_defn from heat.engine import scheduler from heat.tests import common from heat.tests import utils import testtools from heat_do...
{ "content_hash": "c797ca4f09ce416345fb5fd27a6f4347", "timestamp": "", "source": "github", "line_count": 451, "max_line_length": 79, "avg_line_length": 46.57427937915743, "alnum_prop": 0.618852654129969, "repo_name": "steveb/heat", "id": "136549a380d095ef2f21adc2e830650533ee2d9a", "size": "21639", ...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('app', '0059_weeklytimeslot'), ('app', '0151_set_tenth_level_price'), ] operations = []
{ "content_hash": "6a03e66e1cc61242d1c51fb115326c14", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 46, "avg_line_length": 23, "alnum_prop": 0.6231884057971014, "repo_name": "malaonline/Server", "id": "1c47ffa73bcddaed5833af22acf093de2932f137", "size": "207", "binary": f...
"""KDDCUP 99 dataset. A classic dataset for anomaly detection. The dataset page is available from UCI Machine Learning Repository https://archive.ics.uci.edu/ml/machine-learning-databases/kddcup99-mld/kddcup.data.gz """ import errno from gzip import GzipFile import logging import os from os.path import dirname, ex...
{ "content_hash": "c53105a45596dfa9d0ea8d6c53a8d356", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 98, "avg_line_length": 33.94086021505376, "alnum_prop": 0.5773800095041977, "repo_name": "ndingwall/scikit-learn", "id": "e5c8bb2f298ded7e6d779825ec0d32449cdf5b76", "size"...
"""Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob def JoinPath(*args): return os.path.normpath(os.path.join(*args)) class VisualStudioVersion(object): """Information regarding a version of Visual Studio.""" def __in...
{ "content_hash": "4ccc71c7999c3c8a928ff49a68edda6f", "timestamp": "", "source": "github", "line_count": 501, "max_line_length": 80, "avg_line_length": 39.12375249500998, "alnum_prop": 0.549206673128922, "repo_name": "turbulenz/gyp", "id": "49f8b135072ec5541ec3e7f2c272c7cd4185a11c", "size": "19758",...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "a16265b2ba985d6daa2323dc1ef932f6", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 303, "avg_line_length": 27.04237288135593, "alnum_prop": 0.7011386190326961, "repo_name": "benfinke/ns_python", "id": "b46c28a261c3f45b1cd46990e271553d4f963b00", "size": "...
''' Float Layout ============ :class:`FloatLayout` honors the :attr:`~kivy.uix.widget.Widget.pos_hint` and the :attr:`~kivy.uix.widget.Widget.size_hint` properties of its children. .. only:: html .. image:: images/floatlayout.gif :align: right .. only:: latex .. image:: images/floatlayout.png ...
{ "content_hash": "67eb3936e5a6c859a70b470672df94f3", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 79, "avg_line_length": 31.554054054054053, "alnum_prop": 0.5066381156316917, "repo_name": "inclement/kivy", "id": "86145e01663fe995288b9ec7de8ed132a1e867f2", "size": "4670...
import json from cryptography.fernet import InvalidToken from django.test.utils import override_settings from django.conf import settings import pytest from awx.main import models from awx.conf.models import Setting from awx.main.management.commands import regenerate_secret_key from awx.main.utils.encryption import e...
{ "content_hash": "9197e14930d0582b1e7612758e3462c3", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 99, "avg_line_length": 37.9080459770115, "alnum_prop": 0.6247725894481504, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "d27b4329cdf84f2bc5a6471960490...
"""Example for aiohttp.web basic server """ import asyncio import textwrap from aiohttp.web import Application, Response, StreamResponse def intro(request): txt = textwrap.dedent("""\ Type {url}/hello/John {url}/simple or {url}/change_body in browser url bar """).format(url='127.0.0.1:8080')...
{ "content_hash": "2e910c4a7d2e4aec05619250911b3d6f", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 67, "avg_line_length": 26.296875, "alnum_prop": 0.6660724896019014, "repo_name": "decentfox/aiohttp", "id": "78876e4a8538ed8f4015dbf213548fb42d623fa3", "size": "1706", "b...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "099ebb71109eeac82fe14955ebba6a04", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 345, "avg_line_length": 33.00787401574803, "alnum_prop": 0.7180343511450382, "repo_name": "atopuzov/nitro-python", "id": "ec273c90d86a591412ea9a94dcfd70d0bf313ef8", "size"...
"""Operations for BEL graphs.""" from typing import Iterable import networkx as nx from tqdm.autonotebook import tqdm from .utils import update_metadata from ..dsl import BaseEntity __all__ = [ "subgraph", "left_full_join", "left_outer_join", "union", "left_node_intersection_join", "node_int...
{ "content_hash": "ea12fb5f2f350adb678f166f47517da7", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 111, "avg_line_length": 25.274509803921568, "alnum_prop": 0.6144297905352987, "repo_name": "pybel/pybel", "id": "cecafedc550282be810666f54582d464a69745aa", "size": "5181",...
"""Implement the hil-admin command.""" from hil import config, model, deferred, server, migrations, rest from hil.commands import db from hil.commands.migrate_ipmi_info import MigrateIpmiInfo from hil.commands.util import ensure_not_root from hil.flaskapp import app from time import sleep from flask_script import Manag...
{ "content_hash": "4d94658463506148b13c5b5ee6164fb5", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 34.71304347826087, "alnum_prop": 0.6290080160320641, "repo_name": "CCI-MOC/haas", "id": "75073ee8ce0d52c7499b513bad5d08423c555b9d", "size": "3992", ...
import errno import os from unittest import mock import ddt from oslo_concurrency import processutils as putils from oslo_utils import imageutils from oslo_utils import units from cinder import context from cinder import exception from cinder.image import image_utils from cinder.tests.unit import fake_constants as fa...
{ "content_hash": "0ea7550e0eb396ba40bb52e2f2269a3a", "timestamp": "", "source": "github", "line_count": 448, "max_line_length": 78, "avg_line_length": 37.832589285714285, "alnum_prop": 0.5882942946486518, "repo_name": "openstack/cinder", "id": "79a80b246b8735995689a9c9fcb9551b9153a6b0", "size": "17...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_stoos_olko.iff" result.attribute_template_id = 9 result.stfName("npc_name","sullustan_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "b38f2a5b903011b273b24222204b231a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 64, "avg_line_length": 23.23076923076923, "alnum_prop": 0.695364238410596, "repo_name": "anhstudios/swganh", "id": "631b4b10dcf38842b0fa2e09ccda8f544504ec64", "size": "447"...
from subprocess import Popen, PIPE import json import os import re import sys config = dict() if os.path.isfile('/usr/lib/simple-vmcontrol/config.json'): config = json.loads(open('/usr/lib/simple-vmcontrol/config.json', 'r').read()) datadisklocation = '/srv/vm/' if 'datadisklocation' in config: datadisklocati...
{ "content_hash": "1ad3e33defb6d6ae8b68047d248fa00b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 89, "avg_line_length": 30.53846153846154, "alnum_prop": 0.7052896725440806, "repo_name": "allanrbo/simple-vmcontrol", "id": "7da9979cbf74baea9325832de7f78a391e8d1016", "siz...
"""Distributed placement strategies.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import contextlib from absl import logging from adanet import tf_compat from adanet.distributed.devices import _OpNameHashStrategy import numpy as np import ...
{ "content_hash": "18f52cb3750a9fbd58d7a9a354e192f7", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 124, "avg_line_length": 38.925081433224754, "alnum_prop": 0.7061924686192469, "repo_name": "tensorflow/adanet", "id": "88b6726c2d989860d22b46c6052282c4c31afc58", "size": "...
from setuptools import setup, find_packages setup(name='jstestnet', version='0.1', description="""JS TestNet is a Django_ web service that coordinates the execution of JavaScript tests across web browsers.""", long_description="", author='Kumar McMillan', author_email...
{ "content_hash": "28458d404410bc880c8e057b0a99f1da", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 77, "avg_line_length": 36.333333333333336, "alnum_prop": 0.6256880733944954, "repo_name": "kumar303/jstestnet", "id": "30efce283dc53c25276cb477bd686120e67af833", "size": "5...
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core...
{ "content_hash": "68a21feaa242768c1fcf024647b8a809", "timestamp": "", "source": "github", "line_count": 1368, "max_line_length": 198, "avg_line_length": 48.15423976608187, "alnum_prop": 0.641381404174573, "repo_name": "Azure/azure-sdk-for-python", "id": "66ec55fbec264746397bc3c7f605b140a6b51890", "...
from partial.validate.validator import Validator class ParseBool(Validator): """ Parse the value, using parser.parseInt """ def transform(self, value): return value not in ("false", "False", "0")
{ "content_hash": "18236a9c27076654e059b374d3276994", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 51, "avg_line_length": 22.6, "alnum_prop": 0.6460176991150443, "repo_name": "RentennaDev/partial", "id": "735f8354750519a34a3dd194a6d4e8eb35e5fcf2", "size": "226", "binar...