text stringlengths 4 1.02M | meta dict |
|---|---|
from django.contrib import admin
from .models import ConceptNode
import reversion
class ConceptNodeAdmin(reversion.VersionAdmin):
pass
admin.site.register(ConceptNode, ConceptNodeAdmin)
| {
"content_hash": "e891f8d918cfee040f0a4d3495621d51",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 50,
"avg_line_length": 17.727272727272727,
"alnum_prop": 0.8205128205128205,
"repo_name": "kevincwebb/conceptum",
"id": "437bb3a261cf2c6c0556cdcaca0f2c364377722b",
"size": ... |
import logging
from django.conf import settings
from django.contrib.auth.models import Group
from django.core.mail import send_mail
from django.db import transaction
from django.db.models.signals import post_save, post_delete
from guardian.shortcuts import assign
from .models import Cohort, Project, Batch, Sample
PROJ... | {
"content_hash": "a8b857b33a48c1577393352be3dcfb97",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 79,
"avg_line_length": 36.68,
"alnum_prop": 0.6649945474372956,
"repo_name": "chop-dbhi/varify-data-warehouse",
"id": "5d87fe640f6a1f3c1c285671b2039e1d4af32d38",
"size": "... |
"""
FILE: php.py
AUTHOR: Cody Precord
@summary: Lexer configuration module for PHP.
"""
__author__ = "Cody Precord <cprecord@editra.org>"
__svnid__ = "$Id: _php.py 68798 2011-08-20 17:17:05Z CJP $"
__revision__ = "$Revision: 68798 $"
#---------------------------------------------------------------------... | {
"content_hash": "27fe1f192ed6844fdc3db10c0079eec0",
"timestamp": "",
"source": "github",
"line_count": 441,
"max_line_length": 80,
"avg_line_length": 68.28344671201815,
"alnum_prop": 0.6546674193869757,
"repo_name": "ktan2020/legacy-automation",
"id": "cb4f5721716d1420695cbd062dcab4b65b4f1a21",
"s... |
import mysql.connector
from model.group import Group
from model.contact import Contact
import re
class DbFixture:
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.connection = mysql.connector.c... | {
"content_hash": "cf73e577b19e14a3f17718fcb43465b9",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 165,
"avg_line_length": 40.51764705882353,
"alnum_prop": 0.502903600464576,
"repo_name": "Falschberg/python_testing_davydiuk",
"id": "b3c80a97c3e75188964aa4d4357adad2ffec6bfc... |
from maths import Arithmetic, Number
from search import *
print("Do some arithmetic")
print("2 + 3 = %d" % Arithmetic().Add(Number(2), Number(3)).value)
print("8 - 3 = %d" % Arithmetic().Subtract(Number(8), Number(3)).value)
print("4 * 5 = %d" % Arithmetic().Multiply(Number(4), Number(5)).value)
print("16 / 4 = %d" % ... | {
"content_hash": "319c3fb486e47ad4aa88bcf31f801737",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 146,
"avg_line_length": 32.198412698412696,
"alnum_prop": 0.6837564702982499,
"repo_name": "kindasimple/play",
"id": "2a95cc3228a0aee8d641fe4b5a7b798ac29cfaba",
"size": "4... |
from sure import expect
from tests.integration import VCRIntegrationTest, vcr
class TestTimer(VCRIntegrationTest):
@vcr.use_cassette
def test_timer_and_cancel(self):
events = self.run_standalone("tests.integration.workflow.TimerWorkflow")
list_timer_started = [e for e in events if e["eventTyp... | {
"content_hash": "35169ceb6abcf0d5510e6f580e09393c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 86,
"avg_line_length": 45.083333333333336,
"alnum_prop": 0.6414048059149723,
"repo_name": "botify-labs/simpleflow",
"id": "0e2d5fa0fa69bdb82875a431063daf18592003ec",
"size"... |
import logging
from pyOlog.OlogHandler import OlogHandler
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
olog = OlogHandler()
olog.setLevel(logging.DEBUG)
olog.setFormatter(formatter)
ch = logging.StreamHandle... | {
"content_hash": "866eff7718d729d987b50d277b5386ba",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 85,
"avg_line_length": 22.59259259259259,
"alnum_prop": 0.7262295081967213,
"repo_name": "ericdill/pyOlog",
"id": "b3b65c3b18df064a211f7184a7c1a2b653ef020b",
"size": "610",... |
import sys
from setuptools import setup, find_packages
from version import get_version
from commands import preconfigure, configure, create_bucket_types, \
setup_security, enable_security, disable_security
install_requires = ['six >= 1.8.0']
requires = ['six(>=1.8.0)']
if sys.version_info < (2, 7, 9):
install_... | {
"content_hash": "e58e3ee8af94e18870f55e86d0d8ffaa",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 70,
"avg_line_length": 38.05555555555556,
"alnum_prop": 0.618978102189781,
"repo_name": "GabrielNicolasAvellaneda/riak-python-client",
"id": "549f279945d4aef752206050537d21c6... |
from __future__ import print_function
from awesome_thirdparty_library import AwesomeClass
import Pyro4
# create adapter class that only exposes what should be accessible,
# and calls into the library class from there:
class AwesomeAdapterClass(AwesomeClass):
@Pyro4.expose
def method(self, arg):
prin... | {
"content_hash": "d2d27f250c46906ef06dd6c869586d3f",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 92,
"avg_line_length": 34.607142857142854,
"alnum_prop": 0.718266253869969,
"repo_name": "irmen/Pyro4",
"id": "ed76174e26ab5b7febd20743bd01b5f4c29a6817",
"size": "969",
"... |
from __future__ import division, print_function, absolute_import
def configuration(parent_package='',top_path=None):
import numpy
from numpy.distutils.misc_util import Configuration
config = Configuration('sparsetools',parent_package,top_path)
for fmt in ['csr','csc','coo','bsr','dia','csgraph']:
... | {
"content_hash": "117b91ccbb70a657e396ce5070600d57",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 65,
"avg_line_length": 33.6,
"alnum_prop": 0.6235119047619048,
"repo_name": "sargas/scipy",
"id": "0c754a1e3bf28fc03ed8181d19d777095d3b4996",
"size": "694",
"binary": fal... |
import json
import re
import sys
import urllib3
from urllib3.util import retry
# List of projects having tempest plugin stale or unmaintained for a long time
# (6 months or more)
# TODO(masayukig): Some of these can be removed from BLACKLIST in the future
# when the patches are merged.
BLACKLIST = [
'x/gce-api', ... | {
"content_hash": "42bb2d9d06ea96293baeb88ff4f1ab4a",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 78,
"avg_line_length": 36.41904761904762,
"alnum_prop": 0.6725941422594143,
"repo_name": "cisco-openstack/tempest",
"id": "530ce5eae860b8e8841c6c43bed93d417aa42ad2",
"size... |
from setuptools import setup
setup(name='brightway2-conda-installer',
packages=['brightway2_conda_installer'],
version='0.0.1',
author="Adrian Haas",
license=open('LICENSE.txt').read(),
description='Installation of brightway2 and all of its dependencies in a new anaconda environment.',
... | {
"content_hash": "23cd49dac9a0a941c5a6a84d7637519c",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 106,
"avg_line_length": 39.46666666666667,
"alnum_prop": 0.6351351351351351,
"repo_name": "haasad/brightway2-conda-installer",
"id": "dfa66801c0253ec93accb38655ab7947584ca44f... |
from model.group import Group
data_for_group = [
Group(name="name1n", header="header2", footer="footer1"),
Group(name="name2f", header="header2", footer="footer2")
] | {
"content_hash": "be9ea9838a25e07f4e7589f52d5a2a76",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 61,
"avg_line_length": 29,
"alnum_prop": 0.6839080459770115,
"repo_name": "kochetov-a/python_training",
"id": "f186aa22798a66ec39af0e71550e948104602020",
"size": "199",
"b... |
import argparse
import imp
#import cv2
#import os
from tensorpack.dataflow import serve_data
parser = argparse.ArgumentParser()
parser.add_argument(dest='config')
parser.add_argument('-p', '--port', help='port', type=int, required=True)
args = parser.parse_args()
get_config_func = imp.load_source('config_script', arg... | {
"content_hash": "e3eed93b4d1928db31adfc6b6eaa1e8b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 74,
"avg_line_length": 27.25,
"alnum_prop": 0.731651376146789,
"repo_name": "yinglanma/AI-project",
"id": "315ef39c9655d31e6100a5b66de62a415f510359",
"size": "546",
"bina... |
import json
import requests
HEADERS = {'Accept': 'application/json', 'Content-Type':
'application/json', 'Accept-encoding': 'application/json'}
def get_client_info_all(auth, url):
"""
function takes no input to RESTFUL call to HP IMC
:param auth: requests auth object #usually auth.creds from auth p... | {
"content_hash": "9364e71568ef84c87cb772faaa292b12",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 115,
"avg_line_length": 30.0251572327044,
"alnum_prop": 0.6436950146627566,
"repo_name": "netmanchris/PYHPEIMC",
"id": "833f15d534c7aa80ffbd084aabd7ee365746e291",
"size": ... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from argparse import ArgumentParser, ArgumentTypeError
from sqlalchemy.orm.exc import NoResultFound
from flexget import options
from flexget.event import event
from flexget.ma... | {
"content_hash": "af358ecd61caa4a8ebb77e5a9cec191d",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 119,
"avg_line_length": 43.201877934272304,
"alnum_prop": 0.6099760921538796,
"repo_name": "oxc/Flexget",
"id": "b1ed609482f0f7d8175fb4e4959a5e1aa7a143f7",
"size": "9202",... |
"""
.. module:: soap.transformer.utils
:synopsis: Useful utility functions to simplify calls to
ArithTreeTransformer.
"""
import collections
from soap import logger
from soap.expression import operators, is_expression
from soap.semantics import MetaState
from soap.transformer.core import TreeTransformer
fr... | {
"content_hash": "a5ee31fd14700abee050378dc2ad9b28",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 79,
"avg_line_length": 35.18493150684932,
"alnum_prop": 0.676464862760366,
"repo_name": "admk/soap",
"id": "5e868272071f0b0d64326ef65698b21e02b978bd",
"size": "5137",
"b... |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
ex... | {
"content_hash": "626f9068705f74972fd0e056bd990b3d",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 104,
"avg_line_length": 62.23024054982818,
"alnum_prop": 0.7027444916892153,
"repo_name": "mgraupe/acq4",
"id": "90ef15c35d8c28aa2671840f4dfad075d77ab79a",
"size": "18352"... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TicketType.slug'
db.add_column(u'oscar_support_... | {
"content_hash": "e04db2198976b4e2025af43b719269e0",
"timestamp": "",
"source": "github",
"line_count": 386,
"max_line_length": 246,
"avg_line_length": 92.18911917098445,
"alnum_prop": 0.5618940564844738,
"repo_name": "snowball-one/django-oscar-support",
"id": "655e318e3d2dbace3fb0fabfbc24b8e855b62bb... |
"""Read from and write to tar format archives.
"""
__version__ = "$Revision: 70525 $"
version = "0.9.0"
__author__ = "Lars Gust\u00e4bel (lars@gustaebel.de)"
__date__ = "$Date: 2009-03-22 15:34:29 -0500 (Sun, 22 Mar 2009) $"
__cvsid__ = "$Id: tarfile.py 70525 2009-03-22 20:34:29Z lars.gustaebel $"
__credits... | {
"content_hash": "b7eb29453894f83360413aac55fffc5a",
"timestamp": "",
"source": "github",
"line_count": 2425,
"max_line_length": 103,
"avg_line_length": 34.43628865979382,
"alnum_prop": 0.5350744838817838,
"repo_name": "MalloyPower/parsing-python",
"id": "72b3232f25d77e39bde06ca611b8f99900ca8468",
... |
import logging
import sys
from django.db.models.signals import post_delete
from django.utils.six.moves import input
from morango.certificates import Certificate
from morango.models import Buffer
from morango.models import DatabaseIDModel
from morango.models import DeletedModels
from morango.models import Store
from k... | {
"content_hash": "f57c5076979001dbbb90a6930c94227b",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 129,
"avg_line_length": 39.18666666666667,
"alnum_prop": 0.7199727798570943,
"repo_name": "DXCanas/kolibri",
"id": "4c367e22fc1c3f17e1cb3af15a5a7de3dd92b27e",
"size": "2939... |
"""
WSGI config for gettingstarted 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.6/howto/deployment/wsgi/
"""
from SpyPartyDraft import app
if __name__ == '__main__':
app.run()
| {
"content_hash": "ecaeebbcb5bdc322b37c8fd352f96892",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 78,
"avg_line_length": 27.272727272727273,
"alnum_prop": 0.7233333333333334,
"repo_name": "LtHummus/SpyPartyDraft",
"id": "3b2b719c8d0a9418c40d5f293ca2b40356d2e8f5",
"size"... |
import zope.interface
class IContent(zope.interface.Interface): pass
class ITrash(zope.interface.Interface): pass
| {
"content_hash": "1df990f78cab51588f189b8af157d379",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 46,
"avg_line_length": 23.2,
"alnum_prop": 0.8189655172413793,
"repo_name": "sbrauer/recms",
"id": "1c1085cef7ebb04440eba82a63b38c6dea29e2dc",
"size": "116",
"binary": fal... |
from __future__ import unicode_literals
from django.db import migrations, models
import multiselectfield.db.fields
class Migration(migrations.Migration):
dependencies = [
('speakers', '0006_speaker_profile_flags'),
]
operations = [
migrations.AlterField(
model_name='speaker'... | {
"content_hash": "36c84341b73497348960fdd1ac7ba16b",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 236,
"avg_line_length": 40.208333333333336,
"alnum_prop": 0.6601036269430052,
"repo_name": "PyCon/pycon",
"id": "ab8e01fe97a6ffbf446851c1aad06de07fb6a0da",
"size": "989",
... |
from django.urls import include, re_path
urlpatterns = [
re_path(r"^", include("dpaste.urls.dpaste_api")),
re_path(r"^", include("dpaste.urls.dpaste")),
re_path(r"^i18n/", include("django.conf.urls.i18n")),
]
# Custom error handlers which load `dpaste/<code>.html` instead of `<code>.html`
handler404 = "dp... | {
"content_hash": "a5d5c5d13733bdcc429ace6ae5e5fe2c",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 80,
"avg_line_length": 34.72727272727273,
"alnum_prop": 0.6910994764397905,
"repo_name": "bartTC/dpaste",
"id": "ad746cf37bacfa0e1f52576058ccdb124d174311",
"size": "382",
... |
import demistomock as demisto # noqa: F401
from MarkAsNoteByTag import mark_as_note
import MarkAsNoteByTag
ENTRIES = [
{
'Metadata': {'tags': ['test1', 'test2'],
'id': '1'},
},
{
'Metadata': {'tags': ['test1'],
'id': '2'},
}
]
def test_mark_a... | {
"content_hash": "f539e25defd6cb7888352990230f68e6",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 72,
"avg_line_length": 28.574468085106382,
"alnum_prop": 0.6046165301563663,
"repo_name": "demisto/content",
"id": "c60e96efc345cf68a75f931ba4979f5f89025226",
"size": "1343... |
import sys, os, sniper_lib
_, EVENT_MARKER, EVENT_THREAD_NAME, EVENT_APP_START, EVENT_APP_EXIT, EVENT_THREAD_CREATE, EVENT_THREAD_EXIT = range(7)
class SniperStatsBase:
def parse_stats(self, (k1, k2), ncores, metrics = None):
v1 = self.read_snapshot(k1, metrics = metrics)
v2 = self.read_snapshot(k2, metrics... | {
"content_hash": "f48ee27d22367610dcc115558d659870",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 118,
"avg_line_length": 42.87692307692308,
"alnum_prop": 0.6594904915679942,
"repo_name": "abanaiyan/sniper",
"id": "817061d3a634c3fbe35610f77da4caa5f205270e",
"size": "278... |
from __future__ import unicode_literals, absolute_import, print_function
import os
import shutil
from collections import OrderedDict
from cookiecutter.prompt import read_user_yes_no
try:
input = raw_input
except NameError:
pass
folders = OrderedDict()
folders['tasks']= {
'question': '\nShould it have t... | {
"content_hash": "4772da5c77c0f95bf129dee3896b2ed8",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 86,
"avg_line_length": 28.14814814814815,
"alnum_prop": 0.5368421052631579,
"repo_name": "iknite/cookiecutter-ansible-role",
"id": "26a4829c617736ab401bd20eeab00bf6a026cd0f",... |
import multiprocessing as m
import time
import numpy
class StopRemoteIteration:
pass
class ForkedIterator(m.Process):
def __init__(self, fn, *args, **kargs):
self.fn = fn
self.p1, self.p2 = m.Pipe()
self.args = args
self.kargs = kargs
m.Process.__init__(self)
se... | {
"content_hash": "59e84befafa43e3e64c1782da1d9c4bb",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 141,
"avg_line_length": 30.96,
"alnum_prop": 0.5219638242894057,
"repo_name": "hiuwo/acq4",
"id": "5c36792df7c99d9561c687d4615c8e8fb9d3ce79",
"size": "2322",
"binary": fa... |
'''OpenGL extension EXT.framebuffer_object
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_EXT_framebuffer_object'
_DEPRECATED = False
GL_INVAL... | {
"content_hash": "f947de3fed6912527e457720d854f28d",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 142,
"avg_line_length": 49.76569037656904,
"alnum_prop": 0.7956953085589373,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "3a754429866496bf6e446c84b87592c01031d74... |
"""
Print to file differences in two directory structures, ignoring file contents.
Looking recursively in two directories (which are defined below),
print to file the differences found in the subdirectory names,
highlighting odd subdirectories.
Reason for this:
SyncBackFree is a powerful synchronisation program, but ... | {
"content_hash": "312d53132d1d81f4f05b1082fde3d08e",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 79,
"avg_line_length": 38.86740331491713,
"alnum_prop": 0.6092395167022032,
"repo_name": "harriott/SyncPortableDrives",
"id": "152c7278b87e9662d40e2a1da50b525bd6b234ed",
"... |
import os
import pytest
import sh
import shutil
from .config import active_config, FileConfigBuilder
from .io_utils import path_from_var_dir
from .hyperparam_search import (itertools, main, HyperparamSearch,
TrainingCommand)
# Because we spawn other processes, we cannot mock anything i... | {
"content_hash": "823c81ac2a5dfc01b582d44f2a9f335e",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 79,
"avg_line_length": 39.46456692913386,
"alnum_prop": 0.6097366320830008,
"repo_name": "danieljl/keras-image-captioning",
"id": "97b29116d4df3bf3ce389d27519b381b4c3ed761",... |
from pyjamas.ui.Composite import Composite
from pyjamas.ui.FlexTable import FlexTable
from pyjamas.ui.HTML import HTML
from pyjamas.ui.HorizontalPanel import HorizontalPanel
from pyjamas.ui.Widget import Widget
from pyjamas.ui.Label import Label
from pyjamas.ui import HasAlignment
from MailItems import MailItems
from M... | {
"content_hash": "15064d6e5e5fab734785b6c9ff23464c",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 91,
"avg_line_length": 35.56024096385542,
"alnum_prop": 0.5935964763679485,
"repo_name": "pyjs/pyjs",
"id": "e390963a00480818980641cac1b6885a52da3ffc",
"size": "5903",
"... |
"""Callbacks: utilities called at certain points during model training.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import copy
import csv
import io
import json
import os
import re
import time
import numpy as np
import six
from t... | {
"content_hash": "b5ae00635a1373d0a45a97be772da8b9",
"timestamp": "",
"source": "github",
"line_count": 2653,
"max_line_length": 112,
"avg_line_length": 37.59027516019601,
"alnum_prop": 0.6502150871880233,
"repo_name": "aldian/tensorflow",
"id": "7b1cc291be6b1dd086596cac2048c177fd2f9aa6",
"size": "... |
'''
Copyright (C) 2022, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'ServerDefender VP (Port80 Software)'
def is_waf(self):
schemes = [
self.matchHeader(('X-Pint', r'p(ort\-)?80'))
]
if any(i for i in schemes):
return True
return False | {
"content_hash": "60b44b6383a457c40fe7033a03ee5909",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 52,
"avg_line_length": 20.133333333333333,
"alnum_prop": 0.6225165562913907,
"repo_name": "EnableSecurity/wafw00f",
"id": "e46182136778cb9f9907017cebe47654541763e9",
"size"... |
'''
dns_sprockets_version - Contains version for dns_sprockets.
-----------------------------------------------------------
.. Copyright (c) 2015 Neustar, Inc. All rights reserved.
.. See COPYRIGHT.txt for full notice. See LICENSE.txt for terms and conditions.
'''
VERSION = '2.0.0'
# end of file
| {
"content_hash": "8133def4a2fb7866622fbe6c28b1f0ef",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 80,
"avg_line_length": 27.363636363636363,
"alnum_prop": 0.5681063122923588,
"repo_name": "ultradns/dns_sprockets",
"id": "ad7ef352584c2b30e6ce5e886d83f2cd30410eb3",
"size"... |
from __future__ import print_function
import unittest
import numpy as np
import pydrake
import os.path
class TestRBTCoM(unittest.TestCase):
def testCoM0(self):
r = pydrake.rbtree.RigidBodyTree(os.path.join(pydrake.getDrakePath(), "examples/Pendulum/Pendulum.urdf"))
kinsol = r.doKinematics(np.zeros... | {
"content_hash": "b994a7d3bffbac69d5f09adad0371c5d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 113,
"avg_line_length": 26.736842105263158,
"alnum_prop": 0.6633858267716536,
"repo_name": "hanssusilo/drake",
"id": "69035c415ffe72b6a8eb5b076ce6e80cba78799c",
"size": "50... |
import os
import time
import sys
import shutil
import traceback
import re
import tornado.ioloop
import tornado.web
from gitsync import GitSync
from gdrivesync import GDriveSync
rel_dir = '/'
def read_config():
with open("conf/tornado.conf") as f:
cfg_read = eval(f.read())
cfg_read['home_folder'] =... | {
"content_hash": "37bf6e1027caa78f3c88311548db4d26",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 120,
"avg_line_length": 33.61258278145695,
"alnum_prop": 0.5332479558664172,
"repo_name": "mr-justin/JuliaBox",
"id": "f2c3b3cc60d53a15ed19991b901914dbb112728e",
"size": "... |
def get_adaptor(wildcards):
pop = wildcards.population
lib = wildcards.library
adaptor = (
samples
[(samples["population"] == pop) & (samples["library"] == lib)]
["adaptor"]
.values
.tolist()
[0]
)
return adaptor
def get_phred(wildcards):
pop = w... | {
"content_hash": "ae8f375240105e4120b9a01f30f20cd7",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 75,
"avg_line_length": 28.50526315789474,
"alnum_prop": 0.5332348596750369,
"repo_name": "jlanga/smsk_popoolation",
"id": "93231866ee8bdd1be632573c299c8a326dac04e6",
"size"... |
r"""
Format biological sequences (:mod:`skbio.format.sequences`)
===========================================================
.. currentmodule:: skbio.format.sequences
This module provides functions for writing sequence files in a variety of
different formats, the available formatters are listed below.
Functions
----... | {
"content_hash": "b9e7cc29ca31b998b9ab7be26930ac53",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 78,
"avg_line_length": 27.736842105263158,
"alnum_prop": 0.5815939278937381,
"repo_name": "JWDebelius/scikit-bio",
"id": "343e40db52e5f9e0998315e0a27b3a2addd54562",
"size":... |
import os
import random
import tempfile
import unittest
from yalign.datatypes import Sentence
from yalign.evaluation import F_score
from yalign.wordpairscore import WordPairScore
from yalign.sequencealigner import SequenceAligner
from yalign.sentencepairscore import SentencePairScore
from yalign.input_conversion impor... | {
"content_hash": "e0f358573077f0aeae4b2df20ea2c937",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 81,
"avg_line_length": 41.85507246376812,
"alnum_prop": 0.614612188365651,
"repo_name": "pombredanne/yalign",
"id": "b073a267cf197d709472f75674f2b9401dcd6722",
"size": "58... |
"""
Baxter RSDK Inverse Kinematics Example
"""
import argparse
import struct
import sys
import rospy
from geometry_msgs.msg import (
PoseStamped,
Pose,
Point,
Quaternion,
)
from std_msgs.msg import Header
from baxter_core_msgs.srv import (
SolvePositionIK,
SolvePositionIKRequest,
)
def ik_t... | {
"content_hash": "262de4b7ada61a193de037bf3b326811",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 77,
"avg_line_length": 31.15702479338843,
"alnum_prop": 0.553050397877984,
"repo_name": "u3099811/BaxterTictacToe",
"id": "d9850bbdd4fc57756cd49a862b23ff98a8f36138",
"size... |
import glob
import io
import re
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Argument... | {
"content_hash": "a40f133e2669debc9bc089fb6d5f4508",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 113,
"avg_line_length": 30.252747252747252,
"alnum_prop": 0.5935343261896113,
"repo_name": "judy2k/envtool",
"id": "6e986a9cbaaac1f5b4539a85733dd50434df02ce",
"size": "2779... |
from chainer import backend
from chainer import function_node
from chainer.utils import type_check
class FlipLR(function_node.FunctionNode):
"""Flip array in the left/right direction."""
def check_type_forward(self, in_types):
type_check._argname(in_types, ('a',))
a_type = in_types[0]
... | {
"content_hash": "eded300ab47b9e23647d75e1a1495808",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 49,
"avg_line_length": 23.027027027027028,
"alnum_prop": 0.6103286384976526,
"repo_name": "ktnyt/chainer",
"id": "97550c5d7e0a59f00ee514519c77809f57c271e1",
"size": "852",
... |
"""
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 agreed to in... | {
"content_hash": "b454a01b89f3e28f54b9e9f0e65329ec",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 188,
"avg_line_length": 34.98813056379822,
"alnum_prop": 0.6577050292596048,
"repo_name": "google/url_diff",
"id": "fcb1bf7aecd688bf4d8725c595c8443603bdd356",
"size": "118... |
import feedparser, sys, hashlib, csv, re, os
def read_in_recorded_hashes(f):
f.seek(0)
hashes = []
for row in csv.reader(f):
hashes.append(row[0])
return hashes
def process_summary_text(summary):
summary = re.sub("<[^<]+?>", "", summary) # strip HTML tags
summary = re.sub("\s+", " ", summary) # replace consec... | {
"content_hash": "75699116fb2b0f69fcce629b9763f949",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 99,
"avg_line_length": 33,
"alnum_prop": 0.660427807486631,
"repo_name": "tombusby/Log-Bitbucket-History",
"id": "850209b6f7036efef5c2b913cdfc0042b9fd6c64",
"size": "1144",... |
"""Usage: python test_reproducible.py [init]
Used to test if the EMT potential still produces the same energies, forces
and stresses as it used to.
Call it the first time with the "init" argument to generate a data file.
Subsequent calls calculate the same quantities, but compare them with the
database.
"""
from nu... | {
"content_hash": "fed694250d0fc1526b9053747d1dad78",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 122,
"avg_line_length": 33.46551724137931,
"alnum_prop": 0.5718701700154559,
"repo_name": "auag92/n2dm",
"id": "51b80a4421224251836dc7f5e65a1307862b2e0c",
"size": "3882",
... |
"""Implentation of Brocade SVI service Plugin."""
from oslo.config import cfg
from neutron.common import constants as l3_constants
from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging
from neutron.plugins.ml2 import db
from neutron.plugins.ml2.drivers.brocade.db import mod... | {
"content_hash": "22f89e5c1f0301a820c917f3793784d1",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 79,
"avg_line_length": 46.71689497716895,
"alnum_prop": 0.4949662789561138,
"repo_name": "nash-x/hws",
"id": "122d7734c7049c574419742c463d88db7d9f8e44",
"size": "10885",
... |
import numpy as np
from scipy import sparse as sp
def _get_sparse_save_kwargs(A):
return {
"data": A.data,
"indices": A.indices,
"indptr": A.indptr,
"shape": A.shape
}
def save_csr_matrix(filepath, A):
np.savez(filepath, **_get_sparse_save_kwargs(A))
def save_csc_matrix(filepath, A):
np.save... | {
"content_hash": "a096c0be5a5445ef71dc9e24c7cfcf5d",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 70,
"avg_line_length": 29.0327868852459,
"alnum_prop": 0.6606437041219649,
"repo_name": "tbjohns/python-util",
"id": "5845c0856f022d2559ff4c5b156a513cc14fd95e",
"size": "17... |
import operator
from datetime import datetime
import pytest
from numpy import nan
import numpy as np
import pandas as pd
from pandas import (Series, DataFrame, bdate_range,
isna, compat, _np_version_under1p12)
from pandas.tseries.offsets import BDay
import pandas.util.testing as tm
import pandas.... | {
"content_hash": "69ffe367360a36d99dade534a54a12ea",
"timestamp": "",
"source": "github",
"line_count": 1456,
"max_line_length": 80,
"avg_line_length": 38.005494505494504,
"alnum_prop": 0.5600513228278156,
"repo_name": "kdebrab/pandas",
"id": "921c30234660f180c08252025d37e296e7b52bc3",
"size": "553... |
"""The RPC-service-side bridge between RPC Framework and GRPC-on-the-wire."""
import abc
import enum
import logging
import threading
import time
from grpc._adapter import _intermediary_low
from grpc._links import _constants
from grpc.framework.foundation import logging_pool
from grpc.framework.foundation import relay... | {
"content_hash": "881104993fd2d406cc3c36da7d57f708",
"timestamp": "",
"source": "github",
"line_count": 445,
"max_line_length": 80,
"avg_line_length": 34.26516853932584,
"alnum_prop": 0.6701862539349422,
"repo_name": "yinsu/grpc",
"id": "34d3b262c985d87ee96560f1042465f7a781bae5",
"size": "16777",
... |
from ircb.storeclient.base import BaseStore
from ircb.lib.constants.signals import (STORE_CHANNEL_CREATE,
STORE_CHANNEL_CREATED,
STORE_CHANNEL_GET,
STORE_CHANNEL_GOT,
... | {
"content_hash": "7af982a6f2da9b905c9665bdc91f7519",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 71,
"avg_line_length": 46.59090909090909,
"alnum_prop": 0.5307317073170732,
"repo_name": "Ghost-script/ircb",
"id": "1f125f3bb71dda46bee91616d41f3a72e27c233a",
"size": "104... |
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.maxDiff = None
filename = 'chart_pie01.xlsx'
... | {
"content_hash": "7452029cf149568d33e2d18c57614edc",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 68,
"avg_line_length": 25.872340425531913,
"alnum_prop": 0.5600328947368421,
"repo_name": "jkyeung/XlsxWriter",
"id": "24183f7bdd3afaa9c6c348dc5542547dc4f82374",
"size": "1... |
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Record(Base):
__tablename__ = 'records'
id = Column(Integer, primary_key=True)
data = Column(String(255))
if __name__ == "__m... | {
"content_hash": "eb8bb001450ebf2ee1434e6ecfcd63b6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 55,
"avg_line_length": 26.736842105263158,
"alnum_prop": 0.7204724409448819,
"repo_name": "RunnerPro/ProApi",
"id": "6ed95cfd8fc00d75b1fd714ed6073c22c61cf02e",
"size": "531... |
from canvas_sdk import client, utils
def retrieve_assignment_overridden_dates_for_quizzes(request_ctx, course_id, quiz_assignment_overrides_0_quiz_ids=None, per_page=None, **request_kwargs):
"""
Retrieve the actual due-at, unlock-at, and available-at dates for quizzes
based on the assignment overrides acti... | {
"content_hash": "3996c1a57c88868ce01ce7fcb6a19f6b",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 173,
"avg_line_length": 45.06060606060606,
"alnum_prop": 0.6940147948890383,
"repo_name": "penzance/canvas_python_sdk",
"id": "f2b5717567b10b7fdc1a28bf8229930986602fec",
"s... |
import copy
import datetime
import simplejson
from types import NoneType
from django.db import models
from django.forms.widgets import Textarea
from django.utils.timezone import is_aware
from django.utils.translation import ugettext_lazy as _
from django.forms.fields import CharField
from django.forms.utils import Vali... | {
"content_hash": "f641b92d555f86c4c7fda8bdf4b435c8",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 107,
"avg_line_length": 34.73134328358209,
"alnum_prop": 0.5898152127202406,
"repo_name": "liminspace/dju-common",
"id": "3de1037b6a475d441bdea2c55e9458d99a47768d",
"size"... |
""" Contains the base classes for rollover targets and rollover target banks."""
# rollover.py
# Mission Pinball Framework
# Written by Brian Madden & Gabe Knuth
# Released under the MIT License. (See license info at the end of this file.)
# Documentation and more info at http://missionpinball.com/mpf
import logging
... | {
"content_hash": "cc78c70be51ac2290be9ddfa278d6002",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 80,
"avg_line_length": 39.225806451612904,
"alnum_prop": 0.7360197368421053,
"repo_name": "jabdoa2/mpf",
"id": "53ec5f5529d4551d6a5715c4f708b232122bd57d",
"size": "2432",
... |
"""This module contains the general information for LsbootUsb ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class LsbootUsbConsts:
STATE_DISABLED = "Disabled"
STATE_ENABLED = "Enabled"
SUBTYPE_ = ""
SUBTYPE_US... | {
"content_hash": "ed98902256454addb4640788663c4528",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 231,
"avg_line_length": 54.04123711340206,
"alnum_prop": 0.5734452499046165,
"repo_name": "ragupta-git/ImcSdk",
"id": "90513b6ea108d56a33fac2521368f9b5b959254e",
"size": "5... |
from django import forms
from django.forms.models import modelform_factory
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailadmin import widgets
from wagtail.wagtailadmin.forms import (
BaseCollectionMemberForm, collection_member_permission_formset_factory
)
from wagtail.wagtaildocs.mode... | {
"content_hash": "b62b2dcbaa0ba44f281818e8288eb3f4",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 92,
"avg_line_length": 33.407407407407405,
"alnum_prop": 0.6879157427937915,
"repo_name": "davecranwell/wagtail",
"id": "a443116d907a58fc68b52c09075341b0b2599c38",
"size": ... |
import flask
from digits.utils.routing import request_wants_json, job_from_request
from digits.webapp import app, scheduler, autodoc
from digits.dataset import tasks
from forms import GenericImageDatasetForm
from job import GenericImageDatasetJob
NAMESPACE = '/datasets/images/generic'
@app.route(NAMESPACE + '/new', ... | {
"content_hash": "a0df0db99b3fbafd197bcc4745bdffd2",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 92,
"avg_line_length": 33.91304347826087,
"alnum_prop": 0.5441025641025641,
"repo_name": "andreydung/DIGITS",
"id": "b86519b0b00b4f45af429ae09e781de3f8347945",
"size": "39... |
from Quartz import *
import Quartz
import Utilities
import sys
def drawQuartzRomanText(context):
text = "Quartz"
textlen = len(text)
fontSize = 60
opaqueBlack = [0.0, 0.0, 0.0, 1.0]
opaqueRed = [0.663, 0.0, 0.031, 1.0]
# Set the fill color space. This sets the
# fill painting color to... | {
"content_hash": "16573642f089c68a851130fbc8655c9b",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 86,
"avg_line_length": 39.655270655270655,
"alnum_prop": 0.6999066024858107,
"repo_name": "albertz/music-player",
"id": "2adf0fae702488265b0c573594bfa045e5b0515c",
"size":... |
"""Support for the Netatmo cameras."""
import logging
import pyatmo
import requests
import voluptuous as vol
from homeassistant.components.camera import SUPPORT_STREAM, Camera
from homeassistant.core import callback
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.helpers.... | {
"content_hash": "f24f54e0e1a3650fc8fd2d8bcc4351bc",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 96,
"avg_line_length": 32.67908309455587,
"alnum_prop": 0.5458132398071022,
"repo_name": "tchellomello/home-assistant",
"id": "dff6013c7c69892aef38ccfd6a6f3ead173accbd",
"... |
from __future__ import absolute_import
from copy import copy
import numpy as nm
from sfepy.base.base import output, get_default, OneTypeList, Struct, basestr
from sfepy.discrete import Equations, Variables, Region, Integral, Integrals
from sfepy.discrete.common.fields import setup_extra_data
import six
def apply_ebc... | {
"content_hash": "ffafedac29c5bfcf09ca506db6c061a4",
"timestamp": "",
"source": "github",
"line_count": 434,
"max_line_length": 83,
"avg_line_length": 35.345622119815665,
"alnum_prop": 0.5990873533246415,
"repo_name": "sfepy/sfepy",
"id": "54591c78535091f8ac77098644ae8adf4e74efbe",
"size": "15340",... |
import flask
import auth
import config
import model
import util
from main import app
bitbucket_config = dict(
access_token_method='POST',
access_token_url='https://bitbucket.org/site/oauth2/access_token',
authorize_url='https://bitbucket.org/site/oauth2/authorize',
base_url='https://api.bitbucket.org/2.0/',
... | {
"content_hash": "29406f75cdc631c34446127fcb9ecf5e",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 71,
"avg_line_length": 27.32758620689655,
"alnum_prop": 0.7097791798107256,
"repo_name": "jakedotio/gae-init",
"id": "3b25019bf5bbc04203bd2518aa289c2719a62d57",
"size": "16... |
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('password', models.Cha... | {
"content_hash": "de769935be4819c0797326b7c71197c8",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 255,
"avg_line_length": 37.57142857142857,
"alnum_prop": 0.5950570342205324,
"repo_name": "hchen1202/django-react",
"id": "caef2772b17e8b2155b83c2d4d82b0fa9e439ea3",
"size"... |
from django.apps import AppConfig
class DonationsConfig(AppConfig):
name = 'donations'
verbose_name = "Django Donations"
| {
"content_hash": "03ba6a60656a569bf615e78bfb02374a",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 37,
"avg_line_length": 21.833333333333332,
"alnum_prop": 0.7404580152671756,
"repo_name": "founders4schools/django-donations",
"id": "9f9ec074a2e6ab44ee0e48507c27221fb0b2fde6"... |
__author__ = 'efouh'
from docutils import nodes
from docutils.parsers.rst import directives
from docutils.parsers.rst import Directive
import random
import os, sys
import re
sys.path.append(os.path.abspath('./source'))
import conf
def setup(app):
app.add_directive('odsalink',odsalink)
CODE = """\
<link href="%(... | {
"content_hash": "bfe9315f99456fe5a8a5e0545cc98548",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 126,
"avg_line_length": 23.09259259259259,
"alnum_prop": 0.6471531676022454,
"repo_name": "RJFreund/OpenDSA",
"id": "5da27bcdf0da9b45a67000decfcfc94104cdf718",
"size": "176... |
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
ex... | {
"content_hash": "af5e28940c8b50b72f77d1c5740c52dc",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 104,
"avg_line_length": 55.003125,
"alnum_prop": 0.679620476109312,
"repo_name": "hiuwo/acq4",
"id": "c6a0b2b5f897d2587cdac239750dec6bf508306a",
"size": "17859",
"binary... |
from . import AWSObject, AWSProperty, PropsDictType, Tags
from .validators import boolean, double, integer
from .validators.iot import policytypes, validate_json_checker
class AuditCheckConfiguration(AWSProperty):
"""
`AuditCheckConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-... | {
"content_hash": "c1865bc3949a2aa6c8ae9df46332cf7f",
"timestamp": "",
"source": "github",
"line_count": 1174,
"max_line_length": 197,
"avg_line_length": 30.30494037478705,
"alnum_prop": 0.6482938894822643,
"repo_name": "cloudtools/troposphere",
"id": "21fec73e29d29aad0a6d53bb1e4ed2dce7151457",
"siz... |
"""
Views for managing Neutron Routers.
"""
from django.core.urlresolvers import reverse_lazy
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import tables
from horizon import tabs
from hor... | {
"content_hash": "bbf1466ba65b90a3f3b7788a3a17cc97",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 79,
"avg_line_length": 38.76521739130435,
"alnum_prop": 0.5975773889636609,
"repo_name": "rd37/horizon",
"id": "779020c9b4cd896e61052319d2fcc3e16ec4525f",
"size": "5170",
... |
from __future__ import division
import unittest2 as unittest
from mock.tests.support import inPy3k
try:
unicode
except NameError:
# Python 3
unicode = str
long = int
import inspect
import sys
import textwrap
from mock import Mock, MagicMock
from mock.mock import _magics
class TestMockingMagicMeth... | {
"content_hash": "01f7c6c1dc0396e5dfe902a3c2d1ae9e",
"timestamp": "",
"source": "github",
"line_count": 529,
"max_line_length": 79,
"avg_line_length": 30.744801512287335,
"alnum_prop": 0.5576119035907526,
"repo_name": "pypingou/mock",
"id": "5e39770a008a6e06921c3e38049160380f4d065e",
"size": "16411... |
from tempest.services.network import resources as n_resources
DELETABLE_CLASS_DEF = """class %(cls_name)s(n_resources.%(cls_name)s):
pass
"""
IGNORE_LIST = ['DeletableSubnet', 'DeletableRouter']
# inhere Deletable<Class> from parent module
for cls_name in [x for x in dir(n_resources)
if x.start... | {
"content_hash": "6ac8ebc4798d9880740f58a4625abd8c",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 77,
"avg_line_length": 33.75925925925926,
"alnum_prop": 0.6341195831047723,
"repo_name": "gravity-tak/vmware-nsx-tempest",
"id": "1bf6c46d8dfb5841de88db1400b31079019dc67f",
... |
from __future__ import division
import numpy as np
import field_info as field
import pickle
# from evaluation.potentialfield_generated_plot import cleanup_nan_values
from action import Category
import Simulation as Sim
import action as a
from naoth.math import *
import copy
""" General Functions """
gen_field = []
... | {
"content_hash": "097885075c5ab6a9811a46f04789a9ee",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 121,
"avg_line_length": 30.011406844106464,
"alnum_prop": 0.6219434942353984,
"repo_name": "BerlinUnited/NaoTH",
"id": "ebc74762ced8c5073c43f0b704f28b44f033e44c",
"size": ... |
import tensorflow as tf
# Create input data with three samples from a normal distribution with mean 0 and stddev 1
input_data = tf.random_normal([3], mean=0, stddev=1)
# Create a queue that holds three elements
q = tf.FIFOQueue(3, tf.float32)
# Fill the queue with the data
input_data = tf.Print(input_data, data=[inp... | {
"content_hash": "2126967ed4cd487f41f1fa93cf578779",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 103,
"avg_line_length": 36.142857142857146,
"alnum_prop": 0.7148503670242801,
"repo_name": "datitran/Krimskrams",
"id": "f4ef9ed90b4269ceb1aea6da1a1315124748f786",
"size": ... |
from argparse import ArgumentParser
from logging import getLogger
from os import getenv
from crosscompute.exceptions import (
CrossComputeError)
from crosscompute.routines.automation import (
DiskAutomation)
from crosscompute.routines.log import (
configure_argument_parser_for_logging,
configure_loggin... | {
"content_hash": "f52cfb5956444ccdc0c63353c304c141",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 67,
"avg_line_length": 26.08955223880597,
"alnum_prop": 0.6807780320366132,
"repo_name": "crosscompute/crosscompute",
"id": "83d87f38bed9acea9204090cdea9e786c6f09fc3",
"siz... |
import discord
import asyncio
import permissions
import commands
from datetime import datetime, date, time
import tzlocal
import random
client = None
nextDelay = random.randrange(10, 60)
tz=tzlocal.get_localzone()
@commands.registerEventHandler(triggerType="\\timeTick", name="dayget")
async def checkDa... | {
"content_hash": "aa6d6b601f44484d6ea7acd748502619",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 139,
"avg_line_length": 31.9375,
"alnum_prop": 0.6673189823874756,
"repo_name": "Azimath/discordbot",
"id": "3a4143ea9ca838a21a0b9a3fddb3cb330b2f5b6a",
"size": "1022",
"b... |
"""Methods for gathering statistics on the unit test coverage of a library.
"""
def testability(parser, module):
"""Returns a dictionary of testability scores, indexed by executable
name with value {"score", "dscore", "pscore"}.
"""
execs = _list_executables(parser, module)
result = {}
for xname... | {
"content_hash": "acdc2d81595f0251fee39f9e2d21ad11",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 100,
"avg_line_length": 42.78534031413613,
"alnum_prop": 0.613558492413118,
"repo_name": "rosenbrockc/fortpy",
"id": "7396221cd170b89e2bec294f417f5319e57f3cfb",
"size": "8... |
from datetime import datetime
from dajaxice.core import dajaxice_functions
from dajax.core import Dajax
from treeio.projects.models import Task, Milestone
from django.contrib import messages
from django.utils.translation import ugettext as _
def gantt(request, task, start, end):
dajax = Dajax()
try:
t... | {
"content_hash": "70ae7ae5a82d34f6cb509c9391a6ebae",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 83,
"avg_line_length": 31.76923076923077,
"alnum_prop": 0.6464891041162227,
"repo_name": "hellfish2/treeio",
"id": "5c94d3f94e02c671aae673a165f67f7448109ecb",
"size": "939"... |
"""
Class for VM tasks like spawn, snapshot, suspend, resume etc.
"""
import collections
import os
import time
import decorator
from oslo.config import cfg
from oslo.utils import excutils
from oslo.utils import units
from oslo.vmware import exceptions as vexc
from nova.api.metadata import base as instance_metadata
f... | {
"content_hash": "30c32b4358d05936ffee6ebb68f88ccd",
"timestamp": "",
"source": "github",
"line_count": 1652,
"max_line_length": 79,
"avg_line_length": 46.84866828087167,
"alnum_prop": 0.5445512572034008,
"repo_name": "vmthunder/nova",
"id": "cd5869e26aceea35f10cd2cfdda1bb8f7f04ff1d",
"size": "7814... |
from redis_wrap import (
get_redis,
get_list,
get_hash,
get_set,
setup_redis,
get_key,
set_key,
get_queue,
get_dict,
ConnectionError,
ResponseError
)
from task import (
task_registry,
register,
... | {
"content_hash": "83c6806b3d983f6437842c9b5e8fd437",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 68,
"avg_line_length": 19.71875,
"alnum_prop": 0.526148969889065,
"repo_name": "audoe/ztq",
"id": "ef7769d5167395eaa69df127569d1fdd0dc4b25a",
"size": "645",
"binary": fal... |
from setuptools import setup, find_packages
from orc import PACKAGE_NAME, VERSION
if __name__ == '__main__':
setup(
name=PACKAGE_NAME,
version=VERSION,
license='MIT',
packages=find_packages(),
install_requires=['tornado==3.1.1']
)
| {
"content_hash": "39c68c1625e0188d45194406a3b0c997",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 43,
"avg_line_length": 20.214285714285715,
"alnum_prop": 0.5901060070671378,
"repo_name": "eugeniy/orc",
"id": "c1a8414a0831ca90a68f846d19b8385f05fde89d",
"size": "283",
... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../..'))
# -- General configu... | {
"content_hash": "b9c5482cc584615a364dd17c337b93ee",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 80,
"avg_line_length": 32.16593886462882,
"alnum_prop": 0.7011946782514255,
"repo_name": "akuendig/RxPython",
"id": "1916ad94e02b1cdb8b76d00f17155f2787ca265c",
"size": "78... |
"""Create the asset."""
import common # fixes python import path
import argparse
def create_asset(target_dir):
"""Create the asset."""
raise NotImplementedError('Implement me!')
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--target_dir', '-t', required=True)
args = parser.parse_arg... | {
"content_hash": "39bee7c31382230639236a465e04b03c",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 58,
"avg_line_length": 19.7,
"alnum_prop": 0.6700507614213198,
"repo_name": "aosp-mirror/platform_external_skia",
"id": "708ec7b0aeee94dd658a5728b74541fc95a3e9f7",
"size": ... |
"""
WSGI config for tastegood project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... | {
"content_hash": "41e660bcfa4720d67feb8e281c4492e8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 38.130434782608695,
"alnum_prop": 0.7936145952109465,
"repo_name": "blueooh/storehome",
"id": "7849971b577b249084b092c46b092dc871d045e5",
"size": "87... |
import json
from django.contrib import admin
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from .models import Container, ContainerImage, Mirror
from .models i... | {
"content_hash": "0e6dd403ec2a5b006938fc4d73c65447",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 79,
"avg_line_length": 35.10144927536232,
"alnum_prop": 0.6241398293421415,
"repo_name": "jeanmask/opps",
"id": "9e74cc308cd19a6ded5ac663309e8b6e944d1e93",
"size": "7312",... |
"""
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use # as a separator for each node, and , as a separator for node label and each neighbor of the node.
As an example, consider the serialized... | {
"content_hash": "c74f1c1a5f465db451a0610dc876f663",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 109,
"avg_line_length": 30.53012048192771,
"alnum_prop": 0.5840568271507498,
"repo_name": "ufjfeng/leetcode-jf-soln",
"id": "439de7fe8a3a225963bdeb1af872ed0216438711",
"siz... |
import logging
import sys
from cliff.app import App
from cliff.commandmanager import CommandManager
class DemoApp(App):
log = logging.getLogger(__name__)
def __init__(self):
super(DemoApp, self).__init__(
description='cliff demo app',
version='0.1',
command_manag... | {
"content_hash": "23e6461843c7bccce6111dbf4058e3e8",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 75,
"avg_line_length": 23.783783783783782,
"alnum_prop": 0.5829545454545455,
"repo_name": "dreamhost/cliff-tablib",
"id": "85807c8e24734582062fb1f02cc2edea9f16ab7c",
"size"... |
"""
@summary:
Log to stdout.
@author: Ruben Reifenberg
"""
import sys
from rrlog import Log
from rrlog import server
from rrlog.server import textwriter
print_ = sys.stdout.write # tests replace print_
def createServer(writer=None, tsFormat=None, filters=None, observers=None, writeMsgid=False, format_line=None):
... | {
"content_hash": "138f43871907b144edaa60756963689a",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 112,
"avg_line_length": 23.045112781954888,
"alnum_prop": 0.6933115823817292,
"repo_name": "shful/python-rrlog",
"id": "45036cf8573873392fe1339dd417e53df902d281",
"size": ... |
from flask import Flask, Response
import json
from config import *
import sys
if sys.version_info[0] < 3:
import MySQLdb
else:
import pymysql as MySQLdb
app = Flask(__name__)
@app.route("/search/<keyword>/")
@app.route("/search/<keyword>/<encoding>")
def search(keyword=None, encoding=None):
if keyword == None:
... | {
"content_hash": "c5b972265a5bf328c97c755a80c2a037",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 95,
"avg_line_length": 30.112903225806452,
"alnum_prop": 0.6797000535618639,
"repo_name": "Nyubis/bhottu-api",
"id": "38b3b6cd61dba3fc9330bec1a8e270fd586e54dc",
"size": "18... |
from tests.helper.voctomix_test import VoctomixTest
from lib.videomix import VideoMix
class VideomixerSetSources(VoctomixTest):
def setUp(self):
super().setUp()
self.videomixer = VideoMix()
def test_can_set_source_a(self):
self.videomixer.setVideoSourceA(42)
self.assertEqual(s... | {
"content_hash": "144c1f7c889165349d10fe8601e7e27c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 62,
"avg_line_length": 31.41176470588235,
"alnum_prop": 0.6900749063670412,
"repo_name": "h01ger/voctomix",
"id": "7b396bf244ad62f9aae353d813e6665326df3d8c",
"size": "1068"... |
from SystemPanic.Core.draw_util import draw_text
def draw_title_screen(game_surface, game_state):
# Add the background
game_surface.blit(
game_state["active_config"]["background"],
[0, 0]
)
draw_text(game_surface, "SYSTEM PANIC!", (160, 120), game_state["garbled"])
draw_text(game_... | {
"content_hash": "9e394d08f5ef12cd897bb09b033f2168",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 106,
"avg_line_length": 38.72,
"alnum_prop": 0.6838842975206612,
"repo_name": "xaroth8088/SystemPanic",
"id": "687b7ebbc7cf600dfd27f57c98e7741266f69e24",
"size": "968",
"... |
"""Usage:
md2pdf <filepath> [-s <stylesheet>] [-o <output>]
md2pdf [-h|-v]
Options:
-h --help show help
-v --version show version
-o <output> output pdf/html path
-s <stylesheet> stylesheet path"""
import sys
from docopt import docopt
from . import __version__
from .generator import ... | {
"content_hash": "fee5aceba93fc1aa38685ecb1f5eae5c",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 59,
"avg_line_length": 20.463414634146343,
"alnum_prop": 0.5804529201430274,
"repo_name": "hit9/md2pdf",
"id": "a5b774c048eee9d9e20fa3b4107484b6247aae02",
"size": "854",
... |
import requests as req, zipfile, io, markdown2 as md, sqlite3, os, shutil, tarfile
html_tmpl = """<html><head><link rel="stylesheet" type="text/css" href="../style.css"/></head><body><section id="tldr"><div id="page">%content%</div></section></body></html>"""
doc_source = "https://github.com/tldr-pages/tldr/a... | {
"content_hash": "ce924f0d6bf869e7a78b60b7ba350a29",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 176,
"avg_line_length": 44.03703703703704,
"alnum_prop": 0.6232127838519764,
"repo_name": "Moddus/tldr-python-dash-docset",
"id": "d4076ad3335d8ed809363891161fe8b77ae99311",
... |
TAB = '\t'
# regexp = "((ac|bc)*ad+)#"
# regexp = "((a(b|c))*c)#"
# regexp = "(1+|1*01(11|01)+)#"
# regexp = "((a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)" \
# "(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9)*)#"
# regexp = "(a*b|b*(ab+|bc))#"
# regexp = "((1?1?0)*1?)#" # ... | {
"content_hash": "a17c84b389a20307afc466601305cab6",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 119,
"avg_line_length": 27.59011627906977,
"alnum_prop": 0.5280792329575387,
"repo_name": "Katsutami7moto/study",
"id": "d8e670ab54c190a07247d60efc993d5468376027",
"size":... |
from contextlib import contextmanager
from datetime import datetime, timedelta
from fewerror.state import State
class Now:
def __init__(self):
self.now = datetime.now()
def advance(self, td):
self.now += td
def __call__(self):
return self.now
@contextmanager
def roundtripped_st... | {
"content_hash": "1c304c38985b9f0aaccf41be9ec43a3f",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 96,
"avg_line_length": 27.47887323943662,
"alnum_prop": 0.5981547924141466,
"repo_name": "wjt/fewerror",
"id": "3d95fd1afe8ebec66747e3311294000c9ab5a4ee",
"size": "1973",
... |
from flask import make_response, jsonify, abort, current_app
from werkzeug.http import HTTP_STATUS_CODES
import sys
import os
import traceback
def _make_json_response(response, code=200):
''' Helper for making API returns consistent '''
# if response type is not defined, use default HTTP status name
if co... | {
"content_hash": "8420e177160deb1e2657563aeee0220a",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 81,
"avg_line_length": 31.21875,
"alnum_prop": 0.6141141141141141,
"repo_name": "asnorkin/sentiment_analysis",
"id": "204c467547abf51224c5ccf071e96b4848c8f8a7",
"size": "19... |
"""
The task plugin.
"""
import cli.http as http
from cli.exceptions import CLIException
from cli.plugins import PluginBase
from cli.util import Table
PLUGIN_NAME = "task"
PLUGIN_CLASS = "Task"
VERSION = "Mesos CLI Task Plugin"
SHORT_HELP = "Interacts with the tasks running in a Mesos cluster"
class Task(PluginB... | {
"content_hash": "1ec321b17ce0c182114925f716db3b08",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 78,
"avg_line_length": 28.93846153846154,
"alnum_prop": 0.5279106858054227,
"repo_name": "verizonlabs/mesos",
"id": "cc6cff56c71262729a8870017bef2e97636abe5a",
"size": "266... |
"""Test StateVectorSimulatorPy."""
import unittest
import numpy as np
from qiskit.providers.basicaer import StatevectorSimulatorPy
from qiskit.test import ReferenceCircuits
from qiskit.test import providers
from qiskit import QuantumRegister, QuantumCircuit, execute
from qiskit.quantum_info.random import random_unit... | {
"content_hash": "717ec8872cbe80ebae28b2499c18f43b",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 100,
"avg_line_length": 37.00934579439252,
"alnum_prop": 0.5936868686868687,
"repo_name": "QISKit/qiskit-sdk-py",
"id": "15561261cbf82c2179133db9f848edb3421f7842",
"size":... |
import os
import setuptools # type: ignore
from typing import List
VERSION = '0.4.1'
def strip_comments(line: str) -> str:
if line.startswith('-i '):
return ''
return line.split('#', 1)[0].strip()
def req(filename: str) -> List[str]:
ln: str
requires: set
with open(os.path.join(os.get... | {
"content_hash": "1d01e03efbf8f3393ed895bb63aa92bb",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 69,
"avg_line_length": 30.526315789473685,
"alnum_prop": 0.6045977011494252,
"repo_name": "hivdb/sierra-client",
"id": "bab6a920ed03315733916c68b4d7edf74c08a827",
"size": "... |
from django.conf.urls.defaults import patterns, url
from .views import IndexView, DetailView
urlpatterns = patterns('',
url(r'^$', IndexView.as_view(), name='index'),
url(r'^(?P<volume_id>[^/]+)/$', DetailView.as_view(), name='detail'),
)
| {
"content_hash": "1c3e1c433703d14415d5cbd835f1ea53",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 73,
"avg_line_length": 31.125,
"alnum_prop": 0.6546184738955824,
"repo_name": "1ukash/horizon",
"id": "f42c753f0930f12008a5581d4f685695998392ad",
"size": "249",
"binary": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.