text
stringlengths
4
1.02M
meta
dict
from __future__ import unicode_literals """ Patch courtesy of: https://marmida.com/blog/index.php/2012/08/08/monkey-patching-assert_raises/ """ # code for monkey-patching import nose.tools # let's fix nose.tools.assert_raises (which is really unittest.assertRaises) # so that it always supports context management # i...
{ "content_hash": "53d0bf1c7bcf81ecb260f5bab0a4da51", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 76, "avg_line_length": 33.05, "alnum_prop": 0.6762481089258698, "repo_name": "silveregg/moto", "id": "6ceacaa891bf3cd115325b8ceb1dff173c8061e7", "size": "1322", "binary":...
from __future__ import absolute_import input_name = '../examples/navier_stokes/navier_stokes2d.py' output_name = 'test_navier_stokes2d.vtk' from tests_basic import TestInput class Test(TestInput): pass
{ "content_hash": "f98877bc03628094cde27f51b31cfad1", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 59, "avg_line_length": 29.571428571428573, "alnum_prop": 0.7584541062801933, "repo_name": "lokik/sfepy", "id": "9d59b0d4120703a2e468740c68d07c94d55db7b0", "size": "207", "...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2014-2016 Alex Forencich 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...
{ "content_hash": "fcc7ef67781d4c0f01c41d343d9ef8b6", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 77, "avg_line_length": 39.93333333333333, "alnum_prop": 0.8046744574290484, "repo_name": "Diti24/python-ivi", "id": "f5112f804a138755dd00d2293a646501207f3aa4", "size": "119...
from oslotest import base as test_base from testtools import matchers import webob import webob.dec from oslo_middleware import request_id class RequestIdTest(test_base.BaseTestCase): def test_generate_request_id(self): @webob.dec.wsgify def application(req): return req.environ[reques...
{ "content_hash": "f193cbdb2c9c25cc630886f66d107449", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 76, "avg_line_length": 34.666666666666664, "alnum_prop": 0.6909340659340659, "repo_name": "JioCloud/oslo.middleware", "id": "09bdd327596f3f4c726d4d1be4657bedb147e72b", "siz...
""" .. module:: libopenzwave This file is part of **python-openzwave** project https://github.com/OpenZWave/python-openzwave. :platform: Unix, Windows, MacOS X :sinopsis: openzwave C++ .. moduleauthor: bibi21000 aka Sebastien GALLET <bibi21000@gmail.com> .. moduleauthor: Maarten Damen <m.damen@gmail.com> License : ...
{ "content_hash": "282b935448ea7dc4dfa6a351ab3f5f15", "timestamp": "", "source": "github", "line_count": 514, "max_line_length": 331, "avg_line_length": 42.05642023346304, "alnum_prop": 0.6635518342045612, "repo_name": "Julian/libopenzwave-cffi", "id": "0414778e36eb738ff3c83eb64b793b974e632049", "si...
from string import ascii_lowercase import scrapy from scrapy.spiders import CrawlSpider from w3lib.html import remove_tags, remove_tags_with_content class InvestopediaSpider(CrawlSpider): name = 'investopedia' start_urls = ['http://www.investopedia.com/terms/%s/' % s for s in ascii_lowercase + '1'] def ...
{ "content_hash": "7904c135fdd0358f5a0492de8b0b2b04", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 94, "avg_line_length": 31.858823529411765, "alnum_prop": 0.5646233382570163, "repo_name": "hardikp/fnlp", "id": "7c0f9870e79cff216a1da016624dd93d4b229446", "size": "2708", ...
from __future__ import division import numpy as np import scipy as sp from pylab import ion from scipy import signal as sig from scipy import optimize as opt from scipy.interpolate import interp1d #from scipy.io import loadmat import matplotlib as mpl from matplotlib.mlab import * from matplotlib.pyplot import * f...
{ "content_hash": "d2f540171a37f7ca4d84c0a8e3f34063", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 80, "avg_line_length": 30.654605263157894, "alnum_prop": 0.5759201631076296, "repo_name": "jllanfranchi/pygeneric", "id": "591b7ad005c1b91e82e954befe0d85cc7400c94d", "size...
import os import sys import json import yaml def main(): with open(sys.argv[1], 'rb') as f: known_issues = yaml.load(f.read()) skipstrings = [ 'passed in strict mode', 'passed in non-strict mode', 'failed in strict mode as expected', 'failed in non-strict mode as expect...
{ "content_hash": "417a473ad02bfe38cf8b7cfbb33c58aa", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 101, "avg_line_length": 28.31404958677686, "alnum_prop": 0.5239346176298891, "repo_name": "markand/duktape", "id": "5cde7e3daafce2f8d22d738ecd6009d19b14d3d8", "size": "345...
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2013 Nathanael C. Fritz, Lance J.T. Stout This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import logging from sleekxmpp.plugins.base import BasePlugin from sleekxmpp.plugins.xep_0152 import stanza, Reachability log...
{ "content_hash": "51d166942fc48743091ff5afea817fd7", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 79, "avg_line_length": 38.064516129032256, "alnum_prop": 0.5847457627118644, "repo_name": "isandlaTech/cohorte-3rdparty", "id": "4cf81739f04f9447c49570957f6f7883c112f246", ...
""" Copyright 2014 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ...
{ "content_hash": "9be744f082867094695a55644029056c", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 82, "avg_line_length": 38.125, "alnum_prop": 0.6700447093889716, "repo_name": "googlefonts/TachyFont", "id": "603ccd8140305a850b01bafe8ed52b0eeb70d606", "size": "3355", "...
import os DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Poeks', 'poeksweb@gmail.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'appengine' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '' ...
{ "content_hash": "85197fafe4fa4f1fdc2ba6002276275c", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 101, "avg_line_length": 31.554545454545455, "alnum_prop": 0.700374531835206, "repo_name": "poeks/twitterbelle", "id": "d9e24c893bef3cfaa680958fc9b26001364a58c8", "size": "...
import os import copy import six import jsonschema from jsonschema import _validators from jsonschema.validators import create from st2common.util import jsonify __all__ = [ 'get_validator', 'get_parameter_schema', 'validate' ] # https://github.com/json-schema/json-schema/blob/master/draft-04/schema # T...
{ "content_hash": "2bc275fee4303b403d68762b139f730b", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 96, "avg_line_length": 34.38961038961039, "alnum_prop": 0.6695619335347432, "repo_name": "Itxaka/st2", "id": "157ac9b4173a0d970fcff824a929ff7d92c5350a", "size": "5296", ...
""" Classes for handling sparse matrices. To read about different sparse formats, see http://www-users.cs.umn.edu/~saad/software/SPARSKIT/paper.ps """ from __future__ import print_function # TODO # Automatic methods for determining best sparse format? import sys import numpy from numpy.lib.stride_tricks import as_...
{ "content_hash": "8224195eefc42da84cbec3a82d51b884", "timestamp": "", "source": "github", "line_count": 4370, "max_line_length": 133, "avg_line_length": 28.402517162471394, "alnum_prop": 0.5572877641618125, "repo_name": "marcsans/cnn-physics-perception", "id": "dad078afe6e7447800efbab9f699cb029973966...
from rest_framework import viewsets from .models import Note from .serializers import NoteSerializer class NotesViewSet(viewsets.ModelViewSet): queryset = Note.objects.all() serializer_class = NoteSerializer
{ "content_hash": "dc2d99c90780844a4cbd52f5f1bcff57", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 42, "avg_line_length": 27.25, "alnum_prop": 0.7981651376146789, "repo_name": "xunil154/ExampleREST", "id": "0de645b0ea458e896f43a9a51de2bcc5f5ce2f47", "size": "218", "bina...
__author__ = 'pp' __version__ = '1.0.0' import os import re import copy import time class TextFileInfo(object): def __init__(self, file_id, extension=None, delimiter=None, quotechar=None): self.file_id = file_id self.extension = 'csv' if extension is None else extension self.delimiter = ...
{ "content_hash": "1af077e9b3fc7fcbfbd8c59d8f71a30f", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 140, "avg_line_length": 38.17261904761905, "alnum_prop": 0.5928582566661469, "repo_name": "Cocuyo-Labs-Team/ccytsk", "id": "a697105f5b52de3e1a06a8ff9bb0ad5f4d2607aa", "siz...
'''This utility cleans up the html files as emitted by doxygen so that they are suitable for publication on a Google documentation site. ''' import glob import optparse import os import re import shutil import sys try: from BeautifulSoup import BeautifulSoup, Tag except (ImportError, NotImplementedError): print ("...
{ "content_hash": "c362812b84db837d6ff578123b19a9ec", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 80, "avg_line_length": 28.483568075117372, "alnum_prop": 0.626174386022746, "repo_name": "krieger-od/nwjs_chromium.src", "id": "d90f214f8e4f78a56be1a78a345091e354cbb0f3", ...
import os import os.path as osp import sys import click import torch import torchfcn import yaml from dataset import DatasetV1 this_dir = osp.dirname(osp.realpath(__file__)) def git_hash(): import shlex import subprocess cmd = 'git log -n 1 --pretty="%h"' hash = subprocess.check_output(shlex.split...
{ "content_hash": "32e1bd03186a63a78393ffda7152e5e6", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 79, "avg_line_length": 29.442622950819672, "alnum_prop": 0.6322383073496659, "repo_name": "pazeshun/jsk_apc", "id": "168fefc28a879c21e4390531ea9208a18e7b30d8", "size": "36...
"""Unit tests for parser ccio module.""" import os import tempfile import unittest import cclib class guess_fileypeTest(unittest.TestCase): def setUp(self): self.guess = cclib.io.ccio.guess_filetype def test_fail(self): """Does the function fail as expected?""" self.assertIsNone(se...
{ "content_hash": "5e281538976a82015a3ff99880c6de7e", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 106, "avg_line_length": 37.93975903614458, "alnum_prop": 0.667513496348047, "repo_name": "Schamnad/cclib", "id": "d7a03d4b77f0d6a7c43ce0cc28b705bfdb867b70", "size": "3347",...
""" Created on 6 Feb 2018 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) Ten Little Algorithms, Part 2: The Single-Pole Low-Pass Filter https://www.embeddedrelated.com/showarticle/779.php """ # --------------------------------------------------------------------------------------------------------------...
{ "content_hash": "ea1dd972b9fde47c8c32e095d0aeb240", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 118, "avg_line_length": 25.40740740740741, "alnum_prop": 0.358600583090379, "repo_name": "south-coast-science/scs_core", "id": "2d64fd8fb268792019bf3f838732f776febe8339", "...
""" Copyright (c) 2011, 2012, Regents of the University of California All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this l...
{ "content_hash": "c172769fbe7d1d5f5a9385e99d4fb69d", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 92, "avg_line_length": 39.42574257425743, "alnum_prop": 0.6762933199397287, "repo_name": "immesys/smap", "id": "642821e58d1d9bff65c19866804bda33d936a15b", "size": "3982", ...
import fileinput import string import sys import os # Goldstone old fortran_compiler = 'ifort' fortran_link_flags = '-O1 -mtune=core2 -msse3 -align ' fortran_opt_flags = '-O3 -mtune=core2 -msse3 -align -DBIGBLOCK=8 -c ' src_dir = '/home/jeff/code/spaghetty_backup/python/archive/src/' exe_dir = '/home/jeff/code/spaghet...
{ "content_hash": "3ffe4138dd4cccdfc97c0ab41296d446", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 75, "avg_line_length": 28.224489795918366, "alnum_prop": 0.6616052060737527, "repo_name": "jeffhammond/spaghetty", "id": "bffc36b134cb5c5553413b98a6620e1ef2708081", "size":...
""" Fix a word-processor-generated styles.odt for odtwriter use: Drop page size specifications from styles.xml in STYLE_FILE.odt. """ # # Author: Michael Schutte <michi@uiae.at> from lxml import etree import sys import zipfile from tempfile import mkstemp import shutil import os NAMESPACES = { "style": "urn:oasi...
{ "content_hash": "d4eee9e702fc38682d30664a7ff67dc6", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 75, "avg_line_length": 24.672131147540984, "alnum_prop": 0.6132890365448505, "repo_name": "cloudera/hue", "id": "b0b7dccd80df68327768e8d61adbb7a9397571c4", "size": "1701", ...
"""Counter for the days until an HTTPS (TLS) certificate will expire.""" from datetime import timedelta import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import ( CONF_HOST, CONF_PO...
{ "content_hash": "b81397a76c95016e3477b23974251569", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 86, "avg_line_length": 30.043478260869566, "alnum_prop": 0.6794500723589001, "repo_name": "lukas-hetzenecker/home-assistant", "id": "7b6445a2f35740d4c6e29f3a18df88222d9ef06d"...
from __future__ import print_function import getpass import inspect import os import sys import textwrap import prettytable import six from six import moves from rally.openstack.common.apiclient import exceptions from rally.openstack.common.gettextutils import _ from rally.openstack.common import strutils from rally...
{ "content_hash": "47c14870727aa9da9b9f5840568a2fdf", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 77, "avg_line_length": 29.213058419243985, "alnum_prop": 0.5864015998117869, "repo_name": "ytsarev/rally", "id": "a3ce8cc4b1167f7db762e69268a6b3ab5d1a5b63", "size": "9219"...
""" MySQL Connector/Python - MySQL drive written in Python """ # Python Db API v2 apilevel = '2.0' threadsafety = 1 paramstyle = 'pyformat' from .connection import MySQLConnection from .errors import ( Error, Warning, InterfaceError, DatabaseError, NotSupportedError, DataError, IntegrityError, ProgrammingErr...
{ "content_hash": "7524301ebacc6d24bae5c2250ec4fb00", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 72, "avg_line_length": 30.547619047619047, "alnum_prop": 0.6991426344505066, "repo_name": "rcosnita/fantastico", "id": "77b11b4db93b3d4c8bb9573e7287cee5b6fa1136", "size": "...
import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.paging import I...
{ "content_hash": "4e3f8205b5a534e21bbf4175174cc824", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 113, "avg_line_length": 41, "alnum_prop": 0.6354216483341304, "repo_name": "Azure/azure-sdk-for-python", "id": "d5c99c1979cffc83c79f0cb7cb88747a122eac0e", "size": "6773", ...
""" line.client ~~~~~~~~~~~ LineClient for sending and receiving message from LINE server. :copyright: (c) 2014 by Taehoon Kim. :license: BSD, see LICENSE for more details. """ import rsa import requests try: import simplejson as json except ImportError: import json from thrift.transport ...
{ "content_hash": "48a32f3a81b8102e6490de17e226cc21", "timestamp": "", "source": "github", "line_count": 339, "max_line_length": 90, "avg_line_length": 34.46607669616519, "alnum_prop": 0.5890961999315303, "repo_name": "unixz/line-max", "id": "d8092a8601adc2b8e9952f95fb2715beff9274d9", "size": "11708...
import multiprocessing import warnings import six from chainer.backends import cuda from chainer.dataset import convert from chainer import reporter from chainer.training.updaters import standard_updater try: from cupy.cuda import nccl _available = True except ImportError: _available = False import num...
{ "content_hash": "41f876b19ba39a56232d4c1e043ecc4f", "timestamp": "", "source": "github", "line_count": 490, "max_line_length": 79, "avg_line_length": 33.512244897959185, "alnum_prop": 0.5433895621460325, "repo_name": "ktnyt/chainer", "id": "3da8656f263ed2c21d15cb38b099a201865cf822", "size": "16421...
from .app import app from .tags import * from .images import * import config cfg = config.load() if cfg.standalone is not False: # If standalone mode is enabled (default), load the fake Index routes from .index import *
{ "content_hash": "6b34172d5cebe4050a7cb8f8de5e9da9", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 73, "avg_line_length": 23, "alnum_prop": 0.717391304347826, "repo_name": "airbnb/docker-registry", "id": "f8d94ed9d48b6c7dd0b6e162f4834ed51e1bdd29", "size": "255", "binar...
import unittest import env import hiisi import h5py import numpy as np import uuid import os class Test(unittest.TestCase): def setUp(self): self.unique_attr_path = None self.unique_attr_value = None self.reoccuring_attr_paths = [] self.reoccuring_attr_items = [] self....
{ "content_hash": "31037b50cc28925c68082b416d858ec1", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 105, "avg_line_length": 41.677725118483416, "alnum_prop": 0.5499204002729133, "repo_name": "karjaljo/hiisi", "id": "8e2f837e456438794e0b14e05b4e45e4221a0667", "size": "881...
import unittest import time import Queue import logging import sys import xmlrunner sys.path.append('../space_machines') sys.path.append('space_machines') from door import DoorState class DoorTests(unittest.TestCase): def setUp(self): logging.basicConfig(level=logging.WARN) self.doorstate = DoorState() ...
{ "content_hash": "e42b49e68a881223ef9674a369cb266f", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 72, "avg_line_length": 38.81944444444444, "alnum_prop": 0.7030411449016101, "repo_name": "bvesperman/Sector67RaspberryPiAccessControl", "id": "74ede237f27089b1d6e6d8efc4b886b...
from django.db import migrations, models import django.db.models.deletion import markupfield.fields class Migration(migrations.Migration): dependencies = [ ("sponsors", "0019_sponsor_twitter_handle"), ] operations = [ migrations.CreateModel( name="StatementOfWork", ...
{ "content_hash": "a89c0f59087298ff69de2d646263be16", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 87, "avg_line_length": 38.66086956521739, "alnum_prop": 0.36707152496626183, "repo_name": "python/pythondotorg", "id": "e451ee8f253bc6ad2764048cc0127afcd2018e3f", "size": ...
import neural_network as nn # Define some constants that we'll want to have for our project. LOG_DIR = "logs_dir" TRAINING_FILE_NAME = 'train.csv' TESTING_FILE_NAME = 'test.csv' OUTPUT_FILE_NAME = 'results.csv' # Load up our data but make sure we train on everything. data = nn.NNData(TRAINING_FILE_NAME, TESTING_FILE_...
{ "content_hash": "514a559786e86dda1acfbd8b62f31e5d", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 81, "avg_line_length": 32.23076923076923, "alnum_prop": 0.6455847255369929, "repo_name": "GEMISIS/machine-learning", "id": "334b1e80741465a4254b1b7f1a37d8aa2f3d9c4e", "size...
from fnmatch import filter from sys import stderr import argparse import filecmp import os import subprocess import sys LINKTEST="./link_test" ESCAPE="\033[%sm" BOLD=ESCAPE % "1" RED=ESCAPE % "31" NORMAL=ESCAPE % "0" FAILED=RED+"failed"+NORMAL def find(dir, file_filter=None): files = [walkdir[0]+"/"+file for walk...
{ "content_hash": "bf0402717ace0fee520c7dee20211584", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 85, "avg_line_length": 31.27979274611399, "alnum_prop": 0.5623654132847441, "repo_name": "ensemblr/llvm-project-boilerplate", "id": "ad6a3e0ea8d22d90eaf489ef5dcf382323ffe5b4...
from unittest import TestCase from Game.GameMode import GameMode class TestGameMode(TestCase): def setUp(self): pass def test_gm_new(self): gm = GameMode(mode="test", priority=1) self.assertIsInstance(gm, GameMode) def test_gm_new_bad_priority(self): with self.assertRaise...
{ "content_hash": "d7b87ce3f796f2d787b6f16a7fe6926f", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 71, "avg_line_length": 33.65, "alnum_prop": 0.6222139673105498, "repo_name": "dsandersAzure/python_cowbull_server", "id": "35e32dfea581f1875c7f5d40eba0289a19437986", "size"...
import re from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() def static(prefix, **kwargs): return patterns('', url(r'^%s(?P<path>.*)$' % re.escape(prefix.lstrip('/')), 'django.views.static.serve', kwargs=...
{ "content_hash": "8ca94d304a7e9a57d35c8878f3550bbb", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 117, "avg_line_length": 32.82608695652174, "alnum_prop": 0.6556291390728477, "repo_name": "grunskis/groupie", "id": "4581f2e855badb650771d097477db8d6b076a402", "size": "755...
"""Tests for hparam.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.training.python.training import hparam from tensorflow.python.platform import test class HParamsTest(test.TestCase): def testEmpty(self): hparams = hpar...
{ "content_hash": "1f47179d7e80aa5950f1a8455b1c64eb", "timestamp": "", "source": "github", "line_count": 408, "max_line_length": 80, "avg_line_length": 37.872549019607845, "alnum_prop": 0.6179135387004918, "repo_name": "ravindrapanda/tensorflow", "id": "16397622edd382bc6dcb12870de5fa22130a2c2b", "si...
import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) from decimal import Decimal, ROUND_DOWN import json import random import shutil import subprocess import time import re from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util impo...
{ "content_hash": "e4e13cc1d86f94cd2f7b1fa49bef2224", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 104, "avg_line_length": 35.78476821192053, "alnum_prop": 0.6245026371796059, "repo_name": "TBoehm/greedynode", "id": "6d0b21c927b1368f1c17c998742666e3556724a2", "size": "1...
from django.urls import reverse from menu import Menu, MenuItem def profile_title(request): """ Return a personalized title for our profile menu item """ # we don't need to check if the user is authenticated because our menu # item will have a check that does that for us name = request.user.g...
{ "content_hash": "63a438f54a4e3b6d7f90e999f78f90f5", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 100, "avg_line_length": 32.167883211678834, "alnum_prop": 0.5625141819832086, "repo_name": "ianastewart/cwltc-admin", "id": "0a1f1fc83c59aac47081119efcbf85bd9d077fdd", "si...
"""Sparse attention for the transformer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensor2tensor.layers import common_attention from tensor2tensor.layers import common_layers import tensorflow.compat.v1 as tf from state_of_sparsity.sparse_tra...
{ "content_hash": "8fe9e436d123debff55bc4ccf04bb5fc", "timestamp": "", "source": "github", "line_count": 402, "max_line_length": 105, "avg_line_length": 43.06218905472637, "alnum_prop": 0.6011784414534111, "repo_name": "google-research/google-research", "id": "78566d922cf6321d93e9eae391c8d3d0a0223025"...
__author__ = 'zelgadis' import bpy import sys UPDATE = "update" WIDTH = "width" HEIGHT = "height" STEREO_CAMERA = "camera" AUDIOFILE = "audiofile" FORMAT = "format" CYCLES_SAMPLES = "cycles_samples" PRERENDER_COUNT = "prerender_count" GPU_DEVICE = "gpu_device" params = {UPDATE: False, WIDTH: 480, ...
{ "content_hash": "6d4d8c56bdb23b9275db848cf659a330", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 146, "avg_line_length": 37.325842696629216, "alnum_prop": 0.5569937788480834, "repo_name": "scribblemaniac/RenderChan", "id": "6a6bf775ac643f949adb3b2518e1d09d019be449", "...
"""flask.""" from flask import Flask from flask import abort from flask import request from flask import render_template import driver # from t_infinity.engineer_create import EngineerCreate # from t_infinity.engineer_service_report import ServiceReport # from t_infinity.login import Login # from t_infinity.logistics...
{ "content_hash": "67715933a1a50d89fd4450c5aa2c51d8", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 62, "avg_line_length": 23.38235294117647, "alnum_prop": 0.7220125786163522, "repo_name": "k33k00/tesseract_infinity", "id": "f955bf9d17ab05704179a76ed7943c42e2a90bde", "siz...
from .sub_resource import SubResource class VirtualNetworkGatewayIPConfiguration(SubResource): """IP configuration for virtual network gateway. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure....
{ "content_hash": "38004c6f72b99d100d378224063ccffb", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 103, "avg_line_length": 43.33898305084746, "alnum_prop": 0.6589753617520532, "repo_name": "lmazuel/azure-sdk-for-python", "id": "17a483af135717ee03c503082506e7fd33c3890d", ...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('beer', '0002_beer_beer_type'), ] operations = [ migrations.RemoveField( model_name='burger', name='maker', ), migrat...
{ "content_hash": "16e7cfb1e64bb3382a9bdbda522855d6", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 40, "avg_line_length": 19.1, "alnum_prop": 0.5497382198952879, "repo_name": "campovski/beernburger", "id": "26f6d853e035b76c4013e592ecd7d3368f50311b", "size": "453", "bin...
from azure.identity import DefaultAzureCredential from azure.mgmt.apimanagement import ApiManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-apimanagement # USAGE python api_management_service_get_sso_token.py Before run the sample, please set the values of the clie...
{ "content_hash": "f6802268a662ff19c01de509a9cb8321", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 154, "avg_line_length": 33.666666666666664, "alnum_prop": 0.7371737173717372, "repo_name": "Azure/azure-sdk-for-python", "id": "8219fe7c80f88fe6bd6b206ec93f928e5e348c72", "...
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__(self, plotly_name="color", parent_name="parcats.line", **kwargs): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "a4eaeb6e1f2fe2ff86f9342ce3ca2a9f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 85, "avg_line_length": 40.92307692307692, "alnum_prop": 0.618421052631579, "repo_name": "plotly/plotly.py", "id": "c682c57cc651bea1fcecfdec644d478bfb445fdd", "size": "532",...
from django.shortcuts import render # def init(request, api_url, api_settings, viewer_id, group_id, is_app_user): # return render(request, 'vk/index.html', context) # api_url=https://api.vk.com/api.php # &api_settings=0 # &viewer_id=123456 # &group_id=654321 # &is_app_user=0 \\ from django.views.decorators.clickj...
{ "content_hash": "1abee14f727bc78216ef6361f5625dd2", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 96, "avg_line_length": 32.81481481481482, "alnum_prop": 0.7065462753950339, "repo_name": "ParuninPavel/lenta4_hack", "id": "6b092633ebd77184c0cfa8bce6dee69c1818eef4", "size...
''' This script computes a 2-7 year bandpass filtered coral series and plot it above the original one Yuxin Zhou ''' from scipy.signal import butter, lfilter, filtfilt def butter_bandpass(lowcut, highcut, fs, order=4): nyq = 0.5 * fs low = lowcut / nyq high = highcut / nyq b, a = butter(order, [low, hi...
{ "content_hash": "b833a59c49cd5cb1e7a40b9528648601", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 97, "avg_line_length": 29.264705882352942, "alnum_prop": 0.6633165829145728, "repo_name": "CommonClimate/EmileGeay_NatGeo2015", "id": "5ce18b37db2859adf26a7213f8148f7a262f1f5...
"""A module for manipulating Images, which are specially wrapped Pygame surfaces. """ import pygame import spyral import copy def _new_spyral_surface(size): """ Internal method for creating a new Spyral-compliant Pygame surface. """ return pygame.Surface((int(size[0]), int(s...
{ "content_hash": "d2038f402c52bbb201dc4a41323dbdaf", "timestamp": "", "source": "github", "line_count": 530, "max_line_length": 147, "avg_line_length": 39.509433962264154, "alnum_prop": 0.5683381088825215, "repo_name": "justinmeister/spaceinvaders-spyral", "id": "8e577769602bcedf155e68525e67dbc612d9b...
import xml.etree.ElementTree as ET from programy.parser.template.nodes.base import TemplateNode from programy.parser.template.nodes.indexed import TemplateIndexedNode from test.parser.template.base import TemplateTestsBaseClass class TemplateIndexedNodeTests(TemplateTestsBaseClass): def test_node(self): ...
{ "content_hash": "b15c3571f562d01caa3f893e9aa07c3d", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 70, "avg_line_length": 29.476190476190474, "alnum_prop": 0.7382875605815832, "repo_name": "JustArchi/program-y", "id": "80a960005602c42c36adb8b9a99d95521a28bb14", "size": "...
""" Helper routines for density processing, from the Gpcr project originally """ import numpy as np def read_simple(filename,lownam,uppnam) : mat = np.load(filename) return mat[lownam],mat[uppnam] def read_and_scale(filename,lownam,uppnam,scaling=None) : lowmat,uppmat = read_simple(filename,lownam,uppnam) ...
{ "content_hash": "e5d111423700dda8d2519b770f94b80e", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 110, "avg_line_length": 28.21153846153846, "alnum_prop": 0.6837082481254261, "repo_name": "SGenheden/Scripts", "id": "db7c63c11db9d72fd421177db3169ccc5f357049", "size": "15...
import os import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import spline # from http://www.lfd.uci.edu/~gohlke/ try: import tifffile except ImportError: print ''' The Tifffile module by Christoph Gohlke is required for gel image analysis. Download from http://www.lfd.uci.edu/~gohlke/, sav...
{ "content_hash": "c0886aa247211f563c7cbe51c0975475", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 229, "avg_line_length": 46.90151515151515, "alnum_prop": 0.6842997900177678, "repo_name": "wltrimbl/kmerspectrumanalyzer", "id": "e918eea495c1abf7ce8f9563f9eaf6072261cd70", ...
"""Module for testing the del address command.""" import unittest if __name__ == "__main__": import utils utils.import_depends() from brokertest import TestBrokerCommand class TestDelAddress(TestBrokerCommand): def testbasic(self): self.dsdb_expect_delete(self.net.unknown[0].usable[13]) ...
{ "content_hash": "3b4147c441212e0930ac9e12eb09b3bb", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 81, "avg_line_length": 39.12418300653595, "alnum_prop": 0.5711660541262947, "repo_name": "stdweird/aquilon", "id": "d3590c6f07a8e05c615dc92b002fc28532f2ab10", "size": "671...
import importlib import time import datetime from datetime import timedelta from unittest import mock from django.conf import settings from django.core.signals import request_finished, request_started from django.test.testcases import TransactionTestCase from post_request_task.task import _discard_tasks, _stop_queui...
{ "content_hash": "b452439a1d7220baa2be6b77711bf46e", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 86, "avg_line_length": 32.38666666666666, "alnum_prop": 0.6755866611774393, "repo_name": "bqbn/addons-server", "id": "76e4c8f0622615eff507a6d20cd83d804f073614", "size": "4...
from __future__ import unicode_literals import string import itertools import click import xlrd import os from . import asciitable, __version__ from .compat import open_file, csv, out_proc from .cursor import XCursor, CSVCursor from six import PY3 from subprocess import Popen, PIPE @click.command() @click.option('-...
{ "content_hash": "e52108fb896ca3bfe7837f08764ca5fa", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 101, "avg_line_length": 33.84507042253521, "alnum_prop": 0.6179775280898876, "repo_name": "krockode/x_x", "id": "319d09b27ea3b6be346245c9efe965ae7e602745", "size": "2403", ...
from django.core.management import call_command from django.core.management.base import NoArgsCommand from pangolinland.users.factories import generate_users class Command(NoArgsCommand): help = 'Fill the database with test fixtures' def handle(self, *args, **options): self.stdout.write('Starting fi...
{ "content_hash": "56937557c69119dbad2a2a14ff78a271", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 55, "avg_line_length": 27.166666666666668, "alnum_prop": 0.6912065439672802, "repo_name": "skylifewww/pangolinland", "id": "0165a0489846edcd00f8af92114238bc60645a94", "size...
import sys import os import signal import re import cPickle import logging import datetime from urlparse import urlparse from traceback import print_exc from time import time, gmtime, strftime, localtime from random import shuffle from types import StringType, IntType, LongType, ListType, DictType from binascii import ...
{ "content_hash": "14b24e8cec39b12c136428725f200927", "timestamp": "", "source": "github", "line_count": 923, "max_line_length": 236, "avg_line_length": 40.04875406283857, "alnum_prop": 0.5083727850669553, "repo_name": "sauloal/linuxscripts", "id": "0dbb7eb0ea8406d55a53f10ed95343b33676d228", "size":...
from __future__ import absolute_import, print_function from sentry import analytics class IntegrationAddedEvent(analytics.Event): type = "integration.added" attributes = ( analytics.Attribute("provider"), analytics.Attribute("id"), analytics.Attribute("organization_id"), anal...
{ "content_hash": "285c7075952969a6c19d984f6d755d09", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 59, "avg_line_length": 27.78181818181818, "alnum_prop": 0.7045157068062827, "repo_name": "mvaled/sentry", "id": "04d3024d710869c9d795a445306a287f08889b18", "size": "3056",...
""" Copyright (c) 2013 Clarinova. This file is licensed under the terms of the Revised BSD License, included in this distribution as LICENSE.txt """ from . import DatabaseInterface import semidbm as dbm # @UnresolvedImport import os import json class Dbm(DatabaseInterface): def __init__(self, bundle, base_p...
{ "content_hash": "fc065236d6d0c68c27602c990f1ff824", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 75, "avg_line_length": 21.626666666666665, "alnum_prop": 0.5283600493218249, "repo_name": "kball/ambry", "id": "3593cb4c6ca36d115a95df8f219fd3c66156dcc1", "size": "1622", ...
""" byceps.blueprints.admin.site.views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from flask import abort, request from ....services.party import service as party_service from ....services.site import ( service as site_servic...
{ "content_hash": "7eac6de788f6008f82bb01cc207bd19f", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 78, "avg_line_length": 26.402985074626866, "alnum_prop": 0.6463161861692105, "repo_name": "m-ober/byceps", "id": "2bdc96e3c0a2ed670a27a9ff2a0289d525223878", "size": "5307"...
''' @author: Frank ''' import os try: if os.environ['TERM'].startswith('xterm'): os.environ['TERM'] = 'vt100' except: os.environ['TERM'] = 'vt100' import readline import sys reload(sys) sys.setdefaultencoding('utf8') import shlex import hashlib import optparse import termcolor import pydoc import time...
{ "content_hash": "7982e8ec81443623bceb00a12d3cdf6e", "timestamp": "", "source": "github", "line_count": 1073, "max_line_length": 258, "avg_line_length": 38.5358807082945, "alnum_prop": 0.49488500326489154, "repo_name": "ghxandsky/zstack-utility", "id": "97018685dea0a69d30db36d192af3c082b3e8d4f", "s...
"""Basic checks for HomeKitalarm_control_panel.""" from aiohomekit.model.characteristics import CharacteristicsTypes from aiohomekit.model.services import ServicesTypes from homeassistant.helpers import entity_registry as er from .common import get_next_aid, setup_test_component def create_security_system_service(a...
{ "content_hash": "8ea16e804752a71c3ce36f2f85c097be", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 84, "avg_line_length": 33, "alnum_prop": 0.6675324675324675, "repo_name": "nkgilley/home-assistant", "id": "2c2ff92ccb64cab967bd2d13268a20d0103698f0", "size": "4620", "b...
""" Starts a service to scan in intervals for new devices. Will emit EVENT_PLATFORM_DISCOVERED whenever a new service has been discovered. Knows which components handle certain types, will make sure they are loaded before the EVENT_PLATFORM_DISCOVERED is fired. """ import logging import threading from homeassistant ...
{ "content_hash": "3598e28ef475e207b128a353b2b574ec", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 79, "avg_line_length": 28.42105263157895, "alnum_prop": 0.6679012345679012, "repo_name": "aoakeson/home-assistant", "id": "2d58c54ac0d6b7e97452f9ebc7ea0651fa04b1df", "size...
from __future__ import absolute_import from inspect import isclass from celery.datastructures import AttributeDict from django.utils.translation import ugettext_lazy as _ __all__ = ('LOG', 'LOG_BY_ID', 'LOG_KEEP',) class _LOG(object): action_class = None class CREATE_ADDON(_LOG): id = 1 action_class...
{ "content_hash": "d53b070259dc6b105654214ee394e54d", "timestamp": "", "source": "github", "line_count": 621, "max_line_length": 79, "avg_line_length": 24.10950080515298, "alnum_prop": 0.6045952444563185, "repo_name": "mstriemer/addons-server", "id": "bc58282c20c50e909417cb97249a3ac5e7beab77", "size...
from __future__ import unicode_literals from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover(...
{ "content_hash": "281a2b02b23a546bbf4cc8acb020b82b", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 66, "avg_line_length": 33.542857142857144, "alnum_prop": 0.686541737649063, "repo_name": "eldruz/tournament_registration", "id": "20db8f0711a894a70dcc15d0fb79a93c2b892618", ...
from app import app_factory if __name__ == '__main__': app_factory().run()
{ "content_hash": "cce077a037d04efa2fa2dcba682dad8d", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 27, "avg_line_length": 16.2, "alnum_prop": 0.5679012345679012, "repo_name": "comick/barduino", "id": "ef62521583f4c76c76494078da022a2ace6a1acb", "size": "128", "binary": f...
from django.db import models from django.contrib.auth.models import User # Create your models here. # class City(models.Model): city = models.CharField(max_length=255, unique=True) created_at = models.DateTimeField(auto_now_add=True, editable=False) updated_at = models.DateTimeField(au...
{ "content_hash": "3b530c1540ff1017cf45a792aa06daef", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 427, "avg_line_length": 39.883720930232556, "alnum_prop": 0.6171039844509232, "repo_name": "amol-mandhane/konnactivity", "id": "dee15ab45c5a6aa9a464bfa3a8424f94cf80b391", ...
'''Slickbird backend tests''' import os import json import tempfile from slickbird.collectionjson import collectionjson from slickbird import orm from tornado.testing import gen_test from . import base pjoin = os.path.join APP_ROOT = os.path.abspath(pjoin(os.path.dirname(__file__), '..')) class TestSlickbirdBack...
{ "content_hash": "ab55e082305f2479a85b4616901f4005", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 66, "avg_line_length": 25.333333333333332, "alnum_prop": 0.6423444976076556, "repo_name": "lpenz/slickbird", "id": "eb891724a1d6676135a4f8311b1a1c1a7d0a6e68", "size": "836"...
""" WSGI config for pubmed_central_request project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os from os.path import abspath, dirname from sys import path SITE_ROOT = di...
{ "content_hash": "c6ab4e8dd2765b07cf078c6a44e045e8", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 82, "avg_line_length": 26.238095238095237, "alnum_prop": 0.7713248638838476, "repo_name": "allnightdiner/pubmed_central_request", "id": "de06b9abddca0f8ab09be985bc9058b90e422...
import pandas import pyomo import pyomo.opt import pyomo.environ as pe import logging class MaxFlowInterdiction: """A class to compute max-flow interdictions.""" def __init__(self, nodefile, arcfile, attacks=0): """ All the files are CSVs with columns described below. Attacks is the number of...
{ "content_hash": "fb4b27b516b393bf3999c721eb4fdd8d", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 168, "avg_line_length": 37.804761904761904, "alnum_prop": 0.6005794180627283, "repo_name": "Pyomo/PyomoGallery", "id": "96743f38458d4abf00ba54204fea43d4a1d4a05d", "size": ...
"""This module contains the User Model.""" from google.appengine.api import users from google.appengine.ext import db from django.utils.translation import ugettext import soc.models.linkable class User(soc.models.linkable.Linkable): """A user and associated login credentials, the fundamental identity entity. ...
{ "content_hash": "33e189010d5f7031036c4337d020ba44", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 80, "avg_line_length": 42.04838709677419, "alnum_prop": 0.724012274645186, "repo_name": "rhyolight/nupic.son", "id": "b550d05e59ca2cac6d39575b084709747ab3138c", "size": "5...
from collections import namedtuple import sqlparse from django.db import DatabaseError from django.db.backends.base.introspection import BaseDatabaseIntrospection from django.db.backends.base.introspection import FieldInfo as BaseFieldInfo from django.db.backends.base.introspection import TableInfo from django.db.mod...
{ "content_hash": "292e90117ec41857961d4a4181d5af44", "timestamp": "", "source": "github", "line_count": 438, "max_line_length": 88, "avg_line_length": 39.906392694063925, "alnum_prop": 0.5225127295611877, "repo_name": "solarissmoke/django", "id": "a74153757b122abe3d9ea2ebed1cf5d261c54c29", "size": ...
import time, codecs, sys, traceback, cgi, re, os sys.setrecursionlimit(50000) sys.path.append("/Libs/jsoup-1.8.2.jar") sys.path.append("/Libs/lucene-analyzers-common-4.10.4.jar") sys.path.append("/Libs/lucene-core-4.10.4.jar") sys.path.append("/Libs/lucene-queries-4.10.4.jar") sys.path.append("/Libs/lucene-queryparser...
{ "content_hash": "6383bdf3dffff29ca40a70879b940a87", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 119, "avg_line_length": 39.38235294117647, "alnum_prop": 0.6174591320222388, "repo_name": "facoy/facoy", "id": "9f8bef52155452d253fb656a93a3dc40c1893a74", "size": "12171",...
import boto import re from boto.utils import find_class import uuid from boto.sdb.db.key import Key from boto.sdb.db.model import Model from boto.sdb.db.blob import Blob from boto.sdb.db.property import ListProperty, MapProperty from datetime import datetime, date, time from boto.exception import SDBPersistenceError I...
{ "content_hash": "bb2324abeb7d929ae647bfd809e112c3", "timestamp": "", "source": "github", "line_count": 676, "max_line_length": 152, "avg_line_length": 36.531065088757394, "alnum_prop": 0.5195383680907066, "repo_name": "drawquest/drawquest-web", "id": "4e51d2d7e35df3691bd5810a7f40932bb3608f37", "si...
class ImageComparisonFailure(AssertionError): """ Raise this exception to mark a test as a comparison between two images. """
{ "content_hash": "325cb4147f18a55a435591c1d73007aa", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 75, "avg_line_length": 34.5, "alnum_prop": 0.717391304347826, "repo_name": "louisLouL/pair_trading", "id": "c39a39207747c75d768ea2dd498dfed364eb88c5", "size": "138", "bina...
"""Support for HomematicIP Cloud devices.""" import logging import voluptuous as vol from homeassistant import config_entries from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_NAME, EVENT_HOMEASSISTANT_STOP from homeassistant.helpers import device_registry as dr import homeassi...
{ "content_hash": "751d8b3c98991a72b691521c1d375cb1", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 83, "avg_line_length": 31.142857142857142, "alnum_prop": 0.6233135456017269, "repo_name": "tchellomello/home-assistant", "id": "47da33e86dab8cb424b5c61bcf643e73817df6af", ...
''' This is a simple proxy-minion to manage ROKU devices :maintainer: Christer Edwards (christer.edwards@gmail.com) :maturity: 20150920 :depends: none :platform: all ''' from __future__ import absolute_import # Import python libs import logging import salt.utils.http __proxyenabled__ = ['roku'] LOG = logging.getLog...
{ "content_hash": "4e615605c21edfbc60d47258b00ff0d7", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 86, "avg_line_length": 20.074285714285715, "alnum_prop": 0.5977796754910333, "repo_name": "cedwards/saltstack-proxy-module-roku", "id": "21fc4e2fa8f55ee7d05a139ff1824f26d00e...
from openstack_dashboard import api from openstack_dashboard.test import helpers as test from neutronclient.v2_0.client import Client as neutronclient # noqa class FwaasApiTests(test.APITestCase): @test.create_stubs({neutronclient: ('create_firewall_rule',)}) def test_rule_create(self): rule1 = self...
{ "content_hash": "79dbe19c03ce71ffab4d211f9ef43c8e", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 77, "avg_line_length": 41.851540616246496, "alnum_prop": 0.5935345693059367, "repo_name": "mrunge/horizon", "id": "1c978b2f1ec14367e0849649e6267abfd48efd69", "size": "1556...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
{ "content_hash": "e4fa35f727113fca3435c861f61f9026", "timestamp": "", "source": "github", "line_count": 1628, "max_line_length": 103, "avg_line_length": 37.894348894348894, "alnum_prop": 0.5806263372884652, "repo_name": "airbnb/caravel", "id": "6bc08cae88a3bf4987f763ab2bf34a5ca68ef2ce", "size": "61...
"""Implement operations for branch-based reviews.""" # ============================================================================= # CONTENTS # ----------------------------------------------------------------------------- # abdt_branch # # Public Classes: # Branch # .is_abandoned # .is_null # .is_new # ...
{ "content_hash": "7e19f938becb8eca646b05639a647d32", "timestamp": "", "source": "github", "line_count": 623, "max_line_length": 79, "avg_line_length": 35.258426966292134, "alnum_prop": 0.5866794136392607, "repo_name": "valhallasw/phabricator-tools", "id": "14468f155655f4eca7646f095836170115a5608a", ...
import time from lib import oled as display display.disp_content.tonemode = "Vol" display.disp_content.tonevalue = 50 display.disp_content.time = "17:55" display.disp_content.name = "DRadio Wissen" display.disp_content.artist = "Bla" display.disp_content.title = "Blubber" display.disp_content.app_mode = "RAD" displ...
{ "content_hash": "95e8eb07959729546d5ee7d219850b64", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 45, "avg_line_length": 27.96, "alnum_prop": 0.740343347639485, "repo_name": "thk4711/orangepi-radio", "id": "bb92fc6eb2777046f691971e655f83543ae0cd96", "size": "1421", "b...
""" Pyodide and other single-threaded Python builds will be missing the _multiprocessing module. Test that joblib still works in this environment. """ import os import subprocess import sys def test_missing_multiprocessing(tmp_path): """ Test that import joblib works even if _multiprocessing is missing. ...
{ "content_hash": "f062d5bc403934ad292af8ee76e41ae1", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 79, "avg_line_length": 35.09375, "alnum_prop": 0.6829919857524488, "repo_name": "joblib/joblib", "id": "251925ced5208b4aaf09d9aab305eb44c7102818", "size": "1123", "binary...
import bz2 import datetime as dt from datetime import datetime import gzip import io import lzma import os import struct import warnings import zipfile import numpy as np import pytest from pandas.core.dtypes.common import is_categorical_dtype import pandas as pd import pandas._testing as tm from pandas.core.frame i...
{ "content_hash": "8137bed09b21f65cd16d1f8c2ae7c75d", "timestamp": "", "source": "github", "line_count": 1999, "max_line_length": 88, "avg_line_length": 39.09804902451226, "alnum_prop": 0.5394270506800415, "repo_name": "jreback/pandas", "id": "24944281419c340aa764066cb8978843f8b00eb7", "size": "7828...
from framework.dependency_management.dependency_resolver import ServiceLocator from framework.http.wafbypasser import wafbypasser def format_args(args): formatted_args = { "target": None, "payloads": None, "headers": None, "methods": None, "data": None, "contains": ...
{ "content_hash": "e3a139963a24bdd5e06c1a4d3df92000", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 103, "avg_line_length": 29.661290322580644, "alnum_prop": 0.5502990755845568, "repo_name": "DarKnight24/owtf", "id": "eab0a5b35a020cf015fa921e3350b17910828ef4", "size": "18...
import os from flask.cli import DispatchingApp from werkzeug.debug import DebuggedApplication from werkzeug.exceptions import NotFound from werkzeug.middleware.dispatcher import DispatcherMiddleware from werkzeug.middleware.proxy_fix import ProxyFix from werkzeug.serving import WSGIRequestHandler, run_simple from werk...
{ "content_hash": "be05e52eae7e660eac5b342ddcd811b2", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 119, "avg_line_length": 34.179190751445084, "alnum_prop": 0.6350414341281921, "repo_name": "DirkHoffmann/indico", "id": "6555594ef1877560fced6be5294612df0434d64f", "size":...
import sys from telnet import Telnet from handler import Handler from managers import ListeningManager, ConnectionManager # from _handlers import LogonHandler class EchoHandler(Handler): def __init__(self, conn): Handler.__init__(self, conn) def Enter(self): self.SendString(self.connection,...
{ "content_hash": "39a1ab05f15265502f9a7baece5ebf5e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 72, "avg_line_length": 25.714285714285715, "alnum_prop": 0.6544444444444445, "repo_name": "prim/SZMUD", "id": "bf51d5539ea5b35d9f82956471151a9e713ff5c6", "size": "919", "...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('users', '0002_auto_20150905_2016'), ] operations = [ ]
{ "content_hash": "500184742b44fe88706eeeb52c6ed5ec", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 45, "avg_line_length": 17.153846153846153, "alnum_prop": 0.6502242152466368, "repo_name": "sebastian-code/portal", "id": "931780c635df64cf04ab1d0b57d65daf1aeee514", "size":...
from django.conf import settings import ldap import ldap.modlist import logging logger = logging.getLogger("ldapproxy.models") class LdapProxy: ''' wrapper class to talk to the LDAP MASTER server. ''' proxy = None def __init__(self): try: if settings.LDAP_MASTER_DISABLE == Tr...
{ "content_hash": "7d3b3f3d9a76bc725f71a13d5288a105", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 289, "avg_line_length": 51.544444444444444, "alnum_prop": 0.6208234533304592, "repo_name": "avlach/univbris-ocf", "id": "c8be5ccc40f7508af0b238ebb1c8d1a0efbd8940", "size": ...
from __future__ import absolute_import from envisage.resource.file_resource_protocol import *
{ "content_hash": "84169598c7c07fd3edbc3ca683adf281", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 54, "avg_line_length": 47, "alnum_prop": 0.8085106382978723, "repo_name": "enthought/etsproxy", "id": "78fac251c73c33d084002bdd1de2252e769b1af5", "size": "109", "binary": ...
""" Composites are the **factories** and **decision makers** of a behaviour tree. They are responsible for shaping the branches. .. graphviz:: dot/composites.dot .. tip:: You should never need to subclass or create new composites. Most patterns can be achieved with a combination of the above. Adding to this set expo...
{ "content_hash": "44ba99e90c99961bef633180e72d165c", "timestamp": "", "source": "github", "line_count": 609, "max_line_length": 268, "avg_line_length": 41.614121510673236, "alnum_prop": 0.5892751450104565, "repo_name": "stonier/py_trees_suite", "id": "439b76c304a1e05941839a8ec6254f6d3995f136", "siz...
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import warnings from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import DEFAULT_DB_ALIAS from django.db.backends.base.base import BaseDatabaseWrapper from djan...
{ "content_hash": "845a70e1dc9de2a5f19698aea4f7bd87", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 113, "avg_line_length": 39.54887218045113, "alnum_prop": 0.6263307984790875, "repo_name": "jarshwah/django", "id": "1ab05d81f60d232d7037beb7f70f804b4954fec4", "size": "105...
"""Test the Trusted Networks auth provider.""" from ipaddress import ip_address, ip_network from unittest.mock import Mock, patch from hass_nabucasa import remote import pytest import voluptuous as vol from homeassistant import auth from homeassistant.auth import auth_store from homeassistant.auth.providers import tr...
{ "content_hash": "4f678dc47b911da44e688df5d48ba1a2", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 88, "avg_line_length": 34.464467005076145, "alnum_prop": 0.6227262685028353, "repo_name": "toddeye/home-assistant", "id": "406e9a033da4511dbc52c455e6b5b9bae1090f5e", "size...
from cloudify import ctx # put the operation decorator on any function that is a task from cloudify.decorators import operation @operation def my_task(str1, str2, **kwargs): ctx.logger.info('str1 = '+str1) ctx.logger.info('str2 = '+str2) result = str1 + str2 # setting node instance runtime prope...
{ "content_hash": "80f4fc3e3e9045c620abdcebd91fb9bf", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 60, "avg_line_length": 27.933333333333334, "alnum_prop": 0.6992840095465394, "repo_name": "lj020326/cloudify3-training-labs", "id": "15a5e359b85fefb735c478679e1a2f880a769950"...
import sys import os import shlex from recommonmark.parser import CommonMarkParser # 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...
{ "content_hash": "4128aa06f7ff4a905d63c6153d582399", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 79, "avg_line_length": 32.201465201465204, "alnum_prop": 0.7060630189967012, "repo_name": "asolz/pyonep", "id": "68806dcbbe8f74e7f0af9810636b63dede0eafeb", "size": "9210",...
import os import sys try: from setuptools import setup, Command except ImportError: from distutils.core import setup, Command package_name = 'dpkt' description = 'fast, simple packet creation / parsing, with definitions for the basic TCP/IP protocols' readme = open('README.rst').read() requirements = [] # Py...
{ "content_hash": "682b95e06084efaf6cb1ba7f7c0cc1e3", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 103, "avg_line_length": 32.46808510638298, "alnum_prop": 0.6402359108781127, "repo_name": "smutt/dpkt", "id": "8af6f87ca28f9375a9c4f2a50b88a16207286c7e", "size": "1526", ...
import os from opentamiltests import * from solthiruthi.datastore import Trie from solthiruthi.dictionary import * # Test the canned English dictionary with data structure class TestEnglishDictionary(unittest.TestCase): def setUp(self): self.ENG, self.ENG_size = DictionaryBuilder.create(EnglishLinux) ...
{ "content_hash": "8cf311d1448800bc56c899e86b87b6da", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 114, "avg_line_length": 34.245098039215684, "alnum_prop": 0.6378471228170627, "repo_name": "arcturusannamalai/open-tamil", "id": "e6c39232e0c5d551d4676e78454357a62d096341", ...
import os, sys, signal, os.path import subprocess import time from ipython1.kernel.scripts import ipcluster from ipython1.kernel import task, controllerservice as cs, engineservice as es from pebl import data, result from pebl.learner import greedy from pebl.taskcontroller import serial, multiprocess, ipy1 from pebl...
{ "content_hash": "1d13a210f18f43bb03d3eed32e3ffef4", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 87, "avg_line_length": 32.91803278688525, "alnum_prop": 0.6757968127490039, "repo_name": "abhik/pebl", "id": "6b59e424d035923d49c9fe021d9631f1d1672ccf", "size": "2008", "...
import unittest import numpy import chainer from chainer.backends import cuda import chainer.functions as F from chainer import gradient_check from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'shape': [(), (3, 2)], })) class Expm1FunctionTest(unittest.TestCas...
{ "content_hash": "720ed804dad2916286c230ee47be37aa", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 79, "avg_line_length": 30.47826086956522, "alnum_prop": 0.6367094626723728, "repo_name": "aonotas/chainer", "id": "b3373da03b1950008c1250fb2d7e29a76f3a0620", "size": "2103"...
from lino.projects.std.settings import * from lino.utils import i2d class Site(Site): title = "Lino Mini 9" project_model = 'contacts.Person' languages = 'en de fr' user_types_module = 'lino_xl.lib.xl.user_types' demo_fixtures = """std demo demo2 checkdata""".split() default_build_method = 'we...
{ "content_hash": "3874d111316218856671cd9c9bda96a5", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 82, "avg_line_length": 33.83582089552239, "alnum_prop": 0.6193206881340979, "repo_name": "lino-framework/book", "id": "269290e34528ef87283fafd4d5299bc7d0023a2c", "size": "2...
""" This does a test drawing with lots of things in it, running with and without attribute checking. """ __version__ = '''$Id$''' from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation setOutDir(__name__) import os, sys, time import reportlab.rl_config import unittest from reportla...
{ "content_hash": "65bb717ee252fc39269d812779ba37e4", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 92, "avg_line_length": 31.85, "alnum_prop": 0.6138147566718996, "repo_name": "kanarelo/reportlab", "id": "bf9346ac9a4b3c9409ef23fe604e812e2b8371f9", "size": "2628", "bina...