text
stringlengths
4
1.02M
meta
dict
__author__ = "Anton Panasenko" __copyright__ = "Copyright 2013, Qubell.com" __license__ = "Apache" __email__ = "apanasenko@qubell.com" import unittest import yaml import logging as log import re from functools import wraps from qubell.api.globals import * from qubell.api.private.service import COBALT_SECURE_STORE_T...
{ "content_hash": "7e58e2c50a2b8281efd8917c83c2e9a2", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 137, "avg_line_length": 37.93785310734463, "alnum_prop": 0.5577066269545793, "repo_name": "SergeyKemaev/contrib-python-qubell-client", "id": "2a96e160b11f88585f52b8f233d2bd0...
import random from templates.text import TextTemplate def process(input, entities=None): greetings = [ 'Have a good day, sir.', 'Wonderful, I think it\'s time for my evening nap...', 'Bye to you as well, sir.', 'It was my pleasure talking to you.', 'Oh, please do not go!',...
{ "content_hash": "d31bc24bce50ea6a5352b5f3feeba9f4", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 88, "avg_line_length": 33.46153846153846, "alnum_prop": 0.5862068965517241, "repo_name": "swapagarwal/JARVIS-on-Messenger", "id": "2b2b5865239e5fd0311348e0fd17b69decd7bebc", ...
import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * import lldbsuite.test.lldbutil as lldbutil import os import unittest2 import shutil class TestSwiftBridgingHeaderHeadermap(TestBase): mydir = TestBase.compute_mydir(__file__) NO_DEBUG_INFO_TESTCASE = True def setUp(...
{ "content_hash": "9bc87ed1b8fb9aa5e229f6a40b924ed7", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 81, "avg_line_length": 31.857142857142858, "alnum_prop": 0.6322869955156951, "repo_name": "apple/swift-lldb", "id": "e5e5bbb05e77aa10f4aa6edd7267358cbe310d15", "size": "202...
import tornado.web from run_service import make_app from tests.handlers.handler_test_case import HandlerTestCase class MockWeatherHandler(tornado.web.RequestHandler): def get(self): self.finish({ "query": { "count": 1, "created": "2017-11-09T17:30:06Z", ...
{ "content_hash": "9e8a9faeb0bb2a63b740f27ba776ee76", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 78, "avg_line_length": 32.51020408163265, "alnum_prop": 0.4896421845574388, "repo_name": "tjensen/PyTexas2017", "id": "b9da42e5fec1609f765c0664690b1ae6f7ea12d5", "size": "1...
""" .. module: security_monkey.common.utils.utils :platform: Unix :synopsis: Utility methods pasted and bastardized from all over the place. Can probably be removed completely. .. version:: $$VERSION$$ .. moduleauthor:: Patrick Kelley <pkelley@netflix.com> @monkeysecurity """ from security_monkey import app,...
{ "content_hash": "1dfc7c36a7bd1ab6714dce73802627c6", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 114, "avg_line_length": 32.373493975903614, "alnum_prop": 0.5597320431708225, "repo_name": "monkeysecurity/security_monkey", "id": "92b887939082c2a4d549332e8d12063173ae062c",...
"""This module contains support for various built-in output mechanisms. Here, a base OutputToFile class is implemented to provide simple output to a file via the pickle serialization mechanism. It can be subclassed to implement alternative serialization schemes, see json_factory.py and mfg_inspector.py for examples. "...
{ "content_hash": "a4bba2bc4f1fb8b75b1ee5feb9634f11", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 80, "avg_line_length": 32.34444444444444, "alnum_prop": 0.7238062521470285, "repo_name": "ShaperTools/openhtf", "id": "d120600a305ead3df4c157da86200e15223ba9e8", "size": "3...
from datetime import timedelta from django.utils.timezone import now from pos.models.shift import Shift from pos.models.stock import Order from pos.models.user import User from rest_framework import serializers class ShiftSerializer(serializers.ModelSerializer): cash = serializers.SerializerMethodField() c...
{ "content_hash": "0dcb8ca9bef3041a51affb46f5785fbd", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 112, "avg_line_length": 31.392857142857142, "alnum_prop": 0.664012135001896, "repo_name": "nuxis/p0sX-server", "id": "9060db36d22df8f873a15d26e47ae92855b8d7fa", "size": "26...
"""Extract and save accuracy to 'stats/accuracy.json'. The accuracy is extracted from the most recent eventfile. """ import glob import json import os.path from absl import app from absl import flags import numpy as np import tensorflow as tf FLAGS = flags.FLAGS TAG = 'accuracy' def summary_dict(accuracies): r...
{ "content_hash": "00dad062f76af09610fd5ec95dc48c22", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 81, "avg_line_length": 27.49056603773585, "alnum_prop": 0.6115305422100206, "repo_name": "google-research/mixmatch", "id": "db443900faba9fc36cfec4846ac7870ebb1d4c64", "size...
from google.cloud import automl_v1beta1 def sample_deploy_model(): # Create a client client = automl_v1beta1.AutoMlClient() # Initialize request argument(s) request = automl_v1beta1.DeployModelRequest( name="name_value", ) # Make the request operation = client.deploy_model(reques...
{ "content_hash": "c2113d842d6df8797d6bfbda22870276", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 56, "avg_line_length": 22.695652173913043, "alnum_prop": 0.6934865900383141, "repo_name": "googleapis/python-automl", "id": "7d39d1da7af8bf18eec16dd84c48f214523a2cca", "siz...
from cpress import *
{ "content_hash": "a9d68e90c370d900e6f20323b0cbacdd", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 20, "avg_line_length": 20, "alnum_prop": 0.8, "repo_name": "solusipse/cpress", "id": "265b66c1c500a339c2e5926776f14a7fcd5fc787", "size": "20", "binary": false, "copies":...
"""Tests for unspect_utils module.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from functools import wraps import imp import types import weakref import six from tensorflow.python import lib from tensorflow.python.autograph.pyct import inspect_util...
{ "content_hash": "7bb14f26f1949e714af0aa28a3c84bed", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 78, "avg_line_length": 25.255072463768116, "alnum_prop": 0.6695741994720532, "repo_name": "brchiu/tensorflow", "id": "622e3bafc0ab3d7dd8876cbbbee45f8055c48056", "size": "9...
''' SYNBIOCHEM-DB (c) University of Manchester 2015 SYNBIOCHEM-DB is licensed under the MIT License. To view a copy of this license, visit <http://opensource.org/licenses/MIT/>. @author: neilswainston ''' # pylint: disable=too-many-public-methods import unittest from synbiochem.biochem4j import taxonomy class Te...
{ "content_hash": "0c53e6e7866017728595f1b0c1b6eb20", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 78, "avg_line_length": 30.795454545454547, "alnum_prop": 0.6369003690036901, "repo_name": "synbiochem/synbiochem-py", "id": "8333f3bb383c02964ff282b06b4874e0715d5603", "siz...
""" This is the single point of entry to generate the sample configuration file for Arestor. """ import collections from arestor.config import base as conf_base from arestor.config import factory as conf_factory def get_options(): """Collect all the options info from the other modules.""" options = collecti...
{ "content_hash": "fdf6eddd0f252baa9ad11aaff94d4599", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 72, "avg_line_length": 32.15, "alnum_prop": 0.7076205287713841, "repo_name": "alexcoman/arestor", "id": "1785b5ea9de0f290f2c89d61ac2fe1de2aa9cc85", "size": "1259", "binar...
import os,datetime,hashlib from app import app,webscrape import chardet def process_source(token,uploadedfile=None,weburl=None): sourcefilename = os.path.join(app.config['UPLOAD_FOLDER'],''.join(['source',token,'.txt'])) if uploadedfile: process_uploaded_txt_file(uploadedfile=uploadedfile,targ...
{ "content_hash": "c1e7a49a162d8cb1712012874ae7f568", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 119, "avg_line_length": 32.791666666666664, "alnum_prop": 0.6416772554002541, "repo_name": "OlegPyatakov/tagclouds", "id": "27dea6a476849149b3d09dc7f237fc9f7867fd69", "size...
from msrest.serialization import Model class RuleDataSource(Model): """The resource from which the rule collects its data. You probably want to use the sub-classes and not this class directly. Known sub-classes are: RuleMetricDataSource, RuleManagementEventDataSource :param resource_uri: the resourc...
{ "content_hash": "0a931d8dce6042da16fd83478068ec22", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 221, "avg_line_length": 35.4375, "alnum_prop": 0.6798941798941799, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "9dbcb1e1a5b754a1c19f7273755fde62bef8745f", "size":...
from sqlnice import * from tablenice import * from columnnice import * from functions import *
{ "content_hash": "ce2b966bc1a280a8f3ae47304bbfb1ea", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 24, "avg_line_length": 23.5, "alnum_prop": 0.7978723404255319, "repo_name": "TRBaldim/sqlNice", "id": "2a58185e75aabaa93ae7ff36905d26ab524f0e07", "size": "94", "binary": f...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/furniture/modern/shared_coffee_table_modern_style_01.iff" result.attribute_template_id = 6 result.stfName("frn_n","frn_coffee_table") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return r...
{ "content_hash": "9d32a334061a6b0a0c877cf04104c883", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 93, "avg_line_length": 25, "alnum_prop": 0.7046153846153846, "repo_name": "anhstudios/swganh", "id": "58c06d28d6ca77daa57376dff6369926e8a85af2", "size": "470", "binary": ...
def FancyDivide(list_of_numbers, index): denom = list_of_numbers[index] return [SimpleDivide(item, denom) for item in list_of_numbers] def SimpleDivide(item, denom): try: return item / denom except: return 0
{ "content_hash": "e3ee2d4e7af174b28bf4610221649a57", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 43, "avg_line_length": 23.09090909090909, "alnum_prop": 0.6259842519685039, "repo_name": "xala3pa/Introduction-to-Computer-Science-and-Programming-with-python", "id": "dc8cba...
from yapsy.IPlugin import IPlugin import datetime import pymssql import re class PluginModelo(IPlugin): ''' Retorna provider do beneficiario para checagens - Nome - Sexo - Nascimento - Datas de inativação ''' name = "PROVIDER BENEFICIARIO" def executa(self, objeto): pri...
{ "content_hash": "de6f051feef16456d8897af2661b8f79", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 88, "avg_line_length": 32.17333333333333, "alnum_prop": 0.5337753833402403, "repo_name": "dudanogueira/tiss", "id": "e6172f6cbb434548af8c234d8a7685319dcd2097", "size": "243...
""" Tools for different regimes procedure estimations """ __author__ = "Luc Anselin luc.anselin@asu.edu, \ Daniel Arribas-Bel darribas@asu.edu, \ Pedro V. Amaral pedro.amaral@asu.edu" import numpy as np import pysal import scipy.sparse as SP import itertools as iter from scipy.stats import f, ...
{ "content_hash": "c95047b9bfe19367127ab1835c9b7b63", "timestamp": "", "source": "github", "line_count": 572, "max_line_length": 192, "avg_line_length": 37.66258741258741, "alnum_prop": 0.5497841526249826, "repo_name": "pombreda/pysal", "id": "bbf45a2c6b3bd5d836dbfddc989b18c15a49b0e9", "size": "2154...
from classes import wunderpy_wrapper from classes import grocerylist from classes import grocerystore wp = wunderpy_wrapper.wunderpy_wrapper('../data/tokens.csv') obj = wp.get_task_positions_obj(wp.WUNDERLIST_GROCERY) grocery_store = grocerystore.groceryStore('../data/store_order_zehrs.csv', '../data/ingredient_categ...
{ "content_hash": "15a6c3687085661fdbe4c90efccf6bef", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 154, "avg_line_length": 37.333333333333336, "alnum_prop": 0.7869897959183674, "repo_name": "briancousins/RecipeBook", "id": "fda9c7db46182b5e50d8cdae4bc4d814f49e0e1f", "siz...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('schools', '0005_auto_20160407_0115'), ] operations = [ migrations.RemoveField( model_name='school', name='picture', ), ]...
{ "content_hash": "31c5908077516a2a9d7a82d429078f76", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 47, "avg_line_length": 18.88235294117647, "alnum_prop": 0.5856697819314641, "repo_name": "AnimeshSinha1309/WebsiteEdunet", "id": "4a6f4468e01ec7ccd4bae728e8717c38a12436e4", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('user', '0050_auto_20170826_0316'), ] operations = [ migrations.AlterField( model_name='userreviewlist', name='comment', ...
{ "content_hash": "9269eb1470c9d6214b0f2ae816876822", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 86, "avg_line_length": 23.333333333333332, "alnum_prop": 0.6047619047619047, "repo_name": "internship2016/sovolo", "id": "8e897dc61a4aae26e59829db9e0f2f404e66f036", "size":...
''' HRF Functions ============= Various Hemodynamic Response Functions (HRFs) implemented by NiPy Copyright (c) 2006-2017, NIPY Developers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistr...
{ "content_hash": "4fef8ece0eddca46532d02a7ac37e9c9", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 78, "avg_line_length": 35.824858757062145, "alnum_prop": 0.6633023182463333, "repo_name": "elvandy/nltools", "id": "175167a494634ad8a095846f9ab41f8d73b275af", "size": "634...
import sys import os from bgenlocations import TOOLBOXDIR, BGENDIR sys.path.append(BGENDIR) from scantools import Scanner LONG = "Icons" SHORT = "icn" OBJECT = "NOTUSED" def main(): input = LONG + ".h" output = SHORT + "gen.py" defsoutput = TOOLBOXDIR + LONG + ".py" scanner = MyScanner(input, output, ...
{ "content_hash": "124486adc10b959a010919c1b0580da1", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 85, "avg_line_length": 29.557142857142857, "alnum_prop": 0.5451909134847752, "repo_name": "TathagataChakraborti/resource-conflicts", "id": "bdc3b84413e7c7fa8709d34878ff63ce25...
import behave from behave import step from commons.rest_utils import RestUtils from commons.constants import TENANT_DOC, TENANT_OWNER, TENANT_VERSION, TENANT_WSIZE, TENANT_DEFAULT_DOC from commons.configuration import HEADERS, TENANT_ID import commons.utils as Utils api_utils = RestUtils() behave.use_step_matcher("re"...
{ "content_hash": "966bcdd33dfdd5dc6cee5367a409616e", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 114, "avg_line_length": 38.641304347826086, "alnum_prop": 0.6149085794655414, "repo_name": "Fiware/cloud.Cloto", "id": "a8fbb00b2cc8899e2a01be30252c5ad2a9665443", "size": "...
import os, sys, time, threading, traceback import struct, math, json import dbus.service from dbus.mainloop.glib import DBusGMainLoop from gi.repository import GObject DBusGMainLoop(set_as_default=True) ble = dbus.Interface(dbus.SystemBus().get_object("com.devicehive.bluetooth", "/com/devicehive/bluetooth"), "com.dev...
{ "content_hash": "9dea985b1aec619e6195e5517c40ef86", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 134, "avg_line_length": 30.47142857142857, "alnum_prop": 0.6223628691983122, "repo_name": "devicehive/IoT-framework", "id": "62a193ee5e14aaed517504bd34346c669f3486a1", "si...
import numpy as np import lms_code.lib.rep2 as rep2 import lms_code.plots.plot_all as lms_plot from lms_code.lib.volume_mesh import VolumeMesh import sys sys.setrecursionlimit(50000) def get_leftmost(mesh): leftmost_pt = np.array([1e9, 1e9]) for e in mesh: for v in [e.vertex1, e.vertex2]: i...
{ "content_hash": "05029069f75b3ea67128d98601803938", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 76, "avg_line_length": 32.42, "alnum_prop": 0.5854410857495373, "repo_name": "tbenthompson/LMS_public", "id": "baed9059eb312b9acac4ce335ea3d750df04a4c0", "size": "1621", ...
""" Simple man page writer for reStructuredText. Man pages (short for "manual pages") contain system documentation on unix-like systems. The pages are grouped in numbered sections: 1 executable programs and shell commands 2 system calls 3 library functions 4 special files 5 file formats 6 games 7 miscellaneou...
{ "content_hash": "761698b9e38a015811eebbbb1aa671e5", "timestamp": "", "source": "github", "line_count": 1099, "max_line_length": 80, "avg_line_length": 30.461328480436762, "alnum_prop": 0.5438958090629388, "repo_name": "aswadrangnekar/khandelwal", "id": "a02b92d4527fd431d0e02969169e2cbc9c00c43f", "...
import keras import numpy as np from matplotlib import pyplot as plt from skimage import transform model = keras.applications.InceptionResNetV2(include_top=False) (X_train, y_train), (X_test, y_test) = keras.datasets.cifar10.load_data() def generate(X, y, batch_size): while True: choices = np.random.ch...
{ "content_hash": "2f7f1e2ca01c1bd6ccbb3274b881532c", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 100, "avg_line_length": 34.42857142857143, "alnum_prop": 0.7017634854771784, "repo_name": "amozie/amozie", "id": "dd0902b581a41edc51cbcdb3969982ce1015ea07", "size": "1928",...
from bottle import request, response, static_file, redirect from admin.config.config import ROOT #@render('home/index.html') def index(): return redirect('/project/index/1') def static(path): return static_file(path, ROOT+ '/static')
{ "content_hash": "1d580fe8011dbc7791db79c137439597", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 59, "avg_line_length": 27.11111111111111, "alnum_prop": 0.7254098360655737, "repo_name": "seraphlnWu/in_trip", "id": "780ffd4043b33b3774f3bd8a2acd29b64df308d1", "size": "259...
def flatten(nested_list): return [item for sublist in nested_list for item in sublist] def mean(values): return sum(values) / len(values) def sign(value): if value < 0: return -1 if value == 0: return 0 if value > 0: return 1
{ "content_hash": "850f0a3dd852eefbb23167b34e6ac46f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 64, "avg_line_length": 21.166666666666668, "alnum_prop": 0.6377952755905512, "repo_name": "probablytom/msci-model", "id": "107f9d8a67131900ce771fedf0e74aa6366190e2", "size"...
import os import sys from django.conf import settings from django.conf.urls import patterns, include, url from django.http import HttpResponse from django.core.management import execute_from_command_line filename = os.path.splitext(os.path.basename(__file__))[0] urlpatterns = patterns( '', url(r'psql/select'...
{ "content_hash": "d661b3cb119bb6bca8a7791c0860b2a6", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 66, "avg_line_length": 26.727272727272727, "alnum_prop": 0.7091836734693877, "repo_name": "vvv-v13/backend-tools", "id": "e9d4597623275a0c99f9c1d3a44ba1920e4b91f1", "size":...
import sys import eventlet eventlet.monkey_patch() from oslo_config import cfg from tacker.common import config from tacker.openstack.common import service as common_service from tacker import service from tacker.openstack.common import gettextutils from tacker.openstack.common import log as logging gettextutils.in...
{ "content_hash": "0f0b8fc4f7cefcc9023f67547f885846", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 77, "avg_line_length": 28.641025641025642, "alnum_prop": 0.6454789615040286, "repo_name": "SripriyaSeetharam/tacker", "id": "6c652096b302f379872a0ee214b91d16ecc280c6", "siz...
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ...
{ "content_hash": "3944773809f74ff5300daa96656c92d9", "timestamp": "", "source": "github", "line_count": 659, "max_line_length": 210, "avg_line_length": 47.71775417298938, "alnum_prop": 0.6552820708516186, "repo_name": "Azure/azure-sdk-for-python", "id": "b0e7aaa82412788fa13a964763b24061eceadfb1", "...
from django.apps import AppConfig class SunConfig(AppConfig): name = 'sun'
{ "content_hash": "a9a1b24bd579ea461a06552a987af0ff", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 16.2, "alnum_prop": 0.7283950617283951, "repo_name": "k00n/site_update_notifier", "id": "6b26b5234f9c8e3d8999d4a4cbe6d3299a30accc", "size": "81", "b...
""" Copyright 2022 Google LLC 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": "7b11fc94193dcd8ee9cc4eeb221b12ee", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 72, "avg_line_length": 33.895833333333336, "alnum_prop": 0.7197295636140135, "repo_name": "googledrive/python-quickstart", "id": "fb97be41b1e535a9ee61168adb08fa4c8c132f4c", ...
from pyportfolio.models import Equity, Option, Future, Account, Trade, Commodity, Index, Currency, TradeList from datetime import date import unittest AAPL = Equity(ticker='AAPL') AAPL_option = Option(underlying=AAPL, expiry=date(2016, 6, 30), strike=105, type='call') copper = Commodity(name='Copper') cu_future = Futu...
{ "content_hash": "85e0d6de465774fe665696db2b196816", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 108, "avg_line_length": 35.16216216216216, "alnum_prop": 0.6979246733282091, "repo_name": "davidastephens/pyportfolio", "id": "8ca300a189835a574070d57d6a1fca94de4df2ff", "s...
from flask_classy import route from flask import request, jsonify, Response from marvin.tools.query import doQuery, Query from marvin.core.exceptions import MarvinError from marvin.api.base import BaseView, arg_validate as av from marvin.utils.db import get_traceback import json def _getCubes(searchfilter, **kwargs):...
{ "content_hash": "2530287761c449468c1746b6a7c7d7bf", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 108, "avg_line_length": 41.51122194513716, "alnum_prop": 0.5842845127958669, "repo_name": "bretthandrews/marvin", "id": "5f1f22a0dabbb9931aa4c76c72a157e085ddc898", "size":...
from __future__ import unicode_literals, print_function, division __author__ = "mozman <mozman@gmx.at>" import unittest # test helpers from mytesttools import SimpleStructureChecker, create_node, get_n_random_tags from ezodf2.nodeorganizer import PreludeEpilogueOrganizer # objects to test from ezodf2.nodes...
{ "content_hash": "4c1dd078ebdf89c74def98a0424df5a2", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 89, "avg_line_length": 38.44117647058823, "alnum_prop": 0.685539403213466, "repo_name": "iwschris/ezodf2", "id": "2957bd4ff0dc104df13d980783fe59ce0991eb4c", "size": "2761",...
""" Use 'click' library to create an interface for shell execution """ from libs import get_logger logger = get_logger(__name__) # Make this script a powerful command line program import click from libs.bash import BashCommands as basher from libs.irodscommands import EudatICommands from libs.config import MyConfig f...
{ "content_hash": "63b81b1e2713f2a58eb5d45e17089035", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 82, "avg_line_length": 31.789473684210527, "alnum_prop": 0.6767384105960265, "repo_name": "pdonorio/irods2graph", "id": "8493055d465b38c1cc7a7658428600b8db939971", "size": ...
import os import sys if (len(sys.argv) < 2): print "not enough parameters" os._exit(1) content = open(sys.argv[1]).readlines() index = 0 for line in content : if (index % 2): print line, print prev, prev = line index = index + 1
{ "content_hash": "6664a8602731187a027cd3e5b9dfce5f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 39, "avg_line_length": 14.35, "alnum_prop": 0.5435540069686411, "repo_name": "PulseRain/Embedded", "id": "079295c555da84691cb130698cf22e0062b964d8", "size": "1752", "bina...
"""Execute the tests for the fiona program. The golden test outputs are generated by the script generate_outputs.sh. You have to give the root paths to the source and the binaries as arguments to the program. These are the paths to the directory that contains the 'projects' directory. Usage: run_tests.py SOURCE_RO...
{ "content_hash": "e9d6387546f2193e8f777a136d1ea32f", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 79, "avg_line_length": 37.38251366120219, "alnum_prop": 0.5132290600789359, "repo_name": "holtgrewe/seqan", "id": "db8b874351e800256ce9a938839fa6e3a4be2f79", "size": "6863...
from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/corellia/shared_guild_commerce_corellia_style_01.iff" result.attribute_template_id = -1 result.stfName("building_name","guild_commerce_corellia") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS ####...
{ "content_hash": "2880bcdfe17d37e087c4a2cf98693da5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 89, "avg_line_length": 25.923076923076923, "alnum_prop": 0.7151335311572701, "repo_name": "anhstudios/swganh", "id": "45ac252c97d59c1e394b86999da98d4519336771", "size": "48...
import gettext import json from os import path from django.conf import settings from django.test import ( RequestFactory, SimpleTestCase, TestCase, ignore_warnings, modify_settings, override_settings, ) from django.test.selenium import SeleniumTestCase from django.urls import reverse from django.utils.deprecat...
{ "content_hash": "cb5a481d33dcffd6b2aea474f35804ae", "timestamp": "", "source": "github", "line_count": 503, "max_line_length": 109, "avg_line_length": 48.514910536779325, "alnum_prop": 0.6354136786460681, "repo_name": "googleinterns/django", "id": "fcbffa711d5aa6ebb84e0e7381004fc8455d0cd2", "size"...
__author__ = 'Mario' __author__ = 'Mario' import numpy as np from scipy.stats import multivariate_normal as norm import pandas as pd import matplotlib.pyplot as plt dataTraining = pd.read_table('./Data/iris_training.txt',delim_whitespace=True, header=None) dataTest = pd.read_table('./Data/iris_test.txt',delim_whites...
{ "content_hash": "62b7f5d886e562563176f8b9736a8f07", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 123, "avg_line_length": 32.40506329113924, "alnum_prop": 0.65703125, "repo_name": "marioharper182/Patterns", "id": "f07cc28b612f17186438569727d18c8df6e49554", "size": "2560...
from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from units.modules.utils import set_module_args, exit_json, fail_json, AnsibleExitJson from ansible.module_utils import basic from ansible.modules.network.check_point import cp_mgmt_mds_facts OBJECT = { "from": 1,...
{ "content_hash": "a9f07d06b0b2f8bf547ca01d6058f445", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 133, "avg_line_length": 32.34848484848485, "alnum_prop": 0.6721311475409836, "repo_name": "thaim/ansible", "id": "e9a145cd1b755994031caa458df31167184649e2", "size": "2815",...
""" Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 import sys # noqa:...
{ "content_hash": "6fa6cb4940e720a2918375ae57c97274", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 96, "avg_line_length": 37.381188118811885, "alnum_prop": 0.5701231624950338, "repo_name": "onshape-public/onshape-clients", "id": "715f58305937a4c527a2e199a58a29c193d09cdb",...
import csv,sys import urllib ##### append some python libraries sys.path.append("/usr/local/lib/python2.7/dist-packages") #TODO: change to a relative path from netaddr import * import redis import splunk.mining.dcutils as dcu # use the default splunk logger function for alerting logger = dcu.getLogger() # set the co...
{ "content_hash": "e1d7a243cd3885c6ba08105513accd42", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 128, "avg_line_length": 33.025862068965516, "alnum_prop": 0.5638214565387627, "repo_name": "rstcloud/threatdb", "id": "1e0f2bf4ba2adbac66aac6f31687585b73ad171a", "size": "...
""" Parser for the .lang translation format. """ import codecs import re import sys from collections import namedtuple from parsimonious.exceptions import ParseError as ParsimoniousParseError from parsimonious.grammar import Grammar from parsimonious.nodes import NodeVisitor from pontoon.base.formats.base import Pars...
{ "content_hash": "f0d28b1e60dcd176ee430e6310afe391", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 89, "avg_line_length": 33.044444444444444, "alnum_prop": 0.6030598520511096, "repo_name": "vivekanand1101/pontoon", "id": "bb4de7c1af024f6550f07278def7ce33b2311701", "size...
import pygame class Muro(pygame.sprite.Sprite): """Clase para controlar los muros que hay distribuidos por el mapa""" """ Constructor de la clase """ def __init__(self,posx,posy,tipoLadrillo): pygame.sprite.Sprite.__init__(self) self.tipoLadrillo = tipoLadrillo ...
{ "content_hash": "a7293897142ea809225539e83e6d835f", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 89, "avg_line_length": 34.36842105263158, "alnum_prop": 0.5747830525778458, "repo_name": "DavidRamirez19/Total-Demolition---PYGAME", "id": "57bf79ffdaf4ec46f1a93c66e8af736e46...
from __future__ import absolute_import import os import sys import collections import numpy as np import torch from torch.autograd import Variable import torch.nn as nn from torch import optim import torch.nn.functional as F import torchfold from program_synthesis.common.models import beam_search from program_synt...
{ "content_hash": "d880ec0fcfa9ded7a1d3af9069f5e07c", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 132, "avg_line_length": 40.289855072463766, "alnum_prop": 0.6483812949640287, "repo_name": "nearai/program_synthesis", "id": "7b1809725c9deed517cb885a95bfbef19de04b34", "s...
from traits.api import HasTraits, List, Float, Enum, Bool from traitsui.api import Item, CheckListEditor, UItem, HGroup, VGroup from pychron.core.helpers.traitsui_shortcuts import okcancel_view from pychron.core.pychron_traits import BorderHGroup from pychron.persistence_loggable import PersistenceMixin from pychron.p...
{ "content_hash": "0681de2e45c4a2549862e3a06fb65c03", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 88, "avg_line_length": 34.30232558139535, "alnum_prop": 0.4471186440677966, "repo_name": "USGSDenverPychron/pychron", "id": "0df3a0658aac9256b2602f2631080125c9745b61", "siz...
from __future__ import unicode_literals from django.test import TestCase, RequestFactory from django.core.urlresolvers import reverse from django.core.cache import cache from django.contrib.auth import get_user_model from django.utils import timezone from django.template import Template, Context from django.utils.html...
{ "content_hash": "6ffadb1e40a3a722349c48a568764c3a", "timestamp": "", "source": "github", "line_count": 846, "max_line_length": 117, "avg_line_length": 44.5177304964539, "alnum_prop": 0.6357867346396898, "repo_name": "david30907d/feedback_django", "id": "76f6a61549ea8b168ff91b4250b00ed12514714d", "...
""" Performs initial configuration of Wikifeat services Note: Requires python3 """ # from configparser import ConfigParser from argparse import ArgumentParser import util import os from libs import configobj wikifeat_path = os.path.realpath(os.path.join(os.getcwd(), os.pardir)) def config_template(): re...
{ "content_hash": "67b16ce768b0714c2e7d5eed05591cff", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 78, "avg_line_length": 29.98076923076923, "alnum_prop": 0.6828094932649134, "repo_name": "rhinoman/wikifeat", "id": "141a57532ff0f9306c92f459f7f357f72a96e7fa", "size": "31...
"""Moving MNIST dataset. Unsupervised Learning of Video Representations using LSTMs Nitish Srivastava, Elman Mansimov, Ruslan Salakhutdinov https://arxiv.org/abs/1502.04681 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np ...
{ "content_hash": "75cedd9eb43d9b37a7425f5df0d41c00", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 79, "avg_line_length": 30.28985507246377, "alnum_prop": 0.6691387559808613, "repo_name": "tensorflow/tensor2tensor", "id": "1f4600804919a5f14e1d9ef49611a8bed89389d2", "siz...
import sublime, sublime_plugin import os, subprocess, string, json, threading, re, time, signal ST3 = int(sublime.version()) > 3000 if ST3: from .chigi_args import ChigiArgs from .php_input import PhpInputThread from .php_output import PhpOutputThread def cmp(str_a,str_b): return (str_a > str_...
{ "content_hash": "da4ccf9109a84f3c2df8138f740701d5", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 184, "avg_line_length": 42.354838709677416, "alnum_prop": 0.585986290936786, "repo_name": "chigix/sublime-php-connector", "id": "c511019978b13fddc93ef127c5e4e4e2ca636f52", ...
import datetime from flask_appbuilder import Model from sqlalchemy import Column, Date, Enum, ForeignKey, Integer, String from sqlalchemy.orm import relationship mindate = datetime.date(datetime.MINYEAR, 1, 1) class ContactGroup(Model): id = Column(Integer, primary_key=True) name = Column(String(50), unique...
{ "content_hash": "56c5b534315cb9bcfda465351995f11e", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 86, "avg_line_length": 30.473684210526315, "alnum_prop": 0.6865284974093264, "repo_name": "dpgaspar/Flask-AppBuilder", "id": "b723e8c0c1c5364265af6faafe1d5beb2f2aec2d", "si...
"""Functions for computing metrics like precision, recall, CorLoc and etc.""" from __future__ import division import numpy as np def compute_precision_recall(scores, labels, num_gt): """Compute precision and recall. Args: scores: A float numpy array representing detection score labels: A boolean numpy a...
{ "content_hash": "26f5c2d3d75d964720f918523fb61234", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 79, "avg_line_length": 36.83076923076923, "alnum_prop": 0.6942355889724311, "repo_name": "activitynet/ActivityNet", "id": "e8ae8867eac7c13c933370dcf191d62c4f113f1f", "size...
"""Provides device triggers for binary sensors.""" import voluptuous as vol from homeassistant.components.automation import state as state_automation from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA from homeassistant.components.device_automation.const import ( CONF_TURNED_OFF, CONF_T...
{ "content_hash": "74671582016fc0d23d03cb6ccc5746f2", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 88, "avg_line_length": 30.147410358565736, "alnum_prop": 0.6451698163076517, "repo_name": "qedi-r/home-assistant", "id": "c51b9749288bb544671212f653176ccdb45dc65d", "size"...
import enum from datetime import datetime from typing import NamedTuple class BacklogLocation(enum.Enum): """A location with respect to the message backlog. BEGINNING refers to the location of the oldest retained message. END refers to the location past all currently published messages, skipping the entir...
{ "content_hash": "6601d3d89191072541f3eb4cb466d678", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 78, "avg_line_length": 24.166666666666668, "alnum_prop": 0.7310344827586207, "repo_name": "googleapis/python-pubsublite", "id": "dbd0c6039fca76def6ae28568aed799294922492", ...
import math import os import re import time import numpy as np import pytest from numpy.testing import assert_equal from astropy.io import fits from astropy.io.fits.hdu.compressed import DITHER_SEED_CHECKSUM, SUBTRACTIVE_DITHER_1 from astropy.utils.compat.optional_deps import HAS_SCIPY from astropy.utils.data import ...
{ "content_hash": "6d524b3371b41ced40a77b2508e1ff53", "timestamp": "", "source": "github", "line_count": 2005, "max_line_length": 106, "avg_line_length": 40.467331670822944, "alnum_prop": 0.5571933889594143, "repo_name": "larrybradley/astropy", "id": "5092316ce9ac671238f39bf27fb0401cdbfd3f05", "size...
import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # import cocos from cocos.director import director from cocos.actions import MoveTo from cocos.sprite import Sprite import pyglet class TestLayer(cocos.layer.Layer): def __init__(self): super( TestLayer, self ).__init_...
{ "content_hash": "1d624743faca7edaf667ec899ea87b1b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 65, "avg_line_length": 25.464285714285715, "alnum_prop": 0.6199158485273493, "repo_name": "adamwiggins/cocos2d", "id": "1b78bbb34d25fd41ea03bae810d158e0fdfda7d4", "size": "...
import os import re import sys import shlex import pprint import signal import threading import traceback from Queue import Queue from collections import defaultdict from ConfigParser import * from cmd import * from struct import * from getopt import getopt from UserDict import * import vtrace import vtrace.util as ...
{ "content_hash": "559543c8e52ebc32b1d3bbb713a49224", "timestamp": "", "source": "github", "line_count": 2245, "max_line_length": 141, "avg_line_length": 31.564810690423162, "alnum_prop": 0.5198058225025753, "repo_name": "HackerTool/vivisect", "id": "ce5ada3c26b2086c9b370e95595cb9aca12cc6a6", "size"...
import logging import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from matplotlib.ticker import MultipleLocator, FormatStrFormatter from scipy.ndimage.interpolation import rotate class Plotter(object): def __init__(sel...
{ "content_hash": "073a32ee6e9344ec73fde0dbba3c65ee", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 208, "avg_line_length": 44.250803858520904, "alnum_prop": 0.5288475512280192, "repo_name": "wtbarnes/solarnmf", "id": "ca784fb04fb207ddaa0416b4fef2ed596d51d7d1", "size": "...
import tkinter from tkinter.filedialog import askdirectory class File_dialog2(): def file(self): root = tkinter.Tk() root.withdraw() with open("path_output.txt", "w") as file: filename = askdirectory() file.write(filename)
{ "content_hash": "8f934af8f2a2f6235f0711b014eed0d6", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 50, "avg_line_length": 19.733333333333334, "alnum_prop": 0.5709459459459459, "repo_name": "vetlehjelmtvedt/TranscriptApp", "id": "6071aa623c08d1569fe04940de9a2351a0358933", ...
from __future__ import unicode_literals import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('satsound', '0001_initial'), ] operations = [ migrations.AddField( model_name='satellitetrajectory', ...
{ "content_hash": "9fbbfa94cc4be17595dfab2068905cba", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 116, "avg_line_length": 29.75, "alnum_prop": 0.6162464985994398, "repo_name": "saanobhaai/apman", "id": "47de195050b2ce241f5bd06bf41a7f034574533c", "size": "787", "binary...
""" Module for implementing a CTRL file object class for the Stuttgart LMTO-ASA code. It will primarily be used to generate a pymatgen Structure object in the pymatgen.electronic_structure.cohp.py module. """ import re import numpy as np from monty.io import zopen from pymatgen.core.structure import Structure from ...
{ "content_hash": "3aa449094065fd875b62af0c2d0a07f2", "timestamp": "", "source": "github", "line_count": 428, "max_line_length": 119, "avg_line_length": 36.058411214953274, "alnum_prop": 0.5095574418453962, "repo_name": "vorwerkc/pymatgen", "id": "53de0b399a6faaf2c4e03fe9a91295d92e09e1e8", "size": "...
import pbr.version # 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 confi...
{ "content_hash": "6b5f2bcad546a1db14800e01779d71a0", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 80, "avg_line_length": 32.526923076923076, "alnum_prop": 0.7008395412084664, "repo_name": "os-cloud/openstack-ansible-pip_install", "id": "9eb34abc7b12c111487befecf1c079360d...
""" MySQL database backend for Django. Requires MySQLdb: http://sourceforge.net/projects/mysql-python """ import re import sys try: import MySQLdb as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) ...
{ "content_hash": "92be1c6ac6ae7fe8491666b52137aa22", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 127, "avg_line_length": 40.48695652173913, "alnum_prop": 0.6280068728522337, "repo_name": "softak/webfaction_demo", "id": "4f5f329b18e5224868ac49b784204a8f50180524", "size...
import contextlib import json from .common import (assert_command, assert_lines, exec_command, show_app, watch_all_deployments) GOOD_GROUP = 'tests/data/marathon/groups/good.json' def test_deploy_group(): _deploy_group(GOOD_GROUP) _remove_group('test-group') def test_group_list_table(...
{ "content_hash": "3ff63283f823fd38c6b8470da0eba2a6", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 78, "avg_line_length": 31.374485596707817, "alnum_prop": 0.5853882476390346, "repo_name": "Yhgenomics/dcos-cli", "id": "783afaa6768753542349ad19911cf18187fdba53", "size": ...
import pifacecad from carpu.events import GetNextSongEvent from carpu.events import VolumeUPEvent from carpu.events import VolumeDOWNEvent class Face(object): def __init__(self, server): self.events = server self.cad = pifacecad.PiFaceCAD() self.cad.lcd.set_cursor(3, 0) s...
{ "content_hash": "3791f931792cad77905b92a72f1e5ebd", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 75, "avg_line_length": 27.846153846153847, "alnum_prop": 0.6151012891344383, "repo_name": "duct-tape/taped-car-stereo", "id": "90a5d551173936447af3d225a28ff2133463eb1c", "s...
from __future__ import unicode_literals import bluebottle.fsm import bluebottle.utils.fields from decimal import Decimal from django.db import migrations, models import django.db.models.deletion import djmoney.models.fields class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_r...
{ "content_hash": "b9a93c5ab9a65d9183332fcad0cd13c8", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 188, "avg_line_length": 40.26229508196721, "alnum_prop": 0.5977198697068404, "repo_name": "onepercentclub/bluebottle", "id": "c46c258498cf2e012c9d2fd320684846ac9d0364", "si...
import uuid import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('occurrence', '0015_auto_20190122_1638'), ] operations = [ migrations.AlterField( model_name='areae...
{ "content_hash": "380c2cd7edb7f86fd1618175178223c4", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 760, "avg_line_length": 61.371428571428574, "alnum_prop": 0.6680633147113594, "repo_name": "parksandwildlife/wastd", "id": "e1859be18d8cb0ba3614a91eec1dc5f1108206d0", "size...
""" The logger module itself has the common logging functions of Python's :class:`logging.Logger`. For example: .. code-block:: python from tensorpack.utils import logger logger.set_logger_dir('train_log/test') logger.info("Test") logger.error("Error happened!") """ import logging import os import o...
{ "content_hash": "0f9a173c07ba47159896dd7722ac2698", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 108, "avg_line_length": 34.812865497076025, "alnum_prop": 0.6092726356458928, "repo_name": "ppwwyyxx/tensorpack", "id": "31d24d3260264f8c960ce36c39fe56eb286f39fc", "size":...
from filecmp import demo from django.conf.app_template import admin from django.contrib.auth.decorators import login_required from django.contrib.messages.views import SuccessMessageMixin from django.shortcuts import render from django.utils.datetime_safe import datetime from django.utils.decorators import method_decor...
{ "content_hash": "e073d84b7fb89a32018f804d4a5daf8a", "timestamp": "", "source": "github", "line_count": 310, "max_line_length": 112, "avg_line_length": 38.86129032258064, "alnum_prop": 0.681248443595916, "repo_name": "jmennen/group5", "id": "78ec8d3007d668254019aa68583b773c3fda1c41", "size": "12047...
import zmq from .messenger import Messenger class Publisher(Messenger): def _init_socket(self): self.socket = self.context.socket(zmq.PUB)
{ "content_hash": "00bda36cfbbbb80281dfe3dce2f24d63", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 50, "avg_line_length": 19.25, "alnum_prop": 0.7142857142857143, "repo_name": "jtimon/zmqmin", "id": "63fcad8da071798518a86467e4611c22e72c86a0", "size": "155", "binary": fa...
from collections import OrderedDict import config import file_utils def _get_implementation(classname, vpi, card): content = [] if card == '1': shallow_visit = 'false' if vpi in ['vpiParent', 'vpiInstance', 'vpiModule', 'vpiInterface', 'vpiUse', 'vpiProgram', 'vpiClassDefn', 'vpiPackage', 'v...
{ "content_hash": "6e359d8dab9483017b68e38aeb633500", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 190, "avg_line_length": 40.158940397350996, "alnum_prop": 0.5839379947229552, "repo_name": "chipsalliance/UHDM", "id": "4933f64e364d09ee2809c2882c4c0bea972bafe5", "size": ...
from infotv.policy import BasePolicy class TraconPolicy(BasePolicy): def get_event_slug(self, request, slug): return slug def can_edit_slides(self, request): return request.user.is_staff def can_post_datum(self, request): return request.user.is_staff
{ "content_hash": "95086bda7781e32c130120a739df79c7", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 44, "avg_line_length": 24.25, "alnum_prop": 0.6872852233676976, "repo_name": "tracon/infotv-tracon", "id": "c64bd77b443d5c3c7951a7940f89f5abd603a05b", "size": "291", "bin...
from flask import Blueprint,request,redirect,url_for, render_template from bs4 import BeautifulSoup import requests from urllib.parse import urljoin from URLOptimize import URLOptimize links_blueprint = Blueprint('links_blueprint',__name__) @links_blueprint.route('/links') def links(): url = request.args.get('url...
{ "content_hash": "d304b3f06078383cf6861f161dc1d8a4", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 77, "avg_line_length": 29.36, "alnum_prop": 0.6839237057220708, "repo_name": "farseenabdulsalam/wap-proxy", "id": "fb8a53e1651c048185c0c2d8e6babefc66403686", "size": "734",...
import pyCliConf import inspect def main(): print inspect.getsourcelines(pyCliConf.CliConf) main()
{ "content_hash": "7b4fe685a90db32617049c0282401040", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 51, "avg_line_length": 15, "alnum_prop": 0.7714285714285715, "repo_name": "JNPRAutomate/pyCliConf", "id": "f1f869224266cef5f0c993a605b4bb0956513fd1", "size": "105", "binar...
l=[0,1,2] i=iter(l) print i print i.next() print i.next() print i.next() print i.next() ''' $ python exceptions_StopIteration.py <listiterator object at 0x10045f650> 0 1 2 Traceback (most recent call last): File "exceptions_StopIteration.py", line 19, in <module> print i.next() StopIteratiop '''
{ "content_hash": "9e7c5f2b3b233882f6139dd9f3af9ac7", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 58, "avg_line_length": 14.571428571428571, "alnum_prop": 0.6993464052287581, "repo_name": "lmokto/allexceptions", "id": "934403beaaf4b180e03299ef44678f01f5d9fa9a", "size": ...
import cjson import os import re import string import time import rdflib from rdflib.Graph import Graph from datetime import date from Axon.Ipc import producerFinished from Axon.Ipc import shutdownMicroprocess from Axon.ThreadedComponent import threadedcomponent from Kamaelia.Apps.SocialBookmarks.Print import Print f...
{ "content_hash": "1c7a3fd0096c319ef996f34b1c7e30e9", "timestamp": "", "source": "github", "line_count": 540, "max_line_length": 181, "avg_line_length": 56.11666666666667, "alnum_prop": 0.4767184767184767, "repo_name": "sparkslabs/kamaelia", "id": "d51872a8615efead7feeb993ddd8898bb237b899", "size": ...
"""Tests for GBDT estimator.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tempfile import numpy as np from tensorflow.contrib.boosted_trees.estimator_batch import estimator from tensorflow.contrib.boosted_trees.proto import learner_pb2 from ten...
{ "content_hash": "7312bfc368b21fc5702f76b421664ef4", "timestamp": "", "source": "github", "line_count": 829, "max_line_length": 94, "avg_line_length": 37.46562123039807, "alnum_prop": 0.6773559998712129, "repo_name": "Bismarrck/tensorflow", "id": "ee052ac60387d8f993e4942dd7dff39e191dd3a4", "size": ...
from numpy import sum from numpy import zeros from gwlfe.Input.LandUse.NLU import NLU from gwlfe.Input.WaterBudget.Water import Water from gwlfe.Memoization import memoize from gwlfe.MultiUse_Fxns.Erosion.RurEros import RurEros from gwlfe.MultiUse_Fxns.Erosion.RurEros import RurEros_f @memoize def ErosWashoff(NYrs, ...
{ "content_hash": "8fe7d702cabe315a4ca57876f23bbace", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 107, "avg_line_length": 38.11764705882353, "alnum_prop": 0.6049382716049383, "repo_name": "WikiWatershed/gwlf-e", "id": "f323a5529763d2c4ed093ef3f582f71eea7b9df9", "size": ...
from setuptools import setup setup(name='bulkplot', version='0.1', description='A bulk plot generator for pandas DataFrames', url='http://github.com/bpalmer4/bulkplot', author='Bryan Palmer', author_email='palmer.bryan@gmail.com', license='MIT', packages=['bulkplot'],...
{ "content_hash": "b1bee9b7a73d2fb01cf3a4efef8c0894", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 64, "avg_line_length": 31.363636363636363, "alnum_prop": 0.6260869565217392, "repo_name": "bpalmer4/bulkplot", "id": "c5b0f1ad219dfb56531d54029225ea311d9183d0", "size": "34...
import json from imaginet.commands import train, evaluate #from imaginet.defn.visual import Visual from imaginet.defn.lm import LM from imaginet.simple_data import phonemes, characters from funktional.util import linear, clipped_rectify, CosineDistance import numpy dataset = 'coco' datapath = "/home/gchrupala/repos/rei...
{ "content_hash": "fcbda8e8c812ab4030e5f98f6097139b", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 67, "avg_line_length": 23.533333333333335, "alnum_prop": 0.6813031161473088, "repo_name": "gchrupala/reimaginet", "id": "7e320f880117decc2ec08537ce75a32ae0329836", "size": ...
import numpy as np import datetime # Implementation of Linear UCB with a stepwise reset of the model (on a per article basis). If an article # is available for more than 24 hours its model is reset. This leads currently to the best score on the evaluation system. class LinUCB: all_articles = [] all_M = {} ...
{ "content_hash": "932b02b72845dfe4f1347ec3876b1583", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 122, "avg_line_length": 32.1551724137931, "alnum_prop": 0.6075067024128686, "repo_name": "lukaselmer/ethz-data-mining", "id": "d2a6dc5eba6c30db78cf84b522fff4f1321b3d05", "...
"""Binary sensor to read Proxmox VE data.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.const import ATTR_ATTRIBUTION, CONF_HOST, CONF_PORT from . import CONF_CONTAINERS, CONF_NODES, CONF_VMS, PROXMOX_CLIENTS, ProxmoxItemType ATTRIBUTION = "Data provided b...
{ "content_hash": "3f75f53da907677d4bafea518437e1b4", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 87, "avg_line_length": 29.9375, "alnum_prop": 0.5413062928720549, "repo_name": "joopert/home-assistant", "id": "15b1f1483e1f47add667367610c1f08453653d2a", "size": "3353", ...
from django.conf import settings from rest_framework import serializers def get_countries_code_from_queryset(queryset): from common.serializers import CountryPointSerializer return list(set(map(lambda x: x.get("country_code"), CountryPointSerializer(queryset, many=True).data))) def confirm(prompt='Confirm',...
{ "content_hash": "b9ae71bfcc438c9c237bfe3ef16f26d8", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 112, "avg_line_length": 35.05494505494506, "alnum_prop": 0.6382445141065831, "repo_name": "unicef/un-partner-portal", "id": "b75459388bec1684e8dba5668ad183ef8260c436", "siz...
import os import shutil import sys import numpy as np def prepare(): if 'STORING' not in os.environ: os.environ['STORING'] = '/data' storing = os.getenv('STORING') if 'TRAINING' not in os.environ: os.environ['TRAINING'] = os.path.join( storing, 'numerai_training_data.csv') ...
{ "content_hash": "5d50e040972317377e332998188afb66", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 88, "avg_line_length": 39.156028368794324, "alnum_prop": 0.6185473646078609, "repo_name": "altermarkive/Resurrecting-JimFleming-Numerai", "id": "99e3284f2123f0dc94003dd37d68...
from subprocess import * class configBerry: def readConf(self,value): var = Popen("grep --only-matching --perl-regex \"(?<=" + value + "\=).*\" /etc/torberry.conf", stdout=PIPE, shell=True).stdout.read() var = var.replace('"','') var = var.replace("'","") var = var.re...
{ "content_hash": "dba6259fdea2586df60e043653e24e86", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 216, "avg_line_length": 53.095238095238095, "alnum_prop": 0.5192825112107623, "repo_name": "akipta/torberry", "id": "3fea538d764cc4945b2b440fe4d4a7f9aacfc319", "size": "113...
import numpy as np #import theano #import theano.tensor as T import mlbase.networkhelper as N import unittest class TestGenerative(unittest.TestCase): def test_upconv(self): x = np.random.randn(256, 32, 28, 28) gp = N.GlobalPooling() # TODO self.assertEqual(1,1) def test...
{ "content_hash": "1c7614129e3f4fff7508dd38267242f0", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 44, "avg_line_length": 21.714285714285715, "alnum_prop": 0.6140350877192983, "repo_name": "pipehappy1/super-engine", "id": "10b2649e25642f454de6d387e2e8f9134a283c68", "size...
from indico.core.db import db from indico.util.string import format_repr class MapArea(db.Model): __tablename__ = 'map_areas' __table_args__ = (db.Index(None, 'is_default', unique=True, postgresql_where=db.text('is_default')), {'schema': 'roombooking'}) id = db.Column( db.In...
{ "content_hash": "c16b8358a54ec818bc8d026b7eab18b0", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 104, "avg_line_length": 23.317073170731707, "alnum_prop": 0.5564853556485355, "repo_name": "pferreir/indico", "id": "ac0e2f12786fc5f80522e1cc9bbfcb5078a852fd", "size": "117...
from functools import cmp_to_key class Player: def __init__(self, name, score): self.name = name self.score = score @staticmethod def comparator(a, b): if a.score > b.score: return -1 elif b.score > a.score: return 1 elif a.name > b.name: ...
{ "content_hash": "3ffe44399f3b75fb89abe1b90e663606", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 54, "avg_line_length": 21.40625, "alnum_prop": 0.5372262773722628, "repo_name": "Adriel-M/HackerRank", "id": "29a1661b72b83fb57715dd41f011cae78c37b9af", "size": "685", "b...
from django.views.generic import TemplateView, FormView, ListView from django.views.generic.edit import ProcessFormView, FormMixin from django import forms #from django.http import HttpResponseRedirect, HttpResponse #from django.core.context_processors import csrf #from django.template.context import RequestContext# C...
{ "content_hash": "172cb77aec9b2b89be5d591d608f8910", "timestamp": "", "source": "github", "line_count": 419, "max_line_length": 126, "avg_line_length": 31.62529832935561, "alnum_prop": 0.5745981435363369, "repo_name": "Krozark/Harpe-v1.0", "id": "2c088954c85462ced2863097014ed5a1b1c57aff", "size": "...
from distutils.core import setup from setuptools import find_packages with open('README.rst') as readme_file: readme = readme_file.read() setup( name='lcom', packages=find_packages(exclude=['tests']), version='0.1.0', description='Lack of cohesion of methods metric', long_description=readme, ...
{ "content_hash": "715ebea78f66604dc4b516b3ebdd6613", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 71, "avg_line_length": 25.891304347826086, "alnum_prop": 0.5818639798488665, "repo_name": "potfur/lcom", "id": "27092e076a114dae5246733ae5bc4a922df16eb1", "size": "1191", ...
""" Example Session Command Make sure you can authenticate before running this command. This command is currently hard coded to use the Identity service. For example: python -m examples.session /tenants """ import sys from examples import common from examples import connection from openstack.identity import id...
{ "content_hash": "8922303344358de01ee7398701edcff7", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 73, "avg_line_length": 23.8, "alnum_prop": 0.7202881152460985, "repo_name": "mtougeron/python-openstacksdk", "id": "fe55a7cf4d531a857dc494accb54bfc4050e3676", "size": "1379...
import RPi.GPIO as GPIO from ConfigParser import ConfigParser from ast import literal_eval as safe_eval import uinput from raspberry_cereal.constants import CONFIG_PATH def main(): """Validates config file""" config = ConfigParser() config.read(CONFIG_PATH) # Type validate each entry not in the keym...
{ "content_hash": "66208cea89971df4482a1d2d12f06aff", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 88, "avg_line_length": 39.943396226415096, "alnum_prop": 0.5403873405762872, "repo_name": "hfaran/raspberry-cereal", "id": "041327d4f19e29869fa65022e79c6ddc5bc88a79", "size...
from MVC.Controller import Controller import config if __name__ == '__main__': controller = Controller(title=config.__CoinWatcher__) controller.Run()
{ "content_hash": "937172a1b1cafafea988a45633c463b7", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 57, "avg_line_length": 22.857142857142858, "alnum_prop": 0.6875, "repo_name": "mgao6767/CoinWatcher", "id": "6dce59107506fc73014941201a61d8b93742fe33", "size": "160", "bin...