text stringlengths 4 1.02M | meta dict |
|---|---|
import logging
from active_mail_filter import get_logger
from active_mail_filter.simple_password import SimplePassword
logger = get_logger()
logger.setLevel(logging.DEBUG)
def test_password():
start = 'Passw0rd!'
cipher = SimplePassword(secret_key='cipher-key-12345')
encoded = cipher.encode(start)
de... | {
"content_hash": "4913835beb5425823e840ccbe3264dab",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 78,
"avg_line_length": 26.68,
"alnum_prop": 0.6596701649175413,
"repo_name": "kfrodgers/active-mail-filter",
"id": "e70e920d698259e69d36645ad2d2cc4738fbdf4b",
"size": "820"... |
from scout.commands import cli
from scout.server.extensions import store
def test_view_hpo(mock_app):
"""Test CLI that shows all HPO terms in the database"""
runner = mock_app.test_cli_runner()
assert runner
# Test CLI base, no arguments provided
result = runner.invoke(cli, ["view", "hpo"])
... | {
"content_hash": "ac25ec52a424d75279d1b1d1abcce344",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 74,
"avg_line_length": 32.94,
"alnum_prop": 0.6259866423800851,
"repo_name": "Clinical-Genomics/scout",
"id": "6a81361215223b3e68526925c97db198e34b29c0",
"size": "1672",
... |
"""Diff generator for the MSVC C++ Unicode updater script.
* Iterates over every .h; .cpp and .inl files in the input folder (non recursively)
* Look for non-unicode systel calls (like atoi or strcmp) and raw strings
* Generate a diff and json file with every calls replaced by their TCHAR-compliant equivalent an... | {
"content_hash": "77465ec1fd179bffe665eaffe38d347c",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 140,
"avg_line_length": 28.876033057851238,
"alnum_prop": 0.5997424155695478,
"repo_name": "lucasg/MSVCUnicodeUpdater",
"id": "ad942b3d6a72cdfd66305cc14ef6d118e46bb0d8",
"... |
import argparse
import clodius.higlass_getter as chg
import clodius.save_tiles as cst
import collections as col
import cooler
import h5py
import numpy as np
import sys
import time
import multiprocessing as mpr
def recursive_generate_tiles(
tile_positions,
coolers_matrix,
info,
resolution,
max_zoo... | {
"content_hash": "62f21687c2482a45489126f213aac494",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 100,
"avg_line_length": 32.34117647058824,
"alnum_prop": 0.5463805020007275,
"repo_name": "hms-dbmi/clodius",
"id": "2a0ee20e688f12ed4dbfdb27cc41b71f0f92d595",
"size": "82... |
import unittest
import ctypes
import gc
MyCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int)
OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong)
import _ctypes_test
dll = ctypes.CDLL(_ctypes_test.__file__)
class RefcountTestCase(unittest.TestCase):
def test_1(self):... | {
"content_hash": "023b1ce5ec172eb434cd0193e91f0cd6",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 80,
"avg_line_length": 26.316326530612244,
"alnum_prop": 0.5591314462970144,
"repo_name": "ktan2020/legacy-automation",
"id": "3a2b6384e6aec8374a7f6d7f788cf4a24b7d5875",
"s... |
import os,sys
import utils as cu
import libDetection as det
import evaluation as eval
import json
import scipy.io
import numpy as np
def getCategories():
categories = 'aeroplane bicycle bird boat bottle bus car cat chair cow diningtable dog horse motorbike person pottedplant sheep sofa train tvmonitor'.split()
re... | {
"content_hash": "d05ce3a67ef814c4c879970bd2381572",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 159,
"avg_line_length": 44.50684931506849,
"alnum_prop": 0.6705140043090182,
"repo_name": "jccaicedo/localization-agent",
"id": "d9f48f88848f21d2339d6596eee1492f33b00f30",
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
from mock import ANY
from ansible.module_utils.network.fortios.fortios import FortiOSHandler
try:
from ansible.modules.network.fortios import fortios_webfilter_ips_urlfilter_setting6
except ... | {
"content_hash": "bedc06e276bd4402afbd5fdf00f8d8eb",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 133,
"avg_line_length": 36.60377358490566,
"alnum_prop": 0.6479381443298969,
"repo_name": "thaim/ansible",
"id": "32b7006391831e40423fdf2189f505f73a39fb3d",
"size": "6516"... |
from __future__ import division
__all__ = ['UniformOneSided', 'Uniform']
import numpy as np
from pybasicbayes.abstractions import GibbsSampling
from pybasicbayes.util.stats import sample_pareto
from pybasicbayes.util.general import any_none
class UniformOneSided(GibbsSampling):
'''
Models a uniform distribu... | {
"content_hash": "a6e17a8f37ca6f014659e3dc3723a723",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 79,
"avg_line_length": 31.296296296296298,
"alnum_prop": 0.5872189349112426,
"repo_name": "michaelpacer/pybasicbayes",
"id": "c6e3807f343ec9d5d6dc45b94e786ca79d37060d",
"s... |
import logging
from .util import RecommenderWrapper,Recommender,Extension,ExtensionWrapper,Recommender_wrapper,Extension_wrapper
__version__ = '2.2.5'
class NullHandler(logging.Handler):
def emit(self, record):
pass
logger = logging.getLogger(__name__)
if len(logger.handlers) == 0:# To ensure reload() d... | {
"content_hash": "91aed354a05b52bb2ab78fdeae3b5fa3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 113,
"avg_line_length": 29.23076923076923,
"alnum_prop": 0.7421052631578947,
"repo_name": "smrjan/seldon-server",
"id": "77d5ac403d78ca83ed6e264c34cb096daf14f2b4",
"size": ... |
import os.path
from django.contrib.admin.templatetags.admin_urls import admin_urlname
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from django.test import TestCase, Client
from nose.tools import *
from bulkadmin i... | {
"content_hash": "852c87be2b56cfc0b5689b748100dcf1",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 83,
"avg_line_length": 33.32786885245902,
"alnum_prop": 0.5976389572060994,
"repo_name": "openplans/streetscore",
"id": "e73bb776656b1c99e3dfbe2eecdff4bb6fe227d1",
"size":... |
"""
RGB Display Primaries
=====================
Defines the spectral distributions classes for the datasets from
the :mod:`colour.characterisation.datasets.displays` module:
- :class:`colour.characterisation.RGB_DisplayPrimaries`: Implements support
for a *RGB* display (such as a *CRT* or *LCD*) primaries multi... | {
"content_hash": "5ab39d4d5bafaf2015278f9afa8a15f8",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 32.471698113207545,
"alnum_prop": 0.6554328878558977,
"repo_name": "colour-science/colour",
"id": "9f987c77f36c499af62399dcdc86558648f0c729",
"size"... |
"""
This package contains Docutils parser modules.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import Component
if sys.version_info < (2,5):
from docutils._compat import __import__
class Parser(Component):
component_type = 'parser'
config_section = 'parsers'
def parse(self, inp... | {
"content_hash": "b40b67c65c9f8ddf2b065e3dcf5932fe",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 76,
"avg_line_length": 30.510204081632654,
"alnum_prop": 0.6468227424749163,
"repo_name": "Lyleo/OmniMarkupPreviewer",
"id": "d7b8068e3a0901068d109f7016a4afd99d500b1c",
"si... |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from advent import Game
import time
import urlparse
# add games here. As long as they follow the example, they will appear in the drop down menu.
import http_game
# globals
games = {}
state = {}
class State(object):
def __init__(self, game, game_functi... | {
"content_hash": "72940560883db90830d4c5c52cbc8d52",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 261,
"avg_line_length": 33.46825396825397,
"alnum_prop": 0.6236661133507233,
"repo_name": "sleepinghungry/wwif",
"id": "fe7f63f765f813d92f5befb635fae2aa5abc5151",
"size": ... |
"""
Operations associated with logging
"""
import logging
from logging.handlers import SysLogHandler
def parseFacility(facilityStr):
"convert case-insensitive facility string to a facility number"
facilityStrLower = facilityStr.lower()
facility = SysLogHandler.facility_names.get(facilityStrLower)
if f... | {
"content_hash": "83d79434dfe86b60983b9530b77d7354",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 76,
"avg_line_length": 34.63793103448276,
"alnum_prop": 0.7068193130910901,
"repo_name": "ifiddes/pycbio",
"id": "090c74f20dc58193be46a51f7db2121634d00fc5",
"size": "2009",... |
import charms.reactive as reactive
import charmhelpers.core.hookenv as hookenv
# This charm's library contains all of the handler code associated with
# aodh
import charm.openstack.aodh as aodh
# Minimal inferfaces required for operation
MINIMAL_INTERFACES = [
'shared-db.available',
'identity-service.availab... | {
"content_hash": "3f4da88cd9eba11cc388e28c9d60b565",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 79,
"avg_line_length": 24.057471264367816,
"alnum_prop": 0.7085523172479694,
"repo_name": "javacruft/charm-aodh",
"id": "f725d27cbdff7297840854931171bd38aad72f40",
"size": ... |
import os
from alembic import command
from alembic.config import Config
class MigrationsConfig(Config):
def get_template_directory(self):
return os.path.abspath(os.path.dirname(__file__))
config = MigrationsConfig('alembic.ini')
config.set_main_option('script_location', './migrations/dir')
def revisio... | {
"content_hash": "0e5e033655120943f9964d9fe7d9f8e2",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 61,
"avg_line_length": 20.041666666666668,
"alnum_prop": 0.7193347193347194,
"repo_name": "microcood/projectancles",
"id": "529b100f3eaa1960a946f0404ecc01f9f9faa7f0",
"size... |
"""
DetailContributor
-----------------
Details represent the configuration for case lists and case details. The reuse of the word "Detail" here is
unfortunate. Details **can** be used for other purposes, such as the ``referral_detail``, but 99% of the time
they're used for case list/detail.
The case list is the "sho... | {
"content_hash": "b3a21682c7977e811a09c7eb4ff91421",
"timestamp": "",
"source": "github",
"line_count": 758,
"max_line_length": 154,
"avg_line_length": 41.199208443271765,
"alnum_prop": 0.5722245348874444,
"repo_name": "dimagi/commcare-hq",
"id": "463d7c34df636249dbdbbcd564d69aebaee21382",
"size": ... |
import nose
import dpath.util
from nose.tools import assert_raises
try:
# python3, especially 3.8
from collections.abc import MutableSequence
from collections.abc import MutableMapping
except ImportError:
# python2
from collections import MutableSequence
from collections import MutableMapping
... | {
"content_hash": "77d3586e99401dab6a6deb52c8e88de0",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 77,
"avg_line_length": 23.24025974025974,
"alnum_prop": 0.5174629784856105,
"repo_name": "akesterson/dpath-python",
"id": "82f8c05c471d17480dabde90cf0b3100e17a35ac",
"size... |
import time
import struct
from . import Pmod
from . import PMOD_NUM_DIGITAL_PINS
PMOD_PWM_PROGRAM = "pmod_pwm.bin"
CONFIG_IOP_SWITCH = 0x1
GENERATE = 0x3
STOP = 0x5
class Pmod_PWM(object):
"""This class uses the PWM of the IOP.
Attributes
----------
microblaze : Pmod
Microblaze processor... | {
"content_hash": "31d9b217b3d9580a860c9852b34ee3bf",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 74,
"avg_line_length": 25.962962962962962,
"alnum_prop": 0.5534950071326676,
"repo_name": "schelleg/PYNQ",
"id": "536a3c123ead1f48895dda923477bc26b1cbd932",
"size": "2184",... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "doc_flow.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "ab401307ff3588ff1b167ee47bc78ed8",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 72,
"avg_line_length": 25.444444444444443,
"alnum_prop": 0.7074235807860262,
"repo_name": "sychsergiy/DocFlow",
"id": "1d21672f2ad586f6cb821047e68b3cc63658d268",
"size": "25... |
"""@package mock
@brief Mock test this tester framework.
@author Marcel H
@date 2017
@parblock
@b Classes
@li N/A
@b Functions
@li N/A
@b Exceptions
@li N/A
@endparblock
@copyright Copyright (c) 2017 Marcel H
MIT License
Copyright (c) 2017 mh0401
Permission is hereby granted, free of charge, to any perso... | {
"content_hash": "2b51e73ba04ad015a75905c0c9e55c2c",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 28.323529411764707,
"alnum_prop": 0.6863966770508827,
"repo_name": "mh0401/pylab",
"id": "cce5df0b23e84ffba200de4448e6da8cf8a3862f",
"size": "2889",... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Post.source'
db.alter_column('facebook_posts_post', 'source', self.gf('django.db.models.fields.TextField')())
... | {
"content_hash": "86c68808ebb12c825f0b123973d01e40",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 185,
"avg_line_length": 74.28155339805825,
"alnum_prop": 0.5536531172395766,
"repo_name": "ramusus/django-facebook-posts",
"id": "656dd5bcdba024db6a8af8b37e21c9bf0dca0796",
... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1Resourc... | {
"content_hash": "81ceaffb0cfc87527884f3a8d85d4821",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 281,
"avg_line_length": 32.97716894977169,
"alnum_prop": 0.6032954860149543,
"repo_name": "djkonro/client-python",
"id": "3246087889f30f9355bcfd3853caf41c61c4dcc8",
"size"... |
"""
Platform for Ecobee Thermostats.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/thermostat.ecobee/
"""
import logging
from homeassistant.components import ecobee
from homeassistant.components.thermostat import (
STATE_COOL, STATE_HEAT, STATE_IDL... | {
"content_hash": "c53809da807001c77d0e79f963888da4",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 78,
"avg_line_length": 33.34170854271357,
"alnum_prop": 0.6007535795026375,
"repo_name": "justyns/home-assistant",
"id": "756c6c6913a8f9c5c7c78480e4609a3aab6ec8f5",
"size"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0011_auto_20170925_1618'),
]
operations = [
migrations.AlterField(
model_name='account',
name='account_name',
... | {
"content_hash": "951778c4b02499a5a1a1695becc8a79e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 108,
"avg_line_length": 28.565217391304348,
"alnum_prop": 0.5996955859969558,
"repo_name": "hyperwd/hwcram",
"id": "6273b8f3122ceb5330e6bdf08975bee66cdfa56f",
"size": "810"... |
u"""Program for testing bmlingam.
"""
# Author: Taku Yoshioka
# License: MIT
from copy import deepcopy
import six
from bmlingam.tests.test_pm3 import test_posterior_inference, \
infer_params_default, \
mcmc_params_default, \
... | {
"content_hash": "426c0598dc4db48ad81536b83a668abc",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 84,
"avg_line_length": 35.80232558139535,
"alnum_prop": 0.602955505034102,
"repo_name": "taku-y/bmlingam",
"id": "95d58097b949f1dcf8d2959ac8bf946f506f392f",
"size": "6183"... |
"""The module provides services for creating and manipulating GGRC's objects
via REST API."""
# pylint: disable=too-few-public-methods
import json
import re
from lib import environment
from lib.constants import url, objects
from lib.entities.entities_factory import (
ProgramFactory, AuditFactory, AsmtTmplFactory,... | {
"content_hash": "1338b415b9ba46bab1ae8fcdc908f5a7",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 79,
"avg_line_length": 37.17224880382775,
"alnum_prop": 0.6492470073368516,
"repo_name": "VinnieJohns/ggrc-core",
"id": "b262339044677270983079805d3eace87377fb20",
"size":... |
from django.contrib import admin
from django.forms.models import BaseInlineFormSet
from django.forms.fields import BooleanField
from django.forms.formsets import DELETION_FIELD_NAME
from django.forms.util import ErrorDict
from django.utils.translation import ugettext as _
from multilingual.languages import *
from mult... | {
"content_hash": "7946c76a0622ca6a761fdc035782141f",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 88,
"avg_line_length": 38.37914691943128,
"alnum_prop": 0.6211410224746851,
"repo_name": "stefanfoulis/django-multilingual",
"id": "ccd35abacae07ae3f53304e5de4eeac458b39c96"... |
import diventi.accounts.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0127_auto_20190430_1609'),
]
operations = [
migrations.AlterModelManagers(
name='diventiuser',
managers=[
('object... | {
"content_hash": "ef49fea3c70d6d6e5a7a8d4dcaebcfc7",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 74,
"avg_line_length": 22.38888888888889,
"alnum_prop": 0.5831265508684863,
"repo_name": "flavoi/diventi",
"id": "66537a17076dc44b88f5dcae7b7460fb016ccafa",
"size": "452",
... |
from datetime import timedelta
from urllib.parse import parse_qs
from django.test import TestCase, RequestFactory
from django.http import HttpResponseRedirect
from django.contrib.auth.models import User
from payments.models import Payment, Subscription
from payments.backends import PaypalBackend
PAYPAL_IPN_TEST = '... | {
"content_hash": "202d0c17e7c5c338535d52ac8ad542c3",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 89,
"avg_line_length": 32.676923076923075,
"alnum_prop": 0.6610169491525424,
"repo_name": "CCrypto/ccvpn3",
"id": "d88807e7ac073173ce89d2f6c60dba24b678bc46",
"size": "1062... |
from __future__ import print_function
import asyncore
import sys
from logging import getLogger
from smtpd import SMTPServer
from django.core.management.base import BaseCommand, CommandError
from django_extensions.management.utils import setup_logger, signalcommand
logger = getLogger(__name__)
class ExtensionDebug... | {
"content_hash": "8fe84b8d1792e1fbc6ebc40b708d2bca",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 101,
"avg_line_length": 34.8,
"alnum_prop": 0.5686462324393359,
"repo_name": "linuxmaniac/django-extensions",
"id": "ad73ab6eb7c511b77a915437dfb2803a79918272",
"size": "315... |
"""Tests for object_detection.predictors.heads.keypoint_head."""
import tensorflow as tf
from google.protobuf import text_format
from object_detection.builders import hyperparams_builder
from object_detection.predictors.heads import keypoint_head
from object_detection.protos import hyperparams_pb2
from object_detectio... | {
"content_hash": "fff4fed25390f5921872616992aad0a1",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 80,
"avg_line_length": 34.976190476190474,
"alnum_prop": 0.6902654867256637,
"repo_name": "alexgorban/models",
"id": "626d59c49934f9a5228c0fb97e98934483a2d878",
"size": "21... |
__author__ = 'marrabld'
import ConfigParser
import os
class State():
def __init__(self):
self.debug = ''
conf = ConfigParser.ConfigParser()
conf.read(os.path.join(os.path.dirname(__file__), 'bootstrap.conf'))
self.debug = conf.get('Debug', 'Level') | {
"content_hash": "4d226cf8b13d4984ba62e32df8afee76",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 76,
"avg_line_length": 22.153846153846153,
"alnum_prop": 0.5972222222222222,
"repo_name": "marrabld/web_bootstrappy",
"id": "edcc28c60347ce7574095cb2da1044da27b0d84c",
"siz... |
import copy
from gbpservice.nfp.configurator.lib import (
filter_constants as constants)
"""Filter class which provides data asked in a specific format.
This class mocks all rpc calls going from *aaS agent/driver to respective
*aaS plugin.
"""
class Filter(object):
def __init__(self, topic, default_v... | {
"content_hash": "49bf90d0daac57431670f04024f22287",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 79,
"avg_line_length": 35.696245733788395,
"alnum_prop": 0.4828377473945884,
"repo_name": "jiahaoliang/group-based-policy",
"id": "79dcf85b74b8f09fe79735ef0b41469c99052bb1",... |
import json
from django.core.mail import mail_admins
from django.db.models.aggregates import Sum
from django.http import Http404
from django.shortcuts import render
from django.forms.models import model_to_dict
from django.utils.text import slugify
from rest_framework import viewsets, permissions, versioning, excepti... | {
"content_hash": "6d2163937b6a8fccdfec37e96325e617",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 151,
"avg_line_length": 33.445427728613566,
"alnum_prop": 0.6255953430940201,
"repo_name": "porksmash/swarfarm",
"id": "b71417fda92b87b7a7a1906fcb1f437ca8595f58",
"size": ... |
'''
Rabid.Mongoose Webservice/Client
follows the Paranoid Pirate Pattern from ZeroMQ
'''
from flask import Flask, request, make_response
from rabidmongoose.config import ZMQCLIENT, TIMEOUT
import logging
from json import dumps
import zmq
APP = Flask(__name__)
APP.config.from_object('config')
MIME_TYPE = "application/j... | {
"content_hash": "18ccc10ee9c8bba3dbe0d0b46d2c43ea",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 76,
"avg_line_length": 30.804878048780488,
"alnum_prop": 0.6322248614410134,
"repo_name": "palaniyappanBala/rabid.mongoose",
"id": "c3b55a030d75c5a0e83ffd7cc6232abb56c85770",... |
import csv
import datetime
import json
import re
def main():
input = open('out.csv', 'r')
csvfile = open('out_synthetic.csv', 'wb')
writeout = csv.writer(csvfile)
limit = -1 # -1 means no limit
i = 0
while limit < 0 or i < limit:
i += 1
input_line = input.readline()
if '\n' not in input_lin... | {
"content_hash": "c2aee58f7658d79eb1f433c09c0d98c1",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 74,
"avg_line_length": 18.704545454545453,
"alnum_prop": 0.5407047387606319,
"repo_name": "cartland/predict-location",
"id": "270490f7b1297c1d9871c5d64b1f1ae46799d3a3",
"si... |
from django.http import HttpResponse
from django.shortcuts import render_to_response, redirect
from django.conf import settings
from django.template import RequestContext
from util.shortcuts import context_response
from luau.models import WikiPage
from tangle.markdown import mdx_tangle
def home(request):
ctxt =... | {
"content_hash": "51b067b93e8f49da5d3a496194974706",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 59,
"avg_line_length": 25.055555555555557,
"alnum_prop": 0.753880266075388,
"repo_name": "kwangkim/TangleDown",
"id": "b2a00753445a85a43b1984c1822813c1da619927",
"size": "4... |
from gevent import monkey; monkey.patch_all()
from nose.tools import assert_raises
import mock
from . import scheduler as _
from config import config_value
from job import Job
from digits.utils import subclass, override
class TestScheduler():
def get_scheduler(self):
return _.Scheduler(config_value('gpu_... | {
"content_hash": "639407066f5c98d4c156fbb176fbe404",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 80,
"avg_line_length": 27.962962962962962,
"alnum_prop": 0.6370860927152318,
"repo_name": "batra-mlp-lab/DIGITS",
"id": "8447d9c9446de7e28d6574163af5ac5cd31d096d",
"size": ... |
from flask.ext.wtf import Form
from wtforms import SelectField
from wtforms.validators import DataRequired
from wtforms.fields.html5 import DateField
__author__ = 'colinhunt'
class ReportGenerator(Form):
ALL_LABEL = 'all'
diagnosis = SelectField('Diagnosis', validators=[DataRequired()])
start_date = Dat... | {
"content_hash": "0a9e5216f5736405d579f75c55b0767e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 69,
"avg_line_length": 31.142857142857142,
"alnum_prop": 0.7431192660550459,
"repo_name": "MarkGalloway/RIS",
"id": "44437f7e84e4092b89ea2ffb1d4f10bf50d938e8",
"size": "436... |
import logging
from pymongo import MongoClient
from .mongoconfig import MongoConfig
class MongoConnect:
"""Maintaining some basic functions for pymongo"""
def __init__(self, mongo_config=MongoConfig()):
self.LOG = logging.getLogger(self.__class__.__name__)
self.mongo_config = mongo_config
... | {
"content_hash": "3c52d7262fd33e473c8691a8599f021f",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 78,
"avg_line_length": 33.68382352941177,
"alnum_prop": 0.5535909190133159,
"repo_name": "aongko/PythonCommon",
"id": "81b15940e468cdc313dc4df5b7f4e59b8f22ce58",
"size": "... |
try:
from wtforms.ext.csrf.form import SecureForm as Form
except ImportError:
from wtforms.form import Form
from setman import settings
__all__ = ('settings_form_factory', )
class BaseSettingsForm(Form):
"""
Base settings form, which would be dynamically extended by available
settings later.
... | {
"content_hash": "8be31f83c2eef329e45178f434d0af80",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 74,
"avg_line_length": 24.542857142857144,
"alnum_prop": 0.6658905704307334,
"repo_name": "playpauseandstop/setman",
"id": "00ffa31cc7198d2355465c30d0e0a84ec0f864f2",
"size... |
from django.http import JsonResponse
class AjaxMixin(object):
@staticmethod
def success(results, meta=None, status=200):
if isinstance(results, list) or isinstance(results, tuple):
content = {'results': results}
elif results is not None:
content = {'result': results}
else:
content = {}
if meta: c... | {
"content_hash": "be2dcac4dff91623b6d6abd9f3a730c8",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 61,
"avg_line_length": 25.857142857142858,
"alnum_prop": 0.7223756906077348,
"repo_name": "RutledgePaulV/django-commands",
"id": "4a03c7afe7bc80d82d4d1a038bf6475666c283f9",
... |
import ctypes
import numpy as np
from OpenGL.GL import *
from OpenGL.GL import shaders
from glfw import *
class Window(object):
def __init__(self, width=640, height=480, title='GLFW opengl window'):
self.width = width
self.height = height
self.title = title
self.window = None
... | {
"content_hash": "50790bab4c43f50f6a2b7111ae659e2c",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 90,
"avg_line_length": 29.972789115646258,
"alnum_prop": 0.5630957784838856,
"repo_name": "mackst/opengl-samples",
"id": "65ecc3994f983370e83e02ca02c4b10b2a1e010d",
"size"... |
import collections
__author__ = 'cenk'
def check_vertical(cells, free_cells):
movements = []
for (i, j) in cells:
if (i, j + 1) in free_cells and (i, j + 2) in free_cells:
movements.append((i, j + 2))
if (i, j - 1) in free_cells and (i, j - 2) in free_cells:
movements.... | {
"content_hash": "0abca4f6cdbe52b6e2df2a624dbb5be6",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 104,
"avg_line_length": 41.123893805309734,
"alnum_prop": 0.5487411233053583,
"repo_name": "cenkbircanoglu/tic-tac-toe",
"id": "ea4d535f38e0625de61e2b09995c80a2c0d65e0f",
... |
inputFile = "input.txt"
# Tracking vars
finalCode = ""
lastNumber = 5 # start here
tempNumber = 0
with open(inputFile) as f:
while True:
line = f.readline(-1)
if not line:
# print "End of file"
break
# print ("Line: ", line)
print ("First number=" + st... | {
"content_hash": "fd6cf613eb77cc500c85496fbc794f17",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 89,
"avg_line_length": 31.347826086956523,
"alnum_prop": 0.4944521497919556,
"repo_name": "geekygirlsarah/adventofcode2016",
"id": "7ec28e1cde2d0cf972c9976a98a87df9cbb904ca",... |
"""Auto-generated file, do not edit by hand. BW metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BW = PhoneMetadata(id='BW', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[19]\\d{2,4}', possible_length=(3, 5)),... | {
"content_hash": "c30620825fcef9194947c8225d9ac911",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 118,
"avg_line_length": 76.44444444444444,
"alnum_prop": 0.7456395348837209,
"repo_name": "samdowd/drumm-farm",
"id": "de1161e48b7ea0e849318f95ac3580ee6fddc37e",
"size": "68... |
"""S6 supervior system interactions.
"""
from .services import (
LongrunService,
Service,
ServiceType,
)
from ._utils import (
data_write,
environ_dir_write,
script_write,
value_write,
)
__all__ = [
'LongrunService',
'Service',
'ServiceType',
'data_write',
'environ_dir... | {
"content_hash": "29c173f6ccad8fc7564bdcbefb6bbc82",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 36,
"avg_line_length": 14.8,
"alnum_prop": 0.5918918918918918,
"repo_name": "keithhendry/treadmill",
"id": "1047926b37ad95e5b40b081f25964683a6ffbced",
"size": "370",
"bin... |
from django.core.management.base import BaseCommand
from optparse import make_option
import sys
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--verbosity', action='store', dest='verbosity', default='1',
type='choice', choices=['0', '1', '2'],
hel... | {
"content_hash": "390ac81d0e5b02e1d04c5e66817b409e",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 109,
"avg_line_length": 41.916666666666664,
"alnum_prop": 0.6242544731610338,
"repo_name": "diofeher/django-nfa",
"id": "f0e13a20692eb796ab81e45eef9895531c55fde3",
"size": ... |
from setuptools import setup, find_packages
setup(
name="macutil",
version = '0.1',
packages = find_packages(),
)
| {
"content_hash": "36a2139ce3d62dc427031540c4c73006",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 43,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.6307692307692307,
"repo_name": "biviosoftware/macutil",
"id": "e25dacf2186375b3cd680a6954a5960676ed7b8e",
"size": ... |
import sys
from flask import Flask
from flask import request
debug = False
# TODO: need better way than using this global...
# TODO: This all probably should not be an object...
CONFIG = False
app = Flask(__name__)
class Rest(object):
global CONFIG
app = Flask(__name__)
def __init__(self,config,lo... | {
"content_hash": "d228c90edd8dcbd613335d66f97855f1",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 162,
"avg_line_length": 34.62626262626262,
"alnum_prop": 0.6245624270711785,
"repo_name": "jimboca/ISYHelperHABridge",
"id": "e8b9b87ef29e95c7f1e6f38b4f72b8f37afe472d",
"si... |
import os
import sys
def import_module(name, moduleName=None, url=None, glo=globals(), loc=locals()):
"""
Imports a module given its name, look for it on http://www.xavierdupre.fr/...,
the file is copied at this file location.
@param name name of the module
@param moduleName lik... | {
"content_hash": "01d067ff140be22479deeead328593af",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 88,
"avg_line_length": 32.12,
"alnum_prop": 0.524906600249066,
"repo_name": "sdpython/ensae_teaching_cs",
"id": "1a94a6450de3a07482144cbf10f38d5c37c97f62",
"size": "1631",
... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('legislature', '0002_action_bill'),
]
operations = [
migrations.AddField(
model_name='bill',
name='slug',
field=m... | {
"content_hash": "08517c87217e661be8a7318ab4f00e93",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 47,
"avg_line_length": 21.157894736842106,
"alnum_prop": 0.5746268656716418,
"repo_name": "SpringtideCollectiveOrg/openhousens.ca",
"id": "582bc0025100bd483c17ff9e6e245fdc55e... |
import numpy as np
import pandas as pd
from pvlib.iotools import tmy
from ..conftest import DATA_DIR
import pytest
# test the API works
from pvlib.iotools import read_tmy3
TMY2_TESTFILE = DATA_DIR / '12839.tm2'
# TMY3 format (two files below) represents midnight as 24:00
TMY3_TESTFILE = DATA_DIR / '703165TY.csv'
TMY3... | {
"content_hash": "c4f039151d61f77685383f05af5f3b3c",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 143,
"avg_line_length": 37.60204081632653,
"alnum_prop": 0.6816824966078697,
"repo_name": "cwhanse/pvlib-python",
"id": "cc939588ace9540d175b20e14583aac7de383be5",
"size": ... |
"""Training related libraries."""
import math
import os
import re
from absl import logging
import neural_structured_learning as nsl
import numpy as np
import tensorflow as tf
from tensorflow_addons.callbacks import AverageModelCheckpoint
import tensorflow_hub as hub
from tensorflow_examples.lite.model_maker.third_par... | {
"content_hash": "7463decf721a030fdb0c76b78a27f8bd",
"timestamp": "",
"source": "github",
"line_count": 879,
"max_line_length": 110,
"avg_line_length": 39.882821387940844,
"alnum_prop": 0.6450067033687994,
"repo_name": "tensorflow/examples",
"id": "de45b6e0f55ba6e8f54a08f1aeab50aebe51d605",
"size":... |
"""Tests for tensorflow.ops.tf.Assign*."""
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.ops import variables
from tensorflow.python.plat... | {
"content_hash": "4d45b21b4be8c27891dda82ff423424f",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 80,
"avg_line_length": 38.398058252427184,
"alnum_prop": 0.6594184576485461,
"repo_name": "Intel-Corporation/tensorflow",
"id": "89f97aff2fdb71e552bdb2456ae80b129e68e4da",
... |
import re
# First, we try to use setuptools. If it's not available locally,
# we fall back on ez_setup.
try:
from setuptools import setup
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
# Following the recommendations of PEP 396 we parse the versi... | {
"content_hash": "d48c1095e2b1e003f570c2507bfc1fce",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 76,
"avg_line_length": 31.583333333333332,
"alnum_prop": 0.6442392260334213,
"repo_name": "srblum/hackathon-server",
"id": "1a9be5319a7801ec48821e9b71237439147270a3",
"size... |
"""
Django supports parsing the content of an HTTP request, but only for form POST requests.
That behavior is sufficient for dealing with standard HTML forms, but it doesn't map well
to general HTTP requests.
We need a method to be able to:
1.) Determine the parsed content on a request for methods other than POST (eg... | {
"content_hash": "4fe866bb3af1433021bcf9c849375812",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 106,
"avg_line_length": 28.305555555555557,
"alnum_prop": 0.6012897798962569,
"repo_name": "seanfisk/buzzword-bingo-server",
"id": "c8a014aefc29a1ce89340a20aa4b85a42af037ee"... |
import logging
import os
from random import choice
import re
import shlex
import string
import subprocess
LOG = logging.getLogger(__name__)
def genmac(start=None):
LOG.debug('Generating mac address')
if start is None:
start = u'00:16:3e:'
chars = string.digits + 'abcdef'
mac = start + u':'.jo... | {
"content_hash": "257ec97bfe53deb690dc06bf5e1f9dbd",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 79,
"avg_line_length": 29.028985507246375,
"alnum_prop": 0.5686470294558162,
"repo_name": "andrei4ka/fuel-web-redhat",
"id": "9e123c3e396e062b1b5ccf07129192c8d5392aa8",
"si... |
"""Tests for ceilometer.alarm.service.SingletonAlarmService.
"""
import mock
from oslo.config import fixture as fixture_config
from stevedore import extension
from ceilometer.alarm import service
from ceilometer.tests import base as tests_base
class TestSingletonAlarmService(tests_base.BaseTestCase):
def setUp(s... | {
"content_hash": "c5bc5648c565323015c905f16a51641b",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 77,
"avg_line_length": 42.68131868131868,
"alnum_prop": 0.5476313079299691,
"repo_name": "m1093782566/openstack_org_ceilometer",
"id": "8f12b9b9e3a10473c8bd0374ffee6751d5682a... |
"""
Backports the ``register.assignment_tag`` functionality from Django 1.4 to
Django 1.3.
This code is almost entirely reproduced from
https://code.djangoproject.com/browser/django/trunk/django/template/base.py
and is the work of Django's authors:
https://code.djangoproject.com/browser/django/trunk/AUTHORS
It is lic... | {
"content_hash": "556124acb574268f97821086278c4817",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 79,
"avg_line_length": 41.352380952380955,
"alnum_prop": 0.5336250575771534,
"repo_name": "ttrifonov/horizon",
"id": "98ce5de28eda8f4463419c2c33bd10de4a9e972b",
"size": "8... |
"""SCons.Tool.aixlink
Tool-specific initialization for the IBM Visual Age linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ... | {
"content_hash": "2f418c076b60c9106eae3287a6b624a5",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 107,
"avg_line_length": 34.31578947368421,
"alnum_prop": 0.713957055214724,
"repo_name": "renhaoqi/gem5-stable",
"id": "3a064bd2c7bf16ae76db8978a33f191970e4f2ef",
"size": "... |
from os import getenv
from pynamodb.models import Model
from pynamodb.attributes import NumberAttribute
class TweetLog(Model):
"""A snapshot of the most recent tweet."""
class Meta:
table_name = getenv('LOG_TABLE')
region = 'us-east-1'
read_capacity_units = 1
write_capacity_uni... | {
"content_hash": "034ee01bd30be369611a3f9bd0993913",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 63,
"avg_line_length": 23.627906976744185,
"alnum_prop": 0.6151574803149606,
"repo_name": "spmassot/Spaghetti-Twitter-Bot",
"id": "6c21ebd682f839f27defbd02da369a968cc19be8",
... |
"""
Defines the interface for a Plugin class that can be used by the gui_manager.
"""
################################################################################
#This software was developed by the University of Tennessee as part of the
#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
#project... | {
"content_hash": "fefff1bf2069864f986232f4aeb6b5ec",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 80,
"avg_line_length": 28.396491228070175,
"alnum_prop": 0.5725935994068948,
"repo_name": "lewisodriscoll/sasview",
"id": "32408b748d92f58c24a6caca89a766452af43bcd",
"size... |
"""util script to call `windrose` package"""
from calendar import month_abbr
from datetime import datetime, timezone
try:
from zoneinfo import ZoneInfo
except ImportError:
from backports.zoneinfo import ZoneInfo # type: ignore
import numpy as np
import pandas as pd
from pandas import read_sql
from metpy.unit... | {
"content_hash": "9d340039255eefc0cf4e28cb78b539b3",
"timestamp": "",
"source": "github",
"line_count": 396,
"max_line_length": 79,
"avg_line_length": 36.217171717171716,
"alnum_prop": 0.5675637986333845,
"repo_name": "akrherz/pyIEM",
"id": "25779bce76a0ab22b4021390c20cecc36d2b7b45",
"size": "14346... |
"""DNS Authenticator for DigitalOcean."""
import logging
from typing import Any
from typing import Callable
from typing import Optional
import digitalocean
from certbot import errors
from certbot.plugins import dns_common
from certbot.plugins.dns_common import CredentialsConfiguration
logger = logging.getLogger(__na... | {
"content_hash": "1075711268a3dc1bc21459e312f14ec5",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 100,
"avg_line_length": 42.049723756906076,
"alnum_prop": 0.6101694915254238,
"repo_name": "lmcro/letsencrypt",
"id": "0c0ab3faf5caf6bc70b8096d5dcb3c40dd4516b2",
"size": "... |
import hmac
import hashlib
digest_maker = hmac.new('secret-key', '', hashlib.sha256)
f = open('sample-file.txt', 'rb')
try:
while True:
block = f.read(1024)
if not block:
break
digest_maker.update(block)
finally:
f.close()
digest = digest_maker.hexdigest()
print digest | {
"content_hash": "5e3493640c6d3e1dbcc81cbe58677089",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 57,
"avg_line_length": 18.58823529411765,
"alnum_prop": 0.620253164556962,
"repo_name": "nwiizo/workspace_2017",
"id": "26d751ef085351396d1b911b46cb0e206750485a",
"size": "... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Category.awarded_for'
db.add_column('submissions_category', 'awarded_for',
self.gf('django.db.... | {
"content_hash": "91613dcff6e9e4bccbd4075e7ae32f54",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 182,
"avg_line_length": 68.24761904761905,
"alnum_prop": 0.5513536142897014,
"repo_name": "mozilla/gameon",
"id": "f133ff48028c18465bdcfec45853d7479429fc57",
"size": "7190... |
import random
import threading
import datetime
import time
import re
import math
#cli
import cmd
#kml
import simplekml
import paho.mqtt.client as mqtt
#plot
import matplotlib.pyplot as plt
import numpy as np
import json
import argparse
import sys
import math
data_log_file = None
data_file = None
VERSION = "0.7.6"
glo... | {
"content_hash": "0975876b8584dc66d8839a412f691732",
"timestamp": "",
"source": "github",
"line_count": 1226,
"max_line_length": 447,
"avg_line_length": 38.780587275693314,
"alnum_prop": 0.543043432537596,
"repo_name": "LinkItONEDevGroup/LASS",
"id": "45a4687a7da6137c04c9beef76a12f6db00cc20f",
"siz... |
import time
import logging
import hashlib
from scaff import Scaffold
def hash_pwd(pwd, salt):
return hashlib.sha1(pwd+'|'+salt).hexdigest()[:16]
class Runner(Scaffold):
def main(self):
root_user = self.db.user.find_one({'mail': 'root@root'}) or {}
root_user.update({
"name": "root"... | {
"content_hash": "ea204beaaa0c599e51475cb876a18283",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 103,
"avg_line_length": 26.548387096774192,
"alnum_prop": 0.5407047387606319,
"repo_name": "leonsim/shire",
"id": "e8a9c6de3ded7b6b24c74c45dae7ae48c93c0ac4",
"size": "866",... |
import argparse
import mock
import os
import tempfile
import unittest
import shutil
import re
from dogen.plugins.repo import Repo
from dogen.generator import Generator
class TestPackage(unittest.TestCase):
def setUp(self):
self.workdir = tempfile.mkdtemp(prefix='test_repo_plugin')
self.descriptor ... | {
"content_hash": "5a8dbb9f2e599450f84fa372660e2366",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 124,
"avg_line_length": 39.291666666666664,
"alnum_prop": 0.6548250265111347,
"repo_name": "goldmann/dogen",
"id": "3b961bc615667ba27e47801c630569e47e6509a9",
"size": "1886... |
"""Support for Tado hot water zones."""
import logging
import voluptuous as vol
from homeassistant.components.water_heater import (
SUPPORT_OPERATION_MODE,
SUPPORT_TARGET_TEMPERATURE,
WaterHeaterEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE... | {
"content_hash": "7e17b7fed83f37023005757ca237a982",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 92,
"avg_line_length": 29.87888198757764,
"alnum_prop": 0.6166718636316392,
"repo_name": "kennedyshead/home-assistant",
"id": "56bd29bbd9b0eb5fe943e2210c7594991bb6afae",
"... |
"""Created on Mon Oct 30 19:00:00 2017
@author: gsutanto
"""
import numpy as np
from Coupling import *
class TauCoupling(Coupling, object):
'Class defining coupling terms for DMP tau systems.'
pass
| {
"content_hash": "4c57c2e2c29b5c372cbfc49ba4a57cc8",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 54,
"avg_line_length": 17.166666666666668,
"alnum_prop": 0.7281553398058253,
"repo_name": "gsutanto/dmp",
"id": "f80f38946f5566040891bf3e7ae55ded990e929e",
"size": "253",
... |
from sequential import SequentialDataSet
from supervised import SupervisedDataSet
from unsupervised import UnsupervisedDataSet
from importance import ImportanceDataSet
from reinforcement import ReinforcementDataSet
from classification import ClassificationDataSet, SequenceClassificationDataSet | {
"content_hash": "8627400a0bad93213197294503f40961",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 79,
"avg_line_length": 49,
"alnum_prop": 0.9149659863945578,
"repo_name": "firestrand/pybrain-gpu",
"id": "f92bb9642c37c93c60e01ee1eac6056d6c684fe1",
"size": "301",
"binar... |
from .client import CustomerConversionGoalServiceClient
__all__ = ("CustomerConversionGoalServiceClient",)
| {
"content_hash": "adcc9ad561900e485caa479b93e30c00",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 55,
"avg_line_length": 36,
"alnum_prop": 0.8240740740740741,
"repo_name": "googleads/google-ads-python",
"id": "14de2e1d2db25e21a95f6a867adc6262cfd302ba",
"size": "708",
"... |
"""Tests for SliceNet."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensor2tensor.data_generators import cifar # pylint: disable=unused-import
from tensor2tensor.data_generators import mscoco # pylint: disable=unused-import
f... | {
"content_hash": "5ebe9f368f9d19fa2aa8809eb3511b00",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 81,
"avg_line_length": 37.5625,
"alnum_prop": 0.6555740432612313,
"repo_name": "tensorflow/tensor2tensor",
"id": "d4e43f7a41e8936327d4ff51ed63dc5e8b737052",
"size": "3010",... |
from collections import namedtuple
from pybliometrics.scopus.superclasses import Retrieval
from pybliometrics.scopus.utils import check_parameter_value, get_link
class SerialTitle(Retrieval):
@property
def aggregation_type(self):
"""The type of the source."""
return self._entry['prism:aggrega... | {
"content_hash": "567831d46bedcb687108677280a9b6fd",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 104,
"avg_line_length": 34.60849056603774,
"alnum_prop": 0.5855254191086275,
"repo_name": "jkitchin/scopus",
"id": "877e12e59454e607188244c21824851f7dd14028",
"size": "733... |
from distutils.core import setup
import sys
import weibo
kw = dict(
name = 'sinaweibopy',
version = weibo.__version__,
description = 'Sina Weibo OAuth 2 API Python SDK',
long_description = open('README', 'r').read(),
author = 'Michael Liao',
author_email = 'askxuefeng@gmail.com',
url = 'ht... | {
"content_hash": "edc0c65e1364dbcde072dd3428a2cb2a",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 71,
"avg_line_length": 31.966666666666665,
"alnum_prop": 0.6266944734098019,
"repo_name": "origingod/sina-weibo-auto-login",
"id": "86bf3ff7d7c1ea8a359b60245791e74b9b88edcd",... |
"""
An interpreter for a strange word-based language: the program is a list
of space-separated words. Most words push themselves on a stack; some
words have another action. The result is the space-separated words
from the stack.
Hello World => 'Hello World'
6 7 ADD => '13' ... | {
"content_hash": "7900cbb52f9e94fb0aa5d8d830a3bc97",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 79,
"avg_line_length": 36.1651376146789,
"alnum_prop": 0.5887874175545409,
"repo_name": "oblique-labs/pyVM",
"id": "f62500b03b7819d97886e1070f1cefb21d8ea4c8",
"size": "788... |
"""
Parse XML file containing MSDN documentation.
Authors: Moritz Raabe, William Ballenthin
Copyright 2014 Mandiant, A FireEye Company
TODO: License
Based on zynamics' code at
https://code.google.com/p/zynamics/source/browse/?repo=msdn-ida-plugin
"""
import xml.sax.handler
import itertools
import logging
class Pa... | {
"content_hash": "6fa4638c275d8b1c9cfca018c54435c3",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 145,
"avg_line_length": 37.99656357388316,
"alnum_prop": 0.596364294112327,
"repo_name": "fireeye/flare-ida",
"id": "d02b4078ad8bbc180bbdb4583315420480d80884",
"size": "11... |
"""Command-line interface to inspect and execute a graph in a SavedModel.
For detailed usages and examples, please refer to:
https://www.tensorflow.org/programmers_guide/saved_model_cli
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
i... | {
"content_hash": "b6f8aa314afd7ef0f1f9a66cf7ffd8eb",
"timestamp": "",
"source": "github",
"line_count": 641,
"max_line_length": 87,
"avg_line_length": 38.84399375975039,
"alnum_prop": 0.669544961645046,
"repo_name": "with-git/tensorflow",
"id": "11c3587f34d607f88f9bcd43ed54337a92c87190",
"size": "2... |
from __future__ import (absolute_import, division, print_function)
""" DbWrench_DDL_postprocess.py
Emilio Mayorga (UW/APL)
8/15-18/2014
Take the DDL SQL output from DbWrench for PostgreSQL, and apply changes in order to
generate a new, blank ODM2 database following ODM2 conventions. Specifically:
1. All entity names w... | {
"content_hash": "f6a39bce3c16be84179813ca5cdb4acf",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 107,
"avg_line_length": 43.955555555555556,
"alnum_prop": 0.6468655207280081,
"repo_name": "emiliom/ODM2PythonAPI",
"id": "6a964d7e659fff392b28c5f7c1ec7a2afe820c91",
"size"... |
from calendar import timegm
from collections import OrderedDict
from copy import copy
from datetime import datetime
from multiprocessing import Process
import requests
from cbagent.collectors import (NSServer, PS, TypePerf, IO, Net, ActiveTasks,
SpringLatency, SpringQueryLatency,
... | {
"content_hash": "f86acc29fc87ccfaa1b3041ccbee7227",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 86,
"avg_line_length": 39.545138888888886,
"alnum_prop": 0.6027746070770041,
"repo_name": "hsharsha/perfrunner",
"id": "42587ada374ffc619b49ad1e372d5fbf460e3c4f",
"size": ... |
from setuptools import setup, find_packages
import os
version = '0.1.2.dev0'
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
long_description = (
read('README.txt')
+ '\n' +
read('js', 'lightbox', 'test_lightbox.txt')
+ '\n' +
read('CHANGES.txt'))
set... | {
"content_hash": "eb8d943ff9c4aafef42154549b4a958c",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 72,
"avg_line_length": 23.714285714285715,
"alnum_prop": 0.5933734939759037,
"repo_name": "amleczko/js.lightbox",
"id": "352ad4669df8cd21c9230ca327cda474670244c5",
"size": ... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/skreeg/shared_lair_skreeg_swamp.iff"
result.attribute_template_id = -1
result.stfName("lair_n","skreeg_swamp")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "ac1d1fa9cc209715206a2645d74a0f58",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 77,
"avg_line_length": 23.615384615384617,
"alnum_prop": 0.6938110749185668,
"repo_name": "obi-two/Rebelion",
"id": "7ab8f6dad6a45645f92fe0ca1175e6caba76be86",
"size": "452... |
from django.conf.urls import patterns, url
from .views import MediaLibraryAPIView, MediaLibraryItemView, AddShelfRelationAPIView
urlpatterns = patterns('',
url(r'^(?P<type>(audio|video|image))/$', MediaLibraryAPIView.as_view(), name='medialibrary'),
url(r'^(?P<pk>\d+)/$', MediaLibraryItemView.as_view(), name='... | {
"content_hash": "60ddab9fd5b286ea1a57e009f2ffc4b5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 105,
"avg_line_length": 56.25,
"alnum_prop": 0.7177777777777777,
"repo_name": "pulilab/django-medialibrary",
"id": "f15e101f591681f1bb4d986439c43a337a8f508e",
"size": "450",... |
import ShareYourSystem as SYS
from ShareYourSystem.Classors import Resetter,Attester
from ShareYourSystem.Objects import Initiator
#Definition a MakerClass with decorated make by a Switcher
@Resetter.ResetterClass()
class MakerClass(Initiator.InitiatorClass):
#Definition
RepresentingKeyStrsList=[
'MakingMyF... | {
"content_hash": "8ba1f43edc2bf7c654b62d46c5b5104b",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 85,
"avg_line_length": 20.52173913043478,
"alnum_prop": 0.7216101694915255,
"repo_name": "Ledoux/ShareYourSystem",
"id": "1fd692904d21302f25410632348eb7cfe668621b",
"size"... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... | {
"content_hash": "515994207c257d503ece644cefba04f2",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 121,
"avg_line_length": 30.2,
"alnum_prop": 0.6357615894039735,
"repo_name": "Venskiy/chat",
"id": "b03d485d9c920d4c0e7e214875fed24fd9f3d39d",
"size": "827",
"binary": fa... |
import unittest
import jasper
import os
class TestJasperClient(unittest.TestCase):
"""
Test harness for jasper client
"""
def setUp(self):
pass
#try:
# os.remove('report.pdf')
#except:
# pass
def test_getversion(self):
j = jasper.JasperClient(host='192.168.56.60', port=8080, org='organization_1', use... | {
"content_hash": "102e7adaa3485a93210fc45e6e7be8cd",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 128,
"avg_line_length": 28,
"alnum_prop": 0.7047619047619048,
"repo_name": "cjjavellana/pyJasperClient",
"id": "c433e8a4801a2e65069e49ae54efbd87bf677192",
"size": "840",
... |
"""Set ``conn_type`` as non-nullable
Revision ID: 8f966b9c467a
Revises: 3c20cacc0044
Create Date: 2020-06-08 22:36:34.534121
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.ext.declarative import declarative_base
# revision identifiers, used by Alembic.
revision = "8f966b9c467a"
down_revision = "... | {
"content_hash": "7013cdfe643a1f4dd20ad01f76827bd0",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 96,
"avg_line_length": 30.34,
"alnum_prop": 0.6882003955174687,
"repo_name": "Acehaidrey/incubator-airflow",
"id": "1df5bfbfe324cfb84e15ba15872042b6a11d439f",
"size": "2305... |
import os
import unittest
from telemetry import story
from telemetry.page import page
import mock
class TestPage(unittest.TestCase):
def assertPathEqual(self, path1, path2):
self.assertEqual(os.path.normpath(path1), os.path.normpath(path2))
def testFilePathRelative(self):
apage = page.Page('file://som... | {
"content_hash": "7f10cf53f269172d218dfd7d17481dea",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 80,
"avg_line_length": 40.345971563981045,
"alnum_prop": 0.6307999530130389,
"repo_name": "endlessm/chromium-browser",
"id": "008da71ec3444f94a3bfd92142b8fc8e15fb17b8",
"s... |
"""
Mutator Error
"""
class MutatorError(Exception):
def __init__(self, msg, obj=None):
self.msg = msg
self.obj = obj
def __str__(self):
return repr(self.msg) + repr(self.obj)
| {
"content_hash": "4efb2bf3d7eefd69efdf58893c709491",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 46,
"avg_line_length": 21.4,
"alnum_prop": 0.5467289719626168,
"repo_name": "anthrotype/MutatorMath",
"id": "aec60987e471d9d469cc709950ace51aa0892f9d",
"size": "239",
"bi... |
from contextlib import contextmanager
from functools import lru_cache as _lru_cache, wraps
from threading import local
__version__ = '0.2'
__version_info__ = (0, 2)
__all__ = ['cached', 'cache_gen', 'clean_caches']
_thread_local = local()
_thread_local._ref = type('DefaultRef', (object,), {})()
def cache_gen(ref_g... | {
"content_hash": "33c191acb074d83523536beea75eb416",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 107,
"avg_line_length": 30.816666666666666,
"alnum_prop": 0.5630070308274743,
"repo_name": "srkunze/xcache",
"id": "e9a2658a120fe2298a51a7f455b74804518319ef",
"size": "1873... |
"""
@ 2009 by Uche ogbuji <uche@ogbuji.net>
This file is part of the open source Akara project,
provided under the Apache 2.0 license.
See the files LICENSE and NOTICE for details.
Project home, documentation, distributions: http://wiki.xml3k.org/Akara
Module name:: collection
= Defined REST entry points =
http://... | {
"content_hash": "fab54b4bdee85eb99673b15ed8605e1e",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 121,
"avg_line_length": 31.952879581151834,
"alnum_prop": 0.6849090611174832,
"repo_name": "uogbuji/akara",
"id": "6f54b976d5026f546b567f1956ff164b4e5bf90f",
"size": "6135... |
from __future__ import absolute_import
import doctest
import constant_hash
def load_tests(loader, tests, ignore):
tests.addTests(doctest.DocTestSuite(constant_hash))
return tests
| {
"content_hash": "8d211ac1376f909e0275ec1d4ce1b9f0",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 55,
"avg_line_length": 23.625,
"alnum_prop": 0.7671957671957672,
"repo_name": "sunfishcode/cretonne",
"id": "e76f09aed9c87f49b208939d7c9e245786ece114",
"size": "189",
"bin... |
"""
Translator module define translator service interface.
"""
class Translator(object):
"""
Initialize the translator.
:param: config a dict of settings.
"""
def __init__(self, config):
pass
"""
Return languages the translator supports.
:return: tuple of supported languages.
... | {
"content_hash": "6f4689824e6acb1d04c22abc3876dd89",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 73,
"avg_line_length": 29.205128205128204,
"alnum_prop": 0.6611062335381914,
"repo_name": "samsong8610/page-translator",
"id": "e373cc1ec0883fed6a80a9855ce554b9533eb093",
"... |
from rest_framework.exceptions import MethodNotAllowed
from rest_framework.permissions import BasePermission, SAFE_METHODS
from olympia import amo
from olympia.access import acl
# Most of these classes come from zamboni, check out
# https://github.com/mozilla/zamboni/blob/master/mkt/api/permissions.py for
# more.
c... | {
"content_hash": "77af00105e6acbb2084a247e09e1e52f",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 79,
"avg_line_length": 34.08045977011494,
"alnum_prop": 0.6663293985385048,
"repo_name": "harikishen/addons-server",
"id": "2cd4b87f4658433b47f3b6be96ee5ac4f0c40aff",
"siz... |
import pytest
from astral import LocationInfo
try:
import zoneinfo
except ImportError:
from backports import zoneinfo # type: ignore
class TestLocationInfo:
def test_Default(self):
loc = LocationInfo()
assert loc.name == "Greenwich"
assert loc.region == "England"
assert ... | {
"content_hash": "b06c06b8bc7db3ab2a7db2f376b66cdc",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 73,
"avg_line_length": 31.12121212121212,
"alnum_prop": 0.6465433300876339,
"repo_name": "sffjunkie/astral",
"id": "adf118bf451f0d78a83d57b67c164c37f59c3993",
"size": "1042... |
"""Exposes the Python wrapper conversion to trt_graph."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six as _six
# pylint: disable=unused-import,line-too-long
from tensorflow.compiler.tf2tensorrt.python.ops import trt_ops
from tensorflow.python.... | {
"content_hash": "b68b43265a355c832ad70506f024acb6",
"timestamp": "",
"source": "github",
"line_count": 658,
"max_line_length": 91,
"avg_line_length": 45.650455927051674,
"alnum_prop": 0.7007124309208336,
"repo_name": "jendap/tensorflow",
"id": "33b5e50418f9a68cae8f07e4962d6d0c5e117f9a",
"size": "3... |
from threading import Thread
from subprocess import PIPE, STARTUPINFO, STARTF_USESTDHANDLES, \
STARTF_USESHOWWINDOW, STDOUT, Popen
from os import name
from sublime import set_timeout
from functools import partial
from .notifier import log_error
def main_thread(callback, *args):
set_timeout(partial(callback, ... | {
"content_hash": "cade0ad0f444d1de0fc255135e498aaa",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 77,
"avg_line_length": 29.55,
"alnum_prop": 0.6074450084602369,
"repo_name": "Mitko-Kerezov/ns-sublime-plugin",
"id": "2c9f81f7a8bd05b4b663bd65e79e5e6f2abb5c33",
"size": "1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.