text
stringlengths
4
1.02M
meta
dict
# # Copyright 2015 LinkedIn Corp. All rights reserved. # # 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 ...
{ "content_hash": "597af83c4df50e604e7674addcfb8db6", "timestamp": "", "source": "github", "line_count": 511, "max_line_length": 160, "avg_line_length": 47.17416829745597, "alnum_prop": 0.6169003567576536, "repo_name": "thomas-young-2013/wherehowsX", "id": "bb1579dd1767737bf28d2fe8508ae94720b906bc", ...
import numpy as np from astropy.table import Table from sklearn import mixture #from snob import nips_search3 as snob from snob import mixture_ka as snob np.random.seed(42) try: catalog except NameError: catalog = Table.read("../../../apogee-dr14-catalog.fits") else: print("WARNING: USING PRE LOADED CAT...
{ "content_hash": "c44ab72c2c71acdf542af2afb7af2d78", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 130, "avg_line_length": 30.926739926739927, "alnum_prop": 0.5494492478976667, "repo_name": "andycasey/snob", "id": "e169b06fbcd9c69686629e43714cb4d0b7c14403", "size": "844...
import argparse import multiprocessing import os import posixpath import sys import urllib2 import buildbot_common import build_version import generate_make import parse_dsc from build_paths import SDK_SRC_DIR, OUT_DIR, SDK_RESOURCE_DIR from build_paths import GSTORE from generate_index import LandingPage sys.path.a...
{ "content_hash": "4797b4c9c6b28f97f4c93c63798e9c3d", "timestamp": "", "source": "github", "line_count": 343, "max_line_length": 78, "avg_line_length": 31.67055393586006, "alnum_prop": 0.6671269446745834, "repo_name": "Workday/OpenFrame", "id": "f1a76c23686687c97db0e02fc936c17fbfea722f", "size": "11...
import argparse import os import subprocess import sys def setup(): global args, workdir programs = ['ruby', 'git', 'apt-cacher-ng', 'make', 'wget'] if args.kvm: programs += ['python-vm-builder', 'qemu-kvm', 'qemu-utils'] elif args.docker: dockers = ['docker.io', 'docker-ce'] fo...
{ "content_hash": "14f1793675ee3a1194b9b32f235edac3", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 233, "avg_line_length": 60.15151515151515, "alnum_prop": 0.6489384670744872, "repo_name": "chaincoin/chaincoin", "id": "f7a7e508c8392bff1a6d315f7fd52b93b2286999", "size": ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized import tensorflow as tf from tensorflow_examples.lite.model_maker.core import test_util from tensorflow_examples.lite.model_maker.core.task import hub_loader class HubK...
{ "content_hash": "78d8c9c40479e9c91ee03091a49c8577", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 77, "avg_line_length": 39.12244897959184, "alnum_prop": 0.7303077725612936, "repo_name": "tensorflow/examples", "id": "a3ba72117d116b19a2655e7c5737ba5a31c7103b", "size": "2...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0026_auto_20170313_1144'), ] operations = [ migrations.AlterModelManagers( name='profile', managers=[ ], ...
{ "content_hash": "f35acc25ba2c246b8d3a72a3fa28d530", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 43, "avg_line_length": 18.27777777777778, "alnum_prop": 0.5592705167173252, "repo_name": "jumbocodespring2017/bostonathleticsassociation", "id": "87b3289778f07389c8002ca26e60...
""" Get component information from metrics file. """ import sys, os import logging import json from os.path import join, dirname import functools from collections import defaultdict import cStringIO as StringIO import numpy as np from lxml import etree from rpl.tools.geometry.geom_utils import trans_mat_f...
{ "content_hash": "dfe593a65fe0d3300a289852f571037f", "timestamp": "", "source": "github", "line_count": 662, "max_line_length": 135, "avg_line_length": 42.274924471299094, "alnum_prop": 0.5221539341099121, "repo_name": "pombredanne/metamorphosys-desktop", "id": "826bf3aafd19375714dfade5a5cd4700b1f4da...
from AccessControl import ClassSecurityInfo from bika.lims import bikaMessageFactory as _ from bika.lims.utils import t from bika.lims.browser.bika_listing import BikaListingView from Products.Archetypes.Registry import registerWidget from Products.Archetypes.Widget import TypesWidget from Products.CMFCore.utils import...
{ "content_hash": "bb86ea2396fa2c3db1bf2868f799fe48", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 106, "avg_line_length": 41.60732984293194, "alnum_prop": 0.48257203976343277, "repo_name": "hocinebendou/bika.gsoc", "id": "89051e4769fc1f306f605da5ba041a6bcc858898", "siz...
""" Created on Sun Apr 19 23:31:19 2015 @author: willy """ import numpy as np from scipy.integrate import quad import scipy import os import matplotlib.pyplot as plt from scipy.stats import kstest from scipy.stats import chisquare from mpl_toolkits.mplot3d.axes3d import Axes3D class MSPSCModel: """ This cl...
{ "content_hash": "d2a1a6ed6688be3c1c4825d720fd0380", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 181, "avg_line_length": 44.43127962085308, "alnum_prop": 0.5714666666666667, "repo_name": "willyrv/DHNDiff", "id": "31c169f9c94a5c5cf3525e4bcc65aa9468b540a2", "size": "187...
import pyaudio import wave import numpy as np import time from filter_method import filter_signal FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 192000 CHUNK = 1024 # Buffer size print("Recording") audio = pyaudio.PyAudio() stream = audio.open(format=FORMAT, channels=CHANNELS, rate=RATE, input=True...
{ "content_hash": "3bfac2fa5b3c08dc90e4bb639b0b4ae3", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 67, "avg_line_length": 18.795454545454547, "alnum_prop": 0.720677146311971, "repo_name": "labseven/SigsysFinalProject", "id": "9414d5048688e489de6d7dea4fab5bff21786a88", "s...
"""Test the importmulti RPC.""" from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * class ImportMultiTest (BitcoinTestFramework): def set_test_params(self): self.num_nodes = 2 self.setup_clean_chain = True def setup_network(self): self.setup...
{ "content_hash": "9560c41195bd6a99fa0a7cbde07fcc17", "timestamp": "", "source": "github", "line_count": 446, "max_line_length": 137, "avg_line_length": 48.152466367713004, "alnum_prop": 0.6136151983609611, "repo_name": "Rav3nPL/bitcoin", "id": "a691595f15116f94c635dbc1b519b7f60a4b9433", "size": "21...
from dal.test import case, stories from dal_select2.test import Select2Story from .models import TestModel class AdminOneToOneTestCase(Select2Story, case.AdminMixin, case.OptionMixin, case.AutocompleteTestCase): field_name = 'test' inline_related_name = 'inline_test_models' ...
{ "content_hash": "bbab1b951eb744d140f9c1937411bf19", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 76, "avg_line_length": 28.303030303030305, "alnum_prop": 0.6488222698072805, "repo_name": "luzfcb/django-autocomplete-light", "id": "6c20be3302814159104c02b302fa928bd52ef59e"...
""" Use regular expressions to obtain serial number, vendor, model, os_version, and uptime from show version output. """ import re def read_file(filename): """Read filename; return contents as one string.""" with open(filename) as my_file: return my_file.read() class NetDeviceInventory(object): ...
{ "content_hash": "bc462ba2a57aa16a65b4b58e8fb5a7af", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 97, "avg_line_length": 29.565656565656564, "alnum_prop": 0.579091219678852, "repo_name": "ktbyers/pynet_ons", "id": "62163de5493579c4a2e2d53f430628342dfb78fe", "size": "294...
import math import operator import serial class AM03127(): """Runs a AM03127-based signboard (http://www.amplus.com.hk/ aka Maplin N00GA)""" special_map = { u'\n': ' ', u'\r': '', u'<': '<UBC>', u'>': '<UBE>' } def __init__ (self, signport=None, baud=None, signid=None)...
{ "content_hash": "23a84526e67285b8a6e35acef4b3a4ad", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 112, "avg_line_length": 32.75373134328358, "alnum_prop": 0.5103668261562998, "repo_name": "barfle/signboard", "id": "15b31511faf6d2a82db91bec64a2d79eae89bdd3", "size": "44...
"""Tests for Volume Code.""" import datetime import ddt import os import shutil import sys import tempfile import time import uuid import enum import eventlet import mock import os_brick from oslo_concurrency import processutils from oslo_config import cfg from oslo_serialization import jsonutils from oslo_utils impo...
{ "content_hash": "0e183c7edf6b30eaaa875de500c55c0b", "timestamp": "", "source": "github", "line_count": 6720, "max_line_length": 80, "avg_line_length": 46.2125, "alnum_prop": 0.5536567615956309, "repo_name": "Nexenta/cinder", "id": "b06613a1d890dcb4e162ec427cfca32ed7d1121f", "size": "311279", "bi...
from common import * # NOQA import yaml from netaddr import IPNetwork, IPAddress def _create_stack(client): env = client.create_environment(name=random_str()) env = client.wait_success(env) assert env.state == "active" return env def _create_stack_long_name(client, lname): env = client.create_e...
{ "content_hash": "7769f78fcdfbe27f5033181444c25d06", "timestamp": "", "source": "github", "line_count": 3108, "max_line_length": 79, "avg_line_length": 37.648648648648646, "alnum_prop": 0.609134105903668, "repo_name": "Cerfoglg/cattle", "id": "53c4f1955a3ddc8c6fd7b9362cf614a323372d88", "size": "117...
"""Module to load the Dataset.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # internal imports import numpy as np import tensorflow as tf from magenta.models.nsynth import utils # FFT Specgram Shapes SPECGRAM_REGISTRY = { (nfft, hop): shape for...
{ "content_hash": "bbd86b0d9fe7d2c89bfde607fbda9328", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 79, "avg_line_length": 33.956756756756754, "alnum_prop": 0.6045845272206304, "repo_name": "bda2017-shallowermind/MusTGAN", "id": "70541718c2a9d61cccd5139e97bddb5a85f76436", ...
{ 'name': 'Accounting Tax Adjustments', 'version': '1.1', 'category': 'Accounting', 'description': """ Accounting Tax Adjustments. =========================== This module adds a wizard to deal with manual Tax adjustments, to manually correct the VAT declaration through a miscellaneous operation for exa...
{ "content_hash": "4636f47b33554f01b3d98450fb0d0e05", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 149, "avg_line_length": 28.185185185185187, "alnum_prop": 0.6320630749014454, "repo_name": "vileopratama/vitech", "id": "240e175971dce31060f9ed6ff6c0ac3b76b116b5", "size": ...
class PybtexError(Exception): pass
{ "content_hash": "8c4649fc9d6b34633e6d1d33764c31cb", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 29, "avg_line_length": 19.5, "alnum_prop": 0.7435897435897436, "repo_name": "rybesh/pybtex", "id": "26969d05d9050046fa04998d1db83dbc52b04ee6", "size": "1153", "binary": fa...
import pyxb.binding.generate import pyxb.utils.domutils import os.path schema_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../schemas/test-include-daq.xsd')) code = pyxb.binding.generate.GeneratePython(schema_location=schema_path) #file('code.py', 'w').write(code) rv = compil...
{ "content_hash": "e8776ec329d175a953044c95636d783f", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 116, "avg_line_length": 34.3448275862069, "alnum_prop": 0.6495983935742972, "repo_name": "jonfoster/pyxb1", "id": "acc0d6a6dfd62aa80e2bef4e2b9105e4846062c3", "size": "996",...
"""Miscellaneous utility functions for use with Swift.""" from __future__ import print_function import errno import fcntl import grp import hmac import json import math import operator import os import pwd import re import sys import time import uuid import functools import email.parser from hashlib import md5, sha1 ...
{ "content_hash": "f9615c9724c9e0fb7310405f33cf96cd", "timestamp": "", "source": "github", "line_count": 3989, "max_line_length": 79, "avg_line_length": 34.83253948357984, "alnum_prop": 0.5964936270664354, "repo_name": "aerwin3/swift", "id": "fb4baa439652c0f21f55368957aa02368ff3319e", "size": "13954...
import socket import yaml import pymongo class Kwargs(object): def __init__(self, **kwargs): for key, val in kwargs.items(): self.__setattr__(key, val) class Config(object): def __init__(self, filename): self.conf = yaml.load(open(filename)) self.mongo = Kwargs() ...
{ "content_hash": "6d72d7474f9713e291bb88464358b05b", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 90, "avg_line_length": 33.810810810810814, "alnum_prop": 0.47162270183852917, "repo_name": "factornado/coco.registry", "id": "70544ce30c733e088abfc37a503ad7c921197e45", "si...
from __future__ import unicode_literals class StackdioWarning(Warning): pass
{ "content_hash": "91ae0c60c38c356aa9beb78a846a062d", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 39, "avg_line_length": 16.6, "alnum_prop": 0.7469879518072289, "repo_name": "stackdio/stackdio", "id": "7c471e66bb8580f8e2e86ced781696a29df57586", "size": "694", "binary":...
import sys import os # 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('..')) # -- General conf...
{ "content_hash": "ce5e3727f9ee2c102d252b1db00b0174", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 79, "avg_line_length": 31.414634146341463, "alnum_prop": 0.7036749482401656, "repo_name": "troup-system/troup", "id": "eed8dc1663a4f62477e1f05e85d4cb8be66542ed", "size": "...
from setuptools import setup, find_packages import re import os def get_version(): fn = os.path.join(os.path.dirname(__file__), "eli5", "__init__.py") with open(fn) as f: return re.findall("__version__ = '([\d.\w]+)'", f.read())[0] def get_long_description(): readme = open('README.rst').read() ...
{ "content_hash": "8f97af70fa5fe1128da3d4bbe3fb336f", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 83, "avg_line_length": 30.661290322580644, "alnum_prop": 0.563387690689111, "repo_name": "TeamHG-Memex/eli5", "id": "ec561515eff847663d900f9ad73185264c7ff3e1", "size": "192...
import rospy, math, time, copy from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint import sys, select, termios, tty, signal msg = """ Reading from the keyboard to actuate individual joints --------------------------- Initial configuration is 0 rads at each joint To actuate specific joint pass the jo...
{ "content_hash": "f8255c5fafa242bd61a6aa090e9bcac1", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 96, "avg_line_length": 24.666666666666668, "alnum_prop": 0.6496881496881497, "repo_name": "ipab-rad/rad_youbot_stack", "id": "a8e5089b983296154303d7d745514fe6cc9ee75d", "s...
""" Verifies that 'copies' with app bundles are handled correctly. """ import TestGyp import os import sys import time if sys.platform == 'darwin': test = TestGyp.TestGyp(formats=['make', 'xcode']) test.run_gyp('framework.gyp', chdir='framework') test.build('framework.gyp', 'copy_target', chdir='framework') ...
{ "content_hash": "30225fdb15303ff0f31bb805cb4fa011", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 76, "avg_line_length": 27.77777777777778, "alnum_prop": 0.6768, "repo_name": "dtebbs/gyp", "id": "a6e47ffd1b59006651548221040769b5be4597a0", "size": "1430", "binary": fal...
"""VTA RPC client function""" import os from .environment import get_env from .bitstream import download_bitstream, get_bitstream_path def reconfig_runtime(remote): """Reconfigure remote runtime based on current hardware spec. Parameters ---------- remote : RPCSession The TVM RPC session ...
{ "content_hash": "b277efbe1db08decb7bd91fff6751ca8", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 85, "avg_line_length": 26.5, "alnum_prop": 0.6584905660377358, "repo_name": "mlperf/training_results_v0.7", "id": "a5bafab498a524aa61a4aa928458a2b77e56f4e9", "size": "1845"...
from alembic import op import sqlalchemy as sa from neutron.plugins.cisco.common import cisco_constants segment_type = sa.Enum('vlan', 'overlay', 'trunk', 'multi-segment', name='segment_type') profile_type = sa.Enum('network', 'policy', name='profile_type') def upgrade(): op.create_table(...
{ "content_hash": "9c520272dc77d50fa2633905b6c72a2d", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 79, "avg_line_length": 50.432432432432435, "alnum_prop": 0.598517327617006, "repo_name": "NeCTAR-RC/neutron", "id": "7df02a9312e2953248b5c53269e24ba762c45ee1", "size": "11...
from enum import IntEnum from functools import reduce import io import struct from ipv6 import BuildableFromBytes from ipv6 import ConvertibleToBytes class HandshakeType(IntEnum): HELLO_REQUEST = 0 CLIENT_HELLO = 1 SERVER_HELLO = 2 HELLO_VERIFY_REQUEST = 3 CERTIFICATE = 11 SERVER_KEY_EXCHANGE...
{ "content_hash": "004804831f2fc702b11331b819ff8317", "timestamp": "", "source": "github", "line_count": 643, "max_line_length": 101, "avg_line_length": 30.055987558320375, "alnum_prop": 0.6001241850357032, "repo_name": "lanyuwen/openthread", "id": "41fc801248d65c39b671772b7656b3ede423f4f5", "size":...
""" Documents module objects """ from __future__ import unicode_literals from django.db import models from django.core.urlresolvers import reverse from anaf.core.models import Object from anaf.core.conf import settings from files import FileStorage import os import time import re # Folder model class Folder(Object):...
{ "content_hash": "5d8fcb2747265284ac59bd7ca9008c6b", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 83, "avg_line_length": 25.66393442622951, "alnum_prop": 0.6231236026828489, "repo_name": "tovmeod/anaf", "id": "6be854802bcd846cc463034cde4ce1d5f1415a71", "size": "3131", ...
""" Example of how influencers can be queried from the Engine API in CSV format using Python 2.6+ (including Python 3.x). No extra modules are required beyond those that come with a base Python install. Usage: python influencersToCsv.py <job> <server_hostname> [ <server_port> [ <result_limit> ] ] The job ID and ser...
{ "content_hash": "072a667060c63cca844ed025cb3f3c8f", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 110, "avg_line_length": 29.705882352941178, "alnum_prop": 0.700990099009901, "repo_name": "prelert/engine-python", "id": "7f63fd7f923f1580af22420e5a4e51149fc21f66", "size":...
"""empty message Revision ID: 46653c4a2132 Revises: 1bab833a3cce Create Date: 2014-03-20 05:14:20.237000 """ # revision identifiers, used by Alembic. revision = '46653c4a2132' down_revision = '1bab833a3cce' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - ...
{ "content_hash": "30a70900754f62ef1dae3ad6ef3c5ee4", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 91, "avg_line_length": 27.607142857142858, "alnum_prop": 0.6959896507115135, "repo_name": "micknh/EdFirst", "id": "7ebeec5228b35dfe9c4d35484665bb425c6222f9", "size": "773",...
""" This runs a simulation using two different sampling techniques. The model is specified in discrete time. Usage: sample.py [-h] [-v] [-q] priority <filename> <runs> <stream> [--sis=<N>] sample.py [-h] [-v] [-q] shifted <filename> <runs> <stream> [--sis=<N>] Options: -h, --help Show this help message....
{ "content_hash": "e67fdcdd6d904b9cf54ab7cea26a813d", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 85, "avg_line_length": 34.02546296296296, "alnum_prop": 0.6003809782978434, "repo_name": "adolgert/discretenext", "id": "c11f198cee45b0ecb5aaed9f7571332dc94e09f1", "size":...
import unittest from flask_git import Git from flask import Flask import os from repoutils import TempRepo import shutil import tempfile class TestFlaskGitInit(unittest.TestCase): """Flask git extension - init""" def setUp(self): self.root_dir = tempfile.mkdtemp() self.app = Flask(__name__) ...
{ "content_hash": "6f7a5b2a38ed0dd1a909a3e54fcfc5d2", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 93, "avg_line_length": 36.45192307692308, "alnum_prop": 0.6296491690846743, "repo_name": "drivet/flask-git", "id": "e5f1cf6f4cc1d472475d102d62b8e17e3242dc30", "size": "379...
from matplotlib import rc ''' Make matplotlib plots look nice ''' def hidespines(ax, ticksize=0): rc('font',**{'family':'sans-serif','sans-serif':['Times']}) ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) ax.xaxis.set_ticks_position('bottom') ax.yaxis.set_ticks_position('left') if (...
{ "content_hash": "8b5233a6144fa329fb4578757ce27557", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 60, "avg_line_length": 33.07692307692308, "alnum_prop": 0.7046511627906977, "repo_name": "smsolivier/VEF", "id": "017a5e95c19bb12b1f8cd28c0d830d68457717cd", "size": "430", ...
import sys try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest import argparse try: from configparser import ConfigParser except ImportError: from ConfigParser import SafeConfigParser as ConfigParser import plac if sys.version >= '3': fro...
{ "content_hash": "1b655a4dd5b3b1a767688302e6f2e877", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 95, "avg_line_length": 31.861842105263158, "alnum_prop": 0.5985959116250258, "repo_name": "fprimex/plac_ini", "id": "5e3cc39d10b8ec6cf26f796ff278aee672914d17", "size": "48...
import sys import time from PlayerBgndThread import processThread sys.path.append('/home/carlos/Documents/Elettra/Kafka_DonkiOrchestra_project/DonkiOrchestra_0.0.0/DonkiPlayer/scripts/mcstas-generator/src') if __name__ == "__main__": if len(sys.argv) < 4: print "\nUsage:\n\t",sys.argv[0],"player_name info...
{ "content_hash": "51a7eb433c6543ef59acc1c1faf59440", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 140, "avg_line_length": 29.541666666666668, "alnum_prop": 0.6205923836389281, "repo_name": "ess-dmsc/do-ess-data-simulator", "id": "59acce91ba94c0ddf52803a7e3eb9a05ac24d70c",...
import os import re import shutil import sys import tempfile sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from scoot import client_lib as proto # TODO: use a tmp domain socket instead of the default. # Adapted from daemon/server/handler_test.go def example_test(): tmpdir = tempfile.mkdtemp() rp...
{ "content_hash": "f1c79337cf4e4b672b8ef7c1b796a15b", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 123, "avg_line_length": 41.87179487179487, "alnum_prop": 0.676056338028169, "repo_name": "dbentley/scoot", "id": "6c5c41ba8a48c41c365480c6bee4f70ad87df69b", "size": "3290",...
import csv,sys,os os.environ['MPLCONFIGDIR'] = '/tmp' import numpy from matplotlib.path import Path from rtree import index as rtree import shapefile from pyproj import Proj, transform def findNeighborhood(location, index_rtree, neighborhoods): match = index_rtree.intersection((location[0], location[1], location[0...
{ "content_hash": "c24b2d1a2b4c4510fd2126cd7ff8fc0b", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 144, "avg_line_length": 37.34117647058824, "alnum_prop": 0.6364209199747952, "repo_name": "vzmehta/BigData2016", "id": "7c3c96eedbe12ed8ea3c5a79449d956bb70e8a4c", "size": "...
import json import requests from flexbe_core import EventState from rospy import logerr, loginfo from sara_msgs.msg import Entity """ Created on 15/05/2018 @author: Lucas Maurice """ class WonderlandGetPersonByRecognitionId(EventState): ''' Find a person by ID. ># id int Recogniti...
{ "content_hash": "e888bb8f57112329260986f781f5400d", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 107, "avg_line_length": 31.310344827586206, "alnum_prop": 0.6016886930983847, "repo_name": "WalkingMachine/sara_behaviors", "id": "4795ac4e9438f8d7c3a71e9b44be1f83a6716561", ...
""" 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, software distri...
{ "content_hash": "478c97315d93b74c70bf5165234daf12", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 144, "avg_line_length": 38.22222222222222, "alnum_prop": 0.6841085271317829, "repo_name": "rstens/gwells", "id": "397e70bd86a20b63b205b2d60d99c9a99c2608b6", "size": "2064",...
import os import sys import logging import optparse import subprocess class PackageCreator: def __init__(self): self.opts = None logging.basicConfig(level=logging.INFO) self.parse_args() def _execCommand(self, cmd_string) : logging.info('Issuing command %s' % cmd_string) ...
{ "content_hash": "551ab5804af71e00cc6698564256dcea", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 145, "avg_line_length": 40.67567567567568, "alnum_prop": 0.5441860465116279, "repo_name": "GENI-NSF/gram", "id": "874aacbbd66ff25c2d6a94af6ef80ce16790c4c0", "size": "3365",...
from __future__ import absolute_import import logging from geocoder.base import OneResult, MultipleResultsQuery from geocoder.location import Location class IpinfoResult(OneResult): @property def lat(self): loc = self.raw.get('loc') if loc: return Location(loc).lat @propert...
{ "content_hash": "30cafcd52438b715d23a29a85c33083e", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 22.235955056179776, "alnum_prop": 0.5709954522486104, "repo_name": "DenisCarriere/geocoder", "id": "3cc5095502862a76fb2aca8ad9a73ce7613bf0e4", "size"...
from PyQt5.QtWidgets import QWidget from PyQt5.QtWidgets import QLabel from PyQt5.QtWidgets import QPushButton from PyQt5.QtWidgets import QVBoxLayout from PyQt5.QtWidgets import QHBoxLayout from PyQt5.QtCore import pyqtSignal from PyQt5.QtCore import QObject from math import f...
{ "content_hash": "0da8595c08d079dfd66993340038c7a8", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 74, "avg_line_length": 26.032, "alnum_prop": 0.5586969883220652, "repo_name": "alberand/PySM", "id": "190ec25ef9e6ea9303a144d54ff797d27e3f8ce8", "size": "3254", "binary"...
""" WSGI config for twote project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTING...
{ "content_hash": "03bc748839365a300789282d0a242391", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.1875, "alnum_prop": 0.7674418604651163, "repo_name": "totalgood/twote", "id": "94a5e6cc2da6fcda0d738030b4e36d3ccbb3df0b", "size": "387", "binary...
from readStockData import readClosingPrice from readStockData import readVolume from dataAnalysis import calCorrelation s = readClosingPrice('ibm.xls') v = readVolume('ibm.xls') calCorrelation(s,v)
{ "content_hash": "fe08d86ec8914eec5c38741907ab2b8e", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 42, "avg_line_length": 25, "alnum_prop": 0.82, "repo_name": "cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price", "id": "1aaa7d3e8287db2d8a27f19386b58cadbe2b91ed", ...
import errno from collections import deque from _multiprocessing import Connection from satori.objects import Argument from .protocol import Attach, Detach, Disconnect, Map, Unmap, Send, Receive, KeepAlive, ProtocolError class Slave2(object): @Argument('connection', type=Connection) def __init__(self, connecti...
{ "content_hash": "94d60e36a67efc44f752b7f41a240b67", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 101, "avg_line_length": 33.30769230769231, "alnum_prop": 0.5502309468822171, "repo_name": "zielmicha/satori", "id": "f50fcfad1db38e459dc2eac8826a2a409990d6c6", "size": "34...
import time import os import io import traceback from PIL import Image import threading try: from picamera.array import PiRGBArray from picamera import PiCamera except: pass import logging import settings from task_common import TaskBase from image_lib import overlay_pil_image_pi, watermark_image from ...
{ "content_hash": "cd52e1ffd6c73b27fd8e43245defab8f", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 77, "avg_line_length": 24.967741935483872, "alnum_prop": 0.6046511627906976, "repo_name": "guglielmino/selfie-o-matic", "id": "1df17af16a9af42bc58f1bff7882cf46461df968", "s...
import random from collections import namedtuple from os import path, makedirs import zipfile from tqdm import tqdm from embeddings.embedding import Embedding class ElmoEmbedding(Embedding): """ Reference: https://allennlp.org/elmo """ settings = { 'weights': 'https://s3-us-west-2.amazonaws....
{ "content_hash": "a52b02063a102f6d601228f961358b48", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 163, "avg_line_length": 37.595238095238095, "alnum_prop": 0.6548448385053831, "repo_name": "vzhong/embeddings", "id": "2928b66cb05ea3c98744da443f0911e136264b88", "size": "1...
import sys as _sys import numpy as _np import scipy as _sp from scipy.stats import chi2 as _chi2 import warnings as _warnings import time as _time import itertools as _itertools from functools import reduce as _reduce from functools import lru_cache as _lru_cache try: from ...tools import fastcalc as _fastcalc ex...
{ "content_hash": "f3db56fa0e99663d2436c256723fbdcd", "timestamp": "", "source": "github", "line_count": 1643, "max_line_length": 119, "avg_line_length": 43.77175897748022, "alnum_prop": 0.5998025501619922, "repo_name": "DiCarloLab-Delft/PycQED_py3", "id": "996c1f3d4da8cd91e7fe95a69338a65970db3dab", ...
from collections import OrderedDict from tornado import template import tornado.web from dominate.tags import div, br, h3 from backend.components.base_component import BaseComponent from backend.misc.sys_types import Rt class Room(BaseComponent): """Defines room display in system""" table_name = 'rooms' ...
{ "content_hash": "6bcb3529ccbbe77373a4247782cfcaf4", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 113, "avg_line_length": 33.64383561643836, "alnum_prop": 0.5753257328990228, "repo_name": "dzon4xx/system", "id": "901c5b6d97948c860006d14bc676b6af54c811ae", "size": "2456"...
from ducktape.mark import matrix, ignore from ducktape.mark.resource import cluster from kafkatest.services.zookeeper import ZookeeperService from kafkatest.services.kafka import KafkaService from kafkatest.services.verifiable_producer import VerifiableProducer from kafkatest.services.console_consumer import ConsoleCo...
{ "content_hash": "fc50de4939e1ed0eed1a2aeaffa7e366", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 99, "avg_line_length": 36.757894736842104, "alnum_prop": 0.6626575028636884, "repo_name": "sslavic/kafka", "id": "f1a5dd23525de15de5d0db327c40a1ea3469665b", "size": "4273",...
"""System parameters wrappers""" from __future__ import absolute_import import unittest import mock from ros3ddevcontroller.param.parameter import Parameter, ReadOnlyParameter, ParameterStatus, Infinity class ParameterTestCase(unittest.TestCase): def test_new_no_status(self): par = Parameter('foo', 'bar...
{ "content_hash": "74d8f0cb2dcda51e38b57c8b6b67051f", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 102, "avg_line_length": 38.65384615384615, "alnum_prop": 0.6703150912106136, "repo_name": "open-rnd/ros3d-dev-controller", "id": "4292ab73b40ae0587b26a690ce95492d7b4da828", ...
import logging import json import core import uuid import time import base64 try: import queue as Queue except ImportError: import Queue import datetime import string valid_chars = set(string.ascii_letters+string.digits+'{}|~^<>!#$%()+,-.@_[] ') log = logging.getLogger() log.debug("Valid SQL characters are {...
{ "content_hash": "2f6f38f2dedcd2608ba7b02ac324b0f3", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 106, "avg_line_length": 29.574468085106382, "alnum_prop": 0.5936450839328538, "repo_name": "ironman5366/W.I.L.L", "id": "b0e7fe9d62734f95c1b249ebb00366e423ee399f", "size":...
"""RSA module Module for calculating large primes, and RSA encryption, decryption, signing and verification. Includes generating public and private keys. WARNING: this implementation does not use random padding, compression of the cleartext input to prevent repetitions, or other common security improvements. Use with...
{ "content_hash": "0c372d2844062afd988bed1fb8505239", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 78, "avg_line_length": 30.322580645161292, "alnum_prop": 0.723404255319149, "repo_name": "itielshwartz/BackendApi", "id": "b76399f744cbac397fa589ae8699ecd3cc1a1ad4", "size"...
import sqlite3 from vtfunc import TableFunction class GenerateSeries(TableFunction): params = ['start', 'stop', 'step'] columns = ['output'] name = 'series' def initialize(self, start=0, stop=None, step=1): self.start = start self.stop = stop or float('inf') self.step = step ...
{ "content_hash": "78f648b4e107eab7a643087b111e13ce", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 67, "avg_line_length": 23.242424242424242, "alnum_prop": 0.6232073011734028, "repo_name": "coleifer/sqlite-vtfunc", "id": "47ed15a01fe25f6f2b1a33eaeb71626ab142cf58", "size"...
""" Python-Rightscale A stupid wrapper around rightscale's HTTP API """ import time import types from .actions import RS_DEFAULT_ACTIONS, COLLECTIONS from .httpclient import HTTPClient from .util import get_rc_creds, HookList # magic strings from the 1.5 api DEFAULT_API_PREPATH = '/api' # authenticate here OAUTH2_R...
{ "content_hash": "7609d0a20025c89e53fd3ac88fe2f8e4", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 80, "avg_line_length": 32.16030534351145, "alnum_prop": 0.5747685734630904, "repo_name": "diranged/python-rightscale-1", "id": "b274ac5d791aa9b1b8904b872759ece6a188b4d0", ...
from __future__ import unicode_literals from django.db import migrations, models import django.contrib.postgres.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ mi...
{ "content_hash": "342c68f50fd6520f6a269d9f0ab2055d", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 194, "avg_line_length": 35.34782608695652, "alnum_prop": 0.6408364083640836, "repo_name": "project-icp/bee-pollinator-app", "id": "3ad6c479b7dbd34e4029cc9957cfc306068e7d6c", ...
import os if os.name == 'nt': # `isabs('/path/to/thing')` returns true on windows, which I think is wrong, so use `splitdrive` instead def _fixed_nt_isabs(path): return os.path.splitdrive(path)[0] != '' # maintainers apparently don't care about https://bugs.python.org/issue9949, so here is @ncdav...
{ "content_hash": "6a9257bb802a9997689472b5859dae81", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 122, "avg_line_length": 37.74193548387097, "alnum_prop": 0.5974358974358974, "repo_name": "scottbilas/dotfiles", "id": "f4e74a928189847fe22e3dd2b5b4a99f1847f735", "size": "...
__revision__ = "test/File.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" """ Verify that: -- the File() global function and environment method work correctly; -- the former does not try to expand construction variables; -- calling File() as a method of a File() object works correctly. """...
{ "content_hash": "00ecaef5f8d16706404d10c2c0bf3dfd", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 86, "avg_line_length": 18.72, "alnum_prop": 0.6527777777777778, "repo_name": "EmanueleCannizzaro/scons", "id": "ff0829048353934af2b03b3d274c2a3785a0792d", "size": "2071", ...
import jwt import re from tornado.gen import coroutine from tornado.httpclient import AsyncHTTPClient from os import path, getcwd from api.model.models import User, UserActivation from api.Crypto import hash_password import functools def authenticated(method): @functools.wraps(method) def wrapper(self, *arg...
{ "content_hash": "ebf13d1ae03e332362b92b65e7ac7dcd", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 84, "avg_line_length": 25.236842105263158, "alnum_prop": 0.6426833507125478, "repo_name": "fdemian/Morpheus", "id": "24a9f72cc13f6725d309f68f5832e2e1a996387c", "size": "28...
"""Gradients for operators defined in math_ops.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.compat import compat from tensorflow.python.eager import context from tensorflow.python.framework import constant...
{ "content_hash": "ca14a7a4643a2a970027a2bed59183cd", "timestamp": "", "source": "github", "line_count": 1644, "max_line_length": 81, "avg_line_length": 34.41727493917275, "alnum_prop": 0.6536177582976919, "repo_name": "alsrgv/tensorflow", "id": "0db8953b6964bf8f0a42c9bc66a0b88f10f2613d", "size": "5...
from django.db import models from django import forms from django.contrib.auth.models import User, Group from inbox.models import Message from django.core.exceptions import ValidationError # # Allow multiple Groups with the same name # Group._meta.get_field('name')._unique = False def get_received_messages(self): re...
{ "content_hash": "6859659a669f63c135c545a8986f8556", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 119, "avg_line_length": 41.8936170212766, "alnum_prop": 0.7437785678009141, "repo_name": "mas2tg/cs3240-f16-team07", "id": "94af8b36bf78d5ae59e86521eb0ea87f6214cd3a", "size...
""" Modules for creating and accessing Data Store Units """ from __future__ import absolute_import from datacube.storage.tiling import tile_datasets_with_storage_type
{ "content_hash": "4e67dfceb56459843b412526f6eb3c79", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 67, "avg_line_length": 28, "alnum_prop": 0.7857142857142857, "repo_name": "ceos-seo/Data_Cube_v2", "id": "f11d50703c286a9020cc13a3af7a4b450356aeff", "size": "183", "binary...
import os import sys sys.path.insert(1, "../../") # Output checks common for multiple algorithms def compare_output(original, generic, strip_part, algo_name, generic_algo_name): original = original[original.find(strip_part):].replace(algo_name, '').strip() generic = generic[generic.find(strip_part):].replac...
{ "content_hash": "07fd45915aea29287bae4849467720e4", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 108, "avg_line_length": 36.54545454545455, "alnum_prop": 0.675787728026534, "repo_name": "h2oai/h2o-3", "id": "5f3fc7f0fcae20641e10c6e5c18dc9f72970e078", "size": "1206", ...
""" PyCOMPSs Testbench KMeans ======================== """ # Imports from pycompss.api.task import task from pycompss.functions.reduce import merge_reduce import random USER_EVENTS = 70000100 CLUSTER_MAIN_LOOP = 400 PARTIAL_SUM = 401 REDUCE_KEY = 402 REDUCE_NO_KEY = 403 GENERATE = 404 def init_board_gauss(numV, di...
{ "content_hash": "a7fa7304c51c6ccb43f0468ad66e41a8", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 76, "avg_line_length": 29.11377245508982, "alnum_prop": 0.5950226244343891, "repo_name": "mF2C/COMPSs", "id": "7b6c0f8081cce7fb60a1bbfb90097f5a19640963", "size": "4906", ...
from functools import partial from inspect import signature from itertools import product from itertools import chain from itertools import permutations import numpy as np import scipy.sparse as sp import pytest from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import LabelBinari...
{ "content_hash": "ae68514cc683de5f88b835e568247e27", "timestamp": "", "source": "github", "line_count": 1530, "max_line_length": 79, "avg_line_length": 37.9562091503268, "alnum_prop": 0.6301379298469169, "repo_name": "ndingwall/scikit-learn", "id": "767228d4607890e899b1944e1e0d8b8dd68dab5b", "size"...
import os import sys import django.core.handlers.wsgi import tornado.httpserver import tornado.ioloop import tornado.web import tornado.wsgi _HERE = os.path.dirname(os.path.abspath(__file__)) os.environ['DJANGO_SETTINGS_MODULE'] = "booksite.settings" def main(port): wsgi_app = tornado.wsgi.WSGIContainer( ...
{ "content_hash": "5ed5b920370fb8c797b377083725aee7", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 70, "avg_line_length": 27.791666666666668, "alnum_prop": 0.697151424287856, "repo_name": "tkliuxing/bookspider", "id": "4b184743e25e141d697ddf66e4d5e8a7d03d17c5", "size": "...
import pickle as pkl from mxnet.ndarray import NDArray import mxnet as mx from mxnet.test_utils import * from common import random_seed from mxnet.base import mx_real_t from numpy.testing import assert_allclose import numpy.random as rnd import numpy as np import scipy.sparse as spsp from common import assertRaises, ...
{ "content_hash": "092b208ae46b4e3b2edda4f28800b3ee", "timestamp": "", "source": "github", "line_count": 1024, "max_line_length": 119, "avg_line_length": 39.5703125, "alnum_prop": 0.5875370187561698, "repo_name": "apache/incubator-mxnet", "id": "750505c1eb4590cd3ab79473f7c25c3a94688f25", "size": "41...
import numpy, scipy import scipy.stats # BCES fitting # =============== def bces(y1,y1err,y2,y2err,cerr): """ Does the entire regression calculation for 4 slopes: OLS(Y|X), OLS(X|Y), bisector, orthogonal. Fitting form: Y=AX+B. Usage: >>> a,b,aerr,berr,covab=bces(x,xerr,y,yerr,cov) Output: - a,b : best-fit paramet...
{ "content_hash": "f26fc4cf3609a2679c5facbf4a159ed1", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 186, "avg_line_length": 33.63636363636363, "alnum_prop": 0.6572481572481572, "repo_name": "Delosari/dazer", "id": "317df809e4e37c78a11c2a22dbad3757fec7e4cb", "size": "1221...
"""Utilities for querying Microsoft Visual Studio settings. @see: Cake Build System (http://sourceforge.net/projects/cake-build) @copyright: Copyright (c) 2010 Lewis Baker, Stuart McMahon. @license: Licensed under the MIT license. """ import json import os import subprocess import _winreg as winreg import cod...
{ "content_hash": "61171c7ad8ed7a042394d691d4a01bf7", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 101, "avg_line_length": 33.226765799256505, "alnum_prop": 0.6882971582009398, "repo_name": "lewissbaker/cake", "id": "890448746f205d91babcb7928b2a7a8ad71b1a6d", "size": "8...
import asyncio import json import logging import os import aiohttp import questionary from aiohttp import ClientTimeout from prompt_toolkit.styles import Style from typing import Any, Generator from typing import Text, Optional, Dict, List import rasa.shared.utils.cli import rasa.shared.utils.io from rasa.cli import ...
{ "content_hash": "0aa52004dd13a8a8784043b896f6bae4", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 88, "avg_line_length": 33.822966507177036, "alnum_prop": 0.6343188569811855, "repo_name": "RasaHQ/rasa_nlu", "id": "f1f00576b2e2a118a7d2506e1c60bc0b0edda237", "size": "712...
import argparse import codecs import sys from collections import defaultdict from itertools import izip def utf8read(f): return codecs.open(f, 'r', 'utf-8') class Ngram: """ Simple ngram model """ def __init__(self, formFile, lemmaFile, ngram): self.gramStats(formFile, lemmaFile, ngram) ...
{ "content_hash": "976a45400a280b85f7d8ee64ce13f78d", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 118, "avg_line_length": 38.328125, "alnum_prop": 0.5923359152058704, "repo_name": "Nero-Hu/mt", "id": "999e94d3c38122f098352c80f56cba185a76aff9", "size": "2500", "binary"...
import os import sys import json import tempfile import shutil import utils import logging import fcntl from urlparse import urlparse from zips import UnzipUtil from hashes import HashUtil from cache import DirectoryCacheManager from downloads import Downloader from downloads import CurlDownloader from utils import saf...
{ "content_hash": "6b661f550891e6769078d3e977a4aa0d", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 79, "avg_line_length": 41.983539094650205, "alnum_prop": 0.5591060576357577, "repo_name": "dmikusa-pivotal/cf-download-build-pack", "id": "39e5983b38961e0038245e00175ca43c82...
"""Tests for trainer_utils.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil # Dependency imports from tensor2tensor.data_generators import algorithmic from tensor2tensor.data_generators import generator_utils from tensor2tensor....
{ "content_hash": "e723ef7f5db5e2844236d3bad745cbc7", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 80, "avg_line_length": 36.76223776223776, "alnum_prop": 0.6891763363134867, "repo_name": "waterblue13/tensor2tensor", "id": "16a8149f4bf1a20468aeee0116b233903b5c6b14", "si...
"""Status/config and exposure windows for NIC-FPS. History: 2004-10-19 ROwen 2008-02-11 ROwen Modified to use new TUI.Inst.StatusConfigWdg. 2008-02-12 ROwen Misfeature fix: was using instName=Expose for the expose window. 2011-08-11 ROwen Modified to save state. 2014-02-03 ROwen Updated to use modernized T...
{ "content_hash": "d0bb25ab6af72ac7e2e127db5fcffab1", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 84, "avg_line_length": 27.322033898305083, "alnum_prop": 0.6488833746898263, "repo_name": "r-owen/TUI", "id": "23da1b07a435d4a6f87e721d2a968e1b1963b9ad", "size": "1634", ...
"""Classes to generate plain text from a message object tree. """ import re import sys import time import locale import random from types import ListType, StringType from cStringIO import StringIO from email.Header import Header from email.Parser import NLCRE try: from email._compat22 import _isstring except Sy...
{ "content_hash": "da932f542f82672b6ec5c94921d7b44a", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 78, "avg_line_length": 37.47883597883598, "alnum_prop": 0.5777511117385473, "repo_name": "MalloyPower/parsing-python", "id": "3e578a2f745b6a57c9ff9a9e75c51ca4b251290e", "s...
from pygccxml import utils from pygccxml import declarations class default_argument_patcher_t( object ): def __init__( self, enums ): object.__init__( self ) self.__enums = enums def __call__(self, decl): for arg in decl.arguments: if not arg.default_v...
{ "content_hash": "f4abf8376296a3ca54900a1dda144f47", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 104, "avg_line_length": 41.34594594594594, "alnum_prop": 0.5451693031768858, "repo_name": "avaitla/Haskell-to-C---Bridge", "id": "c3b752444584eeb149fda79f7817212712e1f2ce", ...
import datetime import decimal import uuid import sqlalchemy as sa from sqlalchemy import any_ from sqlalchemy import ARRAY from sqlalchemy import cast from sqlalchemy import Column from sqlalchemy import column from sqlalchemy import DateTime from sqlalchemy import Enum from sqlalchemy import event from sqlalchemy im...
{ "content_hash": "a8f58c752cd6486d0fde4cb74077904a", "timestamp": "", "source": "github", "line_count": 3293, "max_line_length": 79, "avg_line_length": 32.03249316732463, "alnum_prop": 0.5176568736194458, "repo_name": "graingert/sqlalchemy", "id": "1903e47d48e99205cc70ee957e57934d564dce4c", "size":...
""" guilloches, following. observe how detail grows and your cpu melts. move mouse horizontally and vertically to change parameters http://ministryoftype.co.uk/words/article/guilloches/ TODO - this is now brokeh, need to find how to get back canvas-like behavior which wouldn't repaint at each frame ""...
{ "content_hash": "43d5e615d2227c8bbce67eba36066e72", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 80, "avg_line_length": 28.690140845070424, "alnum_prop": 0.5930289641629848, "repo_name": "projecthamster/experiments", "id": "dd3dc69734b7df4d4911ffb5c1e0452ae7bebb6c", "s...
""" Temp file to generate mock data. """ import argparse import pathlib import random from collections import defaultdict from typing import DefaultDict, Dict, List from graph_structures_pb2 import ( SLI, Client, Dependency, Node, NodeType, SLIType, UserJourney, ) from . import server_uti...
{ "content_hash": "9b3179489ac8ffbf3be0c6705a2be370", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 94, "avg_line_length": 31.781512605042018, "alnum_prop": 0.5896351136964569, "repo_name": "googleinterns/userjourneytool", "id": "87f621087c21ceaa8d4cb06fb17d21697a7319cf", ...
from django.conf.urls import patterns, url from arenas import views urlpatterns = patterns('', url(r'^$', views.IndexView.as_view(), name='index'), url(r'^(?P<pk>\d+)/$', views.DetailView.as_view(), name='detail'), url(r'^...
{ "content_hash": "62408ecfc5b0377e601c6189dc7197e0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 103, "avg_line_length": 53.46153846153846, "alnum_prop": 0.4719424460431655, "repo_name": "ThrowsException/CLeagueHero", "id": "d179e9ff32a77eeb83308340c1df7abcb1ae8b68", "...
""" Author: Peter Zujko (@zujko) Description: Handles views and endpoints for all profile related operations. Date Created: Nov 7 2016 Updated: Feb 16 2018 """ import logging from django.contrib.auth import login as auth_login from django.contrib.auth import logout from django.contrib.auth.decorators import login_requ...
{ "content_hash": "63a8ee3ca0c881429d5fa4c4ebf077bb", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 131, "avg_line_length": 31.984455958549223, "alnum_prop": 0.66337275230844, "repo_name": "ritstudentgovernment/PawPrints", "id": "abf94a4b68678940489ebf920896f69d5dea7ad1", ...
""" This is a master vasp running script to perform various combinations of VASP runs. """ from __future__ import division __author__ = "Shyue Ping Ong" __version__ = "0.5" __maintainer__ = "Shyue Ping Ong" __email__ = "[email protected]" __status__ = "Beta" __date__ = "12/31/13" import logging import sys import yaml ...
{ "content_hash": "204d2b08ce91dba2d20e8a8aa9846959", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 99, "avg_line_length": 40.605442176870746, "alnum_prop": 0.5230356843692411, "repo_name": "davidwaroquiers/custodian", "id": "157bbc692ef0cbbb53d2c5f484ed6808d3773002", "s...
# -*- coding: utf-8 -*- import json def init(): languages = ['en'] degreepath = 'C:/Users/Elias/Dropbox/__WikiNetworks/Master_Projekt/Degrees/results/' for language in languages: print language totaldegpath = degreepath + language + '_deg_titles.sorted' degre...
{ "content_hash": "c745dfda6db40b564300389e6c4a2e03", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 109, "avg_line_length": 38.280701754385966, "alnum_prop": 0.45187901008249315, "repo_name": "CMThF/wikipedia-analysis-toolkit", "id": "b828a8f6341206b62a93af43a565fe6bc10399a...
from bokeh.core.properties import Instance from bokeh.io import output_file, show from bokeh.models import ColumnDataSource, Tool from bokeh.plotting import figure from bokeh.util.compiler import TypeScript output_file('custom_tool.html') JS_CODE = """ import {GestureTool, GestureToolView} from "models/tools/gestures...
{ "content_hash": "6c99b5d7bc46c37af36785be0f47a8a9", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 79, "avg_line_length": 25.023255813953487, "alnum_prop": 0.6909851301115242, "repo_name": "ericmjl/bokeh", "id": "9d846007ae3dfbcea3f1bcef77c36e9729148e5c", "size": "2152",...
from django.conf.urls import url from django.views.generic import TemplateView urlpatterns = [ url(r'^about/$', TemplateView.as_view(template_name="pages/about_us.html"), name='about'), url(r'^downloads/$', TemplateView.as_view(template_name="pages/downloads.html"), name='downloads'), ]
{ "content_hash": "244606ae420f40d9ce5eb8f745db8908", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 103, "avg_line_length": 42.42857142857143, "alnum_prop": 0.7272727272727273, "repo_name": "geometalab/osmaxx-frontend", "id": "78886d5fa6f9209d5b1d5eada01c4b0219b71051", "si...
from __future__ import print_function, absolute_import import time import numpy from oskar._bda_utils import expand def run(num_antennas, vis_compressed, input_name, vis_original, output_name): print('- Expanding compressed data...') t0 = time.time() expand(num_antennas, vis_compressed, input_name, vis_or...
{ "content_hash": "ebcd961f757227fadcee4522e475261c", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 79, "avg_line_length": 43.81481481481482, "alnum_prop": 0.6086221470836856, "repo_name": "OxfordSKA/bda", "id": "1e8b0ac45f249835cb7d3c81ccbcecfd5a3b8e36", "size": "1208", ...
import app.db as db class Application(): def __init__(self, project_name, student_name, application_date, status='pending', is_new_application=True): self.project_name = project_name self.student_name = student_name self.application_date = application_date self.status = status ...
{ "content_hash": "f1a02f78c1b3beaa0a23256e66164cf7", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 112, "avg_line_length": 34.135802469135804, "alnum_prop": 0.538878842676311, "repo_name": "BunsenMcDubbs/cs4400-project", "id": "d8855d21307d7cca257e8065f52003bbf13d12b1", ...
from ....testing import assert_equal from ..preprocess import SpaceTimeRealigner def test_SpaceTimeRealigner_inputs(): input_map = dict(ignore_exception=dict(nohash=True, usedefault=True, ), in_file=dict(mandatory=True, min_ver='0.4.0.dev', ), slice_info=dict(requires=[u'slice_times'], ...
{ "content_hash": "6a875dc7b92268463158f925150c583a", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 78, "avg_line_length": 29.303030303030305, "alnum_prop": 0.6504653567735263, "repo_name": "carolFrohlich/nipype", "id": "961756a80098b1dfd2a02e5a46ccd45594a4c209", "size": ...
""" pyClanSphere.tests.testModels ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Make sure our core models have consistent behaviour :copyright: (c) 2010 by the pyClanSphere Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import sys import os import unittest f...
{ "content_hash": "d37fcf41aa3f0c602f458696cfc40319", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 87, "avg_line_length": 34.73451327433628, "alnum_prop": 0.6578343949044586, "repo_name": "jokey2k/pyClanSphere", "id": "6f3862535e974064bff1c3e41689b4450e4382d0", "size": ...
from utils import ptb_iterator, sample train_data = [i for i in range(1024)] #num_steps is how many things in a sequence do we grab from data. #If you want to grab 10 words then num_steps is 10 for batch in ptb_iterator(train_data, batch_size=2, num_steps=1): print("Batch") x, y = batch print(x, y)
{ "content_hash": "8887eeb2fe84ede15c336caf2584cf83", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 65, "avg_line_length": 34.77777777777778, "alnum_prop": 0.6964856230031949, "repo_name": "dmitrinesterenko/cs224d", "id": "1a677ab33e2a9f3524741a618d195d508dc13403", "size":...
""" This tutorial introduces the multilayer perceptron using Theano. A multilayer perceptron is a logistic regressor where instead of feeding the input to the logistic regression you insert a intermediate layer, called the hidden layer, that has a nonlinear activation function (usually tanh or sigmoid) . One can use ...
{ "content_hash": "bbb9fcebd76f0295affecc9457873814", "timestamp": "", "source": "github", "line_count": 415, "max_line_length": 80, "avg_line_length": 34.91566265060241, "alnum_prop": 0.5780538302277433, "repo_name": "garbersc/keras-galaxies", "id": "70f6a8993def9e7817b81250fab01c97ac9e0e79", "size...
import unittest from yapyg import math_collision class TestMathCollisionRectCircle(unittest.TestCase): def test_contact_mid_left_side(self): circ = ("circle", 0.0, 0.0, 1.0) rect = ("rectangle", 1.0, -1.0, 1.0, 2.0, 0.0) contact_points = [] self.a...
{ "content_hash": "7ee64204a6bdaefe6ef29d878e54c110", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 104, "avg_line_length": 49.95744680851064, "alnum_prop": 0.5570698466780238, "repo_name": "rkibria/yapyg", "id": "6dbfc4f2b3ecd0a6b7b22b15a50c5e52e98f0d8e", "size": "3441",...
class BadPlateauInit(Exception): def __init__(self): Exception.__init__( self, "Wrong initial Plateau parameters" )
{ "content_hash": "ac7611cd523d6cb0b649b29f1c8c4cc8", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 46, "avg_line_length": 23, "alnum_prop": 0.5279503105590062, "repo_name": "tkanoff/therover", "id": "d49f8bd866029634b9442a3447528199337641a3", "size": "187", "binary": fa...
import pytest import json, sys import pexpect def pytest_collect_file(path, parent): if path.ext == ".q" and path.basename.endswith("_test.q"): return QuarkFile(path, parent) class QuarkFile(pytest.File): def collect(self): for lang in ["python", "java", "javascript", "ruby"]: yiel...
{ "content_hash": "e83b851ee51e3f76a12d4fdc5cb43595", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 90, "avg_line_length": 35.45614035087719, "alnum_prop": 0.5096486887679367, "repo_name": "datawire/quark", "id": "60e9bf089fe029bfe1382276cc7484a499f5d844", "size": "2021",...
from selenium.webdriver.support.ui import Select from models.contact import Contact import re from random import randrange class ContactHelper: def __init__(self, app): self.app = app def open_home_page(self): wd = self.app.wd wd.get("http://localhost/addressbook/") def init_cont...
{ "content_hash": "120cd8bbcfd534d197dd74cf794ff648", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 107, "avg_line_length": 42.02755905511811, "alnum_prop": 0.595503512880562, "repo_name": "s34rching/python_classes", "id": "cf08c45cd48629f339831e08944c815326804498", "siz...
import sys, json, os, tempfile from solver.commonSolver import CommonSolver from logic.smbool import SMBool from logic.smboolmanager import SMBoolManagerPlando as SMBoolManager from logic.helpers import Pickup from rom.rompatcher import RomPatcher from rom.rom_patches import RomPatches from graph.graph import AccessGr...
{ "content_hash": "0518e6952478c9ad079c76dba9a00914", "timestamp": "", "source": "github", "line_count": 1180, "max_line_length": 251, "avg_line_length": 51.78220338983051, "alnum_prop": 0.5738834427114872, "repo_name": "theonlydude/RandomMetroidSolver", "id": "c6d6cacc94f3961038d597e57d0d7166c43375d0...
import constants_v2 as const import netaddr from oslo_log import log as logging from f5_openstack_agent.lbaasv2.drivers.bigip import exceptions as f5_ex from f5_openstack_agent.lbaasv2.drivers.bigip.network_helper import \ NetworkHelper from f5_openstack_agent.lbaasv2.drivers.bigip.resource_helper \ import Big...
{ "content_hash": "767a4c1929f8e31e4c72947059363174", "timestamp": "", "source": "github", "line_count": 368, "max_line_length": 78, "avg_line_length": 39.46739130434783, "alnum_prop": 0.5309143486642798, "repo_name": "F5Networks/f5-openstack-agent", "id": "0af6185879017fe984b6b632386d06bf33a06722", ...