text stringlengths 4 1.02M | meta dict |
|---|---|
"""This file is a collection of widgets to produce some common signs and symbols.
Widgets include:
- ETriangle (an equilateral triangle),
- RTriangle (a right angled triangle),
- Octagon,
- Crossbox,
- Tickbox,
- SmileyFace,
- StopSign,
- NoEntry,
- NotAllowed (the red roundel from 'no smoking' signs),
- N... | {
"content_hash": "58153cc07c4e1515fc428770a6254bf0",
"timestamp": "",
"source": "github",
"line_count": 913,
"max_line_length": 181,
"avg_line_length": 33.71960569550931,
"alnum_prop": 0.49811602676541283,
"repo_name": "jwheare/digest",
"id": "11262f00f5649fb991be5cb410ead376df03e563",
"size": "310... |
"""
Created on Wed Mar 10 14:58:01 2021
@author: Lucian
"""
import tellurium as te
import phrasedml
import libsedml
import sys
r = te.loada("""
model case_01
species S1=10, S2=5
S1 -> S2; S1*k
k = 0.3
end
""")
SBML = r.getSBML()
p_str = """
model0 = model "case_01.xml"
sim0 = ... | {
"content_hash": "e08de9b36e8ac297b314392a65213f3a",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 60,
"avg_line_length": 21.467532467532468,
"alnum_prop": 0.7114337568058077,
"repo_name": "luciansmith/sedml-test-suite",
"id": "8fdbac5d55befe00fbcbaea5994a3e8f6cff6720",
... |
"""This tool builds or repacks the client binaries.
This handles invocations for the build across the supported platforms including
handling Visual Studio, pyinstaller and other packaging mechanisms.
"""
import getpass
import logging
import os
import platform
import time
# pylint: disable=unused-import
from grr.cli... | {
"content_hash": "bccfc08d16d2108e6f699048a7342aa2",
"timestamp": "",
"source": "github",
"line_count": 429,
"max_line_length": 80,
"avg_line_length": 35.8997668997669,
"alnum_prop": 0.6631387572235569,
"repo_name": "pchaigno/grr",
"id": "01dd6cdeccd23c0ea55b50c2e14b8aa24f0655ca",
"size": "15423",
... |
class VarEnv:
def __init__(self):
pass
| {
"content_hash": "efacba9a8c113af34a3742fe1904af73",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 21,
"avg_line_length": 15,
"alnum_prop": 0.5777777777777777,
"repo_name": "jonathanmarvens/jeeves",
"id": "efc88792a414113b8830a04c61a338f14d8ebf3c",
"size": "45",
"binary... |
"""
test_motome_notemodel
----------------------------------
Tests for `Motome.Models.NoteModel`
"""
import glob
import os
import shutil
import unittest
from Motome.Models.NoteModel import NoteModel
from Motome.config import NOTE_EXTENSION, HISTORY_FOLDER, END_OF_TEXT
TESTS_DIR = os.path.join(os.getcwd(), 'tests')
... | {
"content_hash": "f905f39db0f6cc44b95015b371d65e20",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 82,
"avg_line_length": 35.666666666666664,
"alnum_prop": 0.6308411214953271,
"repo_name": "akehrer/Motome",
"id": "5b12b28ae4c463dd2e531fa0721f11477252ff53",
"size": "5183... |
"""
Aho-Corasick string search algorithm.
Author : Wojciech Muła, wojciech_mula@poczta.onet.pl
WWW : http://0x80.pl
License : public domain
"""
import ahocorasick
A = ahocorasick.Automaton()
for index, word in enumerate("he her hers she".split()):
A.add_word(word, (index, word))
A.... | {
"content_hash": "c5aab7aa52fc2ecb0b6e87c16ce67e67",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 59,
"avg_line_length": 23.428571428571427,
"alnum_prop": 0.6432926829268293,
"repo_name": "pombredanne/pyahocorasick",
"id": "1df22ce4153755f81cf0203ad5ec409976de64e0",
"si... |
"""Diagnostics support for Kostal Plenticore."""
from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import REDACTED, async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD
from homeassistant.core import Home... | {
"content_hash": "1d790f4086d4faaef1ead53dd34b9c0e",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 81,
"avg_line_length": 35.54761904761905,
"alnum_prop": 0.7119892833221702,
"repo_name": "rohitranjan1991/home-assistant",
"id": "2e061d35528a4bc7dc20068bf434f168b2ad71ad",
... |
import astropy.units as u
import numpy as np
from astropy import log
from emcee import autocorr
from .extern.interruptible_pool import InterruptiblePool as Pool
from .extern.validator import validate_array
from .utils import sed_conversion, validate_data_table
__all__ = ["plot_chain", "plot_fit", "plot_data", "plot_b... | {
"content_hash": "3a6e9b01a5d22ea2e30420ca243f3455",
"timestamp": "",
"source": "github",
"line_count": 1500,
"max_line_length": 79,
"avg_line_length": 29.917333333333332,
"alnum_prop": 0.553614404135841,
"repo_name": "zblz/naima",
"id": "6bd53158182bb5d11d694417dace8a75b178ab5a",
"size": "44940",
... |
import pickle
import logging
import numpy as np
import mxnet as mx
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Define the network
data = mx.sym.Variable('data')
fc1 = mx.sym.FullyConnected(data=data, name='fc1', num_hidden=2)
sigmoid1 = mx.sym.Activation(data=fc1, name='sigmoid1', act_typ... | {
"content_hash": "216ac95466db9cb7b14ca2a8c44ce6b3",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 95,
"avg_line_length": 28.3,
"alnum_prop": 0.6824835941443715,
"repo_name": "frombeijingwithlove/dlcv_for_beginners",
"id": "dded1ce7665e0691b0655ce99af2f7548d7075b2",
"siz... |
import os
import subprocess
from textwrap import dedent
from mock import patch, Mock
import pytest
from pretend import stub
import pip
from pip.exceptions import (RequirementsFileParseError)
from pip.download import PipSession
from pip.index import PackageFinder
from pip.req.req_install import InstallRequirement
from... | {
"content_hash": "1f106d144d6cebb7c2d9b48c3b4d15c9",
"timestamp": "",
"source": "github",
"line_count": 481,
"max_line_length": 79,
"avg_line_length": 36.86278586278586,
"alnum_prop": 0.5862049517793695,
"repo_name": "zorosteven/pip",
"id": "0c2b3ae3f45a40069abee8274a8970e9ad9cfa1b",
"size": "17731... |
import mimetypes
from datetime import datetime
from operator import itemgetter
import wtforms
from werkzeug.datastructures import FileStorage
from wtforms.validators import InputRequired, NumberRange, ValidationError
from indico.modules.events.registration.fields.base import RegistrationFormBillableField, Registratio... | {
"content_hash": "d404e97b0beb330b1e094af858da32a4",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 119,
"avg_line_length": 38.2639405204461,
"alnum_prop": 0.6357718838045273,
"repo_name": "ThiefMaster/indico",
"id": "acc5169200151d14d92be1ecaeb3f3e7a0cb0cb4",
"size": "1... |
"""
pyrseas.dbobject.operfamily
~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module defines two classes: OperatorFamily derived from
DbSchemaObject and OperatorFamilyDict derived from DbObjectDict.
"""
from pyrseas.dbobject import DbObjectDict, DbSchemaObject
from pyrseas.dbobject import commentable, ownable, spli... | {
"content_hash": "b937f938547a68a768bd8987a0010371",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 78,
"avg_line_length": 36.70192307692308,
"alnum_prop": 0.5858003667801939,
"repo_name": "dvarrazzo/Pyrseas",
"id": "ed7d366dc3690c59c2998be267b2adc044268cda",
"size": "38... |
"""A dummy exception subclass used by core/discover.py's unit tests."""
from unittest_data.discoverable_classes import discover_dummyclass
class DummyExceptionWithParameterImpl2(discover_dummyclass.DummyException):
def __init__(self, parameter1, parameter2):
super(DummyExceptionWithParameterImpl2, self).__init__... | {
"content_hash": "b6b80b511b6e5818c3a48ef0ce37712b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 75,
"avg_line_length": 50.57142857142857,
"alnum_prop": 0.7909604519774012,
"repo_name": "SaschaMester/delicium",
"id": "f299f82a12d1f212ca7bc28a4098684b7af2607e",
"size": "... |
from tensorflowjs import version
# File name for the indexing JSON file in an artifact directory.
ARTIFACT_MODEL_JSON_FILE_NAME = 'model.json'
ASSETS_DIRECTORY_NAME = 'assets'
# JSON string keys for fields of the indexing JSON.
ARTIFACT_MODEL_TOPOLOGY_KEY = 'modelTopology'
ARTIFACT_MODEL_INITIALIZER = 'modelInitiali... | {
"content_hash": "1a50a2f845a22139b639f917937a5751",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 66,
"avg_line_length": 32.610169491525426,
"alnum_prop": 0.7598752598752598,
"repo_name": "tensorflow/tfjs",
"id": "1ed96dd5a2c19c1436c51886efe5cab714e2ee56",
"size": "2579... |
import os
from oslo.config import cfg
from oslo.utils import strutils
from ironic.common import exception
from ironic.common.i18n import _
from ironic.common.i18n import _LE
from ironic.common.i18n import _LI
from ironic.common import image_service as service
from ironic.common import keystone
from ironic.common impo... | {
"content_hash": "5542bdf1648cbc0494020eac190fd219",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 79,
"avg_line_length": 37.3756345177665,
"alnum_prop": 0.6407714246910227,
"repo_name": "debayanray/ironic_backup",
"id": "aa914e27c3f708a02af3dcab4ba007ff957f268c",
"size... |
from __future__ import with_statement, division, unicode_literals
import json
from pkgutil import get_data
from jsonschema import validate, RefResolver, FormatChecker, ValidationError
SCHEMA_FILE = 'api.json'
REQUEST_SCHEMA = '#/definitions/request'
RESPONSE_SCHEMA = '#/definitions/response'
def load_schema():
... | {
"content_hash": "b996e0cb7e17210272cde63ec044bb7d",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 84,
"avg_line_length": 28.90909090909091,
"alnum_prop": 0.749475890985325,
"repo_name": "MatchmakerExchange/reference-server",
"id": "209baaae6eb87ce3f2471e729a660ec12c74375d... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.webpubsub import WebPubSubManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-webpubsub
# USAGE
python web_pub_sub_custom_domains_delete.py
Before run the sample, please set the values of the client ID... | {
"content_hash": "898fa69e0c1298030918aae4fbbbcb80",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 158,
"avg_line_length": 35.35294117647059,
"alnum_prop": 0.737936772046589,
"repo_name": "Azure/azure-sdk-for-python",
"id": "aa78c6ec7f179b4fa1e93e89578e59e6a2e96949",
"si... |
"""
==================
Prediction Latency
==================
This is an example showing the prediction latency of various scikit-learn
estimators.
The goal is to measure the latency one can expect when doing predictions
either in bulk or atomic (i.e. one by one) mode.
The plots represent the distribution of the pred... | {
"content_hash": "a73f10911345e6d16054d616c424b4ca",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 79,
"avg_line_length": 36.05079365079365,
"alnum_prop": 0.6177351179992955,
"repo_name": "loli/sklearn-ensembletrees",
"id": "ad2334a8669f78884b5c909bfff39788ec545464",
"s... |
from datetime import datetime, timedelta
from functools import reduce
from utils.geo import get_nearest_destination, get_distances
from utils.morudall import get_last_lat_lon, get_avg_velocity, get_last_time_online, get_last_positions
def get_nearest_stop(latitude, longitude, kinds=None):
from .models import Bus... | {
"content_hash": "25fe533ddeb314450728bc50a84b9121",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 103,
"avg_line_length": 26.902439024390244,
"alnum_prop": 0.6246600181323663,
"repo_name": "alexandrevicenzi/tcc",
"id": "72ff4a43fe24b76c2b0d27da73153fe8999bb90c",
"size":... |
import math
import ConfigParser
import os
import logging
import StringIO
import sys
import textwrap
import datetime
class configuration(object):
"""Configuration settings. Any user-specific values are read from an external file
and parsed by an instance of the built-in ConfigParser class"""
def __init__(... | {
"content_hash": "26b5652008322a1b2a734d70b01f40ae",
"timestamp": "",
"source": "github",
"line_count": 836,
"max_line_length": 169,
"avg_line_length": 49.938995215311,
"alnum_prop": 0.5233179237826056,
"repo_name": "ligz07/merlin",
"id": "4786e9e98c26f17b7cfead5a56fa044aaf9168a6",
"size": "43809",... |
from ginga import GingaPlugin
from ginga.misc import Bunch
from ginga.gw import Widgets, ColorBar
class Colorbar(GingaPlugin.GlobalPlugin):
def __init__(self, fv):
# superclass defines some variables for us, like logger
super(Colorbar, self).__init__(fv)
self._image = None
self.c... | {
"content_hash": "869d75fc2629ecd1632792727655db55",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 85,
"avg_line_length": 33.080882352941174,
"alnum_prop": 0.5941320293398533,
"repo_name": "Cadair/ginga",
"id": "ff0faba6456990df9e91ac7cce887992f55040e9",
"size": "4752",... |
'''Load fonts and render text.
This is a fairly-low level interface to text rendering. Obtain a font using
`load`::
from pyglet import font
arial = font.load('Arial', 14, bold=True, italic=False)
pyglet will load any system-installed fonts. You can add additional fonts
(for example, from your program resou... | {
"content_hash": "11d8548c326fa9a30f67211b1a3b96f6",
"timestamp": "",
"source": "github",
"line_count": 666,
"max_line_length": 79,
"avg_line_length": 32.55705705705706,
"alnum_prop": 0.5730295623299358,
"repo_name": "niklaskorz/pyglet",
"id": "8739688047c7f64437b3256ab8cd3abf48533c9a",
"size": "23... |
import os
import sys
from setuptools import find_packages, setup
VERSION = "2.0.0"
LONG_DESCRIPTION = """
.. image:: http://pinaxproject.com/pinax-design/patches/pinax-forums.svg
:target: https://pypi.python.org/pypi/pinax-forums/
============
Pinax Forums
============
.. image:: https://img.shields.io/pypi/v/pi... | {
"content_hash": "f991e37f3f124e5111556648f8937e14",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 80,
"avg_line_length": 33.774193548387096,
"alnum_prop": 0.6115886660299268,
"repo_name": "pinax/pinax-forums",
"id": "85acca0288c5486696a406d3055dceebdad1c420",
"size": "3... |
from setuptools import setup, find_packages
setup(name='pywwt',
packages = ['pywwt'],
version='0.2.0',
description = 'Python interface to World Wide Telescope',
author='John ZuHone',
author_email='jzuhone@gmail.com',
url='http://github.com/jzuhone/pywwt',
download_url='https:/... | {
"content_hash": "5493461cef43355c203f1deaaeec4ac8",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 68,
"avg_line_length": 39.35,
"alnum_prop": 0.5883100381194409,
"repo_name": "jzuhone/pywwt",
"id": "4a3894ecc4aad650379c08c931629b906461c5d0",
"size": "809",
"binary": f... |
from ..common import _load_win_dll # this also ensures that libdyndt is loaded first
import os, os.path
import sys
if os.name == 'nt':
_load_win_dll(os.path.dirname(os.path.dirname(__file__)), 'libdynd.dll')
from dynd.config import *
from .array import array, asarray, type_of, dshape_of, as_py, view, \
ones,... | {
"content_hash": "4b9ec8e39112cf730633bf525f579252",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 84,
"avg_line_length": 30.166666666666668,
"alnum_prop": 0.6998158379373849,
"repo_name": "insertinterestingnamehere/dynd-python",
"id": "1cbfb93e45caa885ed97f5f49ddfbd9526a0... |
import sqlite3
from keySearch import *
print "Beggining test on keySearch..."
conn = sqlite3.connect('test2.db')
c = conn.cursor()
for row in c.execute('SELECT source_code FROM appvulnerability WHERE vulnerability_id=10'):
result = keySearch(row[0])
if result[0]:
print "Passed Key test:\t" + inQuotes(row[... | {
"content_hash": "f86cb403a9f8e440be37c84b23ac74d0",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 91,
"avg_line_length": 28.36842105263158,
"alnum_prop": 0.7198515769944341,
"repo_name": "ksparakis/apekit",
"id": "ffa925fdf71e9481d38efdea94f1fc90ba1147be",
"size": "539"... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.iothubprovisioningservices import IotDpsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-iothubprovisioningservices
# USAGE
python dps_get_operation_result.py
Before run the sample, please set the values of t... | {
"content_hash": "307085cbbc5719c7865a223a6cb10c6d",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 151,
"avg_line_length": 36.8235294117647,
"alnum_prop": 0.7531948881789138,
"repo_name": "Azure/azure-sdk-for-python",
"id": "b403e64ded242e2bbb2db160b736fea7b2272156",
"si... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('addons', '0016_addonreviewerflags_auto_approval_disabled_until_next_approval'),
]
operations = [
migrations.AddField(
model_name='addonreviewerflags',
name='notified... | {
"content_hash": "6a60a01f2f3025b3081bd2d4797cdfb7",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 89,
"avg_line_length": 26.9375,
"alnum_prop": 0.6473317865429234,
"repo_name": "bqbn/addons-server",
"id": "38f557de42b843f4fab9966ddd51aacb1ecd6d65",
"size": "481",
"bin... |
"""
Test suite entry point module.
"""
# Add here all your test suites and import from them every test case.
# These test cases will be documented by autoapi:
# http://autoapi.readthedocs.org/
from .test_ovs_openflow import test_ovs_openflow
# Don't forget to list all your test cases here:
__all__ = [
'test_ovs_... | {
"content_hash": "d58829dd07d187bcfa899ac1eef1b4bc",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 69,
"avg_line_length": 22.2,
"alnum_prop": 0.7117117117117117,
"repo_name": "open-switch/ops-switchd",
"id": "57a5e8979c20e4191443c187a86128bda5c0facd",
"size": "945",
"b... |
"""I hold HTML generation helpers.
"""
from cgi import escape
from twisted.python import log
from twisted.python.compat import NativeStringIO as StringIO
from twisted.python.deprecate import deprecated
from incremental import Version
@deprecated(Version('Twisted', 15, 3, 0), replacement='twisted.web.template')
def... | {
"content_hash": "cebfbc962a963948030b50fd1ad9819c",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 77,
"avg_line_length": 26.77777777777778,
"alnum_prop": 0.6327800829875518,
"repo_name": "EricMuller/mywebmarks-backend",
"id": "b8fd0ab5b688d9866aa98ee1b0918e96b91758ed",
... |
from .port_handler import *
from .packet_handler import *
from .group_sync_read import *
from .group_sync_write import *
from .group_bulk_read import *
from .group_bulk_write import *
| {
"content_hash": "1b8fd0883460665e9eed45583dbf89ef",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 31,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.75,
"repo_name": "ROBOTIS-GIT/DynamixelSDK",
"id": "bc227b66df87cb238f7ca9d7b208b17107712085",
"size": "1007",
"... |
try:
from setuptools import setup, find_packages
except ImportError:
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
import os
import sys
import codecs
import re
import ast
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('pymongo_driver/__init__.py'... | {
"content_hash": "e77e7aab2fed3d780988658abc3607b0",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 91,
"avg_line_length": 25.671875,
"alnum_prop": 0.660377358490566,
"repo_name": "lecly/pymongo-driver",
"id": "684f8be3d59d4442ea6156801480d4135421ad84",
"size": "1700",
... |
from inspect import isfunction
from collections import namedtuple
from copy import deepcopy
import os
import json
import numpy as np
from scipy import linalg
from .ecg import (qrs_detector, _get_ecg_channel_index, _make_ecg,
create_ecg_epochs)
from .eog import _find_eog_events, _get_eog_channel_ind... | {
"content_hash": "55cb7e82d9188a8cb578aaf0b86b0109",
"timestamp": "",
"source": "github",
"line_count": 2494,
"max_line_length": 79,
"avg_line_length": 42.09542902967121,
"alnum_prop": 0.578181852818471,
"repo_name": "ARudiuk/mne-python",
"id": "65f2dfa7fca16a7a7d6e2ba069963f16c28fac7f",
"size": "1... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import pipes
import pwd
import random
import re
import string
from ansible.compat.six import iteritems, string_types
from ansible import constants as C
from ansible.errors import AnsibleError
from ansible.module_utils._t... | {
"content_hash": "ee5c8c274ee3c24fda0d50705e43ab99",
"timestamp": "",
"source": "github",
"line_count": 582,
"max_line_length": 154,
"avg_line_length": 42.31958762886598,
"alnum_prop": 0.5863580998781973,
"repo_name": "abtreece/ansible",
"id": "745ea094c750c9efda67e8c125fd126b01610420",
"size": "25... |
import copy
import uuid
import mox
from heat.engine import environment
from heat.tests.v1_1 import fakes
from heat.common import exception
from heat.common import template_format
from heat.engine import clients
from heat.engine import parser
from heat.engine import resource
from heat.engine import scheduler
from heat.... | {
"content_hash": "22d18aaed2b8c196fb696eff2b3a9c17",
"timestamp": "",
"source": "github",
"line_count": 1488,
"max_line_length": 79,
"avg_line_length": 40.55040322580645,
"alnum_prop": 0.5816138815691344,
"repo_name": "ntt-sic/heat",
"id": "60ae9ada02df63e2e2cf3f2d99681610a53d8b25",
"size": "60957"... |
from django.core.urlresolvers import reverse
from django.core import mail
from django_dynamic_fixture import get
from django.utils.translation import ugettext_lazy as _
from oscar.test.testcases import WebTestCase
from oscar.apps.dashboard.users.views import IndexView
from oscar.core.compat import get_user_model
fro... | {
"content_hash": "97f449e3b8abf81879641ff7aa271cc2",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 100,
"avg_line_length": 34.875,
"alnum_prop": 0.6346843121036669,
"repo_name": "marcoantoniooliveira/labweb",
"id": "83d66151b8e9907935174637786a7b0517bd40d3",
"size": "36... |
from django import template
from django.templatetags.static import static
register = template.Library()
@register.simple_tag
def foundation_js(js_name=None):
js_path = "foundation/js/foundation/foundation.{0}.js".format(js_name)
if js_name is None:
js_path = "foundation/js/foundation.min.js".format(js_... | {
"content_hash": "f666e0b945d55c2f717b3a315d1a5903",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 74,
"avg_line_length": 35,
"alnum_prop": 0.7038961038961039,
"repo_name": "bop/bauhaus",
"id": "0885ed292424afd18943f6035c211e03a56bad15",
"size": "770",
"binary": false,... |
'''
Copyright 2015 University of Auckland
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 agre... | {
"content_hash": "6cf74eac10395d5ef055509838e88c71",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 146,
"avg_line_length": 52.040247678018574,
"alnum_prop": 0.6770182640252246,
"repo_name": "alan-wu/neon",
"id": "9fae6ae2e2bc5aca2c605bd4dfcc77fcf55ac0f6",
"size": "16809... |
from conans.client.output import Color
from conans.model.ref import PackageReference
from conans.model.ref import ConanFileReference
from collections import OrderedDict
class Printer(object):
""" Print some specific information """
INDENT_COLOR = {0: Color.BRIGHT_CYAN,
1: Color.BRIGHT_RED... | {
"content_hash": "b720b48b4fa049fab442d58287b7d8d7",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 128,
"avg_line_length": 46.391304347826086,
"alnum_prop": 0.5346766635426429,
"repo_name": "dragly/conan",
"id": "387841aa34aac7483bab50d8d752c183ccd639a0",
"size": "8536"... |
from nose.tools import *
from hawkweed.functional.logical import *
def test_all():
assert_true(all(lambda x: x > 0, range(1,100)))
assert_false(all(lambda x: x > 0, range(100,-1,-1)))
def test_any():
assert_true(any(lambda x: x > 0, [0, 0, 0, 1, 0]))
assert_false(any(lambda x: x > 0, [0, 0, 0, 0, -1])... | {
"content_hash": "16ac4a8b030eadd32273f04492e54a46",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 63,
"avg_line_length": 25.857142857142858,
"alnum_prop": 0.6104972375690608,
"repo_name": "hellerve/hawkweed",
"id": "37c5aa16d6d2f7e998925993f666b7c28c2f7170",
"size": "72... |
import urllib2
import base64
import urllib
from lib.multipartform import MultiPartForm
#===============================================================================
#Using urllib2 to create a package in Databank
url = "http://databank-vm1.oerc.ox.ac.uk/test/datasets"
req = urllib2.Request(url)
USER = "ad... | {
"content_hash": "056ff45fbaf17890c9f26887f60796f6",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 80,
"avg_line_length": 28.754716981132077,
"alnum_prop": 0.634514435695538,
"repo_name": "fcrepo4-archive/RDFDatabank",
"id": "4519576f6ec776300014718db66af93602e5e025",
"s... |
import logging
import util
log = logging.getLogger(util.LOGNAME)
_DEBUG_PREFIX = ""
def DEBUG_PUSH():
global _DEBUG_PREFIX
_DEBUG_PREFIX += " "
def DEBUG_POP():
global _DEBUG_PREFIX
_DEBUG_PREFIX = _DEBUG_PREFIX[:-2]
def DEBUG(s):
log.debug("{}{}".format(_DEBUG_PREFIX, str(s)))
def WARN(s):
log.warn... | {
"content_hash": "068ac003949dd1e1f23a11828ba36ece",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 49,
"avg_line_length": 16.423076923076923,
"alnum_prop": 0.6252927400468384,
"repo_name": "chubbymaggie/mcsema",
"id": "9362184ed38e6a5b3ab9c2ef2e4fd5a6a8507224",
"size": "... |
''' CSV-to-Appliance configuration script for AppNeta 9.x appliances '''
''' Run './csv_to_appliance.py appliances.csv' to configure from CSV file '''
''' Run './csv_to_appliance.py template' to generate blank csv template '''
''' To use, put the current IP of the appliance in the dhcp_ip column, '''
''' and then pop... | {
"content_hash": "fef1320e1decb91042ed65a433f188b0",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 206,
"avg_line_length": 32.57013574660633,
"alnum_prop": 0.6386496248958043,
"repo_name": "mikemorgan15/theappnetas",
"id": "6843ec79e70946467bf80ae45ebad0a17ae2d89a",
"si... |
"""High-level tests."""
import pytest
from httpie.compat import is_windows
from httpie.status import ExitStatus
from .fixtures import FILE_PATH_ARG, FILE_CONTENT
from .utils import http, HTTP_OK
from .utils.matching import assert_output_matches, Expect, ExpectSequence
# <https://developer.mozilla.org/en-US/docs/Web/... | {
"content_hash": "7cab6834f605f5c39d777f1d49344a62",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 102,
"avg_line_length": 30.862068965517242,
"alnum_prop": 0.6044692737430167,
"repo_name": "PKRoma/httpie",
"id": "81dcb2befd4da9ebdf39a5b8372d2bfc12a875e5",
"size": "3580... |
'''
*****************************************
Author: zhlinh
Email: zhlinhng@gmail.com
Version: 0.0.1
Created Time: 2016-05-10
Last_modify: 2016-05-10
******************************************
'''
'''
Given an array nums, write a function to move all 0's to the end of it
while maintaining... | {
"content_hash": "f702403b9e4c938a120bc324b00ea3f1",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 74,
"avg_line_length": 27.634146341463413,
"alnum_prop": 0.5463371579876434,
"repo_name": "zhlinh/leetcode",
"id": "12c4dac4c4b4442b52bf53a3d6cf007ae4413339",
"size": "1179... |
from rest_framework import generics, permissions, status
from rest_framework.decorators import api_view
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework.test import APIRequestFactory, APITestCase
# User class from django
from dj... | {
"content_hash": "94085b5cd3e8169ef88a2a1da43283cc",
"timestamp": "",
"source": "github",
"line_count": 471,
"max_line_length": 382,
"avg_line_length": 49.552016985138,
"alnum_prop": 0.5740177385492095,
"repo_name": "CombustibleLemons/rss-reader",
"id": "0796440dd8207484962fd48c1e47f068223b5c56",
"... |
import click
from do_cli.contexts import CTX
from do_cli.formatters import format_json
from do_cli.settings import get_env
DO_VARS = [
'api_key', 'client_id', 'api_token', 'ssh_key_id', 'size_id', 'region_id',
'image_id', 'wait_timeout', 'redis_host', 'redis_port', 'redis_db'
]
@click.command('env')
@CTX
de... | {
"content_hash": "049ef89b777e88a1cca967bb667cf68a",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 22.857142857142858,
"alnum_prop": 0.6203125,
"repo_name": "meganlkm/do-cli",
"id": "82e4fa4afcc8334a5c0252248f7f5a268dcdaa74",
"size": "640",
"bina... |
"""
Technical Analysis Factors
--------------------------
"""
from __future__ import division
from numbers import Number
from numpy import (
abs,
arange,
average,
clip,
diff,
dstack,
exp,
fmax,
full,
inf,
isnan,
log,
NINF,
sqrt,
sum as np_sum,
)
from numexpr ... | {
"content_hash": "83dc8cf4f24b4915b8f744220769e5f1",
"timestamp": "",
"source": "github",
"line_count": 813,
"max_line_length": 131,
"avg_line_length": 29.731857318573187,
"alnum_prop": 0.5767416845937449,
"repo_name": "alphaBenj/zipline",
"id": "c5fe6804b7aaf14e7806bd7f3e0bd73191a3197a",
"size": "... |
r"""A library of utilities."""
import os
import re
import numpy as np
import soundfile as sf
def read_wav(wav_f, always_2d=False):
data, samplerate = sf.read(wav_f, always_2d=always_2d)
return data, samplerate
# Use subtype = 'FLOAT' to write float wavs.
def write_wav(wav_f, wav_data, samplerate, subtype='PCM_1... | {
"content_hash": "3de3c22533fa3c3179d98ece14b71f72",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 79,
"avg_line_length": 40.06185567010309,
"alnum_prop": 0.633170355120947,
"repo_name": "google-research/sound-separation",
"id": "523096ca8be1792f6a5f8e01647d382e615ef5f5",... |
import unittest
from lib import bst
from algo import print_level_order, sorted_array_to_bst
class TestPrintLevelOrder(unittest.TestCase):
def setUp(self):
self.bst = bst.BST()
def test_add(self):
vals = range(7)
sorted_array_to_bst.convert(vals, 0, len(vals)-1, self.bst)
... | {
"content_hash": "644af0c89b440de787a3b73d14689d0e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 67,
"avg_line_length": 26.285714285714285,
"alnum_prop": 0.657608695652174,
"repo_name": "gsathya/dsalgo",
"id": "44ff62a5edfaf2ef1d108b6c49a2ecc996441a88",
"size": "368",
... |
import smbus
import time
# version 2 uses port 1
bus = smbus.SMBus(1)
DEV_ADRS = 0x5C # Sensor/LED Slave aboard address
DEV_STATUS_LED = 0x00 # Status LED command
LED_ON = 0x01
LED_OFF = 0x00
#out_val = [DEV_STATUS_LED, DSL_ON, 7]
out_block = [LED_OFF]
# Write out a BYTE to DEV_STATUS_LED register
... | {
"content_hash": "69d3db9beb7f84b37f4313bd77e7ff03",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 94,
"avg_line_length": 31.897959183673468,
"alnum_prop": 0.6289187460012796,
"repo_name": "CmdrZin/chips_avr_examples",
"id": "a99f9801faf64166d3fed3b89fa9d60755c77f8c",
"s... |
"""
Module contains Record class that allows you to create SQLAlchemy like classes.
"""
from collections import OrderedDict
from prettyrecord.name_utils import mangle_name, unmangle_name
from prettyrecord.fields import Field, RecordField
__all__ = ("Record",)
class MetaRecord(type):
@classmethod
def __prep... | {
"content_hash": "930685fca2699b6ad674eaa4de914c60",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 93,
"avg_line_length": 32.8,
"alnum_prop": 0.573170731707317,
"repo_name": "skorczan/prettyrecord",
"id": "f9f8706b89f117d64b2103a628cc2ec476b428dc",
"size": "2952",
"bin... |
from autopyfactory.interfaces import SchedInterface
import logging
class WeightedActivated(SchedInterface):
id = 'weightedactivated'
def __init__(self, apfqueue, config, section):
try:
self.apfqueue = apfqueue
self.log = logging.getLogger('autopyfactory.sc... | {
"content_hash": "b88baddcecb1d60c67fcf36e4d2eb645",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 188,
"avg_line_length": 41.67777777777778,
"alnum_prop": 0.6057051452945881,
"repo_name": "btovar/autopyfactory",
"id": "dbcbea741a4dae9af5c8953d2ede7a0ae5bb8694",
"size": ... |
from djangoappengine.settings_base import *
import os
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
# Activate django-dbindexer for the default database
DATABASES['native'] = DATABASES['default']
DATABASES['default'] = {'ENGINE': 'dbindexer', 'TARGET': 'native'}
AUTOLOAD_SITECONF = 'indexes'
SECRET_KEY = ... | {
"content_hash": "d395f111ce31c447ded0ac3208e503ca",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 141,
"avg_line_length": 31.720588235294116,
"alnum_prop": 0.7273991655076495,
"repo_name": "ecopro/ecoop",
"id": "3e962cac42c1f63111fcdd2892ec2155ff7fbded",
"size": "2347",... |
import mock
from rally.plugins.openstack.scenarios.heat import stacks
from tests.unit import test
HEAT_STACKS = "rally.plugins.openstack.scenarios.heat.stacks.HeatStacks"
class HeatStacksTestCase(test.ScenarioTestCase):
def setUp(self):
super(HeatStacksTestCase, self).setUp()
self.default_templ... | {
"content_hash": "cfa7a09f6c75afd57e1c6e057f4b3a66",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 79,
"avg_line_length": 43.23152709359606,
"alnum_prop": 0.6340018231540565,
"repo_name": "vishnu-kumar/PeformanceFramework",
"id": "02e24f12cd3208a9b2559eb7cedee22a3b7cac49"... |
from setuptools import setup, find_packages
import sys, os
version = '0.0.1'
setup(name='sheepherding',
version=version,
description="Sheepherding AI",
long_description="""\
An AI for simulated sheepherding""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_class... | {
"content_hash": "6baced14b99d771bf59e42685b3d5ac4",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 95,
"avg_line_length": 29.192307692307693,
"alnum_prop": 0.6047430830039525,
"repo_name": "schmit/sheepherding",
"id": "38dc5e5f84430b7bc26185fcb20c85fad4988a5c",
"size": "... |
"""A module for Shoptimizer API that fixes identifierExists values.
Reference: https://support.google.com/merchants/answer/6324478
and https://support.google.com/merchants/answer/9464748
Products that have a brand, mpn, or gtin set and identifierExists as "false"
could cause disapproval, so this optimizer will delete... | {
"content_hash": "d1feebd41a556e527bbd393016da62ac",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 76,
"avg_line_length": 38.13636363636363,
"alnum_prop": 0.6968613428684942,
"repo_name": "google/shoptimizer",
"id": "460343a283b0459a454a89b8f27fe5823729e37e",
"size": "31... |
import unittest
from tests.st.utils.docker_host import DockerHost
from test_base import TestBase
class TestEndpointCommands(TestBase):
@unittest.skip("Libnetwork doesn't support multi-host yet.")
def test_endpoint_commands_mainline(self):
"""
Run a mainline multi-host test using endpoint comm... | {
"content_hash": "7cc372748c4737fc3a148fdac64d609d",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 103,
"avg_line_length": 46.61594202898551,
"alnum_prop": 0.6479092180942018,
"repo_name": "L-MA/calico-docker",
"id": "288f8a25461511f5653f4aa35511d1fdd296bb66",
"size": "... |
import datetime
from django import http
from django.shortcuts import get_object_or_404, redirect, render
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.views.decorators.http import require_POST
from django.views.deco... | {
"content_hash": "d871c7240c9fa8207a64d199ba72e0df",
"timestamp": "",
"source": "github",
"line_count": 565,
"max_line_length": 79,
"avg_line_length": 35.00353982300885,
"alnum_prop": 0.5556960105172676,
"repo_name": "bugzPDX/airmozilla",
"id": "0177a1347ae971c4c1457909a0139898854a61cf",
"size": "1... |
import numpy as np
import pandas as pd
import scipy.io.wavfile as wavfile
# Good Luck!
#
# INFO:
# Samples = Observations. Each audio file will is a single sample
# in our dataset.
#
# Audio Samples = https://en.wikipedia.org/wiki/Sampling_(signal_processing)
# Each .wav file is actually just ... | {
"content_hash": "e0cae66c7f8c3ec76fe3bd82d7ae2e89",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 127,
"avg_line_length": 35.109243697478995,
"alnum_prop": 0.7143370033508856,
"repo_name": "mr3bn/DAT210x",
"id": "3cc5a1c0c9842eec88f334a5ac89ef8834dabc8f",
"size": "8356... |
import unittest
from unittest.mock import patch
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from datetime import datetime
import meerkat_abacus
from meerkat_abacus.config import config
from meerkat_abacus import model
from meerkat_abacus.pipeline_worker.process_steps import quality_con... | {
"content_hash": "a42d8ae8cb0d724009da7a17c43eb2ce",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 119,
"avg_line_length": 40.05531914893617,
"alnum_prop": 0.5336237118878148,
"repo_name": "meerkat-code/meerkat_abacus",
"id": "12128b85e9cbbf1ba94787e00807c5095caf27fd",
... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/all/shared_frn_all_lamp_tatt_s01_lit.iff"
result.attribute_template_id = 6
result.stfName("frn_n","frn_lamp_table_tatt_s01")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return ... | {
"content_hash": "498d82c031875dbc549fdf0184a33fef",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 87,
"avg_line_length": 25.076923076923077,
"alnum_prop": 0.696319018404908,
"repo_name": "anhstudios/swganh",
"id": "d4ceea2d757392879bcb437b695499d62c76af9e",
"size": "471... |
import datetime
from database.event_query import TeamYearEventsQuery
from database.match_query import TeamEventMatchesQuery
from helpers.event_helper import EventHelper
from helpers.event_team_status_helper import EventTeamStatusHelper
from helpers.match_helper import MatchHelper
from models.event_team import EventTea... | {
"content_hash": "107a135c007f428395d92ad062568766",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 191,
"avg_line_length": 42.285318559556785,
"alnum_prop": 0.49754339993449065,
"repo_name": "phil-lopreiato/the-blue-alliance",
"id": "34c87f0e8bf461a0791c491383eb52297faf98... |
from kolla.tests import base
class ConfigTest(base.TestCase):
config_file = 'default.conf'
def test_debug_opt(self):
self.assertTrue(self.conf.debug)
| {
"content_hash": "b2033df76f3f7a47c5214a62166fd25b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 40,
"avg_line_length": 21.125,
"alnum_prop": 0.6982248520710059,
"repo_name": "limamauricio/mykolla",
"id": "28a9c8d8de1c177c5c932261d3232aec67af2382",
"size": "714",
"bin... |
"""
WSGI config for my_website 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | {
"content_hash": "132d9ac67adf6c29305e2717dc2afa54",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.8125,
"alnum_prop": 0.7682619647355163,
"repo_name": "meslater1030/my-website",
"id": "44a4db7ae855e5bfb93e5d7e58148699060c9691",
"size": "397",
... |
import hashlib
import json
import os
import shutil
import tempfile
import unittest
from unittest.mock import MagicMock, patch, mock_open, call
import pytest
import requests
import synapseclient.core.constants.concrete_types as concrete_types
import synapseclient.core.multithread_download as multithread_download
from... | {
"content_hash": "b410e888e632b94150bafe81678dcd04",
"timestamp": "",
"source": "github",
"line_count": 538,
"max_line_length": 119,
"avg_line_length": 46.353159851301115,
"alnum_prop": 0.6310048921324886,
"repo_name": "thomasyu888/synapsePythonClient",
"id": "f94c950a8c046268a8640209d8c8f6b1b75c22f3... |
from models import WorkItem, ProcessInstance
class ActivityState:
blocked = 0
inactive = 0
active = 0
suspended = 0
fallout = 0
complete = 0
total = 0
def __init__(self, activity):
wis = WorkItems.objects.filter(activity=activity)
self.total = wis.count()
self.bl... | {
"content_hash": "895255f909712cb1367e20fa00e41c36",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 101,
"avg_line_length": 33.54545454545455,
"alnum_prop": 0.6321138211382114,
"repo_name": "glasslion/djflow",
"id": "73886f0af7600663fce4b3297d563de336a20a6d",
"size": "152... |
"""
The MIT License (MIT)
Copyright (c) 2017 LeanIX GmbH
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, ... | {
"content_hash": "2ad669cd61e6e4ab916949c3e5be148c",
"timestamp": "",
"source": "github",
"line_count": 3958,
"max_line_length": 162,
"avg_line_length": 32.29636179888833,
"alnum_prop": 0.5477082665122938,
"repo_name": "leanix/leanix-sdk-python",
"id": "d50a69d4ac09e09ad16da99af8a7b23dc1570858",
"s... |
from __future__ import unicode_literals
from __future__ import absolute_import
from .. import unittest
import mock
import docker
from docker.utils import LogConfig
from compose.service import Service
from compose.container import Container
from compose.const import LABEL_SERVICE, LABEL_PROJECT, LABEL_ONE_OFF
from co... | {
"content_hash": "1e2aeb4d64be9a1198d94c7967529429",
"timestamp": "",
"source": "github",
"line_count": 525,
"max_line_length": 140,
"avg_line_length": 38.076190476190476,
"alnum_prop": 0.5970985492746373,
"repo_name": "mindaugasrukas/compose",
"id": "7e5266dd79af16333cf8ea154205f53c8ef3f8d1",
"siz... |
import os
import platform
import time
import random
global fishPoss
def bankList():
# slots 1 - 50
print("bankList")
def loadingScreen():
print(topBar)
time.sleep(0.3)
print(coderList)
time.sleep(0.3)
print(betaTesters)
time.sleep(0.3)
oloop=6
while(oloop > 0):
print('o', end="")
... | {
"content_hash": "fe71b634548669dd67f458a520ea1729",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 68,
"avg_line_length": 20.122093023255815,
"alnum_prop": 0.5908696908407974,
"repo_name": "S0Ndustries/TextScapeRPG",
"id": "453833badd78f20b4dacaa64a84f5b393f3f8e4b",
"si... |
""" 'editor' hooks for common editors that work well with ipython
They should honor the line number argument, at least.
Contributions are *very* welcome.
"""
from __future__ import print_function
import os
import pipes
import subprocess
from IPython import get_ipython
from IPython.core.error import TryNext
from IPy... | {
"content_hash": "168e6ab5d6aac2bb518762dd77fafdd8",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 78,
"avg_line_length": 31.120967741935484,
"alnum_prop": 0.6278828712101581,
"repo_name": "Lightmatter/django-inlineformfield",
"id": "2237074e84328015f241adc33df96d2c033db8... |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from os.path import join as path_join
from time import strftime
def save_plot(v,k,goal_val,sim_type,generation,score,output_path,plot_title=None,yrange=None,log_plot=False,constraints=None,name=''):
#For every measurement in results
plt.fi... | {
"content_hash": "a09a5a87515725a19973ec5924801d48",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 134,
"avg_line_length": 33.34375,
"alnum_prop": 0.5857544517338332,
"repo_name": "mekayama/evolutionary-circuits",
"id": "50761cd3fc4a129079826273fd0ea21af19ff7de",
"size":... |
import numpy
# based on the vicar2png module by Jessica McKellar (jesstess at mit.edu)
# substantial modifications have been made to the code. However for
# thoroughness, I am including her Copyright under the MIT License below:
'''
The MIT License (MIT)
Copyright (c) 2012-2013 Jessica McKellar
Permission is hereb... | {
"content_hash": "8edaf5cbbeee825c67d2fd29d3e89937",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 104,
"avg_line_length": 30.602040816326532,
"alnum_prop": 0.5970323441147048,
"repo_name": "gabyx/acciv",
"id": "0c41bbb65ccf764a1f630cb4ac62c7590ba90d53",
"size": "6017",... |
import pytest
from thefuck.rules.grep_arguments_order import get_new_command, match
from tests.utils import Command
stderr = 'grep: {}: No such file or directory'.format
@pytest.fixture(autouse=True)
def os_path(monkeypatch):
monkeypatch.setattr('os.path.isfile', lambda x: not x.startswith('-'))
@pytest.mark.p... | {
"content_hash": "6e66b593da32e599e846e1084513e935",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 74,
"avg_line_length": 35.75,
"alnum_prop": 0.6272727272727273,
"repo_name": "mcarton/thefuck",
"id": "b2896493017a17f011a7db935f63554122974cbc",
"size": "1430",
"binary"... |
"""Public API functions and helpers for declarative."""
from ...schema import Table, MetaData
from ...orm import synonym as _orm_synonym, \
comparable_property,\
interfaces, properties, attributes
from ...orm.util import polymorphic_union
from ...orm.base import _mapper_or_none
from ...util import OrderedDict... | {
"content_hash": "72586e69269beb4da1d25c10da8c92ef",
"timestamp": "",
"source": "github",
"line_count": 659,
"max_line_length": 79,
"avg_line_length": 33.88619119878604,
"alnum_prop": 0.6194527786485156,
"repo_name": "wfxiang08/sqlalchemy",
"id": "0c0ab45c83437257b5ffcb78b4fdfe2b3758163c",
"size": ... |
"""
functions for implementing parts of the HSMs machinery in software
"""
# Copyright (c) 2012 Yubico AB
# See the file COPYING for licence statement.
import struct
import json
import os
__all__ = [
# constants
# functions
'aesCCM',
'crc16',
# classes
'SoftYHSM'
]
import pyhsm
import pyhsm.... | {
"content_hash": "d5b13345448438af40e0c12ac6f60505",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 105,
"avg_line_length": 30.406542056074766,
"alnum_prop": 0.5633932687874597,
"repo_name": "Yubico/python-pyhsm-dpkg",
"id": "4d6f1584f29633aa654a579e67b9ce244b4ded0b",
"s... |
from datetime import datetime
from django.contrib.auth.models import User
from django.db import models
from kitsune.sumo.models import ModelBase
class InboxMessage(ModelBase):
"""A message in a user's private message inbox."""
to = models.ForeignKey(User, related_name='inbox')
sender = models.ForeignKey... | {
"content_hash": "265e42615560a17b3c3d6be9df69eac0",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 74,
"avg_line_length": 31.46938775510204,
"alnum_prop": 0.6750972762645915,
"repo_name": "rlr/kitsune",
"id": "4539915d72eae8d453f56e677eaa0dfa07abcd4f",
"size": "1542",
... |
import logging
import unittest
from unittest import mock
from unittest.mock import call
import pytest
from docker.constants import DEFAULT_TIMEOUT_SECONDS
from docker.errors import APIError
from airflow.exceptions import AirflowException
try:
from docker import APIClient
from docker.types import DeviceReques... | {
"content_hash": "fcd0a2b035725f37784bdeecf87cf0ed",
"timestamp": "",
"source": "github",
"line_count": 534,
"max_line_length": 110,
"avg_line_length": 41.58239700374532,
"alnum_prop": 0.5744652105381671,
"repo_name": "danielvdende/incubator-airflow",
"id": "d03839d727e47d4bccf6f715075d230b03de761f",... |
"""
Make a pie charts of varying size - see
http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.pie for the docstring.
This example shows a basic pie charts with labels optional features,
like autolabeling the percentage, offsetting a slice with "explode"
and adding a shadow, in different sizes.
"""
import ma... | {
"content_hash": "de6027ceac98b5c68128a6479cd83589",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 82,
"avg_line_length": 27.93103448275862,
"alnum_prop": 0.6160493827160494,
"repo_name": "RobertABT/heightmap",
"id": "c3cd16fcb37edfef36e3af900352331fa4d2205e",
"size": "1... |
"""Forest of trees-based ensemble methods
Those methods include random forests and extremely randomized trees.
The module structure is the following:
- The ``BaseForest`` base class implements a common ``fit`` method for all
the estimators in the module. The ``fit`` method of the base ``Forest``
class calls the ... | {
"content_hash": "8f0a3cf0c5ef840441811f2ef89be649",
"timestamp": "",
"source": "github",
"line_count": 1708,
"max_line_length": 105,
"avg_line_length": 39.30152224824356,
"alnum_prop": 0.6072817197252969,
"repo_name": "jaidevd/scikit-learn",
"id": "1c160be7870bc6b1d656c5db6185a8298589324a",
"size"... |
from django.core.management import execute_manager
import sys, os
filedir = os.path.dirname(__file__)
submodules_list = os.listdir(os.path.join(filedir, 'submodules'))
for d in submodules_list:
if d == "__init__.py" or d == '.' or d == '..':
continue
sys.path.insert(1, os.path.join(filedir, 'submodule... | {
"content_hash": "346985d9bbc673ebc9d16a080b213892",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 36.27272727272727,
"alnum_prop": 0.6791979949874687,
"repo_name": "gmimano/commcaretest",
"id": "6fc280d6af44a218adf67d7a3467995cc53a5575",
"size": "... |
import Gaffer
import GafferScene
Gaffer.Metadata.registerNode(
GafferScene.CoordinateSystem,
"description",
"""
Produces scenes containing a coordinate system. Coordinate systems
have two main uses :
- To visualise the transform at a particular location. In this
respect they're similar to locators or nulls... | {
"content_hash": "cd7febbbdee80ed1efd42ea442affa4f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 69,
"avg_line_length": 28.857142857142858,
"alnum_prop": 0.7706270627062707,
"repo_name": "andrewkaufman/gaffer",
"id": "e371ab3ed947c846de4d12b40f51db379d27879e",
"size": ... |
def pytest_addoption(parser):
selenium_class_names = ("Android", "Chrome", "Firefox", "Ie", "Opera", "PhantomJS", "Remote", "Safari")
parser.addoption("--webdriver", action="store", choices=selenium_class_names,
default="PhantomJS",
help="Selenium WebDriver interface to... | {
"content_hash": "421bf4f5d9ba7e513d15433431c92d4b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 110,
"avg_line_length": 79,
"alnum_prop": 0.6365280289330922,
"repo_name": "edisongustavo/asv",
"id": "db13c2ab44208e864cf96381587e30b2db40a44c",
"size": "554",
"binary": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('argus', '0002_auto_20170609_2316'),
]
operations = [
migrations.AddField(
model_name='argusadsl',
name='fio',
fi... | {
"content_hash": "fc8629bb22a755e49600069f34be40eb",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 66,
"avg_line_length": 27.515151515151516,
"alnum_prop": 0.5473568281938326,
"repo_name": "dehu4ka/lna",
"id": "7c29b59ea1f161ca705c2e96ed524a448517f3b4",
"size": "981",
... |
from oslo_config import cfg
import webob.dec
import webob.exc
from nova.api.openstack import wsgi
from nova import context
from nova import wsgi as base_wsgi
CONF = cfg.CONF
CONF.import_opt('use_forwarded_for', 'nova.api.auth')
class NoAuthMiddlewareBase(base_wsgi.Middleware):
"""Return a fake token if one isn'... | {
"content_hash": "182872a49351e73f1ca074915566b709",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 36.394366197183096,
"alnum_prop": 0.5948142414860681,
"repo_name": "cernops/nova",
"id": "bbaf74d20de001ed7b21c9c105ce005b73b25eab",
"size": "3247",
... |
from nova import db
from nova.objects import base
from nova.objects import fields
@base.NovaObjectRegistry.register
class TaskLog(base.NovaPersistentObject, base.NovaObject):
# Version 1.0: Initial version
VERSION = '1.0'
fields = {
'id': fields.IntegerField(read_only=True),
'task_name': ... | {
"content_hash": "b8c684521950dd4bd657bed5cdb245f7",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 79,
"avg_line_length": 35.42465753424658,
"alnum_prop": 0.6067285382830626,
"repo_name": "whitepages/nova",
"id": "e3c066f9d80a4bbb41c68c69b3b76c5c5eeb3aef",
"size": "3159"... |
"""
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
import json
import logging
import os
import shutil
i... | {
"content_hash": "8c2b1d2ca2b4b673e0e3cadfb468e3f9",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 112,
"avg_line_length": 33.71875,
"alnum_prop": 0.6314874884151993,
"repo_name": "mlperf/training_results_v0.7",
"id": "3f5d95072044931e758d4b60c8fffe6debb097fb",
"size": ... |
"""The virtual interfaces extension."""
import webob
from nova.api.openstack import api_version_request
from nova.api.openstack import common
from nova.api.openstack import wsgi
from nova import compute
from nova.i18n import _
from nova import network
from nova.policies import virtual_interfaces as vif_policies
def... | {
"content_hash": "ace126e93d053231f2d05d7c450a343c",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 76,
"avg_line_length": 36.083333333333336,
"alnum_prop": 0.6480369515011547,
"repo_name": "phenoxim/nova",
"id": "46724c9c4aaf6ece58b459e8c29f7cc4a0a26e18",
"size": "2796",... |
"""
Twisted runner: run and monitor processes
Maintainer: Andrew Bennetts
classic inetd(8) support:
Future Plans: The basic design should be final. There are some bugs that need
fixing regarding UDP and Sun-RPC support. Perhaps some day xinetd
compatibility will be added.
procmon:monitor and restart pr... | {
"content_hash": "411bd5615624ac59364effc4cbc2513e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 25.75,
"alnum_prop": 0.7475728155339806,
"repo_name": "timkrentz/SunTracker",
"id": "f7f80142682ee2eaa2d12695e92cc59eb4d8a700",
"size": "486",
"bin... |
import unittest
import scram_modules.alignedreads as ar
import scram_modules.srnaseq as srna
import scram_modules.refseq as refseq
import scram_modules.dna as dna
import os
_BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class TestARMethods(unittest.TestCase):
def test_srna_profile_1(self):
"""
... | {
"content_hash": "1df5a5d1a3688f9e024629f1f2c93a6a",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 77,
"avg_line_length": 29.36,
"alnum_prop": 0.6852861035422343,
"repo_name": "Carroll-Lab/scram",
"id": "cd27cbe22313f9491453476a25b3cd46f822e637",
"size": "749",
"binary... |
from django.urls import path
from . import views
app_name = "owntracks"
urlpatterns = [
path('owntracks/logtracks', views.manage_owntrack_log, name='logtracks'),
path('owntracks/show_maps', views.show_maps, name='show_maps'),
path('owntracks/get_datas', views.get_datas, name='get_datas'),
path('owntr... | {
"content_hash": "5203927be74f9c9deff8160d2c0ba6a9",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 77,
"avg_line_length": 31.75,
"alnum_prop": 0.7007874015748031,
"repo_name": "liangliangyy/DjangoBlog",
"id": "c19ada8782e81ad195fd904d4a639504aaf05482",
"size": "381",
"... |
from pythonbacktest.datafeed import PriceBar
from . import *
class BasicBackTestEngine(AbstractBackTestEngine):
def __init__(self):
AbstractBackTestEngine.__init__(self)
# run backtest on single day only
def start_single_date(self, date, strategy, indicators_history, broker):
indicators... | {
"content_hash": "3e68582da72b27aff38c7ae9d04f8450",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 115,
"avg_line_length": 38.70909090909091,
"alnum_prop": 0.660403945514326,
"repo_name": "quantwizard-com/pythonbacktest",
"id": "da54a8e7387530d0ef74dbc0d8bb0e1b06982338",
... |
"""
This file contains implementation of database model for contrail config daemons
"""
from exceptions import NoIdError
from vnc_api.gen.resource_client import *
from utils import obj_type_to_vnc_class
class DBBase(object):
# This is the base class for all DB objects. All derived objects must
# have a class m... | {
"content_hash": "6d907704e2c07898e56f60fd030e2001",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 81,
"avg_line_length": 33.97971014492754,
"alnum_prop": 0.5342489123944383,
"repo_name": "codilime/contrail-controller",
"id": "35faf7df2c6cb573c4d01be3ed1cec4adeeb84f5",
... |
'''
run the following test with:
python driver_mathTest.py
'''
import unittest
import math
import rospy
from geometry_msgs.msg import Quaternion
from nav_msgs.msg import Odometry
from driver_pseudolinear import PseudoLinearDriver as Driver
from utils import heading_to_quaternion, quaternion_to_heading, easy_Odom, is... | {
"content_hash": "5b481fac0100d7533610154935a6231d",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 85,
"avg_line_length": 34.53521126760563,
"alnum_prop": 0.6331566068515497,
"repo_name": "buckbaskin/drive_stack",
"id": "0a9ea9ddc9e4b0bed7695cf16afaa29af48ecd65",
"size"... |
from django.test import TestCase
from django.test.client import Client
from users.models import User
class TestViewShow(TestCase):
def setUp(self):
self.user = User.objects.create_user(
email = "test_user@example.com",
password = "test_password",
)
self.client = Cli... | {
"content_hash": "2d603e1aa4367d12726a672bea9dcea7",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 78,
"avg_line_length": 37.23809523809524,
"alnum_prop": 0.6675191815856778,
"repo_name": "buildbuild/buildbuild",
"id": "1748898a47d3424e640d980da7cd6a9e4846403b",
"size": ... |
"""Shared testing utilities."""
from gcloud import _helpers
from gcloud._helpers import _DefaultsContainer
class _Monkey(object):
# context-manager for replacing module names in the scope of a test.
def __init__(self, module, **kw):
self.module = module
self.to_restore = dict([(key, getattr(... | {
"content_hash": "dceb05813f5699c4f8ad0032855e028a",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 75,
"avg_line_length": 29.457142857142856,
"alnum_prop": 0.6508244422890398,
"repo_name": "GrimDerp/gcloud-python",
"id": "18d21b19b3589fce6b850872a9ad486e74061461",
"size"... |
import statsd
from thumbor.metrics import BaseMetrics
class Metrics(BaseMetrics):
@classmethod
def client(cls, config):
"""
Cache statsd client so it doesn't do a DNS lookup
over and over
"""
if not hasattr(cls, "_client"):
cls._client = statsd.StatsClient(
... | {
"content_hash": "b14bf8576bfa5c6f4a54ea143fca191f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 29.272727272727273,
"alnum_prop": 0.6242236024844721,
"repo_name": "scorphus/thumbor",
"id": "e52fa64296985365bf86c89ffb06362baef5e748",
"size": "896... |
import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="visible", parent_name="layout.geo", **kwargs):
super(VisibleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "575792c3445631f3b62042d8876ac1f7",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 82,
"avg_line_length": 36.45454545454545,
"alnum_prop": 0.6234413965087282,
"repo_name": "plotly/plotly.py",
"id": "8acac3fc8656a6876de9352d2bd7c6761c8582ef",
"size": "401"... |
from collections import OrderedDict
class Typed:
_expected_type = type(None)
def __init__(self, name=None):
self._name = name
def __set__(self, instance, value):
if not isinstance(value, self._expected_type):
raise TypeError('Expected ' + str(self._expected_type))
ins... | {
"content_hash": "2e35f80d40e46930d695e12c182f89cf",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 73,
"avg_line_length": 22.789473684210527,
"alnum_prop": 0.5850654349499615,
"repo_name": "xu6148152/Binea_Python_Project",
"id": "c7b22dd0f59a5d30b0cefe7d7faa875ffbe5f327",
... |
import os
APP_DIR = os.path.dirname( globals()['__file__'] )
DBNAME = 'metadb'
COLLECTIONNAME = 'metadata'
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psyc... | {
"content_hash": "6d876781a66309c649a25c1af67d848e",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 115,
"avg_line_length": 33.453416149068325,
"alnum_prop": 0.6761975492016339,
"repo_name": "alexbyrnes/pico-ckan",
"id": "0ee47c09ec6ac72d6a702c2c919f702caa7efd05",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.