text
stringlengths
4
1.02M
meta
dict
from __future__ import print_function, division import sys import os sys.path.append(os.path.abspath(".")) sys.dont_write_bytecode = True # from datasets.albrecht import Albrecht # from datasets.china import China # from datasets.desharnais import Desharnais # from datasets.finnish import Finnish # from datasets.isbsg...
{ "content_hash": "6cf0400e7ef3c4888179ca00004d8938", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 118, "avg_line_length": 39.016460905349795, "alnum_prop": 0.6246176563653623, "repo_name": "dr-bigfatnoob/effort", "id": "6bb2bdf62d0f2daa61236372311d65af9bdc6cd3", "size"...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import sys import dataset import logging import importlib from . import config from . import helpers logger = logging.getLogger(__name__) # Module API def cli(argv): ...
{ "content_hash": "f79b6aa9d533eac58f866e5a0e2f1b07", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 72, "avg_line_length": 21.4375, "alnum_prop": 0.6793002915451894, "repo_name": "opentrials/scraper", "id": "f6a5f8010f8e86f96746f57d3a34f0b9326650e8", "size": "710", "bin...
from __future__ import unicode_literals from datetime import datetime from django.conf import settings from django.http import HttpResponse, Http404 from django.views.decorators.csrf import csrf_exempt from functools import update_wrapper from pycon.pycon_api.exceptions import AuthenticationError from pycon.pycon_api.m...
{ "content_hash": "570e62e2acd56272878ead0001fe89e2", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 71, "avg_line_length": 34.1948051948052, "alnum_prop": 0.5685529813900494, "repo_name": "alex/pycon", "id": "ff2120b9c4c09db1c6c87a4ad6792d97dd623c5f", "size": "2633", "b...
def disable_for_loaddata(signal_function): """ This is a decorator that will disable signals that should not be run on loaddata """ def wrapped_signal(**kwargs): if kwargs.get('raw'): return else: return signal_function(**kwargs) return wrapped_signal
{ "content_hash": "86b8ee98b4471fa95d613853b3c6a8ae", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 49, "avg_line_length": 28.727272727272727, "alnum_prop": 0.6075949367088608, "repo_name": "PFWhite/qipr_approver", "id": "cf4d18f8acda58689c44fe3b59cc213ad1775230", "size":...
import xml.sax import base64 import time import boto import boto.utils import urllib from boto.connection import AWSQueryConnection from boto import handler from boto.resultset import ResultSet from boto.rds.dbinstance import DBInstance from boto.rds.dbsecuritygroup import DBSecurityGroup from boto.rds.parametergroup i...
{ "content_hash": "f95a13426725d795d5be3bbb02547332", "timestamp": "", "source": "github", "line_count": 791, "max_line_length": 90, "avg_line_length": 43.29962073324905, "alnum_prop": 0.5538102189781022, "repo_name": "linkedin/indextank-service", "id": "92b7199e631826262bebecc43677689e95c2a0e8", "s...
import traceback from oslo_concurrency import processutils from oslo_config import cfg from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import fileutils from oslo_utils import timeutils import taskflow.engines from taskflow.patterns import linear_flow from taskflow.types import failu...
{ "content_hash": "bdc5021f8a40bb40e66843444cc663a1", "timestamp": "", "source": "github", "line_count": 1167, "max_line_length": 79, "avg_line_length": 45.59982862039417, "alnum_prop": 0.5501644273231232, "repo_name": "Datera/cinder", "id": "010309fb5b567bed1fe024350a444b34dc89d05f", "size": "53788...
"""Support for the Netatmo devices.""" import logging from datetime import timedelta from urllib.error import HTTPError import voluptuous as vol from homeassistant.const import ( CONF_API_KEY, CONF_PASSWORD, CONF_USERNAME, CONF_DISCOVERY, CONF_URL, EVENT_HOMEASSISTANT_STOP, ) from homeassistan...
{ "content_hash": "84fb3c96550943c22aa1a6888aec9809", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 88, "avg_line_length": 33.47727272727273, "alnum_prop": 0.6408689748811949, "repo_name": "fbradyirl/home-assistant", "id": "28d422557da3f36f54da3d0c0c4cd301b8749a2b", "siz...
import os from robot.libraries.BuiltIn import BuiltIn from robot.api import logger from keywordgroup import KeywordGroup class _LoggingKeywords(KeywordGroup): # Private def _debug(self, message): logger.debug(message) def _get_log_dir(self): variables = BuiltIn().get_var...
{ "content_hash": "6d0dbd48ebbdfcd0d727d49c1a81b1a5", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 86, "avg_line_length": 28.23404255319149, "alnum_prop": 0.5410700828937453, "repo_name": "minhnguyenphuonghoang/robotframework-appiumlibrary", "id": "a146122b646e8fa6a9a142c3...
""" Example demonstrating the picking of line objects. """ import numpy as np from bokeh.models import ColumnDataSource, CustomJS, TapTool from bokeh.plotting import figure, show t = np.linspace(0, 0.1, 100) source = ColumnDataSource(data=dict(text=['No line selected'], text_color=['black'])) p = figure(width=600,...
{ "content_hash": "95b31803f9d238c2ee5bfc4c16d01c0c", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 85, "avg_line_length": 30.5, "alnum_prop": 0.6460945033751205, "repo_name": "bokeh/bokeh", "id": "8d53985cb8b356bfd84e1a709d1d656ccb2816ba", "size": "1037", "binary": fal...
""" Command Line Interface Module """ import optparse import sys import os import yaml import re import json import hashlib from pymongo import MongoClient from outbit.restapi import routes from outbit.plugins import builtins from outbit.exceptions import DecryptWrongKeyException, DecryptNotClearTextException, DecryptE...
{ "content_hash": "a6c4230fe59559cc5d52daba588cd59f", "timestamp": "", "source": "github", "line_count": 662, "max_line_length": 203, "avg_line_length": 42.383685800604226, "alnum_prop": 0.5539240145413072, "repo_name": "starboarder2001/outbit", "id": "c19e56e9128cdb0efff8fd90d632020a1a4bd669", "siz...
from unittest.mock import ANY, call from boxsdk.config import API def test_automatic_refresh( box_client, mock_box_network, generic_successful_response, successful_token_mock, unauthorized_response, ): mock_box_network.session.request.side_effect = [ unauthorized_re...
{ "content_hash": "399de23bb2524df1714ab53e29446406", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 110, "avg_line_length": 27.925, "alnum_prop": 0.5335720680393913, "repo_name": "box/box-python-sdk", "id": "0117419da1aecc62d104dd3250d31c22e00079a1", "size": "1117", "bi...
class Settings: """ Contains basic settings for SLAMon Agent Fleet Manager """ port = 8080 # Port for the server database_name = 'slamon' # Name of the psql database database_user = 'afm' # Username to use for psql connection database_password = 'changeme' # Password to use for psql con...
{ "content_hash": "23f42fd8a5bdd4a26995e644f4e091c0", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 107, "avg_line_length": 37.94444444444444, "alnum_prop": 0.6954612005856515, "repo_name": "StealthyLoner/SLAMon", "id": "815618104cd886ff8584e7113d99faad7cd0077e", "size": ...
"""Grid-based simulation of lateral erosion by channels in a drainage network. Benjamin Campforts """ import numpy as np from landlab import Component, RasterModelGrid from landlab.grid.nodestatus import NodeStatus from landlab.utils.return_array import return_array_at_node from ..depression_finder.lake_mapper impo...
{ "content_hash": "bfc79bff239f68eb6371aa41f183dd2c", "timestamp": "", "source": "github", "line_count": 561, "max_line_length": 153, "avg_line_length": 35.948306595365416, "alnum_prop": 0.554966033619279, "repo_name": "landlab/landlab", "id": "925e1fb39e02e6ba1ba51ba54656403024575c84", "size": "201...
from crosscompute.exceptions import DataTypeError from crosscompute.types import DataType from pytest import raises class ADataType(DataType): @classmethod def load(Class, path): if path == 'x': raise Exception instance = Class() instance.path = path return instanc...
{ "content_hash": "789b0d0884d770da77e47f040c8773b6", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 53, "avg_line_length": 24.215384615384615, "alnum_prop": 0.5952986022871665, "repo_name": "crosscompute/crosscompute", "id": "691aeb4d0652ece923e253308ec9214b7b3fe258", "si...
import math import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import warnings from math import nan from .ctrlutil import unwrap from .bdalg import feedback from .margins import stability_margins from .exception import ControlMIMONotImplemented from .statesp import StateSpace from .xferfcn im...
{ "content_hash": "72633be98ef34752919fbd7ebba21b86", "timestamp": "", "source": "github", "line_count": 1717, "max_line_length": 80, "avg_line_length": 40.77577169481654, "alnum_prop": 0.5531337485002571, "repo_name": "murrayrm/python-control", "id": "05ae9da55fb6f33ef013cd05f645ff2166488729", "siz...
''' Created by auto_sdk on 2015.09.11 ''' from top.api.base import RestApi class OpenimTribeQuitRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.tribe_id = None self.user = None def getapiname(self): return 'taobao.openim.tribe.quit'...
{ "content_hash": "981cd5db7fd0f7391c4e77cb36f3badd", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 55, "avg_line_length": 26.833333333333332, "alnum_prop": 0.6832298136645962, "repo_name": "Akagi201/pycsc", "id": "73e623e8faf318e48c6f3c7e0bfc4342bd31a0ab", "size": "322",...
import pyglet from pyglet.window import BaseWindow, WindowException from pyglet.window import MouseCursor, DefaultMouseCursor from pyglet.event import EventDispatcher from pyglet.canvas.cocoa import CocoaCanvas from pyglet.libs.darwin.cocoapy import * from .systemcursor import SystemCursor from .pyglet_delegate impo...
{ "content_hash": "7e9f8f76ba510e6b8c01c7b31759dd40", "timestamp": "", "source": "github", "line_count": 579, "max_line_length": 99, "avg_line_length": 40.46804835924007, "alnum_prop": 0.6095770560368742, "repo_name": "bitcraft/pyglet", "id": "3d9342a9261218c892c50932130a673d7628931c", "size": "2514...
""" pygments.formatters.rtf ~~~~~~~~~~~~~~~~~~~~~~~ A formatter that generates RTF files. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.formatter import Formatter from pygments.util import get_int_opt, _surrogatepair ...
{ "content_hash": "2ffb8ac8f2d64088cbb50ba1122dc1f5", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 81, "avg_line_length": 34.38356164383562, "alnum_prop": 0.5135458167330678, "repo_name": "spencerlyon2/pygments", "id": "abecd4847b0024863481d3a31332de8fe3d58f9a", "size":...
import os from glob import glob from utils import * # Return all images of one slice of a brain (seperated) def get_img_row(overall_img, img_size, i): from_ = i * img_size to = from_ + img_size img_row = overall_img[from_:to] return np.array(np.split(img_row, 10, axis=1)) # Output array has the shape...
{ "content_hash": "5244a61b551d8d8bb21700349d02f97f", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 91, "avg_line_length": 37.56818181818182, "alnum_prop": 0.64670296430732, "repo_name": "ultra-lstm/RNA-GAN", "id": "c7fc62c3cbdbe59759cfad4522a142b3bc8a26dd", "size": "1653...
sum_of_answered_yes = 0 with open("input.txt", "r") as f: lines = [line.rstrip() for line in f.readlines()] answered_yes_group = [] for line in lines: #print(line) if line == "": sum_of_answered_yes += len(set(answered_yes_group)) answered_yes_group = [] ...
{ "content_hash": "3e0593fa881778be826564b3b1749fcc", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 66, "avg_line_length": 29.42105263157895, "alnum_prop": 0.5778175313059034, "repo_name": "neiesc/Problem-solving", "id": "d31cb22a56fc949a332e3eb055ac17bcbaa6e6cc", "size":...
from ducktape.mark import matrix from ducktape.mark.resource import cluster from kafkatest.tests.kafka_test import KafkaTest from kafkatest.services.kafka import quorum from kafkatest.services.streams import StreamsSmokeTestShutdownDeadlockService class StreamsShutdownDeadlockTest(KafkaTest): """ Simple test ...
{ "content_hash": "a29699bd77cf4e05a163e0b70574040c", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 105, "avg_line_length": 32.285714285714285, "alnum_prop": 0.6938053097345133, "repo_name": "apache/kafka", "id": "3da5b481da9ffbe18ad11dfc13a0b91c336457ba", "size": "1911",...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('login', '0017_remove_userprofile_theme'), ('news_event', '0007_auto_20160730_1343'), ] operations = [ migrations.AddField( model...
{ "content_hash": "15e968a13e5433a590675f2b3d7b5801", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 71, "avg_line_length": 23.842105263157894, "alnum_prop": 0.5960264900662252, "repo_name": "BuildmLearn/University-Campus-Portal-UCP", "id": "e909e84a3d8dd5a4911a7d3ed7b99d3ec...
import json import time import telnetlib from fabric.api import * from fabric.colors import * from fabric.contrib.console import * from fabric.contrib.files import * import config cm_conn = None class Output: def __init__(self): self.cm = True def init(): for i in range(3): if connect() == Tr...
{ "content_hash": "c6b57f49ee40c64e18dbee6cbaf3208f", "timestamp": "", "source": "github", "line_count": 296, "max_line_length": 93, "avg_line_length": 27.945945945945947, "alnum_prop": 0.5530705996131529, "repo_name": "otheng03/nbase-arc", "id": "94f95b668fa71c231e198bedb578452d29d08540", "size": "...
""" Connect dialog for entering the url, username, password of the WebDAV Server. """ from PyQt4 import QtCore from PyQt4.QtGui import QDialog from datafinder.gui.gen.user.authentification_connect_dialog_ui import Ui_AuthConnectDialog from datafinder.gui.user.dialogs.authentification_dialog.auth_pref_...
{ "content_hash": "ae3f1e67b9dbd9fbffd058bba539cb0b", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 115, "avg_line_length": 34.016304347826086, "alnum_prop": 0.6341268573254514, "repo_name": "DLR-SC/DataFinder", "id": "d75677088e9bfe95c86b3bbf9de72b7b4071d0b7", "size": "...
from django.contrib import messages from django.core.urlresolvers import reverse_lazy, reverse from django.http import JsonResponse from django.views.generic import View from django.views.generic.edit import CreateView, UpdateView, DeleteView from django.views.generic.detail import DetailView import requests from djang...
{ "content_hash": "ddd4558131ac5a5a193f8f9458a9e9d4", "timestamp": "", "source": "github", "line_count": 703, "max_line_length": 131, "avg_line_length": 38.02560455192034, "alnum_prop": 0.5860017956007781, "repo_name": "ahharu/plugin-manager", "id": "911c4dcf16b7914d1d4884c79e29d989b459bef3", "size"...
""" FIZZ BUZZ. CHALLENGE DESCRIPTION: Players generally sit in a circle. The first player says the number “1”, and each player says next number in turn. However, any number divisible by X (for example, three) is replaced by the word fizz, and any divisible by Y (for example, five) by the word buzz. Numbers divisible b...
{ "content_hash": "6f402e54316ec55bb736a3ef800e13f3", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 78, "avg_line_length": 32.296875, "alnum_prop": 0.6686018384131591, "repo_name": "kirillmorozov/CodeEval", "id": "58f732491085936a8db25dcaafe92d1478e8c587", "size": "2128",...
#!/usr/bin/env python3 # python setup.py sdist --format=zip,gztar from setuptools import setup import os import sys import platform import imp import argparse with open('contrib/requirements/requirements.txt') as f: requirements = f.read().splitlines() with open('contrib/requirements/requirements-hw.txt') as f:...
{ "content_hash": "ea97ca9a5e2b51744b7d491737413087", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 95, "avg_line_length": 31.53846153846154, "alnum_prop": 0.6097560975609756, "repo_name": "romanz/electrum", "id": "63581a614106543095b845b5d2dce4df97145102", "size": "2870"...
formatter = "%r %r %r %r" print formatter % (1, 2, 3, 4) print formatter % ("one", "two", "three", "four") print formatter % (True, False, False, True) print formatter % (formatter, formatter, formatter, formatter) print formatter % ( "I had this thing.", "That you could type up right.", # The ...
{ "content_hash": "c105708e47d2e97b1064dec91d008d10", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 154, "avg_line_length": 41.44186046511628, "alnum_prop": 0.7048260381593715, "repo_name": "jaredmanning/learning", "id": "a62408b2b5f4b1958dd196cf2c251260d2efc5ba", "size":...
from django.conf import settings from django.core.files.storage import Storage from django.core.files.base import ContentFile import azure_util from azure_util.storage import * from datetime import datetime import os, mimetypes class AzureStorage(Storage): def __init__(self, container=None): self.blob_se...
{ "content_hash": "9bbc181fffe58458108ecc5ff93fc539", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 159, "avg_line_length": 36.515625, "alnum_prop": 0.6534017971758665, "repo_name": "fergalmoran/dss", "id": "2f2a4b36d3b5111a21c08c5133123ee1f0e3cb2f", "size": "2337", "bi...
"""Package contenant les commandes du module commerce.""" import primaires.commerce.commandes.acheter import primaires.commerce.commandes.info import primaires.commerce.commandes.lister import primaires.commerce.commandes.questeur import primaires.commerce.commandes.vendre
{ "content_hash": "313609f52a22c5050335c84375a87e39", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 57, "avg_line_length": 39.285714285714285, "alnum_prop": 0.8545454545454545, "repo_name": "vlegoff/tsunami", "id": "abc049eef12ebdd5fac985250f14fc2028c6ceb8", "size": "1842"...
import time import logging import json import inspect import random from . import config from .proto import Protocol from .chain.message import * from threading import Thread from threading import Lock from werkzeug.wrappers import Request, Response from werkzeug.serving import run_simple from jsonrpc import JSONRPCR...
{ "content_hash": "fce519e5680bddfa4b48971d78744f0d", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 119, "avg_line_length": 32.163120567375884, "alnum_prop": 0.6809261300992282, "repo_name": "contractvm/contractvmd", "id": "3ce7369ff77f88d26fa2b0eb30c3458e5811968d", "siz...
import subprocess import sys def main(args): if '--local' in args: args = [a for a in args if a != '--local'] else: subprocess.check_call("docker pull ffig/ffig-base".split()) subprocess.check_call("docker build -t ffig_local .".split()) subprocess.check_call(['docker', ...
{ "content_hash": "c7d0af591d66f6c6c072166a904149a1", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 79, "avg_line_length": 29.05, "alnum_prop": 0.4509466437177281, "repo_name": "jbcoe/C_API_generation", "id": "f0b31dfd98ae13bc7bd35ecf99c3745499e98321", "size": "603", "b...
"""Package providing discourse segmenter for BitPar constituency trees. Attributes: align (module): auxiliary routines for doing string alignment constants (module): constants specific to that package constituency_tree (module): proxy class for handling constituency syntax trees b...
{ "content_hash": "8210db684030abba48777cbf2e317811", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 40.29032258064516, "alnum_prop": 0.6052842273819056, "repo_name": "discourse-lab/DiscourseSegmenter", "id": "69954a7d99ef4c54253e6ae867848625a9a7ec98",...
""" Support for ComEd Hourly Pricing data. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.comed_hourly_pricing/ """ from datetime import timedelta import logging import voluptuous as vol from requests import RequestException, get import homeassi...
{ "content_hash": "20ccff26c384a414609ad274bb49593b", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 78, "avg_line_length": 32.24545454545454, "alnum_prop": 0.6458979419227516, "repo_name": "morphis/home-assistant", "id": "30948fada8fd182295a4d1d0bab809d472623a3b", "size"...
""" search_backend.py .. moduleauthor:: Shaun O'Keefe <shaun.okeefe@versi.edu.au> """ # # Note: We're pulling this straight out of the solr_backend module. # ideally we should be pulling it out of the backend module, # but we're already cheating with the highlightSearchBackend. # This is a definite TODO once the s...
{ "content_hash": "f9511e59083e0fdace2c1c4e0c95e330", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 68, "avg_line_length": 26.043478260869566, "alnum_prop": 0.7128547579298832, "repo_name": "iiman/mytardis", "id": "03875b6cb59aef3603185a0f1a9705bb621ac02b", "size": "2350"...
"""Support for a switch using a 433MHz module via GPIO on a Raspberry Pi.""" import importlib import logging from threading import RLock import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.const import ( CONF_NAME, CONF_PROTOCOL, CONF_SWITC...
{ "content_hash": "c23b9ce91db8d39bda9326d97c8bbbb0", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 84, "avg_line_length": 29.18840579710145, "alnum_prop": 0.6117179741807348, "repo_name": "turbokongen/home-assistant", "id": "4ac7283b1942d036653eb220b0563f5f4db72ab1", "s...
import numpy import opengm from opengm import learning import vigra from progressbar import * import glob import os from functools import partial from opengm.learning import secondOrderImageDataset, getPbar,superpixelDataset #i = numpy.ones([7, 5]) # #print posiFeatures(i).shape # # where is the dataset stored dse...
{ "content_hash": "88038ca5a1c547826339fe42e1e694af", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 98, "avg_line_length": 24.368932038834952, "alnum_prop": 0.6402390438247012, "repo_name": "chaubold/opengm", "id": "1d1579b4a8b7b1dcc4e0d6fe95644cbc3e0c5499", "size": "502...
import proto from utils import str_to_bytes def print_verbose(security_ctx, data): if (security_ctx.verbose): print(f'\x1b[32;20m++++ {data} ++++\x1b[0m') def scan_start_request(security_ctx, blocking=True, passive=False, group_channels=5, period_ms=120): # Form protobuf request packet for ScanStart...
{ "content_hash": "815d4419881ec600ffeb3190a238afa4", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 105, "avg_line_length": 46.01162790697674, "alnum_prop": 0.6805660854182461, "repo_name": "espressif/esp-idf", "id": "8d48cc23d318b4f0fa12ccf5998aa59b9381465b", "size": "41...
import re import sys from Bio.Seq import Seq import pandas as pd import pybedtools as pbt import pysam from general import parse_region def get_region_nt_counts(region, bam, stranded=False): """ Get counts of each nucleotide from a bam file for a given region. If R1 and R2 reads both overlap a position, ...
{ "content_hash": "a9db63d0cf47c11be50bdb3f9b82c03a", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 80, "avg_line_length": 36.056338028169016, "alnum_prop": 0.5985677083333333, "repo_name": "cdeboever3/cdpybio", "id": "1871565e4cd8f3061c8b35a79fbd9118ba67a31e", "size": "...
import os import six import unittest import numpy import chainer from chainer import testing from chainer.training import extensions class TestVariableStatisticsPlot(unittest.TestCase): def setUp(self): stop_trigger = (2, 'iteration') extension_trigger = (1, 'iteration') self.file_name ...
{ "content_hash": "e88edb4bf0bbb44998ecbbd1e18d0e66", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 77, "avg_line_length": 33.49484536082474, "alnum_prop": 0.6512773160972607, "repo_name": "aonotas/chainer", "id": "9ae05f23cd332ffe6a2ec4a0136ce2bbdd485dcc", "size": "3249"...
import json import os class SiteSettings: def __init__(self): config_file = '%s/../ldap.json' % os.path.dirname(os.path.realpath(__file__)) with open(config_file) as data_file: self.config = json.load(data_file) def get_ldap_url(self): return self.config.get('ldap_url') ...
{ "content_hash": "f59d66a985e5b6c6b338afee217ba5fc", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 85, "avg_line_length": 25.272727272727273, "alnum_prop": 0.6061151079136691, "repo_name": "ishgroup/lightbook", "id": "4e31c1f2cfa4ff0be3adbe8c1c675daeb6333398", "size": "5...
from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/structure/dantooine/shared_dant_large_communal_dest.iff" result.attribute_template_id = -1 result.stfName("obj_n","unknown_object") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "dee356c5158ea775e71f3e534b469daa", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 90, "avg_line_length": 24.53846153846154, "alnum_prop": 0.7021943573667712, "repo_name": "obi-two/Rebelion", "id": "602117513e9d0695c8047b4dcc009c9494256406", "size": "464"...
from setuptools import setup, find_packages setup( name='dallasdata_crime', version='0.1', author='Peter Griess', author_email='pg@std.in', package_dir={'': 'src'}, packages=['dallasdata.crime'], install_requires=[ 'postgres', 'pyproj', ], )
{ "content_hash": "6408e65eadd19afa751fc8eb2e77ac8e", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 43, "avg_line_length": 20.785714285714285, "alnum_prop": 0.584192439862543, "repo_name": "dallasdata/crime", "id": "5036704bdc090bfa2285d59f2fb2e7864a556432", "size": "1407...
import csv as Csv import math as python_lib_Math import math as Math import functools as python_lib_Functools import inspect as python_lib_Inspect from io import StringIO as python_lib_io_StringIO class _hx_AnonObject: def __init__(self, fields): self.__dict__ = fields class Enum: _hx_class_name = "Enum" _hx_f...
{ "content_hash": "2b18a9a2da88f3087bd84a4ecdec29ee", "timestamp": "", "source": "github", "line_count": 713, "max_line_length": 301, "avg_line_length": 26.220196353436187, "alnum_prop": 0.60994918427387, "repo_name": "ustutz/dataquest", "id": "f1d5598ca2656e2506db8e24eee034c3239746d5", "size": "186...
import os import json import datetime import pprint import math API_KEY = "0f60efd9302d38f88380c6a4608bd9be" dir_weather = "../dataset/weather" file_business = "../dataset/yelp_academic_dataset_business.json" file_users = "../dataset/yelp_academic_dataset_user.json" file_reviews = "../dataset/yelp_academic_datase...
{ "content_hash": "a497162a785a8d64f7d2b698b8bfaf7a", "timestamp": "", "source": "github", "line_count": 427, "max_line_length": 288, "avg_line_length": 25.875878220140514, "alnum_prop": 0.6194225721784777, "repo_name": "jordansilva/lorien", "id": "2fcb4efec7cb5d8aa6461a64c01e251a1e0cc30f", "size": ...
from __future__ import division import sys import random import pygame import numpy as np from StimControl.LightStim.Core import DefaultScreen from StimControl.LightStim.LightData import dictattr from StimControl.LightStim.SweepSeque import TimingSeque from StimControl.LightStim.FrameControl import FrameSweep from Sti...
{ "content_hash": "12752bfb421779980c60205cc6c49984", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 90, "avg_line_length": 33.45679012345679, "alnum_prop": 0.7022140221402214, "repo_name": "chrox/RealTimeElectrophy", "id": "32c28291f2164fb5386ce9dd59fea9964ef0e983", "size...
from __future__ import absolute_import import mock from orquesta import statuses as wf_statuses import st2tests # XXX: actionsensor import depends on config being setup. import st2tests.config as tests_config tests_config.parse_args() from tests.unit import base from st2common.bootstrap import actionsregistrar f...
{ "content_hash": "43beca8a982f43cad64048efa43bfec0", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 88, "avg_line_length": 33.06488549618321, "alnum_prop": 0.5846704374927854, "repo_name": "nzlosh/st2", "id": "b325839c9d8440fc4d2392a7b72951dcdfb20cb9", "size": "9291", ...
from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from dlux.dashboards.network.layer3.staticroutes import views urlpatterns = patterns( '', url(r'^create$', views.CreateStaticRouteView.as_view(), name='create'), )
{ "content_hash": "d70ec44090eeac73f3d8dda41639174d", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 75, "avg_line_length": 26.2, "alnum_prop": 0.732824427480916, "repo_name": "ekarlso/dlux-horizon", "id": "9e4f5e9029a77ba80ea6aa2f305a443e63f719ff", "size": "917", "binar...
""" acos-submit is a custom directive that behaves almost identically to the normal submit directive. It is intended for exercises that are hosted outside the MOOC grader, such as the ACOS server. The directive option url should define the URL path of the exercise in the ACOS server. The URL domain is added automatical...
{ "content_hash": "d9859ae9a60414467c32e07b14a5ee6d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 96, "avg_line_length": 46.303030303030305, "alnum_prop": 0.693717277486911, "repo_name": "Aalto-LeTech/a-plus-rst-tools", "id": "4f14415446729cb735aa25b790ae0aad9a36cb76", ...
"""Base class for all hypervisors The syntax for the _CHECK variables and the contents of the PARAMETERS dict is the same, see the docstring for L{BaseHypervisor.PARAMETERS}. @var _FILE_CHECK: stub for file checks, without the required flag @var _DIR_CHECK: stub for directory checks, without the required flag @var RE...
{ "content_hash": "736f701c71eb1ffc629af8cb9c6a5e02", "timestamp": "", "source": "github", "line_count": 753, "max_line_length": 80, "avg_line_length": 32.83665338645418, "alnum_prop": 0.6714794143816226, "repo_name": "dimara/ganeti", "id": "8aaa06245bb5feca336c8e742fdad7dcf7046c7a", "size": "26104"...
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 model 'Attachment' db.create_table(u'attachment_attachment', ( (u'id', self....
{ "content_hash": "e73f17746a55006125fc65873808d043", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 195, "avg_line_length": 68.25510204081633, "alnum_prop": 0.5890267603528181, "repo_name": "lettoosoft/lettoo-weixin-platform-back", "id": "ec3779a82e2f6d3c2b64456cab2c92b5ac6...
from django.test import LiveServerTestCase from django.test import TestCase from selenium import webdriver from selenium.webdriver.common.keys import Keys # Create your tests here. class SignupTestCase(LiveServerTestCase): def setUp(self): self.selenium = webdriver.Firefox(executable_path='/opt/firefox-ge...
{ "content_hash": "dc86052135e8b76ba5ef186c4eb47f78", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 97, "avg_line_length": 38.49152542372882, "alnum_prop": 0.6393659180977543, "repo_name": "kantanand/insmartapps", "id": "0a32905e09376ef00d1a3aee431b0310220d1b4a", "size": ...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 12, transform = "Integration", sigma = 0.0, exog_count = 20, ar_order = 12);
{ "content_hash": "7be37aaa5ba8e8751876c03aae07c34f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 172, "avg_line_length": 38.857142857142854, "alnum_prop": 0.7132352941176471, "repo_name": "antoinecarme/pyaf", "id": "db0714be74944d213453a5f43ba8f3e75c4432d1", "size": "27...
import logging from luigi import six import luigi.target logger = logging.getLogger('luigi-interface') class CascadingClient(object): """ A FilesystemClient that will cascade failing function calls through a list of clients. Which clients are used are specified at time of construction. """ # ...
{ "content_hash": "c86b057c8549d9b61e089b347f11ed97", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 114, "avg_line_length": 37.56666666666667, "alnum_prop": 0.5488021295474712, "repo_name": "Houzz/luigi", "id": "a85068a97ac77128bc8751cbf6668f9128cc4d90", "size": "2858", ...
import pytest from dvc.fs.base import FileSystem, RemoteMissingDepsError @pytest.mark.parametrize( "pkg, msg", [ (None, "Please report this bug to"), ("pip", "pip install"), ("conda", "conda install"), ], ) def test_missing_deps(pkg, msg, mocker): requires = {"missing": "missi...
{ "content_hash": "9ab8b6875c36248dffbab6ef1c50d9d7", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 58, "avg_line_length": 26.63157894736842, "alnum_prop": 0.6403162055335968, "repo_name": "efiop/dvc", "id": "8d35654bf1026275441e50f1a05c2a07ac0226e6", "size": "506", "bi...
""" Author: Peter Zujko (@zujko) Lukas Yelle (@lxy5611) Desc: Implements channels routing for the whole pawprints app. """ from channels.routing import ProtocolTypeRouter, URLRouter from channels.auth import AuthMiddlewareStack import petitions.routing application = ProtocolTypeRouter({ 'websocket': AuthMi...
{ "content_hash": "b3040014b98cb8555252e306d1dbd718", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 62, "avg_line_length": 26.625, "alnum_prop": 0.7206572769953051, "repo_name": "ritstudentgovernment/PawPrints", "id": "64113caad0f484d20b25b0a8725abcdec1427da0", "size": "4...
""" sphinx.builders.linkcheck ~~~~~~~~~~~~~~~~~~~~~~~~~ The CheckExternalLinksBuilder class. :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import sys import Queue import socket import threading from os import path from urlli...
{ "content_hash": "b13c5bf204c132b6a427e39e96c20bec", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 80, "avg_line_length": 33.34705882352941, "alnum_prop": 0.5284882695360734, "repo_name": "neumerance/deploy", "id": "ad15b55deae2d7bee3b8ecc3d12c0f08f0f0db58", "size": "56...
from setuptools import setup, find_packages import os here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() NEWS = open(os.path.join(here, 'NEWS.txt')).read() version = '0.1' install_requires = [] setup(name='eventually', version=version, description="...
{ "content_hash": "70527f256cd4c81291a43a22b01daf93", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 54, "avg_line_length": 26.441176470588236, "alnum_prop": 0.6017797552836485, "repo_name": "eventbrite/eventually", "id": "759dc175711e0253965c409a54223141af9b6486", "size":...
import warnings from cloudify_rest_client.responses import ListResponse class Node(dict): """ Cloudify node. """ @property def id(self): """ :return: The identifier of the node. """ return self.get('id') @property def deployment_id(self): """ ...
{ "content_hash": "e26a9a9e5ee18467ebadae44e67fead2", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 78, "avg_line_length": 27.971291866028707, "alnum_prop": 0.5417379404721177, "repo_name": "cloudify-cosmo/cloudify-rest-client", "id": "a16b271670ffef2269d41d44a7f8de852f278...
class AuthenticationError(Exception): """Generic OAuth2 authentication error. Attributes: message (dict) - parsed JSON response status_code (int) - HTTP code returned response (requests.Response) - response from Google Args: response (requests.Response) - response from Goog...
{ "content_hash": "8d6bf282195148282a138a99bf7d7c94", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 59, "avg_line_length": 32.333333333333336, "alnum_prop": 0.6494845360824743, "repo_name": "miedzinski/google-oauth", "id": "f172a8dd03622c027ca7183347e170dad1fbe51a", "size...
from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """ Test file created by XlsxWriter against a file created by Excel. """ def setUp(self): self.maxDiff = None filename = 'image07.xlsx' ...
{ "content_hash": "686239e3a6f7892b4c7011b538c2f596", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 74, "avg_line_length": 28.10810810810811, "alnum_prop": 0.6317307692307692, "repo_name": "jkyeung/XlsxWriter", "id": "9bf8580c1021819e6f4aafac7e6a0f136f2e9688", "size": "12...
from __future__ import division, print_function, absolute_import import pytest import numpy as np from numpy.testing import TestCase, assert_array_equal import scipy.sparse as sps from scipy.optimize._constraints import ( Bounds, LinearConstraint, NonlinearConstraint, PreparedConstraint, new_bounds_to_old, old_...
{ "content_hash": "c92bcc663000fa0319dc868e90822817", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 77, "avg_line_length": 37.621212121212125, "alnum_prop": 0.5386629077728554, "repo_name": "gfyoung/scipy", "id": "78b5637691073339321d0cb679947c7e6b67dc6a", "size": "4966"...
""" The MIT License (MIT) Copyright (c) 2015 Mat Leonard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, ...
{ "content_hash": "df15a8666823cc900305d8fc6c2107b8", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 103, "avg_line_length": 37.3125, "alnum_prop": 0.5988274706867671, "repo_name": "leupibr/BombDefusal", "id": "a6c347fbe67d170e06be1fc9ce45c9249aaed4ef", "size": "5970", ...
from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import django_extensions.db.fields class Migration(migrations.Migration): dependencies = [ ('cbh_chembl_model_extension', '0021_auto_20150721_0551'), ] operations = [ migrations...
{ "content_hash": "1bb4d302a5a5057d6da24ba2c7db301e", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 109, "avg_line_length": 39.73809523809524, "alnum_prop": 0.5644098262432594, "repo_name": "strets123/cbh_chembl_model_extension", "id": "5a92ee320c4bb71462e43609aafa590cd7fc0...
import sys def input_process(in_question): return input(in_question) if sys.version_info >= (3,0) else raw_input(in_question) if __name__ == '__main__': answer = str(input_process('Is the car silent when you turn the key? ')) if answer.upper() == 'Y': answer = str(input_process('Are the battery te...
{ "content_hash": "f02cc4e43b6bf4bbb241bef551158dd7", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 86, "avg_line_length": 43.08108108108108, "alnum_prop": 0.5043914680050188, "repo_name": "kssim/efp", "id": "c9a141b452b7d5aeb125e78a02e26bea4ee4e15e", "size": "1936", "b...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0009_auto_20150113_1311'), ] operations = [ migrations.AlterField( model_name='apirequest', name='meta', ...
{ "content_hash": "ac73080a754d124ce68a16e2120c839b", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 58, "avg_line_length": 22.05263157894737, "alnum_prop": 0.5871121718377088, "repo_name": "CMU-Robotics-Club/roboticsclub.org", "id": "804601410afbf484c2d913e9c72bf7dcd213d89f...
import cPickle from collections import defaultdict from helpers import functions as helpers from view import View import pandas as pd import copy class Chain(defaultdict): """ Container class that holds ordered Link defintions and associated Views. The Chain object is a subclassed dict of list ...
{ "content_hash": "5beb43e30c8a51139026c80eb7221053", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 144, "avg_line_length": 37.22175732217573, "alnum_prop": 0.5061825539568345, "repo_name": "Quantipy/quantipy", "id": "fb354e6abeb75e347b92381b397c5a586e24be60", "size": "8...
from django.utils import timezone TASK_ID_PREFIX = "cla_backend.notifications.task.notifications" def get_update_client_times(instance): times = [] now = timezone.now() task_id = "%s-%s" % (TASK_ID_PREFIX, instance.pk) times.append({}) if instance.start_time > now: times.append({"eta": i...
{ "content_hash": "da18869204e4f0ef6a34aa15f62fb2a4", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 83, "avg_line_length": 29.391304347826086, "alnum_prop": 0.665680473372781, "repo_name": "ministryofjustice/cla_backend", "id": "a9e736977b50098f693d1cca792944247dac2e97", ...
from __future__ import absolute_import # Generated by Django 1.9 on 2016-05-14 20:30 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('podcasts', '0019_podcastepisode_flair_tip_jar'), ] operations = [ ...
{ "content_hash": "946c6a1bc2d941ee67ffc13b07471ddd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 76, "avg_line_length": 25.15, "alnum_prop": 0.6361829025844931, "repo_name": "AlmostBetterNetwork/podmaster-host", "id": "8380b8f264e44d8fedfb21a41f9f823faab5b913", "size":...
""" p2p-streams (c) 2014 enen92 fightnight This file contains web utilities Classes: download_tools() -> Contains a downloader, a extraction function and a remove function Functions: get_page_source -> Get a webpage source code through urllib2 mechanize_browser(url) -> Get...
{ "content_hash": "dd9e27dfca7da46a2c8a3a056b40e700", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 362, "avg_line_length": 33.98095238095238, "alnum_prop": 0.6519058295964125, "repo_name": "aplicatii-romanesti/allinclusive-kodi-pi", "id": "4ecea0759f4e1e42984ee84385546d00...
from chartforge import dynamic_chart @dynamic_chart() class ExampleChart: """ Example line chart. """ template_name = 'example_line_chart.json' def get_data(self): return {'bvah': 1} @dynamic_chart('CustomChartName', template_name='example_line_chart.json') def my_chart(chart): prin...
{ "content_hash": "c09ec9e38544aa65e33b20e3a15080f6", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 20.61111111111111, "alnum_prop": 0.6442048517520216, "repo_name": "featherweightweb/django-chartforge", "id": "b28e9f5f37fb114efb34f823951a612da27f2cf9...
class mysql(object): def __init__(self, host, user, passwd, db): import pymysql self.con = pymysql.connect(host=host,user=user,password=passwd,database=db) self.x = self.con.cursor(pymysql.cursors.DictCursor) def close(self): self.x.close() self.con.close() def...
{ "content_hash": "c5c398ad18d04db837ac64fd639eb8ac", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 83, "avg_line_length": 24.19672131147541, "alnum_prop": 0.5650406504065041, "repo_name": "xcs491/PythonPlugs", "id": "75f3086a5bfe401252e481689b93d38f787159dd", "size": "14...
from . import memory_usage_calc from .memory_usage_calc import * from . import op_frequence from .op_frequence import * from . import quantize from .quantize import * from . import slim from . import extend_optimizer from .extend_optimizer import * from . import model_stat from .model_stat import * from . import mixed_...
{ "content_hash": "2b3a6c911206697c803be7f19281ae30", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 36, "avg_line_length": 25.4, "alnum_prop": 0.6797900262467191, "repo_name": "PaddlePaddle/Paddle", "id": "2860d414d0a5bd4bb212c0ee56b82033eb34f498", "size": "1440", "bina...
""" Copyright 2013 yuki akiyama (you2197901 at gmail.com) 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 applic...
{ "content_hash": "cf0479b7970f9658a46553ee5f9b1b97", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 146, "avg_line_length": 30.982758620689655, "alnum_prop": 0.6521981079577073, "repo_name": "you21979/mysql_batch", "id": "6e95872c0920d14430f731a56f1e7c13da21d9d7", "size":...
import webapp2 import handler from blog import NewPost, MainPage, SinglePost URL_BASE = "/assignment-3/blog" URL_MAIN = URL_BASE + "/?" URL_SINGLE_POST = URL_BASE + "/(\d+)" URL_NEWPOST = "/assignment-3/blog/newpost" config = { 'jinja_env' : handler.setup_jinja('assignment-3'), 'url_base' : URL_BASE, 'ur...
{ "content_hash": "1b8145714f573fecc882e0b56ff361e1", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 54, "avg_line_length": 23.857142857142858, "alnum_prop": 0.6606786427145709, "repo_name": "bikush/udacity-web-development", "id": "b26455e80f445791e929a4b753e8e9b0a1da3af9", ...
import logging from hailtop.utils import secret_alnum_string log = logging.getLogger('batch.spec_writer') class SpecWriter: byteorder = 'little' signed = False bytes_per_offset = 8 @staticmethod def get_index_file_offsets(job_id, start_job_id): assert job_id >= start_job_id idx_...
{ "content_hash": "4753291b4b68f2ddd6c6c7da55a10a97", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 129, "avg_line_length": 36.43076923076923, "alnum_prop": 0.6351351351351351, "repo_name": "cseed/hail", "id": "dd4a5abf2a7c023da950faf6cbfa6b08771f91db", "size": "2368", ...
''' Describes enumerated variable types for use in the server ''' # STANDARD PYTHON IMPORTS # PYTHON LIBRARIES # USER LIBRARIES # GLOBAL VARIABLES # CLASSES # FUNCTIONS def enum(*sequential, **named): ''' Enables the use of enumerated types in python. Returns an Enum() type, the lookup of which returns entries...
{ "content_hash": "2736495027b77df36085ebeb85534b32", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 76, "avg_line_length": 24.419354838709676, "alnum_prop": 0.6882430647291942, "repo_name": "plus44/hcr-2016", "id": "1b28a9df27495392a5093fc15fcd8a26cee153ba", "size": "776"...
import datetime import json import logging import os from unidecode import unidecode logger = logging.getLogger(__name__) def check_parliament_members_at_date(check_date): filepath = './data/secret/parliament_members_check.json' if not os.path.exists(filepath): logger.error('file ' + filepath + ' do...
{ "content_hash": "95daf5bde96ccf70d1daa60ebef86da7", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 111, "avg_line_length": 41.03076923076923, "alnum_prop": 0.6134233220847394, "repo_name": "openkamer/openkamer", "id": "100840c92ad85a4fd7dd90406a4dc804c5949f93", "size": "...
data = '../data/fm_train_real.dat' parameter_list = [[data]] def converter_isomap (data_fname): from shogun import CSVFile from shogun import Isomap features = sg.features(CSVFile(data)) converter = Isomap() converter.set_k(20) converter.set_target_dim(1) converter.transform(features) return features if ...
{ "content_hash": "04cb8644de0f351797e1636221075b02", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 38, "avg_line_length": 19.95, "alnum_prop": 0.706766917293233, "repo_name": "karlnapf/shogun", "id": "82a31d63b466ee32715a46d78a30a40b3d4e71c4", "size": "421", "binary": ...
"""Meta checkout manager supporting both Subversion and GIT.""" # Files # .gclient : Current client configuration, written by 'config' command. # Format is a Python script defining 'solutions', a list whose # entries each are maps binding the strings "name" and "url" # ...
{ "content_hash": "ad275dc8cd9d74ac03183ddbca28f18b", "timestamp": "", "source": "github", "line_count": 2061, "max_line_length": 80, "avg_line_length": 39.30228044638525, "alnum_prop": 0.6245648255598627, "repo_name": "Chilledheart/depot_tools", "id": "b60884a0c2742bd55b43f01ddc5e5380af216bff", "si...
import json import os import errno import re import subprocess import time import urllib2 import urlparse import cherrypy import autoupdate_lib import common_util import log_util # Module-local log function. def _Log(message, *args): return log_util.LogWithTag('UPDATE', message, *args) UPDATE_FILE = 'update.gz'...
{ "content_hash": "d69cea69ed3844ed12f050288578a03d", "timestamp": "", "source": "github", "line_count": 768, "max_line_length": 87, "avg_line_length": 37.053385416666664, "alnum_prop": 0.6498576800084338, "repo_name": "coreos/dev-util", "id": "3f060b3f1d0ee0243377181603d450726663e285", "size": "286...
from __future__ import absolute_import import json import logging import logging.config import os import shutil from celery import Celery import boto from boto.s3.connection import S3Connection import pika import requests import time from retrying import retry BASE_DIR = os.path.dirname(os.path.dirname(__file__)) T...
{ "content_hash": "478add0096589e98d1a33a677eef4e64", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 101, "avg_line_length": 34.973214285714285, "alnum_prop": 0.6413071227980598, "repo_name": "arvindkandhare/mosaicme", "id": "af8aeb2adf626e3c333a489b4bd9a2a9edb0de65", "si...
"""Import files from an NXP MCUXpresso SDK archive into Zephyr The MCUXpresso SDK provides device header files and peripheral drivers for NXP Kinetis, LPC, and i.MX SoCs. Zephyr drivers for these SoCs are shims that adapt MCUXpresso SDK APIs to Zephyr APIs. This script automates updating Zephyr to a newer version of ...
{ "content_hash": "1ecb61b403b2ce0178651e7e04c31abf", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 86, "avg_line_length": 33.214285714285715, "alnum_prop": 0.6413978494623656, "repo_name": "explora26/zephyr", "id": "5029991808d106ebab827ec7f6c98c0a6e100106", "size": "38...
"""Implentation of Brocade Neutron Plugin.""" from oslo.config import cfg from neutron.agent import securitygroups_rpc as sg_rpc from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api from neutron.common import rpc as q_rpc from neutron.common import ...
{ "content_hash": "d5956c92c9eafda555b5937c140c771c", "timestamp": "", "source": "github", "line_count": 453, "max_line_length": 79, "avg_line_length": 40.18763796909492, "alnum_prop": 0.5555616588849217, "repo_name": "ykaneko/neutron", "id": "137fb979eef714af656de1c6d088acc3af9da034", "size": "1908...
from platypus.server import routes, app from platypus.server.models import db def run(port, debug, local): db.create_all() routes.add_routes() app.run(host='127.0.0.1' if local else '0.0.0.0', port=port, debug=debug) def show_routes(): max_length = max([len(k) for k in routes.routes.keys()]) + 5 ...
{ "content_hash": "2338ebe9c762ddc9c1fbf46ee6aa9a2a", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 84, "avg_line_length": 29.933333333333334, "alnum_prop": 0.643652561247216, "repo_name": "devraccoon/platypus", "id": "1067aa040f4da91c9ae4ad659407aa74fc0fc41b", "size": "4...
from distutils.core import setup setup(name='carnival', version='1.0.0', author='Elben Shira', author_email='elbenshira@gmail.com', url='http://elbenshira.com', description='Expert Search on Code Repositories.', packages=['carnival'], )
{ "content_hash": "2b14e523467ef8456102bc7775bc5980", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 56, "avg_line_length": 23.5, "alnum_prop": 0.6276595744680851, "repo_name": "elben/carnival", "id": "e0954d10942da12aae411d3747a36deb569db603", "size": "282", "binary": f...
import os import sys import asciichart # ----------------------------------------------------------------------------- this_folder = os.path.dirname(os.path.abspath(__file__)) root_folder = os.path.dirname(os.path.dirname(this_folder)) sys.path.append(root_folder + '/python') sys.path.append(this_folder) # ---------...
{ "content_hash": "757a42cf6f976d42b091efe314cc3159", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 90, "avg_line_length": 28.717391304347824, "alnum_prop": 0.5352006056018168, "repo_name": "tritoanst/ccxt", "id": "a4c28b6344c59c341beabc1d04f64d66c3041052", "size": "1348"...
from event import * from pygame.locals import * from model import * import pygame from pprint import pprint class CPUTickController: def __init__(self, evtmgr): self.evtmgr = evtmgr self.keep_going = True self.clock = pygame.time.Clock() def notify(self, event): if isinstance(e...
{ "content_hash": "10ad62560fe72e0cce6de5f42beb8cd6", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 95, "avg_line_length": 33.15384615384615, "alnum_prop": 0.5001288992008249, "repo_name": "WishCow/gemgem", "id": "bc00e879b88025a90d3c1423260ba07f34c5fffb", "size": "3879"...
from django.forms import ChoiceField, Field, Form, Select from django.test import SimpleTestCase class BasicFieldsTests(SimpleTestCase): def test_field_sets_widget_is_required(self): self.assertTrue(Field(required=True).widget.is_required) self.assertFalse(Field(required=False).widget.is_required...
{ "content_hash": "b351de3675e5b91377403a9d09bc9cb9", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 73, "avg_line_length": 35.42857142857143, "alnum_prop": 0.6149193548387096, "repo_name": "cloudera/hue", "id": "67c3003393940f0fc0c5413ec6831b02de2dd64c", "size": "1488", ...
try: import asyncio except ImportError: # Trollius >= 0.3 was renamed import trollius as asyncio from os import environ import datetime from autobahn.asyncio.wamp import ApplicationSession, ApplicationRunner class Component(ApplicationSession): """ A simple time service application component. ...
{ "content_hash": "4fb5fed154545b94ae5163cfc6e918bd", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 71, "avg_line_length": 23.314285714285713, "alnum_prop": 0.6446078431372549, "repo_name": "RyanHope/AutobahnPython", "id": "d587ff24f760135d67e8d9b74ef42c0bb633bba1", "size...
__all__ = ["config", "pageserver", "restful", "heart"] import config import pageserver import restful import heart def run(host, port, ns_host, ns_port, name): """ Runs the server. @param host The host for the server @param port The port for the server """ hb = heart.Heart(name, host, por...
{ "content_hash": "0414337aefb8531b7be318425ad09220", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 77, "avg_line_length": 20.11111111111111, "alnum_prop": 0.5874769797421732, "repo_name": "wallarelvo/SmallCartography", "id": "16ff04de0beda3a11cadc1391ee08f005e4cc7e1", "s...
''' ''' from ambry.bundle import BuildBundle import csv import datetime class Bundle(BuildBundle): ''' ''' def __init__(self,directory=None): self.super_ = super(Bundle, self) self.super_.__init__(directory) self.part_cache = {} def generate_incidents(self, p): ...
{ "content_hash": "e59aa51c71a52bad1e3468ceb38a68b5", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 84, "avg_line_length": 25.257731958762886, "alnum_prop": 0.4816326530612245, "repo_name": "sdrdl/sdrdl-ambry-bundles", "id": "c4b854edd15243a86e6b162d689ab4048af13522", "si...
import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) # -- Hack for ReadTheDocs ...
{ "content_hash": "7f7fcab6383de3eb1c169df0953df102", "timestamp": "", "source": "github", "line_count": 239, "max_line_length": 85, "avg_line_length": 35.27196652719665, "alnum_prop": 0.6892052194543298, "repo_name": "mc-hammertimeseries/cs207project", "id": "9141c1834bfe7e1521273a75e140776fd26223bf"...
import sys import os import os.path from flask import Flask, send_file, Response sys.path[0:0] = [""] from pyclosuretempaltes.javascript_backend import compileToJS app = Flask(__name__) TEST_JS_DIR = os.path.join(os.path.dirname(os.path.join(os.getcwd(), __file__)), 'js/') @app.route('/') def mainPage(): retu...
{ "content_hash": "362a9fb8028778e6496b58a79ef16a77", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 88, "avg_line_length": 25.633333333333333, "alnum_prop": 0.6488946684005201, "repo_name": "archimag/python-closure-templates", "id": "c2a5b0ddea58b3b2a9e934328863b4b248f0ca3c...
""" A Printer for generating executable code. The most important function here is srepr (that is an exact equivalent of builtin repr, except for optional arguments) that returns a string so that the relation eval(srepr(expr))=expr holds in an appropriate environment. """ from __future__ import annotations import typ...
{ "content_hash": "c01a0b8a332b175d73b44dd9c34d1478", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 115, "avg_line_length": 34.717948717948715, "alnum_prop": 0.5425406203840473, "repo_name": "diofant/diofant", "id": "7bc4b40f1525851325241246b5954994c3484465", "size": "67...
from libnmap.process import NmapProcess from libnmap.parser import NmapParser, NmapParserException # start a new nmap scan on localhost with some specific options def do_scan(targets, options): nm = NmapProcess(targets, options) rc = nm.run() if rc != 0: print("nmap scan failed: {0}".format(nm.std...
{ "content_hash": "1efa22fee80273a2a6b73c5687cbc258", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 71, "avg_line_length": 30.076923076923077, "alnum_prop": 0.5607416879795396, "repo_name": "pyphrb/myweb", "id": "5399b666fccf369655b273a2a004d923c8b167b6", "size": "1586", ...
''' Sample usage of function 'topology'. Print the function's documentation. Apply the function to the network. Print the function output. ''' from __future__ import print_function as _print_function from basics.topology import topology from pydoc import plain from pydoc import render_doc as doc from basi...
{ "content_hash": "6618aadd884b764add062b44568509eb", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 106, "avg_line_length": 28.61764705882353, "alnum_prop": 0.6834532374100719, "repo_name": "tbarrongh/cosc-learning-labs", "id": "1729ba1b10acc7893c8e8746f91185d31460d5cd", ...
import os import argparse import subprocess import re __paceconfigs = {} common_props = ['checker_tool', 'scratchpad_dir', 'debug_level', 'ignore_ioctl', 'ignore_mmap', 'ignore_stacktrace', 'ignore_file_read', 'cached_prefix_states_file'] def init_paceconfig(machine_id, args): global __paceconfigs __paceconfig = No...
{ "content_hash": "dcbe4b5b0f54319861e997235a5cf186", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 165, "avg_line_length": 39.52517985611511, "alnum_prop": 0.6821987622861303, "repo_name": "ramanala/PACE", "id": "47a182269e63c9e2ae5206d9170e0cc703b1cffa", "size": "6575"...
from nutils import mesh, function, solver, export, cli, testing import numpy, treelog def main(nelems:int, etype:str, btype:str, degree:int, traction:float, maxrefine:int, radius:float, poisson:float): ''' Horizontally loaded linear elastic plate with FCM hole. .. arguments:: nelems [9] Number of e...
{ "content_hash": "c882e0dc3f3587fe9661184b153b2dce", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 126, "avg_line_length": 46.123893805309734, "alnum_prop": 0.7014581734458941, "repo_name": "joostvanzwieten/nutils", "id": "dadafac16693c9d1ef0504c6128eabec55f46f1b", "siz...
"""Test listing raw events. """ import datetime import testscenarios from oslo.config import cfg from ceilometer.publisher import rpc from ceilometer import sample from ceilometer.tests import api as tests_api from ceilometer.tests import db as tests_db load_tests = testscenarios.load_tests_apply_scenarios class...
{ "content_hash": "3957c5d24713196298833e5aa213d2d6", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 78, "avg_line_length": 39.19211822660098, "alnum_prop": 0.5214932126696833, "repo_name": "citrix-openstack-build/ceilometer", "id": "a5add0b250cae487dd0896f0e89112431e8a691d...