text stringlengths 4 1.02M | meta dict |
|---|---|
import tempfile
import os
import shutil
from biicode.client.store import hivedb
from unittest import TestCase
from biicode.common.test.conf import BII_TEST_FOLDER
from nose.plugins.attrib import attr
from biicode.client.store.migration_store import MigrationStore
from biicode.common.test.migration.migration_utils impor... | {
"content_hash": "70a34ca538bf4aa4e6f55c5c25689c58",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 82,
"avg_line_length": 33.3421052631579,
"alnum_prop": 0.6898184688239937,
"repo_name": "bowlofstew/client",
"id": "65fd6f92c9a43de73edf3983344b38d04428c490",
"size": "1267... |
from . api import api
from . root import root
| {
"content_hash": "1ab654f9c7e342965f7dec5670260525",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 23,
"avg_line_length": 23,
"alnum_prop": 0.7391304347826086,
"repo_name": "jjangsangy/ExplainToMe",
"id": "904b7f58142f6eddddaf925dbff7b62a92fb1707",
"size": "46",
"binary... |
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.21
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class SubscriptionResponse(object):
"""
NOTE: This class is auto generat... | {
"content_hash": "bca2368862cd1c1f22aea357f91f2132",
"timestamp": "",
"source": "github",
"line_count": 398,
"max_line_length": 239,
"avg_line_length": 26.349246231155778,
"alnum_prop": 0.5604081243444264,
"repo_name": "kinow-io/kinow-python-sdk",
"id": "880f65f3bdc3500af74ef9a5d3fa76a852d7be62",
"... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "52f8e78c675ef68cf9f01f86d03c8df7",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 72,
"avg_line_length": 42.785714285714285,
"alnum_prop": 0.8080133555926544,
"repo_name": "alexryndin/ambari",
"id": "098b5cf2480e3be8d073da17e0bb443dad320ed5",
"size": "12... |
from datetime import datetime, timedelta
from django.contrib.admin.models import User
from django.conf import settings
from challenges.models import (ExternalLink, Submission, Phase, Challenge,
Category, Project, SubmissionParent)
__all__ = ['challenge_setup', 'challenge_teardown', 'cr... | {
"content_hash": "fc71885ebf3f41116bafed619c86798e",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 87,
"avg_line_length": 33.05050505050505,
"alnum_prop": 0.5974938875305623,
"repo_name": "mozilla/mozilla-ignite",
"id": "ab10d64d3ea31497d9edf3fdce14cce49a049a69",
"size":... |
from pathlib import Path
import pytest
from django.conf import settings
from django.urls import reverse
from rdmo.core.constants import (VALUE_TYPE_CHOICES, VALUE_TYPE_FILE,
VALUE_TYPE_TEXT)
from ..models import Value
users = (
('owner', 'owner'),
('manager', 'manager'),
... | {
"content_hash": "a2babc92f6dece336140073f4edc542a",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 116,
"avg_line_length": 37.70454545454545,
"alnum_prop": 0.6483825597749648,
"repo_name": "DMPwerkzeug/DMPwerkzeug",
"id": "9a4ca791603042c3a905bb08693f9d37d871e028",
"siz... |
from typing import Sequence
from pyramids import categorization
from pyramids.categorization import Category
from pyramids.rules.subtree_match import SubtreeMatchRule
# all_terms(),
class AllTermsMatchRule(SubtreeMatchRule):
def __str__(self) -> str:
return str(categorization.Category('all_terms', self.... | {
"content_hash": "ed6cd7c3cf2ab30dfdd9ddafa59c0eb7",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 94,
"avg_line_length": 38.36363636363637,
"alnum_prop": 0.6398104265402843,
"repo_name": "hosford42/pyramids",
"id": "51815a9a43591061b0fb6a82ead2f3397cf46a20",
"size": "84... |
from neutron.api.v2 import attributes
from neutron.db import db_base_plugin_v2
from neutron.extensions import l3
from neutron.openstack.common import timeutils
def _uos_extend_timestamp(res, db):
res['created_at'] = timeutils.strtime(db['created_at'])
def _uos_extend_floatingip_dict_binding(core_plugin, res, db... | {
"content_hash": "898e5a1c70846b44e12441e1aaab613d",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 63,
"avg_line_length": 28,
"alnum_prop": 0.7436224489795918,
"repo_name": "CingHu/neutron-ustack",
"id": "97a8667d885eac45f0cd4a4a096228b44fc247b2",
"size": "2291",
"bina... |
from c7n_azure.resources.arm import ArmResourceManager
from c7n_azure.provider import resources
@resources.register('disk')
class Disk(ArmResourceManager):
"""Disk Resource
:example:
This policy will find all data disks that are not being managed by a VM.
.. code-block:: yaml
policies:
... | {
"content_hash": "18640e6d49b42a3592de6fa3802c341a",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 76,
"avg_line_length": 24.86842105263158,
"alnum_prop": 0.5682539682539682,
"repo_name": "alfredgamulo/cloud-custodian",
"id": "6caa115fdac9c6f5c484615fa6742d379134d62d",
"... |
import setuptools
from distutils.core import setup
setup(
name='vttools',
version='0.0.x',
author='Brookhaven National Lab',
packages=["vttools",
'vttools.vtmods',
'vttools.vtmods.import_lists',
'vttools.to_wrap',
'vttools.tests'
],
... | {
"content_hash": "ff57ffa90b4e25f7666eeae989ea522d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 60,
"avg_line_length": 25.8,
"alnum_prop": 0.5503875968992248,
"repo_name": "Nikea/VTTools",
"id": "07498a9ef2283db6e2cdc51981ee92eada7b25de",
"size": "388",
"binary": fa... |
import tamil
from tamil.txt2unicode import *
from transliterate import ISO, algorithm
def unicode_converter(tsci, cod):
out = ""
if cod == "t2u":
out = tamil.tscii.convert_to_unicode(tsci)
elif cod == "u2t":
temp = str(tsci)
out = unicode2tscii(temp)
elif cod == "an2u":
... | {
"content_hash": "b9a249dbe2b912fd5b9b34a849c8672d",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 69,
"avg_line_length": 35.34020618556701,
"alnum_prop": 0.6080805134189031,
"repo_name": "arcturusannamalai/open-tamil",
"id": "4947e8e5ef5c99c45866e130c229f344985d7c78",
... |
import pika
import logging
import locale
import json
class RabbitClient(object):
'''
RabbitClient is the base level class that handles rabbit exceptions, connections and logging. Subsequent
consumer/publishers will sublcass RabbitClient and implement the necessary functions.
'''
_LOG_FORMAT = ('%(... | {
"content_hash": "9e1aeca6cd9bd1a1fdefb63c7efe2219",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 152,
"avg_line_length": 39.89622641509434,
"alnum_prop": 0.6488531567746512,
"repo_name": "changzone/rabbitclient",
"id": "b75619f6dee4c090d2fea24350f6c91191416721",
"size... |
"""The ClimaCell integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from math import ceil
from typing import Any
from pyclimacell import ClimaCellV3, ClimaCellV4
from pyclimacell.const import CURRENT, DAILY, FORECASTS, HOURLY, NOWCAST
from pyclimacell.exceptions import (
... | {
"content_hash": "bfcadb26ae9b79246672c7a64c57c22d",
"timestamp": "",
"source": "github",
"line_count": 329,
"max_line_length": 92,
"avg_line_length": 32.0516717325228,
"alnum_prop": 0.5811284969179706,
"repo_name": "toddeye/home-assistant",
"id": "cf80b83fc36a9d93524dbceb19a26e8b87cc11e2",
"size":... |
from django.db.models.expressions import OrderByList
class OrderableAggMixin:
def __init__(self, *expressions, ordering=(), **extra):
if isinstance(ordering, (list, tuple)):
self.order_by = OrderByList(*ordering)
else:
self.order_by = OrderByList(ordering)
super()._... | {
"content_hash": "eb192d69ddc97acba5c741983fe577a2",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 85,
"avg_line_length": 40.724137931034484,
"alnum_prop": 0.6418289585097375,
"repo_name": "blighj/django",
"id": "340a9178793b850a427680a71815d7653089e361",
"size": "1181",... |
"""
This file will:
Compile your python files into an excecutable using:
python setup.py py2exe
This file will not:
Copy over any templates/css/js etc into the dist folder alongside the exe
"""
import sys
import py2exe
import os
"""
We need to do this so that py2exe includes the correct dlls in the... | {
"content_hash": "a67fe118b6960d0006e9e0c5bf7766f7",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 79,
"avg_line_length": 24.337349397590362,
"alnum_prop": 0.6163366336633663,
"repo_name": "joeyjojo/django_offline",
"id": "407d79a29d96a96afa4e3cdc1659e4414199f4be",
"size... |
from django.db import models
from .helper import bulk_update
class BulkUpdateManager(models.Manager):
def bulk_update(self, objs, update_fields=None,
exclude_fields=None, batch_size=None):
return bulk_update(
objs, update_fields=update_fields,
exclude_fields=exc... | {
"content_hash": "51bf99fcb7a5feae4b1cca0f259bf713",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 58,
"avg_line_length": 34.81818181818182,
"alnum_prop": 0.6553524804177546,
"repo_name": "lead-ratings/django-bulk-update",
"id": "7fe11ecb8dbea1a41d87d28a40106c4814c8d308",
... |
"""Unittests for the subcmds module (mostly __init__.py than subcommands)."""
import optparse
import unittest
import subcmds
class AllCommands(unittest.TestCase):
"""Check registered all_commands."""
def test_required_basic(self):
"""Basic checking of registered commands."""
# NB: We don't test all sub... | {
"content_hash": "bc2831e2f7196adab8d0fc56bce1c3a1",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 34.152542372881356,
"alnum_prop": 0.6332506203473945,
"repo_name": "couchbasedeps/git-repo",
"id": "bc53051a3e6e2a89da5d621c74b6852513a360a6",
"size"... |
import pygame
from pygame.locals import *
import os, sys
import threading
import time
"""
NOTES - pygame events and values
JOYAXISMOTION
event.axis event.value
0 - x axis left thumb (+1 is right, -1 is left)
1 - y axis left thumb (+1 is down, -1 is up)
2 - x axis right thumb (+1 is ri... | {
"content_hash": "4ec41f853288e911df45418e5fd3d7b7",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 134,
"avg_line_length": 33.272965879265094,
"alnum_prop": 0.5589650548236964,
"repo_name": "abramhindle/xbox-controller-supercollider",
"id": "175a5aa56e73b27cb35b0108dc2372... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Don't use "from appname.models import ModelName".
... | {
"content_hash": "26895571359f6bd62f52515f792c191d",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 194,
"avg_line_length": 66.62337662337663,
"alnum_prop": 0.560233918128655,
"repo_name": "michaupl/materialsapp",
"id": "19eb313ad6a133c3925692f1a1dd55f77c83973a",
"size": ... |
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
import numpy as np
import matplotlib.pyplot as plt
from kivy.garden.matplotlib.backend_kivyagg import FigureCanvas
def enter_axes(event):
print('enter_axes', event.inaxes)
event.inaxes.patch.set_facecolor('yellow'... | {
"content_hash": "38df0d6b45c474322f8fa6abfc5f3763",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 75,
"avg_line_length": 24.594594594594593,
"alnum_prop": 0.6395604395604395,
"repo_name": "andnovar/garden.matplotlib",
"id": "3a3c84de59c0a98e3a25b6f1ee25ec5538eac8c9",
"s... |
"""
Support the sensor of a BloomSky weather station.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor.bloomsky/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const impo... | {
"content_hash": "1033418b3e8d7c356bee0ea02399f46d",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 78,
"avg_line_length": 31.818181818181817,
"alnum_prop": 0.6415873015873016,
"repo_name": "shaftoe/home-assistant",
"id": "62769dc049486c101815b4fc93eae0fc0c1b1a05",
"size"... |
import os
TWILIO_ACCOUNT_SID = os.environ.get('TWILIO_ACCOUNT_SID', None)
TWILIO_AUTH_TOKEN = os.environ.get('TWILIO_AUTH_TOKEN', None)
#NOTE: The mongodb will be deleted right before this repo goes publis so I don't care if you can see the password.
MONGODB_HOST = os.environ.get('MONGODB_HOST', 'mongodb://ted:ted@sa... | {
"content_hash": "5b80766a00facbf0ed3a3afc61d3f6f7",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 114,
"avg_line_length": 48.833333333333336,
"alnum_prop": 0.7389078498293515,
"repo_name": "sayar/tedxhec",
"id": "cdf403fec52547fd437abebe7ca3785435380cb9",
"size": "608",... |
import os
import shutil
import sqlite3
def quotateNames(names):
return ", ".join([('"%s"' % name) for name in names])
class TagFolder:
def __init__(self, path):
self.path = path
self.tag_path = self.path + os.sep + ".tag"
self.db_path = self.tag_path + os.sep + "tag.db"
@staticmethod
def getTFByPath(path):... | {
"content_hash": "824c578469c4e0ab62d50090fac657aa",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 116,
"avg_line_length": 29.430851063829788,
"alnum_prop": 0.6752213988794505,
"repo_name": "modifier/tag",
"id": "efbd863dbe68c95128a5582b3e5b70901ffdc5e5",
"size": "5533"... |
import copy
from tempest.lib.api_schema.response.compute.v2_1 import parameter_types
_version = {
'type': 'object',
'properties': {
'id': {'type': 'string'},
'links': {
'type': 'array',
'items': {
'type': 'object',
'properties': {
... | {
"content_hash": "f8a381cb1045a63a8555e89119727ec2",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 74,
"avg_line_length": 26.540816326530614,
"alnum_prop": 0.46251441753171857,
"repo_name": "Juniper/tempest",
"id": "7f56239286649578f8078b002639116346f1e9a2",
"size": "323... |
""" BGP Exception """
_FATAL_EXCEPTION_FORMAT_ERRORS = False
class BGPException(Exception):
"""Base BGP Exception.
"""
message = "An unknown exception occurred."
def __init__(self, **kwargs):
try:
super(BGPException, self).__init__(self.message % kwargs)
self.msg = se... | {
"content_hash": "031755b76e2db588747b6ea5d6196bcf",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 80,
"avg_line_length": 28.710526315789473,
"alnum_prop": 0.6099908340971586,
"repo_name": "jack8daniels2/yabgp",
"id": "c8073cae8c62a6437d93f29a533dce12d08702de",
"size": "... |
import pytest
def get_file_contents(file_path):
file = open(file_path)
file_contents = file.read()
file.close()
return file_contents
def cleanup_stack_if_exists(heat_client, template_name):
stacks = heat_client.stacks.list()
for stack in stacks:
if stack.stack_name == template_name:
... | {
"content_hash": "1fe06b5228f8bba961553ff841ab91c1",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 69,
"avg_line_length": 29.520833333333332,
"alnum_prop": 0.6146788990825688,
"repo_name": "pjbreaux/f5-openstack-test",
"id": "122881af0b00731423aa1f2e23b72757ebe4e8cd",
"s... |
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.spatialite',
'NAME': 'neo.db',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
}
}
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache... | {
"content_hash": "da438662b5fa188eceedacd63f5341b4",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 95,
"avg_line_length": 24.806451612903224,
"alnum_prop": 0.618335500650195,
"repo_name": "praekelt/jmbo-neo",
"id": "d0d5efd3a3ae5e179e076b9b20890f7a2fbb1b19",
"size": "30... |
"""The tests for UVC camera module."""
import socket
import unittest
from unittest import mock
import pytest
import requests
from uvcclient import camera, nvr
from homeassistant.components.camera import SUPPORT_STREAM
from homeassistant.components.uvc import camera as uvc
from homeassistant.exceptions import Platform... | {
"content_hash": "5eff3669aeb13724a1486e3118cb84e9",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 88,
"avg_line_length": 40.2814371257485,
"alnum_prop": 0.5886725137505574,
"repo_name": "postlund/home-assistant",
"id": "b95d940bda47772bf97254de0a2c2fc61d55a3be",
"size"... |
"""Test the collection viewer interface."""
from grr.gui import runtests_test
from grr.lib import aff4
from grr.lib import flags
from grr.lib import test_lib
class TestContainerViewer(test_lib.GRRSeleniumTest):
"""Test the collection viewer interface."""
def CreateCollectionFixture(self):
with aff4.FACTOR... | {
"content_hash": "e67086e0ef214e3b0f2d9e0622da378e",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 78,
"avg_line_length": 34.04,
"alnum_prop": 0.6399529964747356,
"repo_name": "ojengwa/grr",
"id": "bb0e2658891f0f78d1ee6f637778a4b4dee6e47b",
"size": "4318",
"binary": f... |
from collections import Sequence, Hashable
from itertools import islice, chain
from numbers import Integral
from pyrsistent._plist import plist
class PDeque(object):
"""
Persistent double ended queue (deque). Allows quick appends and pops in both ends. Implemented
using two persistent lists.
A maximu... | {
"content_hash": "46cb5b3fb8f1e0b03d889d72da3fd0c2",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 115,
"avg_line_length": 32.34770889487871,
"alnum_prop": 0.5759520039996667,
"repo_name": "Futrell/pyrsistent",
"id": "ef89cc5441ae619ec2d959f7136c11ad1eaff8bf",
"size": "... |
"""Variables. See the @{$python/state_ops} guide."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.ops import gen_resource_variable_ops... | {
"content_hash": "4e47a7f18090b7b3d5f5bce12802ed81",
"timestamp": "",
"source": "github",
"line_count": 457,
"max_line_length": 110,
"avg_line_length": 37.63019693654267,
"alnum_prop": 0.6645345118334594,
"repo_name": "aselle/tensorflow",
"id": "2c93cf72c75ba27145e06abe69bcbef9418b39e0",
"size": "1... |
import re
import pydoop.mapreduce.api as api
import pydoop.mapreduce.pipes as pp
class Mapper(api.Mapper):
def map(self, context):
words = re.sub('[^0-9a-zA-Z]+', ' ', context.getInputValue()).split()
for w in words:
context.emit(w, 1)
class Reducer(api.Reducer):
def reduce(se... | {
"content_hash": "738c164087f5d911befb8102ba738e6d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 77,
"avg_line_length": 20.48,
"alnum_prop": 0.634765625,
"repo_name": "ilveroluca/pydoop",
"id": "758b5fc7803f2f87272973293c8fb56465f947ba",
"size": "1123",
"binary": fal... |
import collections
import uuid
from eventlet import event
from eventlet import greenthread
from neutron.common import exceptions
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.plugins.vmware.vshield.tasks import constants
DEFAULT_INTERVAL = 1000
LOG... | {
"content_hash": "6220d82dae4272be264046ffce8e7fe6",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 79,
"avg_line_length": 31.484293193717278,
"alnum_prop": 0.5416978465120146,
"repo_name": "virtualopensystems/neutron",
"id": "7037c430dd42dca92c55625485e02df7b5cea29c",
"... |
import gettext
import json
from os import path
from django.conf import settings
from django.test import (
RequestFactory, SimpleTestCase, TestCase, ignore_warnings, modify_settings,
override_settings,
)
from django.test.selenium import SeleniumTestCase
from django.urls import reverse
from django.utils.deprecat... | {
"content_hash": "50433dfe6626d4203f1504a10b9ba41d",
"timestamp": "",
"source": "github",
"line_count": 503,
"max_line_length": 109,
"avg_line_length": 48.512922465208746,
"alnum_prop": 0.635439718055897,
"repo_name": "claudep/django",
"id": "dd07aa9f935fb915301ad7ec6a01d1755f3e8255",
"size": "2440... |
from django.db import models
from django.template.defaultfilters import slugify
class Category(models.Model):
name = models.CharField(max_length=128, unique=True)
views = models.IntegerField(default=0)
likes = models.IntegerField(default=0)
slug = models.SlugField(unique=True)
def save(self, *arg... | {
"content_hash": "5adc7687997a7579034b07e3a4aca790",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 70,
"avg_line_length": 31.77777777777778,
"alnum_prop": 0.6870629370629371,
"repo_name": "bobbybabra/codeGuild",
"id": "dbf73ffc13bb77f8f29059f9971955d86b7e88e5",
"size": "... |
"""Files
We're getting close to being able to write
something really useful. To do that, we need to
_receive_ data from the outside world, not just
_produce_ it.
In this environment, you can access a virtual filesystem
that is part of the in-browser interpreter.
Let's do something silly: let's get
all of the lines of... | {
"content_hash": "e8482536d59f78db20bdee6fc3b56ede",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 62,
"avg_line_length": 29.558139534883722,
"alnum_prop": 0.7285601888276947,
"repo_name": "shiblon/pytour",
"id": "ffa9d8bd02e37d36a553f400e058c44c8c4aedca",
"size": "1284"... |
import codecs
import os
import sys
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools import setup, find_packages
def readme():
return open(os.path.join(os.path.dirname(__file__), 'README.md'), "r").read()
setup(
name='python-cache',
packages = find_packages(exclude=... | {
"content_hash": "9c3cbb5bd7d69fcc8ec47bbd33e9b52b",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 81,
"avg_line_length": 25.84375,
"alnum_prop": 0.6662636033857315,
"repo_name": "python-cache/python-cache",
"id": "b04680dc7a3caf29c702e235cfe581a6a3801d31",
"size": "827"... |
from django.db.models import Count, F
from django.shortcuts import get_object_or_404
from rest_framework.viewsets import ReadOnlyModelViewSet
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status as http_status
from .models import Connection, Image, Vot... | {
"content_hash": "982f01f9e910d9a52bcdcc65daeaf1f0",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 89,
"avg_line_length": 35.06153846153846,
"alnum_prop": 0.6520403685827117,
"repo_name": "hackerspace-silesia/jakniedojade",
"id": "5834a1fef62d634d40b8a166b0d300821005f696",... |
import sbs
import cp2112
i2c = cp2112.CP2112()
batt = sbs.Battery(i2c)
print "Manufacturer:", batt.manufacturer()
print "Device Name: ", batt.device_name()
print "Chemistry: ", batt.chemistry()
print "Temperature: ", batt.temperature(), "C"
print "Voltage: ", batt.voltage(), "V"
print "Aux Data: ", batt.manu... | {
"content_hash": "5f65bc9175d511d6b042bda5da955947",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 47,
"avg_line_length": 28,
"alnum_prop": 0.6845238095238095,
"repo_name": "taiwenko/python",
"id": "f295d3caf20361ca0b1d3056c3df7dd150b2d2c5",
"size": "358",
"binary": fa... |
'''
Copyright 2018 Chris McKinney
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 agree... | {
"content_hash": "c25fec2797dd023fae29ef427148fa21",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 29.73913043478261,
"alnum_prop": 0.7207602339181286,
"repo_name": "NighttimeDriver50000/tachibanasite",
"id": "6d05594d895c767793eb3ad669e43ababf8656e6... |
'''
Description : Unit test for recsys.py
Author : Jin Kim jjinking(at)gmail(dot)com
License : MIT
Creation date : 2014.03.25
Last Modified : 2014.03.27
Modified By : Jin Kim jjinking(at)gmail(dot)com
'''
import os,sys
# Add project root to PYTHONPATH
sys.path.insert(0, os.path.join(os.pat... | {
"content_hash": "24450ab030116d7c08e67e6bb5a6bd45",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 113,
"avg_line_length": 44.94074074074074,
"alnum_prop": 0.522333937695731,
"repo_name": "jjinking/datsci",
"id": "16f1531e89698b846f670f879473472b2b01a567",
"size": "6089... |
import logging
import time
from injector import singleton, inject, Injector
from .config import ConfigModule, Config
from .data_builder import DataBuilder
from .data_log import DataLog
from .measurement import MeasurementDispatcher
from .sensor import SensorModule
from .store import StoreClient
from .store import Sto... | {
"content_hash": "759b5422b4094b7e96210d9d4599ba3c",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 82,
"avg_line_length": 27.759036144578314,
"alnum_prop": 0.6449652777777778,
"repo_name": "wuan/klimalogger",
"id": "cc9987751b5c11df99f04110fc1a0d215e1c4229",
"size": "230... |
def domain_for_model(model):
return model._meta.db_table | {
"content_hash": "8a269ee8e5d936ac4fb706262ed79ab4",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 31,
"avg_line_length": 30,
"alnum_prop": 0.7333333333333333,
"repo_name": "danfairs/django-simpledb",
"id": "3731c0bf30fce83ec36b21ddd4ec457e6e72345f",
"size": "60",
"bina... |
import os
import sys
from collections import defaultdict
from . import helpers as util
import requests
import json
class Empath:
def __init__(self, backend_url="http://54.148.189.209:8000"):
self.cats = defaultdict(list)
self.staging = {}
self.backend_url = backend_url
self.base_dir... | {
"content_hash": "01e95bbe7aa6978deb0015c6771e79dc",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 115,
"avg_line_length": 37.28048780487805,
"alnum_prop": 0.5528295714753025,
"repo_name": "Ejhfast/empath-client",
"id": "03da9f4d09716650efc3fab82c11bfa30868a650",
"size":... |
""" Trains an agent with Deep Q Learning or Double DQN on Breakout. Uses OpenAI Gym.
"""
import sys
import os
sys.path.insert(0,os.path.expanduser('~/Library/Python/2.7/lib/python/site-packages/'))
import numpy as np
import cPickle as pickle
import gym
from optparse import OptionParser
import itertools
import random
... | {
"content_hash": "f84af0f659f187f504a7b31cc70b0ff6",
"timestamp": "",
"source": "github",
"line_count": 768,
"max_line_length": 352,
"avg_line_length": 41.009114583333336,
"alnum_prop": 0.5934910303222733,
"repo_name": "Bleyddyn/malpi",
"id": "625990f3961f286c4294e83ffeb2676ad1f82d63",
"size": "314... |
from minimax import minimax
from game_tree import game_tree
from copy import deepcopy
class connect_four(object):
def __init__(self):
self.number_cols = 7
self.number_rows = 6
# self.board = np.zeros((self.number_rows, self.number_cols), dtype=np.int)
self.board = [[0 for col in ran... | {
"content_hash": "5ce732c66cdf6e960e5ce1f95207b152",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 96,
"avg_line_length": 32.28260869565217,
"alnum_prop": 0.4922558922558923,
"repo_name": "michaelneuder/connect_four",
"id": "194925ed5349e395296b3aabc0eb310da6dfad5d",
"si... |
from __future__ import unicode_literals, absolute_import
import io
import os
import re
import abc
import csv
import sys
import zipp
import operator
import functools
import itertools
import posixpath
import collections
from ._compat import (
install,
NullFinder,
ConfigParser,
suppress,
map,
Fil... | {
"content_hash": "ddd37ebe10bef9da43b1c583307cd56e",
"timestamp": "",
"source": "github",
"line_count": 620,
"max_line_length": 79,
"avg_line_length": 30.52741935483871,
"alnum_prop": 0.6130395730966345,
"repo_name": "kennethreitz/pipenv",
"id": "7031323db7b194b78a17a0865fd492e48df879e0",
"size": "... |
from os import popen, system, chdir, mkdir
from os.path import exists, isdir, isfile
from sys import stderr,exit,platform
msg = """
This script will download a set of compatible BLAST executables, parameter and
database files used by the tcr-dist pipeline, and some TCR datasets for
testing and analysis. It should be r... | {
"content_hash": "db51abd74fb4d58d73c35a78b4ec97ab",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 129,
"avg_line_length": 28.44392523364486,
"alnum_prop": 0.6282240841136849,
"repo_name": "phbradley/tcr-dist",
"id": "f76f8611e09cd51e622ef51fef33bba1820891ae",
"size": "... |
"""Tests for the private `_AutoShardDataset` transformation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl.testing import parameterized
from tensorflow.core.example import example_pb2
from tensorflow.core.example import feature_pb2... | {
"content_hash": "acb234ea53c54ef68f1867bb0ef01364",
"timestamp": "",
"source": "github",
"line_count": 596,
"max_line_length": 118,
"avg_line_length": 40.149328859060404,
"alnum_prop": 0.6850265368381462,
"repo_name": "davidzchen/tensorflow",
"id": "564dda0cf11599aef7ece525fb4526f816465314",
"size... |
from __future__ import absolute_import
from logging.config import fileConfig
from logging import getLogger, root, StreamHandler
import os
def configure(name, path=None):
""" Configure logging and return a logger and the location of its logging
configuration file.
This function expects:
+ A Splunk a... | {
"content_hash": "636d62917a96d399765ffeafccb8e541",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 80,
"avg_line_length": 32,
"alnum_prop": 0.616875,
"repo_name": "splunk/splunk-app-twitter",
"id": "6e7b0081a5a7a9943784742987b31eb28b23a151",
"size": "3782",
"binary": ... |
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import GroupAdmin
from django.contrib.auth.models import Group
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.forms import FlatpageForm
from django.contrib.flatpages.mod... | {
"content_hash": "ee6f8f9b622c9c056741707bc35a79c7",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 65,
"avg_line_length": 26.976744186046513,
"alnum_prop": 0.7698275862068965,
"repo_name": "comic/comic-django",
"id": "9e174691fbb4ef99532849486bfc2b3273c92c8d",
"size": "1... |
import base64
import unittest
import jmespath
from parameterized import parameterized
from tests.charts.helm_template_generator import render_chart
class ResultBackendConnectionSecretTest(unittest.TestCase):
non_chart_database_values = {
"user": "someuser",
"pass": "somepass",
"host": "... | {
"content_hash": "29a633381b76fb21b25854abfef89815",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 105,
"avg_line_length": 35.516129032258064,
"alnum_prop": 0.5874659400544959,
"repo_name": "lyft/incubator-airflow",
"id": "d32a3bcf0e5da3fde962044e58ead5812073ca34",
"siz... |
"""Netowrk utils for the DHCP client implementation of the Anonymity Profile
([:rfc:`7844`])."""
import logging
import os.path
import subprocess
from dbus import SystemBus, Interface, DBusException
from pyroute2 import IPRoute
from pyroute2.netlink import NetlinkError
from .constants import RESOLVCONF, RESOLVCONF_ADM... | {
"content_hash": "1cb80aa6fb769b589ee34e8cacdeff1c",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 78,
"avg_line_length": 35.046875,
"alnum_prop": 0.603655818100758,
"repo_name": "juga0/dhcpcanon",
"id": "20cc6bc1f12f146505e4052941ae1116dfa7f530",
"size": "4605",
"bin... |
import unittest
import numpy.testing as npt
import pandas as pd
import titanic
AGE_MEDIAN = 28.0
class TestStuff(unittest.TestCase):
def assert_preconditions(self, td):
npt.assert_array_equal(
['PassengerId', 'Survived', 'Pclass', 'Name', 'Sex', 'Age', 'SibSp',
'Parch', 'Ticket'... | {
"content_hash": "fc7f4867f41337c2c409a53094290c84",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 109,
"avg_line_length": 31.675675675675677,
"alnum_prop": 0.556740614334471,
"repo_name": "krosaen/ml-study",
"id": "df4d98884bbc65ead4de112a61cd4373ce7cd8b5",
"size": "234... |
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from app.openapi_server.models.base_model_ import Model
from openapi_server import util
class SwapSpaceMonitorMemoryUsage2(Model):
"""NOTE: This class is auto generated by the swa... | {
"content_hash": "06317dd9acf53f362ef1fe55bb05c511",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 185,
"avg_line_length": 35.174698795180724,
"alnum_prop": 0.6655249186504538,
"repo_name": "cliffano/swaggy-jenkins",
"id": "3bd0d03e51f4ee32fc77e5ead075178fe27aeb61",
"si... |
import sqlalchemy as sa
from sqlalchemy_continuum import count_versions, versioning_manager
from tests import TestCase
class TestInsert(TestCase):
def _insert(self):
article = self.Article()
article.name = u'Some article'
article.content = u'Some content'
self.session.add(article)... | {
"content_hash": "f2292af8447200b47ea91edb8c021029",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 76,
"avg_line_length": 32.28048780487805,
"alnum_prop": 0.6135247449943332,
"repo_name": "avilaton/sqlalchemy-continuum",
"id": "12b0bf048a1ded1cc1805e40f2ae3321ba396578",
... |
import os
import shutil
import sys
import time
import unittest
from argparse import Namespace
from rnglib import SimpleRNG
from fusegen import invoke_shell, make_fuse_pkg, SH
from merkletree import MerkleTree
class TestFuseGeneration(unittest.TestCase):
def setUp(self):
self.rng = SimpleRNG(time.time())
... | {
"content_hash": "f18ce57b33e312885fb22d305bc49e56",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 77,
"avg_line_length": 31.33170731707317,
"alnum_prop": 0.5606414448077223,
"repo_name": "jddixon/fusegen",
"id": "e58e8c6e5b8783dc781327f81e5ef3a4d62f4375",
"size": "6480... |
from __future__ import division, print_function
import numpy as np
import bosehubbard # model base
import graph # forcedirectedgraph layout
import scipy.linalg as linalg
import scipy.sparse as sparse
# $$\ $$\ $$\ $$\
# $$$\ $$$ | $$ | $$ |
#... | {
"content_hash": "8deb0ab9a3a9e0d703af2a7e18f10332",
"timestamp": "",
"source": "github",
"line_count": 514,
"max_line_length": 160,
"avg_line_length": 32.79961089494164,
"alnum_prop": 0.5027581707100065,
"repo_name": "georglind/babusca",
"id": "cf01a79add88a2ec0ab46bc09dc6260ed1514425",
"size": "1... |
import os
APP_HOME = os.environ['GDD_HOME']
import sys
sys.path.append('%s/code' % APP_HOME)
import data_util as dutil
import argparse
### ATTENTION!!!! PLEASE PIPE THE OUTPUT OF THIS SCRIPT THROUGH sort | uniq !!! ###
### Doing it within python is a waste of resources. Linux does it much faster. ###
if __name__ == ... | {
"content_hash": "84d98a77341a1858eb24dc409a08b102",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 88,
"avg_line_length": 35.96666666666667,
"alnum_prop": 0.6617238183503243,
"repo_name": "HazyResearch/dd-genomics",
"id": "2e4404aced58ad49d97e67c5eeb49ee9b0f7714e",
"size... |
def main(j, params, service, tags, tasklet):
"""
Create or update Alert object
"""
import time
eco = params.value
session = params.session
alertservice = j.core.osis.cmds._getOsisInstanceForCat('system', 'alert')
alerts = alertservice.search({'eco':eco['guid']}, session=session)[1:]
... | {
"content_hash": "25b8d985c6d1ecdb78c7f5c9461ce02e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 82,
"avg_line_length": 33.89473684210526,
"alnum_prop": 0.5582298136645962,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "a26ec7f72ccd0ff7a8dc996013afb68c8d1f7964",
"siz... |
__author__ = 'benjaminwatson'
| {
"content_hash": "4cb423c5a18897a83f849ab1cd0e07ad",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 29,
"avg_line_length": 30,
"alnum_prop": 0.6666666666666666,
"repo_name": "0xr0ot/lobotomy",
"id": "4330f3f111475c320ccbcefdea22f4d96ace15a5",
"size": "30",
"binary": fals... |
import base64
import webbrowser
from floo.common.handlers import floo_handler
from floo.common import msg, utils, shared as G
class AgentConnection(floo_handler.FlooHandler):
def __init__(self, owner, workspace, emacs_handler, auth, join_action):
super(AgentConnection, self).__init__(owner, workspace, a... | {
"content_hash": "9260d093ebee20e302adbe8f5466f6cf",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 126,
"avg_line_length": 36.610169491525426,
"alnum_prop": 0.5600308641975309,
"repo_name": "Floobits/floobits-emacs",
"id": "63971f869641ac53b59c8ed6ea3f7f039b9e57aa",
"si... |
from .decision import ClassifiedObject
from .decision import DecisionTreeGenerator
from .decision import DecisionTreeEnv
from .mutator import Mutator
| {
"content_hash": "82fa6b82d4498430278365a5efa66ebe",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 43,
"avg_line_length": 37.5,
"alnum_prop": 0.8666666666666667,
"repo_name": "smcl/grf",
"id": "61b4ba420d3e69ad655e1cdb6b5951bf3213320b",
"size": "150",
"binary": false,
... |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("RandomForestClassifier" , "FourClass_10" , "hive")
| {
"content_hash": "3df508ebe58b2ee24784be9bb211d2aa",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 72,
"avg_line_length": 37,
"alnum_prop": 0.7905405405405406,
"repo_name": "antoinecarme/sklearn2sql_heroku",
"id": "d95278c0c4d2afe980ae40358e31e0f49318fc45",
"size": "148",... |
from __future__ import unicode_literals
import datetime
import uuid
from copy import deepcopy
from django.core.exceptions import FieldError
from django.db import DatabaseError, connection, models, transaction
from django.db.models import TimeField, UUIDField
from django.db.models.aggregates import (
Avg, Count, M... | {
"content_hash": "558b08662356e338e1305e0e2badd1b1",
"timestamp": "",
"source": "github",
"line_count": 871,
"max_line_length": 112,
"avg_line_length": 40.954075774971294,
"alnum_prop": 0.5768271144627288,
"repo_name": "ojengwa/django-1",
"id": "59fd0631034921de39e816784bb9be8657fda58a",
"size": "3... |
import logging
from son_editor.app.database import db_session
from son_editor.app.exceptions import InvalidArgument
from son_editor.impl.private_catalogue_impl import publish_private_nsfs, query_private_nsfs
from son_editor.models.descriptor import Service, Function
from son_editor.models.project import Project
from s... | {
"content_hash": "513d1a7f77125fd08d8c4d82ff658d61",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 91,
"avg_line_length": 43.5,
"alnum_prop": 0.6588802373007044,
"repo_name": "Jmanuel4SandMan/upb-son-editor-backend",
"id": "f9fcabc215678c70b5e8f616b7e799ce197b31bc",
"siz... |
import logging
from oidc_provider.lib.errors import *
from oidc_provider.lib.utils.params import *
from oidc_provider.lib.utils.token import *
from oidc_provider.models import *
logger = logging.getLogger(__name__)
class AuthorizeEndpoint(object):
def __init__(self, request):
self.request = request
... | {
"content_hash": "dcd426183db96bf5ebd6659ab4b91a60",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 99,
"avg_line_length": 33.40136054421769,
"alnum_prop": 0.5307535641547861,
"repo_name": "django-py/django-openid-provider",
"id": "2ea36656e4beccca558886141d89372c4f2a83dc"... |
"""Conversion tool from EDF+,BDF to FIF
"""
# Authors: Teon Brooks <teon.brooks@gmail.com>
# Martin Billinger <martin.billinger@tugraz.at>
#
# License: BSD (3-clause)
import os
import calendar
import datetime
import re
import warnings
from math import ceil, floor
import warnings
import numpy as np
from sci... | {
"content_hash": "b084cc9070c2460754d4007d2d677133",
"timestamp": "",
"source": "github",
"line_count": 683,
"max_line_length": 79,
"avg_line_length": 40.825768667642755,
"alnum_prop": 0.5322407115191508,
"repo_name": "effigies/mne-python",
"id": "a3e535b691af02dd3106f69fc5063479a0dfec9a",
"size": ... |
import ape.lib.basecommand
import os
import argparse
class Command(ape.lib.basecommand.BaseCommand):
prog_name = 'hello'
prog_description = 'Speak to an AI.'
def add_arguments(self):
self.parser.add_argument('bot',
default = 'chimpbot',
help = "Name of the bot to talk to. ... | {
"content_hash": "35dbe165476d0fb3bb5d128a59db9566",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 104,
"avg_line_length": 25.70731707317073,
"alnum_prop": 0.5104364326375711,
"repo_name": "mrchimp/ape",
"id": "4323e96fd2846f3d36dc6b5ae765bbaadff21306",
"size": "1055",
... |
__version__=''' $Id $ '''
__doc__='''Superclass for renderers to factor out common functionality and default implementations.'''
from reportlab.graphics.shapes import *
from reportlab.lib.validators import DerivedValue
from reportlab import rl_config
def inverse(A):
"For A affine 2D represented as 6vec return 6ve... | {
"content_hash": "92c326286375aedda6d6cadd6d73988f",
"timestamp": "",
"source": "github",
"line_count": 353,
"max_line_length": 123,
"avg_line_length": 35.90934844192635,
"alnum_prop": 0.5686336383717261,
"repo_name": "Distrotech/reportlab",
"id": "64a64cc8255463c7d79e33b3154e771007af0b90",
"size":... |
import os
import logging.config
import pkg_resources
import enum
from functools import wraps
import pytoml as toml
import click
from .settings import settings
from .connect import Reddit # noqa: F401
__version__ = '0.1.0'
def _setup_logging():
try:
with open('logging.toml') as f:
raw = f.... | {
"content_hash": "1f3e8b0a8016e760df4fc02bf68a8b43",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 78,
"avg_line_length": 20.152941176470588,
"alnum_prop": 0.5808523058960887,
"repo_name": "amici-ursi/ImagesOfNetwork",
"id": "5391333728a99dd841f997abb1d4e97b2470f6f1",
"s... |
"""Tests for converters for producing compute counter messages from
notification events.
"""
import copy
from oslotest import base
from ceilometer.compute.notifications import cpu
METRICS_UPDATE = {
u'_context_request_id': u'req-a8bfa89b-d28b-4b95-9e4b-7d7875275650',
u'_context_quota_class': None,
u'ev... | {
"content_hash": "5a84da6ba4c3bee71277cddf55dd59c9",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 73,
"avg_line_length": 43.36363636363637,
"alnum_prop": 0.6308659893565554,
"repo_name": "Juniper/ceilometer",
"id": "09e91416dcb3c44904091aac3778edbd4472ea7b",
"size": "6... |
import sys, os
sys.path = [os.path.join(os.getcwd(), "..", "..") ] + sys.path
from flapp.app import App
from flapp.glRenderer3D import glRenderer3D
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL import GLUT
class glInitObj:
def draw(self):
glEnable(GL_DEPTH_TEST)
class ScreenClearer:
d... | {
"content_hash": "d89d808134b51db08b4172c0ec1c71e8",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 62,
"avg_line_length": 22.761194029850746,
"alnum_prop": 0.6131147540983607,
"repo_name": "rpwagner/tiled-display",
"id": "bd5747acabdaac20014faf4af61cea4367d3e974",
"size"... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "54c1a03ff275f648753b1b1176399689",
"timestamp": "",
"source": "github",
"line_count": 611,
"max_line_length": 146,
"avg_line_length": 39.91653027823241,
"alnum_prop": 0.6637418508343925,
"repo_name": "radicalbit/ambari",
"id": "cac6e9c89295118845dc3bba0936140081d42780",
"size": "2... |
import numpy as np
import warnings
from ._base import NeighborsBase
from ._base import KNeighborsMixin
from ..base import OutlierMixin
from numbers import Real
from ..utils._param_validation import Interval, StrOptions
from ..utils.metaestimators import available_if
from ..utils.validation import check_is_fitted
from... | {
"content_hash": "12e52fb26bf58183d0bf588b5c9f1427",
"timestamp": "",
"source": "github",
"line_count": 493,
"max_line_length": 86,
"avg_line_length": 38.62068965517241,
"alnum_prop": 0.6169642857142857,
"repo_name": "vinayak-mehta/scikit-learn",
"id": "ecfb1712f85039b781e0439558df761394d01801",
"s... |
from __future__ import with_statement
import sys
import FSEvents
try:
from cStringIO import StringIO
except ImportError:
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
header = """# -*- coding: utf-8 -*-
# File generated by watchdog/scripts/dump_mac_constan... | {
"content_hash": "efb68a1a767f07161f9aa47b7f0af341",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 67,
"avg_line_length": 23.630434782608695,
"alnum_prop": 0.6384544618215271,
"repo_name": "teleyinex/watchdog",
"id": "3d27459cfefd58a70650a88ae338101c7a15049f",
"size": "1... |
from collections import deque
from re import sub, UNICODE
from earwigbot.wiki.copyvios.markov import EMPTY_INTERSECTION
from markupsafe import escape
__all__ = ["highlight_delta"]
def highlight_delta(context, chain, delta):
degree = chain.degree - 1
highlights = [False] * degree
block = deque([chain.STAR... | {
"content_hash": "0bfc5081af7624776a24bc8c8b11c395",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 79,
"avg_line_length": 32.71134020618557,
"alnum_prop": 0.5455404979514655,
"repo_name": "earwig/copyvios",
"id": "a3fb21f6b29af02176ed2fede74ea061ec931982",
"size": "3199"... |
from math import log2 #For converting numbers to log base 2
'''PIPE TO EXTERNAL FILE WITH > filename.txt'''
letters = 'abcdefghijklmnopqrstuvwxyz'
'''File to read in data from, change this name to read from other files'''
file_name = "typos20.data"
test_file = "typos20Test.data"
'''
NOTE: Spaces are uncorrupted. Words ... | {
"content_hash": "091446ba4f0dc8aaebc20b6d4b61a6f8",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 256,
"avg_line_length": 37,
"alnum_prop": 0.6828358208955224,
"repo_name": "mitchtz/ai3202",
"id": "7e7e13d9c9d1d094e7bba2e96f128b20c1429362",
"size": "10004",
"binary":... |
from .directory import *
from .shunt import *
from .utils import *
from .context import *
from .data import *
from .timeouts import *
from .processes import *
| {
"content_hash": "6978e14824f078a621b1cefb55311c47",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 24,
"avg_line_length": 22.714285714285715,
"alnum_prop": 0.7358490566037735,
"repo_name": "ravenac95/testkit",
"id": "47b922194c3d68bfa7f452cae712082ae798cb57",
"size": "159... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
description='sbsmanip is a set of utilities designed to help '
'clean a Space Engineers savefile for performance reasons',
author='Victor Robertson',
license='MIT License',
url='https:/... | {
"content_hash": "3659c64f383cb3458ba08a618cf163ed",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 75,
"avg_line_length": 27.636363636363637,
"alnum_prop": 0.6282894736842105,
"repo_name": "vmrob/sbsmanip",
"id": "60201d60e8169502c5cdcf11e2b0e28248f406fc",
"size": "608",... |
"""
=========================================================
Legacy discrete Fourier transforms (:mod:`scipy.fftpack`)
=========================================================
.. warning::
This submodule is now considered legacy, new code should use
:mod:`scipy.fft`.
Fast Fourier Transforms (FFTs)
==========... | {
"content_hash": "2fb16b46b594271f4beb6e6de16801bc",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 78,
"avg_line_length": 30.62135922330097,
"alnum_prop": 0.6277742549143944,
"repo_name": "arokem/scipy",
"id": "33b3050d11041b5075f2f2e4647cd794937256d8",
"size": "3154",
... |
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
This is a handler for lighttpd+fastcgi
This file has to be in the PYTHONPATH
Put something like this in the lighttpd.conf file:
server.port = 8000
server... | {
"content_hash": "fa2dae8514e38e19da27e9ad1b945134",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 69,
"avg_line_length": 28.057692307692307,
"alnum_prop": 0.6196024674434544,
"repo_name": "SEA000/uw-empathica",
"id": "e81d7ee37a5649357b7b2e8a7f7b7e655fe70edc",
"size": "... |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
from db.db_manager import db_sync_manager
from mapper.utils.filter import PathFinderTNtoSDNFilterUtils as FilterUtils
from mapper.utils.format import PathFinderTNtoSDNFormatUtils as FormatUtils
from mapper.utils.combin... | {
"content_hash": "e43074e69a5cc3fe341127384ed66069",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 183,
"avg_line_length": 53.4901185770751,
"alnum_prop": 0.6213699844823765,
"repo_name": "dana-i2cat/felix",
"id": "413d6d18cdac45396de107e8f415fa6d116591c6",
"size": "135... |
AWS = {
'key': '',
'secret': '',
'use_safe_connection': True,
'validate_certs': True,
}
DEBUG = False
# From AppEngine documentation (http://goo.gl/AO8lt):
# For security purposes, the sender address of a message must be the email
# address of an administrator for the application or any valid email re... | {
"content_hash": "2690a486f7448448e1ecebb4329c55c7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 78,
"avg_line_length": 35.56,
"alnum_prop": 0.7019122609673791,
"repo_name": "renanivo/cloudsnap",
"id": "e1f96a13399b969db1c6a48b70ec3713d3741e40",
"size": "889",
"binar... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_narmle_rifleman_rodian_male_01.iff"
result.attribute_template_id = 9
result.stfName("npc_name","rodian_base_male")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "b772b29d5e60bdcafba26cd47629a7e5",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 84,
"avg_line_length": 24.53846153846154,
"alnum_prop": 0.7021943573667712,
"repo_name": "anhstudios/swganh",
"id": "b44a247e66d30168c714355bb76f391c88cc395b",
"size": "464... |
from collections import defaultdict
from casexml.apps.stock.consumption import compute_consumption_or_default
from casexml.apps.stock.utils import get_current_ledger_state
from dimagi.utils.parsing import json_format_datetime
from datetime import datetime
from casexml.apps.stock.const import COMMTRACK_REPORT_XMLNS
de... | {
"content_hash": "62c06702d566918ddbfa0ce7d51e787a",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 102,
"avg_line_length": 42.26315789473684,
"alnum_prop": 0.6014943960149439,
"repo_name": "puttarajubr/commcare-hq",
"id": "975f44f633451d760bd2372fb9c6cfd5edaab530",
"size... |
from __future__ import absolute_import
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test.utils import override_settings
from django.utils import six
import django_comments
import bogofilter
from bogofilter.models import BogofilterComment
from bogofilter.forms im... | {
"content_hash": "4436d18172a613e7155b47e4dbe1d614",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 79,
"avg_line_length": 33.97530864197531,
"alnum_prop": 0.7074854651162791,
"repo_name": "stefantalpalaru/django-bogofilter",
"id": "756a27dee8d201252bf092e5f3258dfaa66503af"... |
import numpy
def readBamp(filename):
"""
This is a general bamp reading function. returns list of numpy.complexes
representing the complex amplitudes of the wave represented by the file.
"""
temp1=numpy.fromfile(file=filename,dtype=numpy.dtype('f8'))
temp2=temp1.reshape((2,-1),order='F')
t... | {
"content_hash": "008758883a36d41ae043ccd9db27cffa",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 77,
"avg_line_length": 35.84615384615385,
"alnum_prop": 0.6974248927038627,
"repo_name": "bdell/pyPWA",
"id": "6555efc3e6004c5ebdc2f0cedc3799204d62adee",
"size": "466",
"... |
from typing import Any
from django.conf.urls import include
from django.urls import path
from django.views.generic import RedirectView, TemplateView
from corporate.views.billing_page import billing_home, update_plan
from corporate.views.event_status import event_status, event_status_page
from corporate.views.portico ... | {
"content_hash": "d7f0737fe2bef40129a14caaffe11cea",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 100,
"avg_line_length": 38.96350364963504,
"alnum_prop": 0.6702884975646309,
"repo_name": "zulip/zulip",
"id": "134c6531d270c49b7ffabcf5e3c437e495895795",
"size": "5338",
... |
from rest_framework import viewsets
from .serializers import BookSerializer
from .models import Book
class BookViewSet(viewsets.ModelViewSet):
"""
API endpoint for my very sophisticated book model
"""
queryset = Book.objects.all()
serializer_class = BookSerializer
| {
"content_hash": "d8da16f0a678b1029e523b62961aacb9",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 53,
"avg_line_length": 28.6,
"alnum_prop": 0.7517482517482518,
"repo_name": "stephanpoetschner/django-vienna",
"id": "c8c0cf7c0f6853524cdd6910dbec130a35c997e6",
"size": "28... |
"""
test_sample_project
----------------------------------
Tests for `sample_project` module.
"""
import unittest
from sample_project import sample_project
class TestSample_project(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
assert 2 == 3
def test_something_el... | {
"content_hash": "b1de9d4ebe6f237c4f907c9c6a1550a6",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 44,
"avg_line_length": 16.586206896551722,
"alnum_prop": 0.5758835758835759,
"repo_name": "saksham/sample_project",
"id": "4884ab6fb5da63c29dc0b24cc875cfc701b9b9c8",
"size"... |
import logging
import os
import shutil
import sys
import unittest
import environment
import utils
import tablet
tablet_62344 = tablet.Tablet(62344)
tablet_62044 = tablet.Tablet(62044)
tablet_41983 = tablet.Tablet(41983)
tablet_31981 = tablet.Tablet(31981)
zkocc_server = None
def setUpModule():
try:
utils.zk_s... | {
"content_hash": "44da325569ae5add1f69195991ca9322",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 111,
"avg_line_length": 28.697674418604652,
"alnum_prop": 0.6742301458670988,
"repo_name": "apmichaud/vitess-apm",
"id": "666d18dfbebb622bd552096c82d1ae6f33446397",
"size"... |
"""
Handler for create collection wizard.
"""
from datafinder.gui.user.dialogs.creation_wizard.constants import PROPERTY_PAGE_ID, SOURCE_PAGE_ID
from datafinder.gui.user.dialogs.creation_wizard.state_handler.base_state_handler import BaseStateHandler
from datafinder.gui.user.models.repository.filter.leaf_... | {
"content_hash": "82e086cfb96e69c82fd147993dcc9fdb",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 137,
"avg_line_length": 41.916666666666664,
"alnum_prop": 0.5964214711729622,
"repo_name": "DLR-SC/DataFinder",
"id": "c50b00f3ece86d4fd67fc9816718c9462d501cb9",
"size": "4... |
from ctypes import cdll, c_double, c_int32
import os
lib = cdll.LoadLibrary(os.path.join(os.path.dirname(__file__), "src/libgomonte.so"))
estimate_pi = lib.EstimatePi
lib.EstimatePi.restype = c_double
lib.EstimatePi.argtypes = [c_int32, c_int32]
def estimate_pi(sims, needles):
return lib.EstimatePi(sims, needles)... | {
"content_hash": "00b3a1de0e1bd20ed3f3439061837717",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 84,
"avg_line_length": 32.1,
"alnum_prop": 0.7414330218068536,
"repo_name": "domluna/fun_with_ffi",
"id": "d9855ead81c32e35e4be8f97888c2a0c4f25c649",
"size": "321",
"bina... |
import smbl
| {
"content_hash": "1fa606abbccd32eaa232617805883c1a",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 11,
"avg_line_length": 12,
"alnum_prop": 0.8333333333333334,
"repo_name": "karel-brinda/smbl",
"id": "610a76d8eeb4aecec8e9a2e68a712e3b1b56f190",
"size": "12",
"binary": fa... |
"""``tornado.gen`` is a generator-based interface to make it easier to
work in an asynchronous environment. Code using the ``gen`` module
is technically asynchronous, but it is written as a single generator
instead of a collection of separate functions.
For example, the following asynchronous handler:
.. testcode::
... | {
"content_hash": "3484f60470b0056cd130712e99411361",
"timestamp": "",
"source": "github",
"line_count": 1241,
"max_line_length": 82,
"avg_line_length": 35.519742143432715,
"alnum_prop": 0.6073049001814882,
"repo_name": "arthurdarcet/tornado",
"id": "29e8cb50b53861893522b5482e16c13a0dad260f",
"size"... |
from pos_parameters import filename_parameter, value_parameter, \
string_parameter, list_parameter,\
vector_parameter
import pos_wrappers
class preprocess_slice_volume(pos_wrappers.generic_wrapper):
_template = """pos_slice_volume \
-i {input_image... | {
"content_hash": "bc67f726b91f805c8171b3c1455b2745",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 114,
"avg_line_length": 41,
"alnum_prop": 0.5651808242220353,
"repo_name": "pmajka/poSSum",
"id": "2ac70d56019dfb540f223cc39c1725fcef6a56e6",
"size": "2378",
"binary": fa... |
from __future__ import unicode_literals, division, absolute_import
import logging
from flexget import plugin
from flexget.event import event
log = logging.getLogger('inputs')
class PluginInputs(object):
"""
Allows the same input plugin to be configured multiple times in a task.
Example::
inputs:... | {
"content_hash": "9ecc32f588511e36021ac946129ced7b",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 111,
"avg_line_length": 36.03076923076923,
"alnum_prop": 0.5106746370623398,
"repo_name": "voriux/Flexget",
"id": "80b61bc17412849de1b5a4d147b24b7b508d3259",
"size": "2342"... |
"""yaml_config_loader setup file."""
from setuptools import setup
setup(
name='yaml-config-loader',
version='0.1.0',
description='Yaml configuration loader',
maintainer='Greg Leeper',
maintainer_email='gleeper@google.com',
url='https://github.com/google/python-spanner-orm',
packages=['yaml_... | {
"content_hash": "9d8543cf05b32bc0f89e6505a7309a6d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 55,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.6842105263157895,
"repo_name": "google/python-yaml-config",
"id": "ff0bdb8cfc637354326ce0ac0d689e4006d35c3e",
"si... |
"""
Tools for visualizing dependencies between Terms.
"""
from __future__ import unicode_literals
from contextlib import contextmanager
import errno
from functools import partial
from io import BytesIO
from subprocess import Popen, PIPE
from networkx import topological_sort
from six import iteritems
from zipline.pip... | {
"content_hash": "053138a5107053e057398c5b24caa9ee",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 78,
"avg_line_length": 26.369565217391305,
"alnum_prop": 0.5929101401483924,
"repo_name": "florentchandelier/zipline",
"id": "fdc34b70af9f008ee7cd9562b97ef75832d9929f",
"s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.