text
stringlengths
4
1.02M
meta
dict
import time # from mufsim.errors import MufRuntimeError from mufsim.insts.base import Instruction, instr @instr("date") class InstDate(Instruction): def execute(self, fr): when = time.localtime() fr.data_push(int(when.tm_mday)) fr.data_push(int(when.tm_mon)) fr.data_push(int(when....
{ "content_hash": "53144d39a2c3329aa194949830f1afd5", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 60, "avg_line_length": 25.235294117647058, "alnum_prop": 0.6317016317016317, "repo_name": "revarbat/mufsim", "id": "f56dcdf173ea668782ad8e708aae523b012338d0", "size": "1716...
"""Template tags and filters for Zinnia""" import re from hashlib import md5 from datetime import date try: from urllib.parse import urlencode except ImportError: # Python 2 from urllib import urlencode from django.db.models import Q from django.db.models import Count from django.conf import settings from dja...
{ "content_hash": "16ffd5c9296d3c568e996ae8d32f6e09", "timestamp": "", "source": "github", "line_count": 488, "max_line_length": 79, "avg_line_length": 33.618852459016395, "alnum_prop": 0.6169694014384981, "repo_name": "marctc/django-blog-zinnia", "id": "00511a4fceb5ea7e46b2eaba456dccaea490b84f", "s...
from ...models import Judge from ...utils.logging import logger import click import requests import json from .utils import get_data, login_oauth from beautifultable import BeautifulTable from ...utils.Errors import AuthenticationError from .models import Problem, Contest, Testcase from ...utils import style class Co...
{ "content_hash": "faa397e2e86d0eb90d65f52d44158d90", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 82, "avg_line_length": 38.9375, "alnum_prop": 0.5711816273614027, "repo_name": "termicoder/termicoder", "id": "dc0025936bd34c1234f3e3fc4e018d13c947a496", "size": "8264", ...
""" Created on Wed Mar 16 15:40:29 2016 @author: okada $Id: signature.py 205 2017-08-08 06:25:59Z aokada $ """ ########### js template js_header = """(function() { sig_data = {}; """ js_footer = """ })(); Object.freeze(sig_data); """ js_dataset = """ sig_data.tooltip_format = {{ signature_title:{signature_title...
{ "content_hash": "114ea6b2e88b13003142c474e18ac163", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 176, "avg_line_length": 35.68093385214008, "alnum_prop": 0.5735005452562705, "repo_name": "Genomon-Project/paplot", "id": "d0bf131cfe23e230013b8aeca123af12e2a3b595", "size...
""" Utility functions from 2to3, 3to2 and python-modernize (and some home-grown ones). Licences: 2to3: PSF License v2 3to2: Apache Software License (from 3to2/setup.py) python-modernize licence: BSD (from python-modernize/LICENSE) """ from lib2to3.fixer_util import (FromImport, Newline, is_import, ...
{ "content_hash": "ee3b0bf4a13fddf3684abca1efbd0742", "timestamp": "", "source": "github", "line_count": 520, "max_line_length": 105, "avg_line_length": 33.64230769230769, "alnum_prop": 0.5923745284097405, "repo_name": "ryfeus/lambda-packs", "id": "48e4689db96917b39586f1f939142741dd46203d", "size": ...
"""Default Hyperparameter configuration.""" import ml_collections def get_config(): """Get the default hyperparameter configuration.""" config = ml_collections.ConfigDict() config.learning_rate = 0.1 config.momentum = 0.9 config.batch_size = 128 config.num_epochs = 10 return config
{ "content_hash": "b21250a2fdaf79635009a8242d647516", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 53, "avg_line_length": 21.5, "alnum_prop": 0.7209302325581395, "repo_name": "google/flax", "id": "822bf7fb8d382bd8bfc8f06761f2c8107d4c8cb2", "size": "883", "binary": fals...
"""Models of the aps_purchasing app.""" from django.db import models from django.utils.translation import ugettext_lazy as _ class AML(models.Model): """ Approved Manufacturer List. List of IPNs that may only be purchased through approved manufacturers. :ipn: The IPN instance. :manufacturer: A m...
{ "content_hash": "ef1d1e735fa58db2d9dd9c488f89cd2b", "timestamp": "", "source": "github", "line_count": 405, "max_line_length": 77, "avg_line_length": 22.94814814814815, "alnum_prop": 0.592317624273725, "repo_name": "bitmazk/django-aps-purchasing", "id": "56f4ed51a73d8c22f66836bfe0ac66ee4e30f1a1", ...
import tensorflow as tf import numpy as np import threading # Generating some simple data r = np.arange(0.0,100003.0) raw_data = np.dstack((r,r,r,r))[0] raw_target = np.array([[1,0,0]] * 100003) # are used to feed data into our queue queue_input_data = tf.placeholder(tf.float32, shape=[20, 4]) queue_input_target = tf...
{ "content_hash": "62f36c093c129929f311e1f9fbad9783", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 112, "avg_line_length": 34.838235294117645, "alnum_prop": 0.6956521739130435, "repo_name": "kafkasl/contextualLSTM", "id": "b9ce68ac88dfac0076bdb0e0a3542f2fc6b585cc", "size...
import serial import create # Create the Create! robot = create.Create("/dev/ttyUSB0") # Safe Mode does not allow Create to move why plugged in, run off cliffs, and stops and adjusts when bumped. # Full Mode ignores all that #robot.toSafeMode() robot.toFullMode() # Move forward in millimeters; optional second param...
{ "content_hash": "b175817ad0c48d6c0a90d847e0efee83", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 108, "avg_line_length": 24.185185185185187, "alnum_prop": 0.6983154670750383, "repo_name": "Kaceykaso/design_by_roomba", "id": "346bd8093bb39906100372db4f0e902e5c123ac2", "...
from models.scf import Frame, database import warnings, MySQLdb warnings.filterwarnings("ignore", category=MySQLdb.Warning) ## This class calculates loglikelihodd for each frame # @author Adriano Zanette # @version 1.0 class LogLikelihood: ## Calculates loglikelihood for each frame # @author Adriano Zanette # ...
{ "content_hash": "cc35791bdbf5d67156d4a510a75cb647", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 176, "avg_line_length": 52.6875, "alnum_prop": 0.4665875840253064, "repo_name": "adzanette/scf-extractor", "id": "0b08661dbd6aaf939f9c2979f2061f990e687a37", "size": "2529",...
import os import webapp2 import jinja2 import config from app.utils.compressor import WEBASSETS_ENV JINJA_ENV = jinja2.Environment( autoescape=lambda x: True, extensions=['jinja2.ext.autoescape', 'webassets.ext.jinja2.AssetsExtension'], loader=jinja2.FileSystemLoader( os.path.joi...
{ "content_hash": "d277049cb87f8d25862156972dc54ebd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 56, "avg_line_length": 23.1, "alnum_prop": 0.7229437229437229, "repo_name": "ronbeltran/webapp2-bedrock", "id": "1486390989e81040ce5dfa57404584bdd0aad30e", "size": "462", ...
import unittest import re from unittest.mock import patch from flask import current_app, url_for, g from flask_login import current_user from webapp import dbsql, mail from webapp.utils import create_user from webapp.admin import forms from webapp.controllers import get_user_by_email from webapp.notifications import se...
{ "content_hash": "4276b53e5a0c10e522d2d27dc706e9cf", "timestamp": "", "source": "github", "line_count": 4778, "max_line_length": 173, "avg_line_length": 42.16366680619506, "alnum_prop": 0.5333171182082618, "repo_name": "scieloorg/opac", "id": "5f27f0c85f60a7eea4480fb4b989dc2dc19c3219", "size": "202...
from django.contrib import admin from models import Book admin.site.register(Book) class BookAdmin(admin.ModelAdmin): fields = ('title', 'price') # Register your models here.
{ "content_hash": "d87c2a3662ba060664ee957294b5ec99", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 34, "avg_line_length": 20.22222222222222, "alnum_prop": 0.7472527472527473, "repo_name": "tlycken/whatiscode", "id": "cb2089c09fc85d345a5cee5b80afaf48fd27f331", "size": "182...
import json import os from operator import itemgetter import datetime from flask import current_app as app from app import get_db, s3_client from flask_login import current_user @app.template_filter("to_str") def to_jobs(lst): return ", ".join(json.loads(lst)) @app.template_filter("to_name") def to_name(compan...
{ "content_hash": "27520a245b8378227d74379914a1d3b0", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 116, "avg_line_length": 29.87878787878788, "alnum_prop": 0.6085192697768763, "repo_name": "ForumOrganisation/forumorg", "id": "a418823a158cacebb9577840f9d7d2410b2e8cc0", "s...
"""Positive definite Operator defined with diagonal covariance.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import six from tensorflow.contrib.distributions.python.ops import operator_pd from tensorflow.python.framework import ops from te...
{ "content_hash": "cfd8e4316c2c2db49dc7af1882881ad1", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 79, "avg_line_length": 30.527972027972027, "alnum_prop": 0.6583438323216126, "repo_name": "Lab603/PicEncyclopedias", "id": "5e019355f74a3d72ef34876b94cbbc1addbc72a6", "siz...
from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ class Supplier(models.Model): """ * A supplier holds all shop supplier related information * A Supplier is only created by the system administrator """ user = models.For...
{ "content_hash": "94e5886d6d7d32c17f290048000aee37", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 67, "avg_line_length": 30.8, "alnum_prop": 0.6866883116883117, "repo_name": "diefenbach/django-lfs", "id": "39b7eeae948998d9f70fb63ee40d7e1ff5c664da", "size": "633", "bin...
import oslo_messaging from oslo_messaging import serializer as oslo_serializer DEFAULT_URL = "__default__" TRANSPORTS = {} def setup(): oslo_messaging.set_transport_defaults('ceilometer') def get_transport(conf, url=None, optional=False, cache=True): """Initialise the oslo_messaging layer.""" global TR...
{ "content_hash": "0e3e502815c35563cd5e1da0f04db3d6", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 75, "avg_line_length": 34.375, "alnum_prop": 0.6658585858585858, "repo_name": "ityaptin/ceilometer", "id": "8f8211bede290ed64d648585d49f09841e24affd", "size": "3104", "bi...
import smtplib def sendMail(mail_executor,to_address,message): """mails the report of sysbench test""" logging=mail_executor.logging #configuring sender's login from_address='smtplibpython@gmail.com' from_password='smtpprotocol' #sending mail to specified to_addresses logging.info("Maili...
{ "content_hash": "85cdfadd7ff30c301bc1447d634dcd25", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 52, "avg_line_length": 29.82608695652174, "alnum_prop": 0.6953352769679301, "repo_name": "pcrews/kewpie", "id": "4acd8cfb68ebf70739fc2d221eb8c0465ba8caae", "size": "1549", ...
import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # read data # reader = vtk.vtkGenericEnSightReader() # M...
{ "content_hash": "0ed836f036d535c0c0ff1e5f284e349f", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 81, "avg_line_length": 35.872727272727275, "alnum_prop": 0.811454637607704, "repo_name": "gram526/VTK", "id": "22183c080d3db2e86ee82945b23e63b3282d9896", "size": "1995", ...
"""El Nino dataset, 1950 - 2010""" __docformat__ = 'restructuredtext' COPYRIGHT = """This data is in the public domain.""" TITLE = """El Nino - Sea Surface Temperatures""" SOURCE = """ National Oceanic and Atmospheric Administration's National Weather Service ERSST.V3B dataset, Nino 1+2 http://www.cpc...
{ "content_hash": "6e83baf30308b95dcae1bdda65f5e091", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 79, "avg_line_length": 24.37837837837838, "alnum_prop": 0.6624168514412417, "repo_name": "bert9bert/statsmodels", "id": "35b0bcc1b7b2acdaa95dcdb07dcf2f2c24e75390", "size": ...
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..utils import ( int_or_none, ExtractorError, sanitized_Request, ) class VeohIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?veoh\.com/(?:watch|iphone/#_Watch)/(?P<id>(?:v|e|yapi-)[\da-zA-Z]+)' ...
{ "content_hash": "cc9504fdbe68b2083050bc1dd5b0e64e", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 270, "avg_line_length": 37.78740157480315, "alnum_prop": 0.5384455094811419, "repo_name": "C00kiie/Youtube-Mp3-telegram-bot", "id": "b20dddc5c4eb1307e02da56efc6bff35c603933c...
import sys from stop_words import stopword import os from nltk import stem class gram: def __init__(self,file_name,input_folder,output_folder,complete_file_name,max_gram,pos_filter_file,gram_ext): self.doc_name=complete_file_name #print self.doc_name self.grams={} f=open(self.doc_name,"r") self.max_gram=max_...
{ "content_hash": "cb2e963f78f8f8ce31ac7402db56823a", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 119, "avg_line_length": 26.666666666666668, "alnum_prop": 0.6583333333333333, "repo_name": "amudalab/concept-graphs", "id": "3c615cfc24a30d5b0ecfc31cf31c25736eebbc41", "si...
import pytest import os from csv import Sniffer from natural_bm import callbacks from natural_bm import optimizers from natural_bm import training from natural_bm.models import Model from natural_bm.datasets import random from natural_bm.utils_testing import nnet_for_testing #%% @pytest.mark.parametrize('sep', [',',...
{ "content_hash": "df1a91763d904a61b9608c9f38f3619e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 79, "avg_line_length": 28.38095238095238, "alnum_prop": 0.5838926174496645, "repo_name": "alexhunterlang/natural_bm", "id": "4d9730f5aef0bd8d322583a08360223da84a5f3c", "siz...
from bokeh.io import push_notebook, show, output_notebook import matplotlib.pyplot as plt import numpy as np from bokeh.io import push_notebook, show, output_notebook from bokeh.plotting import figure from pextant.lib.geoshapely import GeoPolygon class TriExpandViz(object): def __init__(self, env_model, start_poi...
{ "content_hash": "066edcee2223d62663a97ac10c6e9c9a", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 122, "avg_line_length": 34.707317073170735, "alnum_prop": 0.5921761536659639, "repo_name": "norheim/pextant", "id": "799e8c16f9f03ccc91502e546680f4a6f3ed567e", "size": "42...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "smallearth.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "d1e6703e7cf0a18e1667a7c19ca4147d", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 74, "avg_line_length": 25.666666666666668, "alnum_prop": 0.7142857142857143, "repo_name": "robertwhaskell/smallearth", "id": "290508c26483236de9df425745ed64df9c9d6755", "siz...
from flask_assets import Bundle from flask_assets import Environment def init_app(app): assets = Environment(app) styles = Bundle( 'main.scss', filters='scss', output='main.css', depends='**/*.scss' ) scripts = Bundle( '*.js', filters=('slimit'), ...
{ "content_hash": "240286a02523b78a1fd41d67aa368c32", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 74, "avg_line_length": 23.535714285714285, "alnum_prop": 0.6084977238239757, "repo_name": "dallbee/Bytelog", "id": "18945ad63c4f4286186477bccdf234ec1fc16f60", "size": "659"...
from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class GpuProcessTestsPage(page_module.Page): def __init__(self, url, name, page_set): super(GpuProcessTestsPage, self).__init__(url=url, page_set=page_set, name=nam...
{ "content_hash": "38e77e40b1605ab6c0d8b6095c16faf2", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 79, "avg_line_length": 36.70422535211268, "alnum_prop": 0.6761320030698388, "repo_name": "Fireblend/chromium-crosswalk", "id": "a93f1039accd793483c117701c587e2ba03debc9", "...
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse fr...
{ "content_hash": "b7bd042bf16aa587303c69cae2db99a5", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 122, "avg_line_length": 41.215, "alnum_prop": 0.6617736261069999, "repo_name": "Azure/azure-sdk-for-python", "id": "ac22a2f6b15884eccf44dc1552cc422f29e5587f", "size": "874...
from itertools import product from lasagne.layers import get_output import matplotlib.pyplot as plt import numpy as np import theano import theano.tensor as T def plot_loss(net): train_loss = [row['train_loss'] for row in net.train_history_] valid_loss = [row['valid_loss'] for row in net.train_history_] ...
{ "content_hash": "9d8680b78be82fda2a2c64db8d670d49", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 78, "avg_line_length": 32.64556962025316, "alnum_prop": 0.5971306708026367, "repo_name": "williford/nolearn", "id": "c73ee97d6eb94887b6c3c801ee55a558c8a1cd59", "size": "77...
class Solution: # @param {int[]} A an integer array # @return {int[]} A list of integers includes the index of the # first number and the index of the last number def continuousSubarraySum(self, A): # Write your code here
{ "content_hash": "4b5a784cb7d290e0144ee12bd3494df5", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 68, "avg_line_length": 44, "alnum_prop": 0.6212121212121212, "repo_name": "quake0day/oj", "id": "795e2da195f065df490bdcee56e2fc64fe1e02ab", "size": "264", "binary": false,...
from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend # models from users.models import User class CustomBackend(ModelBackend): """ Authenticates against users.models.User """ supports_inactive_user = True def authenticate(self, email, password, tok...
{ "content_hash": "aaab8fd037abd460a6f55eb0f78cad40", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 76, "avg_line_length": 29.717391304347824, "alnum_prop": 0.5808339429407462, "repo_name": "magnet-cl/django-project-template-py3", "id": "eb4ab3518d3d310054ec28ec0dc809f96653...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import os import shutil import tempfile import time from unittest import TestCase from po_localization.file_watcher import FileWatcher class FileWatcherTestCase(TestCase): def setUp(self): ...
{ "content_hash": "2c3a760776e3733e776ea7e97e2b8576", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 59, "avg_line_length": 35.080357142857146, "alnum_prop": 0.635530669381522, "repo_name": "kmichel/po-localization", "id": "d6b3e597b899648a809ddf2653daea15374f3ef2", "size...
import contextlib import sys import logging import time import itertools from teuthology.config import config from teuthology.exceptions import MaxWhileTries log = logging.getLogger(__name__) @contextlib.contextmanager def nested(*managers): """ Like contextlib.nested but takes callables returning context ...
{ "content_hash": "c65063b88ce8c45c9e1a6562eb42659f", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 79, "avg_line_length": 33.51034482758621, "alnum_prop": 0.584070796460177, "repo_name": "SUSE/teuthology", "id": "57a0f08c86b6dbc969350aca850f188d2ef0f8a2", "size": "4859"...
from conjureup import events, utils from conjureup.app_config import app from . import common class RegionsController(common.BaseRegionsController): def render(self): if app.provider.region or not self.regions: self.finish(app.provider.region) elif self.default_region: sel...
{ "content_hash": "138803addcf3da39f266a4ece0259571", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 75, "avg_line_length": 35.63636363636363, "alnum_prop": 0.6033163265306123, "repo_name": "ubuntu/conjure-up", "id": "0f70a90653c05959572d8eda22eab8cf4434973a", "size": "784...
import subprocess import setup_util from os.path import expanduser from os import kill python = expanduser('~/FrameworkBenchmarks/installs/py2/bin/python') cwd = expanduser('~/FrameworkBenchmarks/tornado') def start(args): setup_util.replace_text( cwd + "/server.py", "localhost", args.database_host) ...
{ "content_hash": "d104864c77899d8541b061209c34ccec", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 101, "avg_line_length": 30.32, "alnum_prop": 0.6662269129287599, "repo_name": "julienschmidt/FrameworkBenchmarks", "id": "913031dbbf76ee93b53812d35b54e101df1f9d1f", "size":...
from .client import TensorboardServiceClient from .async_client import TensorboardServiceAsyncClient __all__ = ( "TensorboardServiceClient", "TensorboardServiceAsyncClient", )
{ "content_hash": "25d4b50fc22165d4a9ce17bb2f362320", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 55, "avg_line_length": 26.428571428571427, "alnum_prop": 0.7891891891891892, "repo_name": "googleapis/python-aiplatform", "id": "91397832d25fe4032de7e4a630b39174c4660a1d", "...
""" Module to control a virtual create """ from ..vrep import vrep as vrep from enum import Enum class VirtualCreate: """ Class to control a virtual create in V-REP. """ def __init__(self, client_id): """Constructor. Args: client_id (integer): V-REP client id. ""...
{ "content_hash": "cc3cba27595785f2291c0f2d0878fdfc", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 114, "avg_line_length": 38.5, "alnum_prop": 0.622564935064935, "repo_name": "USC-ACTLab/pyCreate2", "id": "6a7bdbabade270ee906e0e3f3c87aab6d91b3436", "size": "2464", "bin...
from airflow.sensors.base_sensor_operator import BaseSensorOperator from airflow.utils.decorators import apply_defaults class S3PrefixSensor(BaseSensorOperator): """ Waits for a prefix to exist. A prefix is the first part of a key, thus enabling checking of constructs similar to glob airfl* or SQL LI...
{ "content_hash": "7f86535a2b9dc7caa4ba7974d2b08876", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 84, "avg_line_length": 38.204081632653065, "alnum_prop": 0.6223290598290598, "repo_name": "CloverHealth/airflow", "id": "917dd46e26c288a0eb9f01dab3bea139dabf194c", "size": ...
import time from shotgun import settings class Config(object): def __init__(self, data=None): self.data = data self.time = time.localtime() def _timestamp(self, name): return "{0}-{1}".format( name, time.strftime('%Y-%m-%d_%H-%M-%S', self.time) ) ...
{ "content_hash": "d3108e257814d3fd6aa99d47bd83750b", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 62, "avg_line_length": 27.294117647058822, "alnum_prop": 0.5506465517241379, "repo_name": "andrei4ka/fuel-web-redhat", "id": "86d4dce74e6c2c66162a581e555b5fcb4e6bbb79", "si...
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer class AlertHandler(BaseHTTPRequestHandler): def do_POST(self): # print out new alert changes print(self.rfile.read(int(self.headers['Content-Length']))) self.send_response(200) self.end_headers() def run(): httpd ...
{ "content_hash": "1e457eb02734c82199d106f905de7b0c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 67, "avg_line_length": 23.1, "alnum_prop": 0.645021645021645, "repo_name": "yaacov/mohawk", "id": "667ae4ba83fca63cbb6ca67eb78f888e814765a8", "size": "484", "binary": fal...
answer1 = widget_inputs["radio1"] answer2 = widget_inputs["radio2"] answer3 = widget_inputs["radio3"] answer4 = widget_inputs["radio4"] answer5 = widget_inputs["radio5"] answer6 = widget_inputs["radio6"] answer7 = widget_inputs["radio7"] answer8 = widget_inputs["radio8"] answer9 = widget_inputs["radio9"] answer10 = wid...
{ "content_hash": "2ccd185fb403ef5950fb82516294f14e", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 103, "avg_line_length": 26.67924528301887, "alnum_prop": 0.698019801980198, "repo_name": "udacity/responsive-images", "id": "746bfcfc47937f4cd108e5619081c7af8daa7e76", "siz...
from m5.SimObject import * from m5.params import * # QoS scheduler policy used to serve incoming transaction class QoSPolicy(SimObject): type = 'QoSPolicy' abstract = True cxx_header = "mem/qos/policy.hh" cxx_class = 'gem5::memory::qos::Policy' class QoSFixedPriorityPolicy(QoSPolicy): type = 'QoSF...
{ "content_hash": "94e3a36e13c5f692c29edcebb8aefbc5", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 77, "avg_line_length": 34.54545454545455, "alnum_prop": 0.6042763157894737, "repo_name": "gem5/gem5", "id": "99a3f2faae4e2f007e8a86d33791b7c9cbfa091c", "size": "5110", "b...
""" Presence analyzer unit tests. """ import os.path import json import datetime import unittest from presence_analyzer import main, utils from presence_analyzer import views # pylint: disable=unused-import TEST_DATA_CSV = os.path.join( os.path.dirname(__file__), '..', '..', 'runtime', 'data', 'test_data.csv' )...
{ "content_hash": "63bd498ee08ac2cb7f6486e62717b515", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 78, "avg_line_length": 31.047210300429185, "alnum_prop": 0.5628974288084048, "repo_name": "stxnext-kindergarten/presence-analyzer-murbanski", "id": "2e7881ea2e2f9fecba8a8ab0...
import rospy class RegisterMonitor(type): def __init__(cls, name, bases, nmspc): super(RegisterMonitor, cls).__init__(name, bases, nmspc) if not hasattr(cls, 'registry'): cls.registry = {} cls.registry[cls.name] = cls # Remove base classes for b in bases: ...
{ "content_hash": "92851f49980b60f769c176831fc1a592", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 91, "avg_line_length": 34.97435897435897, "alnum_prop": 0.5586510263929618, "repo_name": "bfalacerda/strands_apps", "id": "3607dfc6d60f1430b2dfde40b76c51ff480bc965", "size"...
""" Copyright 2014 Rackspace 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 dist...
{ "content_hash": "638d61034acd2e56672c487ef9868b1a", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 79, "avg_line_length": 37.27230046948357, "alnum_prop": 0.6148129487340975, "repo_name": "jmvrbanac/barbican", "id": "5def5904b8085e1646452916f9e510db03f8798f", "size": "7...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('app', '0009_class'), ] operations = [ migrations.AddField( model_name='ability', name='cls', field=models.Foreig...
{ "content_hash": "f401c8d3fabf946c60c5066f680a899d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 66, "avg_line_length": 20.72222222222222, "alnum_prop": 0.5764075067024129, "repo_name": "XcomConvent/xcom40k-shades", "id": "be3e0a0292d75fa533d37e261dd35eaaaece4299", "si...
import apache_beam as beam from log_elements import LogElements class BreakIntoWordsDoFn(beam.DoFn): def process(self, element): return element.split() with beam.Pipeline() as p: (p | beam.Create(['Hello Beam', 'It is awesome']) | beam.ParDo(BreakIntoWordsDoFn()) | LogElements())
{ "content_hash": "1cfb9d5ae4c62143b4ccfe8009e4d9d6", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 51, "avg_line_length": 18.41176470588235, "alnum_prop": 0.6773162939297125, "repo_name": "robertwb/incubator-beam", "id": "8d63b568d439d5042f7af35fda15afde76c73692", "size"...
'''@file tfreader.py contains the TfReader class''' from abc import ABCMeta, abstractmethod, abstractproperty import tensorflow as tf class TfReader(object): '''class for reading tfrecord files and processing them''' __metaclass__ = ABCMeta def __init__(self, datadirs): '''TfReader constructor ...
{ "content_hash": "846a0ebe12d2a824253787dc975c6026", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 78, "avg_line_length": 27.11904761904762, "alnum_prop": 0.5921861281826163, "repo_name": "vrenkens/nabu", "id": "6d3703256883a8e15ff1d65cbff1915e6e679b6a", "size": "2278", ...
__author__ = 'tbeltramelli' import cv2 from pylab import * class UMedia: @staticmethod def get_image(path): return cv2.imread(path) @staticmethod def load_video(path, callback): cap = cv2.VideoCapture(path) is_reading = True while is_reading: is_reading, ...
{ "content_hash": "15a901bff0d12e1f54381d6b98e2fe1a", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 66, "avg_line_length": 26.25862068965517, "alnum_prop": 0.5088640840446487, "repo_name": "tonybeltramelli/Graphics-And-Vision", "id": "32793e480af27e622934e781903b7963232f5b2...
import requests import json base_url = "https://api.sbgenomics.com/v2/" def run_task(token, app_id): url = base_url + "apps/" + app_id headers = {'X-SBG-Auth-Token': token, 'Content-Type': 'application/json'} resp = requests.get(url, headers=headers) #print(resp.json()) print(json...
{ "content_hash": "57dc9896edea33265a5311be9f6f795f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 99, "avg_line_length": 30.956521739130434, "alnum_prop": 0.648876404494382, "repo_name": "hms-dbmi/fourfront", "id": "bcb00688beb5e415759964810d9ff0ccc6796779", "size": "71...
import glob import os import sys from lib.util import execute SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def main(): os.chdir(SOURCE_ROOT) eslint = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'eslint') if sys.platform in ['win32', 'cygwin']: eslint += '.cmd' settin...
{ "content_hash": "b9a167f05f86a647bbe6af5bfde3c580", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 73, "avg_line_length": 24.24137931034483, "alnum_prop": 0.6500711237553343, "repo_name": "Evercoder/electron", "id": "8fa2c3a7e3a7f4fcbed4f69d0d6ddebb0d79ee6d", "size": "72...
import socket from qpid.util import connect TRANSPORTS = {} class SocketTransport: def __init__(self, conn, host, port): self.socket = connect(host, port) if conn.tcp_nodelay: self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) def fileno(self): return self.socket.fileno() class...
{ "content_hash": "0e2c3fd26786cbce182724779edd1a83", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 120, "avg_line_length": 29.52995391705069, "alnum_prop": 0.615792759051186, "repo_name": "irinabov/debian-qpid-python", "id": "c4e7c6834ee64bf00638ec3a94d102252c95f277", "...
from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): help = "Dance around like a madman." args = '' requires_system_checks = '__all__' def add_arguments(self, parser): parser.add_argument("integer", nargs='?', type=int, default=0) parser.add_ar...
{ "content_hash": "6c78eae42ee8efb969a9f4ec9595c441", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 93, "avg_line_length": 40.91304347826087, "alnum_prop": 0.6057385759829969, "repo_name": "koordinates/django", "id": "efa1bc0d8a4f21ed621a55673e63f7bf56dd4671", "size": "94...
''' Created on 2014��11��12�� @author: ��� ''' class ModuleFactory(): _builders = {} def registerModuleBuilder(self, module_type, module_builder): self._builders[module_type] = module_builder; def buildModule(self, module_type, module_config, context=None): builder = sel...
{ "content_hash": "959685b5d71136cb50101ab4099a6307", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 68, "avg_line_length": 22.794117647058822, "alnum_prop": 0.6025806451612903, "repo_name": "kevenli/FeedIn", "id": "3a4187ed314224ca2b53cb4d2919c7ec6e8e46b0", "size": "817",...
''' Copyright (c) 2017 Brandon Butch Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
{ "content_hash": "ca58d99a5a5bc04698275cae3cb76652", "timestamp": "", "source": "github", "line_count": 567, "max_line_length": 157, "avg_line_length": 51.232804232804234, "alnum_prop": 0.5810527040517746, "repo_name": "bbutch/gtrade", "id": "6452b2ac350dd7eef9fdcb9ca159a2e2a117afe0", "size": "2909...
import numpy as np from sklearn.cluster import KMeans import csv from sklearn.datasets import fetch_20newsgroups from sklearn.feature_extraction.text import CountVectorizer from sklearn import tree from sklearn.cross_validation import train_test_split from sklearn.cross_validation import ShuffleSplit from sklearn.utils...
{ "content_hash": "b2063158637fd82eff843122348bd606", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 106, "avg_line_length": 30.160194174757283, "alnum_prop": 0.5974569451150813, "repo_name": "HugoLG/SFCrimeClassification", "id": "e16992da471ea14d5af06611499974ef38cb7dd0", ...
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* '''A script to be executed by Blender Python API to return Blender version''' import bpy print('<?xml version="1.0" encoding="UTF-8"?>') print('<root>') version = bpy.app.version print('<version version="'+str(version[0])+'.'+str(version[1])+'-'\ +bpy.app.version_char+'"...
{ "content_hash": "44395e56da4a5817b0a4d2dabcf50283", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 77, "avg_line_length": 31.181818181818183, "alnum_prop": 0.6326530612244898, "repo_name": "CaptainDesAstres/Blender-Render-Manager", "id": "685e54775f4685cf891d06f406ca5e6313...
from ..excel_comparison_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.set_filename('image46.xlsx') def test_create_file(sel...
{ "content_hash": "9d69ab8afd5d64bc4725c7e8a278c7c9", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 103, "avg_line_length": 25.535714285714285, "alnum_prop": 0.6517482517482518, "repo_name": "jmcnamara/XlsxWriter", "id": "36a541d2a6830142b31704fd739cb1e2351370d1", "size":...
from setuptools import setup #with open("README.rst", 'r') as readme_file: # readme = readme_file.read() readme = """Noto font tools are a set of scripts useful for release engineering of Noto and similar fonts""" setup(name='nototools', version='0.0.1', description='Noto font tools', license="Ap...
{ "content_hash": "37ceb2dee4f09d3daaa69fe5f0d146f3", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 109, "avg_line_length": 38, "alnum_prop": 0.5666293393057111, "repo_name": "davelab6/nototools", "id": "9348f2433f7ca4607c4575da60b0286933ba473d", "size": "1834", "binary...
import os import multiprocessing import serial def start_dosenet(): os.system('sudo bash /home/pi/dosenet-raspberrypi/pocket.sh start') def start_D3S(): os.system('sudo bash /home/pi/dosenet-raspberrypi/D3S.sh start') if __name__ == '__main__': print('Waiting for NTP to be synced...') os.sys...
{ "content_hash": "fa99e3c52b67675e8fc9edfba053204e", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 71, "avg_line_length": 25.62162162162162, "alnum_prop": 0.5991561181434599, "repo_name": "tybtab/dosenet-raspberrypi", "id": "0c36df2924a961f72d314365378fd9f33e936bd6", "si...
""" Person Registry, Controllers @see: U{http://eden.sahanafoundation.org/wiki/BluePrintVITA} """ module = request.controller resourcename = request.function # ----------------------------------------------------------------------------- # Options Menu (available in all Functions' Views) def s3_menu_postp():...
{ "content_hash": "3778dc265d9de241c522bfdde5fcb3c4", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 97, "avg_line_length": 35.970387243735765, "alnum_prop": 0.4453802799062757, "repo_name": "madhurauti/Map-Polygon", "id": "87d93ba6dee997d30446d6fd0a17ef32c3fb8076", "size...
""" There are two definitions of the usable area on the SWIR detector: 'illuminated': Detector area illuminated by external sources, defined as an rectangular area where the signal is at least 50% of the maximum signal. Coordinates: rows [11:228], columns [16:991]. 'level2': A smaller area used in o...
{ "content_hash": "c473f8cbf37c4ca694fbf4841562cb50", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 77, "avg_line_length": 25.63235294117647, "alnum_prop": 0.5846242111302352, "repo_name": "rmvanhees/pys5p", "id": "19eec578ae8d08423c87a71de5e7c14be2f3a40c", "size": "1942"...
from instruments.AWGBase import AWG, AWGDriver from atom.api import Int, Constant class Tek7000(AWG): numChannels = Int(default=2) seqFileExt = Constant('.awg') translator = Constant('TekPattern')
{ "content_hash": "b0ac4b1e247d090cd1784d545259ca7d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 46, "avg_line_length": 28.714285714285715, "alnum_prop": 0.7661691542288557, "repo_name": "rmcgurrin/PyQLab", "id": "401bc8c71a6f7b9abbd8e90c6e18c3ca4a32f75b", "size": "201"...
from distutils.core import setup setup(name = 'simpleon', version ='0.2.0', description = "SimpleON (Simple Object Notation) format decoder", author = "Xinhao Yuan", author_email = "xinhaoyuan@gmail.com", license = "MIT", packages = ['simpleon' ], package_dir = { 'simpleon' : ...
{ "content_hash": "006ebb1a21b62d7306adb26792d6c25f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 71, "avg_line_length": 31.272727272727273, "alnum_prop": 0.5988372093023255, "repo_name": "xinhaoyuan/simpleon", "id": "8a7a6fdbe04eb770d603bd08c0ae511c6745c839", "size": "...
"""Approvals checking logic.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from grr_response_core import config from grr_response_core.lib import rdfvalue from grr_response_server import access_control from grr_response_server import data_store from g...
{ "content_hash": "f5fadca76f3500cee2a20f34fd2b41f9", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 36.11304347826087, "alnum_prop": 0.7358535998073682, "repo_name": "dunkhong/grr", "id": "c61286f25c104f0225482a967c2c081d189b25ce", "size": "4175", ...
"""Beamformers for source localization.""" from ._lcmv import (make_lcmv, apply_lcmv, apply_lcmv_epochs, apply_lcmv_raw, lcmv, lcmv_epochs, lcmv_raw, tf_lcmv) from ._dics import dics, dics_epochs, dics_source_power, tf_dics from ._rap_music import rap_music
{ "content_hash": "15d374db6e4bd80c06b8282bd6b5bc48", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 77, "avg_line_length": 46.5, "alnum_prop": 0.6881720430107527, "repo_name": "jaeilepp/mne-python", "id": "4582fbd71a2013f619a351b94affb03353ac8a4b", "size": "279", "binary...
"""autogenerated by genpy from gf_beacon/gf_encodingRequest.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct class gf_encodingRequest(genpy.Message): _md5sum = "b4f5ff271c45bb829d5e504e08e16e34" _type = "gf_beacon/gf_encodingRequest" _has_header...
{ "content_hash": "e9de13f5f9d82824b357f1011a80eb11", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 213, "avg_line_length": 36.02230483271376, "alnum_prop": 0.6380804953560372, "repo_name": "geofrenzy/utm-mbsb", "id": "e69ac3f38e28b4274891ae72a0ba4cfd8c6cb6b5", "size": "...
from PyQt4 import QtCore, QtGui, Qt class DragLabel(QtGui.QLabel): def __init__(self, text, parent): super(DragLabel, self).__init__(text, parent) self.setMinimumSize(7 * (len(self.text().encode('utf-8')) + len(self.text())), 30) self.setAlignment(Qt.Qt.AlignCenter) self.se...
{ "content_hash": "b44bbd0cc7110be3a79cab435e95b460", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 203, "avg_line_length": 35.07017543859649, "alnum_prop": 0.5167583791895948, "repo_name": "ghold/OneKeySql", "id": "817794ffe32facfb88c73c7018ebb6af74c0a053", "size": "403...
from matplotlib.pylab import * import numpy as np from pymc import * from pymc.distributions.timeseries import * from scipy.sparse import csc_matrix from scipy import optimize # <markdowncell> # Asset prices have time-varying volatility (variance of day over day `returns`). In some periods, returns are highly variab...
{ "content_hash": "c3ab9169835faf13c9e2094f33c091a9", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 456, "avg_line_length": 31.819444444444443, "alnum_prop": 0.6874727193365343, "repo_name": "kyleam/pymc3", "id": "676ec3011025b0ce7c48442701e84fbb995fff9b", "size": "4648"...
import math import pandas as pd from sklearn import preprocessing # A Note on SKLearn .transform() calls: # # Any time you transform your data, you lose the column header names. # This actually makes complete sense. There are essentially two types # of transformations, those that change the scale of your features, # ...
{ "content_hash": "eb7952e8cd6d998fecb60d1335f2c028", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 131, "avg_line_length": 43.93103448275862, "alnum_prop": 0.7344322344322345, "repo_name": "FernanOrtega/DAT210x", "id": "97ac92cd6669173d6c1381b68eb74375a81f52fb", "size": ...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_kavas_urdano.iff" result.attribute_template_id = 9 result.stfName("npc_name","chiss_patron") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "6fdc0c1eb0020b5c4620158958f02431", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 66, "avg_line_length": 22.846153846153847, "alnum_prop": 0.6936026936026936, "repo_name": "anhstudios/swganh", "id": "52aba922a35c3a6b81e3d8eac210c0a68ded0313", "size": "44...
class HTTPError(Exception):pass
{ "content_hash": "22d1fe82f6d95ae83d92bd1953f6256a", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 31, "avg_line_length": 31, "alnum_prop": 0.8709677419354839, "repo_name": "olemis/brython", "id": "3666af57c55ea1f0d666fa4933c1267b4f221ae1", "size": "31", "binary": false...
from __future__ import absolute_import import bokeh.command.subcommands.secret as scsecret from bokeh.command.bootstrap import main def test_create(): import argparse from bokeh.command.subcommand import Subcommand obj = scsecret.Secret(parser=argparse.ArgumentParser()) assert isinstance(obj, Subcomm...
{ "content_hash": "77247467ceb6158ff8fbf9035dd130af", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 88, "avg_line_length": 25.607142857142858, "alnum_prop": 0.6875871687587168, "repo_name": "azjps/bokeh", "id": "b8ee97d8ba245c21e292bb60c8ecedf0a43e7fda", "size": "717", ...
from flask import Flask, request from shutil import copyfile import json, os, requests, redis, collections, thread, time app = Flask(__name__) rackhdHost = "http://localhost:8080" rackhdAPI = rackhdHost + "/api/2.0" rackhdConfig = "~/rackhd-pm2-config.yml" flaskDir = "/home/labadmin/rackhd-scaleio/flask/" notificatio...
{ "content_hash": "523feba32684d322cf34ef0aca7c0be3", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 143, "avg_line_length": 31.20408163265306, "alnum_prop": 0.6536952256376717, "repo_name": "jialehuo/rackhd-scaleio", "id": "cab6f8b85d2311422b9ad7fd0bccd091cdd8bbb1", "siz...
from absl import app from iree.tf.support import tf_test_utils import numpy as np import tensorflow.compat.v2 as tf class ControlFlowModule(tf.Module): def __init__(self): pass @tf.function(input_signature=[tf.TensorSpec([], tf.float32)]) def collatz(self, a): i = 0. while a > 1.: i = i + 1....
{ "content_hash": "01bea1f291cf542ec3ea28a4af09700e", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 70, "avg_line_length": 22.01818181818182, "alnum_prop": 0.6317093311312965, "repo_name": "google/iree", "id": "0196a7f3bdfeb125f016e138ea1f281ee64683cf", "size": "1429", ...
import os import time import pytest import requests from generic_test_code.common import assert_endpoint_response from util import GuardedSubprocess, SearchCriteria, auth_type_str EXHIBITOR_PATH = "/exhibitor/foo/bar" # Note(JP): this test assumes that the IAM is contacted when trying to reach # /mesos_dns. This i...
{ "content_hash": "99ff3cc8af68bba0290fcb2a662e1588", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 93, "avg_line_length": 33.438066465256796, "alnum_prop": 0.5576436573906758, "repo_name": "GoelDeepak/dcos", "id": "281eb28523ea9f96b0d257f9391dcd09015a606d", "size": "111...
from setuptools import setup, find_packages import upyunstorage setup( name = 'django-upyun-storage', version = upyunstorage.__version__, packages = find_packages(), author = 'Fei Tao', author_email = 'filia.tao@gmail.com', license = 'BSD', description = 'Upyun storage backend for Django p...
{ "content_hash": "f8570fe8e2cc7672384b7659c2a04db3", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 78, "avg_line_length": 31.2, "alnum_prop": 0.6256410256410256, "repo_name": "ftao/django-upyun-storage", "id": "9a3df47f1ed72ec5eee23e604bec9f09217d0fe2", "size": "780", ...
""" Main program for the child process run by L{twisted.test.test_stdio.StandardInputOutputTests.test_loseConnection} to test that ITransport.loseConnection() works for process transports. """ from __future__ import absolute_import, division import sys from twisted.internet.error import ConnectionDone from twisted.i...
{ "content_hash": "93b0a05b2d67dcc2a021cb6ded4bc784", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 78, "avg_line_length": 30, "alnum_prop": 0.6659420289855073, "repo_name": "ntuecon/server", "id": "008cff6e74279a329c463dbc1d8b6b4638815081", "size": "1548", "binary": fa...
""" Copyright 2011 Jeff Garzik AuthServiceProxy has the following improvements over python-jsonrpc's ServiceProxy class: - HTTP connections persist for the life of the AuthServiceProxy object (if server supports HTTP/1.1) - sends protocol 'version', per JSON-RPC 1.1 - sends proper, incrementing 'id' ...
{ "content_hash": "03c75cbca2f28e0904a0a74a78da54ea", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 105, "avg_line_length": 37.303225806451614, "alnum_prop": 0.589069526115531, "repo_name": "moneta-develop/moneta", "id": "37d59aab1c05efa2b89e6f601beb86102fac49f4", "size"...
''' Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once in the combination. Note: All numbers (including target) will be positive integers. Elements in a combination (a1, a2, … , ak) must b...
{ "content_hash": "39e03eb6539ea78f24eb463dd042c3e9", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 141, "avg_line_length": 32.68, "alnum_prop": 0.5636474908200735, "repo_name": "gavinfish/leetcode-share", "id": "24101fcbee7dd5f5af277493ff7534cebbec653b", "size": "1644", ...
from Metarouting.Algebra.Semiring import * from Metarouting.Algebra.Products import * from Metarouting.Policy.Routing.ShortestR import * class ShortestOnShortest(Tunnel): zeroElt = (ShortestR.zeroElt, ShortestR.zeroElt) unitElt = (ShortestR.unitElt, ShortestR.unitElt) def __init__(self, val): (s,...
{ "content_hash": "2c9e949469da60898f75480d1422911e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 52, "avg_line_length": 28.842105263157894, "alnum_prop": 0.6094890510948905, "repo_name": "sdynerow/SemiringsLibraryPython", "id": "4af3784e943fe9f12ecfcb6012fc70a0b3d95cf4",...
from random import Random class Cell(object): def __init__(self, is_wall): self.is_wall = is_wall if not is_wall: self.in_maze = False # This is only looked at if it's not a wall def generate_maze(height, width): # Width and height including walls: full_width = width*2 + 1 ...
{ "content_hash": "7fe4b32a0577f8307e2d603054e07a7c", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 80, "avg_line_length": 38.74324324324324, "alnum_prop": 0.5434251831182421, "repo_name": "graue/mazegen", "id": "2909e0281a7855f442d4869039e32df0efdc8bd5", "size": "2918", ...
from .connection import Connection from .account_management import AccountManagement from .provisioning import Provisioning # from .reporting import Reporting # from .audit import Audit class Client: def __init__(self, username, password, host="api.security.biz"): """ Initialize the client. Arguments: username...
{ "content_hash": "1721f5f792a5da3c849c88da85d196d2", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 75, "avg_line_length": 28.5, "alnum_prop": 0.7506265664160401, "repo_name": "sbarbett/ssp-sdk-python", "id": "5ebc0ca49c97237dbab2d1b22dcc83509de9b98d", "size": "1394", "...
from __future__ import print_function, absolute_import def show(*args, **kw): # Compatibility with dss 0.6 or older. # Use dss.tools.show.show instead print(*args, **kw) class DictObj(dict): """ Dictionary with attribute syntax to get, set and delete items. """ def __getattr__(self, item): ...
{ "content_hash": "39de461d87727ce53286ec8341767956", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 74, "avg_line_length": 24.645833333333332, "alnum_prop": 0.5655114116652579, "repo_name": "terabit-software/dynamic-stream-server", "id": "6f2dceb3b00489712861881f49429140926...
"""Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath import os class Resamp...
{ "content_hash": "72b0f4c697816892e6c211cc545e2872", "timestamp": "", "source": "github", "line_count": 370, "max_line_length": 657, "avg_line_length": 63.18378378378378, "alnum_prop": 0.7595174950808452, "repo_name": "FCP-INDI/nipype", "id": "cb87deb4f5f33abf2807609537e14ce5a9414c5b", "size": "234...
from django.conf.urls.defaults import url, patterns, include from .app.views import TestView urlpatterns = patterns( '', url('^', include('mob.urls', namespace = 'mob')), url('^$', TestView.as_view()), )
{ "content_hash": "ae63432e504ff77e3de283c24652ba13", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 60, "avg_line_length": 27.125, "alnum_prop": 0.6497695852534562, "repo_name": "caffeinehit/django-mob", "id": "8edfa6f30a941ac06ac03514a611f2f072324514", "size": "217", "b...
# The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j ខែ F ឆ្នាំ Y' TIME_FORMAT = 'G:i:s' DATETIME_FORMAT = 'j ខែ F ឆ្នាំ Y, G:i:s' # YEAR_MONTH_FORMAT = MONTH_DAY_FORMAT = 'j F' SHORT_DATE_FORMAT = 'j M Y' SHORT_DAT...
{ "content_hash": "e48f6645426b704db7e88a0f6e313ff7", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 77, "avg_line_length": 33.9, "alnum_prop": 0.672566371681416, "repo_name": "marcosmodesto/django-testapp", "id": "7a39d92ead90c79fe2a82c80aea5240763597c70", "size": "810", ...
import jmespath import logging import time from botocore_eb.exceptions import WaiterError logger = logging.getLogger(__name__) class Waiter(object): """Wait for a resource to reach a certain state. In addition to creating this class manually, you can also use ``botocore.service.Service.get_waiter`` t...
{ "content_hash": "5c977963bd07233d1c00b798ba69381d", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 86, "avg_line_length": 40.0253164556962, "alnum_prop": 0.5653067678684377, "repo_name": "ianblenke/awsebcli", "id": "6e920b060b9dd7faae0664e5d9172cc02b2d67ec", "size": "68...
import os import time from arnold import * testNumber = "test_0001" print("[FabricArnold::TestSuite] Generating reference image for {0}...".format(testNumber)) start = time.clock() AiBegin() # create a sphere sphere = AiNode("sphere") AiNodeSetStr(sphere, "name", "mysphere") AiNodeSetFlt(sphere, "radi...
{ "content_hash": "9d45befdeb1f30c0afd4df343ae66b93", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 91, "avg_line_length": 29.318181818181817, "alnum_prop": 0.7085271317829457, "repo_name": "wildparky/FabricArnold", "id": "e093c8a942cffdaad7a3c1972f415bb1d9e61350", "size"...
import os import sys import hashlib import configparser import random import binascii ERR_PASSWD = "__err_passwd__" INF_SERDOWN = "__info_serverdown__" CL_HELLO = "__client_hello__" CL_EXIT = "__client_bye__" VERSION = '0.91.5 AES' CODENAME = 'Pockenberg' AUTHOR = 'Anna-Sophia Schroeck <pba3h11aso@t-online.de>' PYMD...
{ "content_hash": "4a932a44a3e99031e3424cd658801ac4", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 70, "avg_line_length": 33.828125, "alnum_prop": 0.5480369515011547, "repo_name": "RoseLeBlood/pyMD", "id": "daef02842c805ecf989f0947c1c06e8fb93cc57f", "size": "5222", "b...
import string import types from module_info import * from module_mission_templates import * from process_common import * from process_operations import * mission_template_name_pos = 0 mission_template_flags_pos = 1 mission_template_types_pos = 2 mission_template_desc_pos = 3 mission_template_groups_pos ...
{ "content_hash": "1fb4cbb17f3aa1bf362d9fc6ad93879a", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 392, "avg_line_length": 61.29824561403509, "alnum_prop": 0.6853176874642244, "repo_name": "nycz/useful-sisters", "id": "80360c483f168169a18da16cdc82047b2a71bcd7", "size": ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Main', '0004_auto_20170903_2029'), ] operations = [ migrations.RenameField( model_name='article', old_name='category_id', ...
{ "content_hash": "623ffa819e933bc929a0fb5621eda97f", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 85, "avg_line_length": 25, "alnum_prop": 0.53375, "repo_name": "Lobo-Prix/Blog", "id": "be124357e070e6961fbbdc247b6a56c39a22483d", "size": "873", "binary": false, "copi...
import mock import re from stronghold import conf from stronghold.middleware import LoginRequiredMiddleware from django.core.urlresolvers import reverse from django.http import HttpResponse from django.test import TestCase from django.test.client import RequestFactory class StrongholdMiddlewareTestCase(TestCase): ...
{ "content_hash": "fca40a8f5b41ba8e005cc3696421927b", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 80, "avg_line_length": 31.432835820895523, "alnum_prop": 0.6885090218423552, "repo_name": "klenks/jobsportal", "id": "51e1d5320108a80d288c258e051fa0aa8c03feb6", "size": "21...
from interviewcake.tree_binary import * def largest(node): while node.right: node = node.right return node def second_largest(node): prev_largest = None while node: if node.right: prev_largest = node node = node.right continue if node.left...
{ "content_hash": "3211e9d36a98179074ec0daf63d50fcd", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 39, "avg_line_length": 18.62295081967213, "alnum_prop": 0.4744718309859155, "repo_name": "JDFagan/InterviewInPython", "id": "6aa12d5c21bc6ea8f18af872b7501ecf5ba7ec66", "siz...
from collections import OrderedDict from glob import glob import os from agate.table import Table @classmethod def from_csv(cls, dir_path, column_names=None, column_types=None, row_names=None, header=True, **kwargs): """ Create a new :class:`TableSet` from a directory of CSVs. See :meth:`.Table.from_csv...
{ "content_hash": "4e61c8298cea88f8e22b1e5ed3a0787e", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 117, "avg_line_length": 30.17948717948718, "alnum_prop": 0.6448598130841121, "repo_name": "flother/agate", "id": "81af9b490e678ece4bc591534ae7bfd36ae3dc2e", "size": "1200",...
from msrest.serialization import Model from msrest.exceptions import HttpOperationError class Error(Model): """Error. :param status: :type status: int :param message: :type message: str :param parent_error: :type parent_error: :class:`Error <Fixtures.AcceptanceTestsModelFlattening.mo...
{ "content_hash": "ff98952635120bcf929a7bb372f7fc5b", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 83, "avg_line_length": 27.92105263157895, "alnum_prop": 0.6352497643732328, "repo_name": "tbombach/autorest", "id": "f4119b0cfaede686ea7bc55626769aa3d516a9b7", "size": "153...
""" pygments.lexers.textfmts ~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for various text formats. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups from pygments.token import Text, Comment...
{ "content_hash": "59e2c24789d707b3e3f986718c5f5b5d", "timestamp": "", "source": "github", "line_count": 296, "max_line_length": 89, "avg_line_length": 36.58108108108108, "alnum_prop": 0.5026782415958626, "repo_name": "GarySparrow/mFlaskWeb", "id": "cab9add544648d63129cb8d0632b7f412caa6712", "size":...
""" setup.py for mock.matchers """ __author__ = "Ali-Akber Saifee" __email__ = "ali@indydevs.org" __copyright__ = "Copyright 2014, Ali-Akber Saifee" from setuptools import setup, find_packages import os this_dir = os.path.abspath(os.path.dirname(__file__)) REQUIREMENTS = filter(None, open( os.path.join(this_dir,...
{ "content_hash": "6593efbad7c5326b6ae8d5eadf084dd5", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 76, "avg_line_length": 29.605263157894736, "alnum_prop": 0.696, "repo_name": "alisaifee/mock-matchers", "id": "da9489c111add49869f9b1a137c86188ea3eb157", "size": "1125", ...
import argparse import json import yaml from typing import Dict, List skipped_phi_api_list_file = "/tools/infrt/skipped_phi_api.json" api_yaml_file = "/paddle/phi/api/yaml/api.yaml" legacy_api_yaml_file = "/paddle/phi/api/yaml/legacy_api.yaml" def get_skipped_kernel_list(): skiped_kernel_list = [] with open(...
{ "content_hash": "039afbc3a96e60aeb6cd63d6b987bf73", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 129, "avg_line_length": 31.005102040816325, "alnum_prop": 0.5567714332729965, "repo_name": "PaddlePaddle/Paddle", "id": "9eeee88276d80c58839a3db40aa29b00d93bbde1", "size":...
import datetime import logging import re from concurrent.futures import ThreadPoolExecutor import botocore import pytz import autoscaler.aws_utils as aws_utils import autoscaler.utils as utils logger = logging.getLogger(__name__) class AutoScalingGroups(object): _BOTO_CLIENT_TYPE = 'autoscaling' _CLUSTER_...
{ "content_hash": "8240d8d0a4fb461a61e0b5691a155b7c", "timestamp": "", "source": "github", "line_count": 548, "max_line_length": 312, "avg_line_length": 45.17153284671533, "alnum_prop": 0.5660499313242304, "repo_name": "openai/kubernetes-ec2-autoscaler", "id": "ca6a91374d0f42d1d65a8e42efbdf2623ec082e1...