text stringlengths 4 1.02M | meta dict |
|---|---|
'''Database specifications for an evaluation protocol based on the Iris Flower
databases from Fisher's original work.'''
import numpy
import pkg_resources
# A list of protocols we implement
PROTOCOLS = {
'proto1': {'train': range(0, 30), 'test': range(30, 50)},
'proto2': {'train': range(20, 50), 'te... | {
"content_hash": "e622f014b394b5283927207c974bf992",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 79,
"avg_line_length": 26.311827956989248,
"alnum_prop": 0.6501838986514099,
"repo_name": "anjos/rrpack",
"id": "14490c131edd28562e2834dae4fd1164a5648b3b",
"size": "2557",
... |
"""Updates ACL item with specified ID"""
from baseCmd import *
from baseResponse import *
class updateNetworkACLItemCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""the ID of the network ACL item"""
"""Required"""
self.id = None
self.typeInfo['... | {
"content_hash": "2bf1d4f44434ecf9ce73508f227f0b8e",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 113,
"avg_line_length": 37.09243697478992,
"alnum_prop": 0.5713638423198912,
"repo_name": "MissionCriticalCloud/marvin",
"id": "e53f7c489086eb8dd886bc6d694f00e4cc46742b",
... |
"""
Management class for live migration VM operations.
"""
import functools
from oslo.config import cfg
from oslo.utils import excutils
from nova.i18n import _
from nova.openstack.common import log as logging
from nova.virt.hyperv import imagecache
from nova.virt.hyperv import utilsfactory
from nova.virt.hyperv impor... | {
"content_hash": "56b5bdf2588793febd704667a8d02303",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 78,
"avg_line_length": 41.11009174311926,
"alnum_prop": 0.6065610354831511,
"repo_name": "mgagne/nova",
"id": "72fef72e9620652b84c4a1d85a185c88421feb0a",
"size": "5120",
... |
"""Run all tutorials successively."""
from galry import run_all_scripts
run_all_scripts()
| {
"content_hash": "a7d0b80e3d23154d01f30f6cc6c71015",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 37,
"avg_line_length": 30,
"alnum_prop": 0.7555555555555555,
"repo_name": "rossant/galry",
"id": "cf4ccdb0eb364647ad969918a0741f0236ed0e45",
"size": "90",
"binary": false,... |
from evennia import create_object, search_object, logger
from random import randint
def roll_hit():
"Roll 1d100"
return randint(1, 10)
def roll_dmg():
"Roll 1d6"
return randint(1, 6)
def check_defeat(character):
"Checks if a character is defeated."
if character.db.HP <= 0:
character.m... | {
"content_hash": "4a22b10d25b7189e6aa74df1475f6b71",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 113,
"avg_line_length": 35.625850340136054,
"alnum_prop": 0.595760931831201,
"repo_name": "debanjum/ArMUD",
"id": "86a4ce395f7c4c76b3bae190abd150807e2d584c",
"size": "5237... |
import microcircuit.constants as const
from microcircuit.viz import show
from microcircuit.dataset.testconnectome001 import testconnectome
para = {
const.CONNECTOME_CHEMICAL_SYNAPSE: {
'marker': 'o',
'c': 'r',
's': 50
},
const.CONNECTOME_ELECTRICAL_SYNAPSE: {
'marker': '^',
... | {
"content_hash": "da30666c8105fc60b9c18414435c217e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 85,
"avg_line_length": 26.944444444444443,
"alnum_prop": 0.6412371134020619,
"repo_name": "unidesigner/microcircuit",
"id": "8fb33b0bddd3ac8f48ba02627fe6b3c798ba9471",
"siz... |
import copy
from django.contrib.sites.models import Site
from cms.api import create_page
from cms.models import Page
from cms.test_utils.testcases import URL_CMS_PAGE, CMSTestCase
from cms.utils.compat import DJANGO_2_2, DJANGO_3_0, DJANGO_3_1
from cms.utils.conf import get_cms_setting
from cms.utils.urlutils import ... | {
"content_hash": "5e510be198544c9aca5fcf161566a7fb",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 127,
"avg_line_length": 49.76119402985075,
"alnum_prop": 0.5625374925014996,
"repo_name": "datakortet/django-cms",
"id": "c869335df756b7f910052debd194571f907f6320",
"size"... |
from devinclude import *
from bustime.models import *
from bustime.views import ajax_stop_id_f
from bustime.views import bus_last_f
import ujson
import time
# import six
# from twisted.python import log
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.internet.endpoi... | {
"content_hash": "12eca79a7a233eb9b3c34e40be7df488",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 94,
"avg_line_length": 29.90967741935484,
"alnum_prop": 0.6147540983606558,
"repo_name": "norn/bustime",
"id": "1acf644fc80c525c59930d009b6203c56b9dec40",
"size": "4682",
... |
"""
These tests cover the individual code pieces related to structural variant
calling.
"""
import os
from django.conf import settings
from django.test import TestCase
import vcf
from main.models import AlignmentGroup
from main.models import Dataset
from main.models import ExperimentSample
from main.models import Ex... | {
"content_hash": "9d434b535703dc99ce488ca4941db39f",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 84,
"avg_line_length": 39.76282051282051,
"alnum_prop": 0.6363050137030469,
"repo_name": "woodymit/millstone_accidental_source",
"id": "d7e1fd8cd808bd663df0a0ac659db87570c1a... |
'''
OpenShiftCLI class that wraps the oc commands in a subprocess
'''
import atexit
import json
import os
import shutil
import subprocess
import re
import yaml
# This is here because of a bug that causes yaml
# to incorrectly handle timezone info on timestamps
def timestamp_constructor(_, node):
'''return time... | {
"content_hash": "6941a0028206ce0d679d352892c0dee7",
"timestamp": "",
"source": "github",
"line_count": 799,
"max_line_length": 116,
"avg_line_length": 35.66207759699625,
"alnum_prop": 0.5187407875342177,
"repo_name": "twiest/openshift-tools",
"id": "c6b45c14e067371d48b602fd6f434a76fede8ff0",
"size... |
from django.test import TransactionTestCase
from reversion.models import Version
from waldur_core.core.utils import silent_call
from . import models as test_models
class TestQuotaField(TransactionTestCase):
def test_quota_is_automatically_created_with_scope(self):
scope = test_models.GrandparentModel.o... | {
"content_hash": "ab0eac03503c60e38bcb029c34867c69",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 112,
"avg_line_length": 43.26470588235294,
"alnum_prop": 0.6860129163834127,
"repo_name": "opennode/nodeconductor",
"id": "9f1933f22797da2134dda194ce908f35a7f461cd",
"size... |
import re
class File:
@staticmethod
def read(filename):
with open(filename,'rb') as f:
contents = f.read()
return contents
class Textops:
@staticmethod
def sentences(text):
sentences = re.findall(r'[^.!\?]+[\.!\?]',text)
return sentences
| {
"content_hash": "0962d09946c938eef694f38c046b3f12",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 49,
"avg_line_length": 16.5,
"alnum_prop": 0.6439393939393939,
"repo_name": "dluman/inker",
"id": "eb4de3a9a1bb849e22adc78be90e2b5d5a3cdb7a",
"size": "264",
"binary": fal... |
DEBUG = False
SERVER_PORT = 8895
GUNICORN_WORKERS = 4 | {
"content_hash": "e59dbd11a63f19bf650ac4c3240ea3da",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 20,
"avg_line_length": 11,
"alnum_prop": 0.7272727272727273,
"repo_name": "dropbox-dashbpard/error-detect-of-log",
"id": "8524c8fa83de902558f84e6ca16ad952950761bb",
"size": ... |
"""
django-fhir
FILE: __init__.py
Created: 1/6/16 5:07 PM
"""
__author__ = 'Mark Scrimshire:@ekivemark'
# Hello World is here to test the loading of the module from fhir.settings
# from .settings import *
#from fhir_io_hapi.views.get import hello_world
#from fhir_io_hapi.views.delete import delete
#from fhir_io_h... | {
"content_hash": "3b29f88386b17c762c5ef8182b6a0d7a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 74,
"avg_line_length": 23.347826086956523,
"alnum_prop": 0.7318435754189944,
"repo_name": "ekivemark/BlueButtonFHIR_API",
"id": "d439b10ad2712c0ad9053027d3f3597ce116ba2b",
... |
class InvalidExpression(Exception):
pass
class WriterNotSupportingGroupedBatch(Exception):
pass
class ConfigurationError(ValueError):
"Configuration provided isn't valid."
class InvalidDateRangeError(ValueError):
"Empty or impossible date range"
class UnsupportedCompressionFormat(ValueError):
... | {
"content_hash": "cbbc1c9ef99e6c02be69f565bfccd788",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 91,
"avg_line_length": 31.43243243243243,
"alnum_prop": 0.6354256233877902,
"repo_name": "scrapinghub/exporters",
"id": "1af91deef07783ab07493eb2ab94275072e1d8cf",
"size": ... |
import datetime
from plugin.svtplay.utils import logger
# TODO: Combine with episode (?)
class SvtVideo(object):
def __init__(self, url, title, description, duration, published_at, genres,
image_url):
self.url = url
self.title = title
self.description = description
se... | {
"content_hash": "4e305620060a30f5837b35f499b8000a",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 79,
"avg_line_length": 33.25806451612903,
"alnum_prop": 0.5063045586808923,
"repo_name": "dstenb/pylaunchr-svtplay",
"id": "ee0037c9e8835738a493ef363607e20c42340980",
"size... |
from __future__ import absolute_import, print_function
import re
import functools
from turbo.conf import app_config
try:
from jinja2 import Environment, FileSystemLoader
except ImportError:
raise ImportError('jinja2 module ImportError')
class Jinja2Environment(Environment):
"""find template location
... | {
"content_hash": "7c4d000ffdd7e10289c25ce0d499e69f",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 111,
"avg_line_length": 29.72151898734177,
"alnum_prop": 0.6068994889267462,
"repo_name": "wecatch/app-turbo",
"id": "fa34480e228b9407fc2f7f4eb79024dc0c0a0b9e",
"size": "23... |
__author__ = 'giacomov'
from astromodels.core.tree import Node
from astromodels.core.parameter import Parameter
class Polarization(Node):
def __init__(self, polarization_type='linear'):
assert polarization_type in ['linear', 'stokes'], 'polarization must be linear or stokes'
self._polarization... | {
"content_hash": "7cdaa49bf253f27c72870e66e5367210",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 122,
"avg_line_length": 31.04385964912281,
"alnum_prop": 0.5637185645662617,
"repo_name": "grburgess/astromodels",
"id": "9c0f5b469d2e4d7edb4ddd475a591af6c7e05945",
"size"... |
"""Tests that all parsers and plugins are imported correctly."""
from __future__ import unicode_literals
import glob
import os
import unittest
from tests import test_lib
class ParserImportTest(test_lib.ImportCheckTestCase):
"""Tests that parser classes are imported correctly."""
_IGNORABLE_FILES = frozenset([... | {
"content_hash": "ea8e7e74fd256a2a0be5591ba8cbcd1d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 76,
"avg_line_length": 31.083333333333332,
"alnum_prop": 0.6952636282394995,
"repo_name": "rgayon/plaso",
"id": "39c232aee27622db126b0be259d637218da402af",
"size": "1166",
... |
'''GRIT tool that runs the unit test suite for GRIT.'''
from __future__ import print_function
import getopt
import sys
import unittest
try:
import grit.test_suite_all
except ImportError:
pass
from grit.tool import interface
class UnitTestTool(interface.Tool):
'''By using this tool (e.g. 'grit unit') you run ... | {
"content_hash": "dc9787af766cacdea323166c505603db",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 79,
"avg_line_length": 26.23076923076923,
"alnum_prop": 0.6774193548387096,
"repo_name": "endlessm/chromium-browser",
"id": "7e96b699c3c4566eca2815c839e96391396e2a14",
"siz... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('groups', '0016_auto_20170322_0342'),
]
operations = [
migrations.AlterField(
model_name='group',
name='name',
fi... | {
"content_hash": "058c46c5b28c2674ff3c0a0f67187055",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 100,
"avg_line_length": 27.130434782608695,
"alnum_prop": 0.5865384615384616,
"repo_name": "fxa90id/mozillians",
"id": "1402de832d3688989f54837ae62741f4ff6888f1",
"size": "... |
from unittest import skip
import numpy as np
from .VariableUnitTest import VariableUnitTest
from gwlfe.Input.WaterBudget import SatStorCarryOver
class TestSatStorCarryOver(VariableUnitTest):
@skip("not ready")
def test_SatStorCarryOver(self):
z = self.z
np.testing.assert_array_almost_equal(
... | {
"content_hash": "7bffc2a88aee38993f22979477dcb23e",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 59,
"avg_line_length": 28.733333333333334,
"alnum_prop": 0.7331786542923434,
"repo_name": "WikiWatershed/gwlf-e",
"id": "bf97f74f07dc0c905e91d1599bcc5306eb7f3883",
"size": ... |
import os
import sys
import glob
import pkgutil
import tarfile
import zipfile
import warnings
import collections
if sys.version_info >= (3,):
import io as StringIO
import configparser as ConfigParser
else:
import StringIO
import ConfigParser
from email.parser import FeedParser
from .utils import ext, ... | {
"content_hash": "48df49f7757349acc84d7a0894e0c873",
"timestamp": "",
"source": "github",
"line_count": 569,
"max_line_length": 145,
"avg_line_length": 31.9402460456942,
"alnum_prop": 0.5360404974138879,
"repo_name": "rubik/pkgtools",
"id": "9c333ac8e48ba1c3f78528e2e85a6cd48b1def03",
"size": "18174... |
from django import template
register = template.Library()
@register.tag
def order_menu(parser, token):
try:
tag, request, ordering = token.split_contents()
except ValueError:
raise template.TemplateSyntaxError('%s tag requires 2 argument' % token.split_contents()[0])
return OrderMenuNode(... | {
"content_hash": "98f692fe1324e41ff58aa268a0c4900d",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 110,
"avg_line_length": 31.085714285714285,
"alnum_prop": 0.6038602941176471,
"repo_name": "fiam/oauthsp",
"id": "f3c4c62b6ae36bac3cdf401ec008380b4842a3ae",
"size": "2231",... |
'''
Copyright 2012 STFC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | {
"content_hash": "5715c157522a57f88756b6ecd8560aaf",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 91,
"avg_line_length": 31.03921568627451,
"alnum_prop": 0.6689829437776375,
"repo_name": "stfc/apel",
"id": "7af15956121ed5f84f372efabfba6f544a4b1f57",
"size": "1583",
"b... |
"""
This code was generated by Codezu.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
"""
from mozurestsdk.mozuclient import default as default_client
from mozurestsdk.mozuurl import MozuUrl;
from mozurestsdk.urllocation import UrlLocation
from mozures... | {
"content_hash": "edf9009f29432ca25667d5f366721980",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 394,
"avg_line_length": 50.76470588235294,
"alnum_prop": 0.7427578215527231,
"repo_name": "sanjaymandadi/mozu-python-sdk",
"id": "ffa113dfc2ec1f8971055342f21fa8b2db3ead67",
... |
from tsa.models import Endpoint, create_session
from tsa import logging
logger = logging.getLogger(__name__)
def read(limit=None):
'''
Yields Endpoints (but only those with content)
'''
DBSession = create_session()
endpoints_with_content = DBSession.query(Endpoint).\
filter(Endpoint.statu... | {
"content_hash": "3e342049164399e198dd8a2b5661ba39",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 88,
"avg_line_length": 31,
"alnum_prop": 0.6627565982404692,
"repo_name": "chbrown/tsa",
"id": "ec09bd8055e80b7dc0e757dce7473083ebb95edb",
"size": "682",
"binary": false,... |
"""
A complete binary tree is a binary tree in which every level, except possibly
the last, is completely filled, and all nodes are as far left as possible.
Write a data structure CBTInserter that is initialized with a complete binary
tree and supports the following operations:
CBTInserter(TreeNode root) initializes ... | {
"content_hash": "72a7eb6d86f41d47aa8939237ebc7454",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 78,
"avg_line_length": 30.02247191011236,
"alnum_prop": 0.6216317365269461,
"repo_name": "algorhythms/LeetCode",
"id": "2c4ec26fca2c49952afeaa6f122dcce05c47b93b",
"size": "... |
import nltk
import re
import os
import time
p = nltk.PorterStemmer()
b = re.compile(r"\b\w+\b")
tokens = b.findall(open("./text/de-bello-gallico.txt").read().lower())
def test(tokens):
print("call...")
for i in range(0, 10):
print("loop...", i)
[p.stem(t) for t in tokens]
start = time.time()... | {
"content_hash": "bfbbd4b062ff647600f0384f68318c1a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 70,
"avg_line_length": 17.80952380952381,
"alnum_prop": 0.606951871657754,
"repo_name": "rharriso/nltk-workspace",
"id": "e2c2645464cb11400b74bb3849acada08f52f7bf",
"size":... |
"""The Apple TV integration."""
import asyncio
import logging
from random import randrange
from pyatv import connect, exceptions, scan
from pyatv.const import Protocol
from homeassistant.components.media_player import DOMAIN as MP_DOMAIN
from homeassistant.components.remote import DOMAIN as REMOTE_DOMAIN
from homeass... | {
"content_hash": "1091a64fd5ac2a0f8a7badde9dd22a14",
"timestamp": "",
"source": "github",
"line_count": 376,
"max_line_length": 87,
"avg_line_length": 32.90691489361702,
"alnum_prop": 0.6036531156550554,
"repo_name": "jawilson/home-assistant",
"id": "b710a753da938668ca631287d1c3bfd5cec339d9",
"size... |
import pandas as pd
from variant_annotations import process_variant_annotations, mp_variant_annotations
from vcf_metadata import VCFMetadata
class VCF(object):
"""Loads in a vcf file, aware of gzipped files.
Parameters
--------------------------------------
filename: str, required
path to v... | {
"content_hash": "85c953a2927d91a1cc642d27792b7043",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 164,
"avg_line_length": 36.53716216216216,
"alnum_prop": 0.5150254276467868,
"repo_name": "erscott/pandasVCF",
"id": "5a96291cfc2545deca82d0fc1c09397b5b3ed264",
"size": "1... |
"""wrapper for xcodebuild command line tool (OSX only)"""
import subprocess
name = 'xcodebuild'
platforms = ['osx']
optional = False
not_found = 'please install Xcode and Xcode cmd line tools'
#------------------------------------------------------------------------------
def check_exists(fips_dir) :
"""test if x... | {
"content_hash": "bb7ee1a68f249bd19926b97faacf4b08",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 101,
"avg_line_length": 35.6078431372549,
"alnum_prop": 0.5644273127753304,
"repo_name": "michaKFromParis/fips",
"id": "cc12cd7d0ece6f3e9f208e25e79a64f523b67afe",
"size": "... |
'''
:Author:
Helder Vieira da Silva <contato@helder.eti.br>
:Created:
2014-04-01
:License:
BSD, see LICENSE for more details.
'''
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object(__name__)
basedir = os.path... | {
"content_hash": "6b0c08f7bb2fda2aedcf6d03f24e95b7",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 93,
"avg_line_length": 23.14814814814815,
"alnum_prop": 0.6992,
"repo_name": "HelderVieira/flask_master_detail",
"id": "09d54bfcdf7abff15bbd5726c10a47157a2c4c69",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stocks', '0004_auto_20171011_1324'),
]
operations = [
migrations.CreateModel(
name='InvestmentBucketDescription',
fields=[
... | {
"content_hash": "d00b4c26de609c117718ac63e0be8253",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 114,
"avg_line_length": 30.12,
"alnum_prop": 0.5962815405046481,
"repo_name": "Neitsch/ASE4156",
"id": "194d8230e9718181ed812ad732886c80a59ce29f",
"size": "826",
"binary"... |
from __future__ import print_function
import os
import sys
import struct
import threading
import subprocess
import SocketServer # TODO(leszeks): python 3 compatibility
def CreateFileHandlerClass(root_dirs, verbose):
class FileHandler(SocketServer.BaseRequestHandler):
def handle(self):
data = self.request.... | {
"content_hash": "faeadd6f8959e2650b78223396f72735",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 78,
"avg_line_length": 31.207207207207208,
"alnum_prop": 0.6283198614318707,
"repo_name": "fceller/arangodb",
"id": "416714692c59b205820ad64de618ede87bebf55f",
"size": "75... |
import os
currentDir = os.getcwd()
##### ------------ go to ../lighthouse/database/ ---------------- #####
database_path = os.path.abspath(os.path.join(os.path.dirname(__file__),"../../"))
print database_path
##### ------------ for LAPACK routine info table ---------------- #####
### load data to table
### lapack_ro... | {
"content_hash": "b1826d04c952b2abd134e20f888d21c5",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 101,
"avg_line_length": 27.191176470588236,
"alnum_prop": 0.6576527852893456,
"repo_name": "LighthouseHPC/lighthouse",
"id": "59c637316ed1986cd7f675a0fa11dab73d1f1961",
"si... |
from __future__ import division, print_function, absolute_import
__author__ = 'jiajunshen'
import amitgroup as ag
import numpy as np
from pnet.layer import Layer
@Layer.register('normalize-layer')
class NormalizeLayer(Layer):
def __init__(self):
self._mean = None
@property
def trained(self):
... | {
"content_hash": "dd3be74bcac2982528e2d877b39833ae",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 64,
"avg_line_length": 23.25,
"alnum_prop": 0.5746714456391876,
"repo_name": "jiajunshen/partsNet",
"id": "ea666b5f46c32f9e6af9080e366c66e94d529a27",
"size": "838",
"bina... |
from agents.agent import Agent
from agents import MonteCarloAgent
class HumanAgent(Agent):
"""This agent is controlled by a human, who inputs moves via stdin."""
def __init__(self, reversi, color, **kwargs):
self.reversi = reversi
self.color = color
def reset(self):
pass
def ... | {
"content_hash": "1c608dfa8c287c3105fe0a9b4075a3ea",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 74,
"avg_line_length": 32.771929824561404,
"alnum_prop": 0.5112419700214133,
"repo_name": "andysalerno/reversi-ai",
"id": "98d5afc6c9d4cf153c4d748ff7145f09ebbffc0e",
"size"... |
"""The tests for an update of the Twitch component."""
from requests import HTTPError
from twitch.resources import Channel, Follow, Stream, Subscription, User
from homeassistant.components import sensor
from homeassistant.const import CONF_CLIENT_ID
from homeassistant.setup import async_setup_component
from tests.asy... | {
"content_hash": "ac36fc6d9baf2d23d09918be7ec5b537",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 87,
"avg_line_length": 37.35,
"alnum_prop": 0.6915067678119887,
"repo_name": "sdague/home-assistant",
"id": "33afde2a076380c829596c8a5ab3fc645e964170",
"size": "6723",
"... |
"""
Special models useful for complex compound models where control is needed over
which outputs from a source model are mapped to which inputs of a target model.
"""
from .core import FittableModel
__all__ = ['Mapping', 'Identity']
class Mapping(FittableModel):
"""
Allows inputs to be reordered, duplicate... | {
"content_hash": "173d02e96fc5fda6d69b839c24c613a0",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 79,
"avg_line_length": 31.16949152542373,
"alnum_prop": 0.573500090628965,
"repo_name": "funbaker/astropy",
"id": "314bd007e09895324c91f58ef05cd30726e97b1b",
"size": "5517... |
"""
Utility functions for dealing with the Design/Service registry.
TODO: M21 replace with OCCI calls!
"""
import os
from keystoneclient.v2_0 import client
def list_services(token, endpoint='http://localhost:35357/v2.0'):
"""
List services registered within this CC.
:param token: The token.
:param... | {
"content_hash": "833bac8927d14be45981bce5217012c3",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 100,
"avg_line_length": 30.04964539007092,
"alnum_prop": 0.612697663441114,
"repo_name": "icclab/hurtle_cc_sdk",
"id": "0b57c0e198928126110289ba0ff7a6a74d916d68",
"size": ... |
"""
Setup script for LO-PHI Network Services
(c) 2015 Massachusetts Institute of Technology
"""
import os
from distutils.core import setup
DIR_ROOT = "/opt/lophi"
def get_data_files(rel_dir):
install_list = []
for x in os.walk(rel_dir):
directory = x[0]
install_files = []
# G... | {
"content_hash": "4e21004011a84ae1fd3bcbbf3758178b",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 78,
"avg_line_length": 27.083333333333332,
"alnum_prop": 0.5981538461538461,
"repo_name": "mit-ll/LO-PHI",
"id": "83c08bd666eb4239a2251823f713b8428c63f694",
"size": "1625",... |
import sys
from plenum.common.constants import PREPREPARE
from plenum.test.delayers import ppDelay, msg_rep_delay
from plenum.test.helper import sdk_send_random_and_check, \
sdk_send_random_request
from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data
from plenum.test.node_request.helper impo... | {
"content_hash": "52f57243c94da649ad8b0de580c9886f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 104,
"avg_line_length": 51.627906976744185,
"alnum_prop": 0.6563063063063063,
"repo_name": "evernym/plenum",
"id": "1d8a950fef7bc7213de6d0e715ea0c7707ebf7d0",
"size": "2220... |
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
class Solution:
# @param matrix, a list of lists of integers
# @return nothing (void), do not return anything, modify matrix in-place instead.
def rotate(self, matrix... | {
"content_hash": "f412a9a294859a9b060e3cfa9e26c670",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 85,
"avg_line_length": 31.523809523809526,
"alnum_prop": 0.6057401812688822,
"repo_name": "UmassJin/Leetcode",
"id": "96321d859452fb16caf8b272e59cbc119f240baf",
"size": "68... |
"""
WSGI config for amazondealsapi project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICA... | {
"content_hash": "9e075db4e4aeabe0510adcd87a55545e",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 45.09375,
"alnum_prop": 0.7962577962577962,
"repo_name": "Aameer/amazon_deals_api",
"id": "1b5b2621419bf206218879f278deeaf96c74d96a",
"size": "1443",... |
import errno
import hashlib
import io
import os
import posixpath
from contextlib import contextmanager
from contextlib import ExitStack
from contextlib import suppress
from ftplib import Error as FTPError
from inspect import cleandoc
from pathlib import Path
from subprocess import CalledProcessError
from subprocess imp... | {
"content_hash": "98e94f5a0af6794f6d516ea9eb1074e1",
"timestamp": "",
"source": "github",
"line_count": 908,
"max_line_length": 90,
"avg_line_length": 35.41189427312775,
"alnum_prop": 0.5743608882254152,
"repo_name": "lektor/lektor",
"id": "e9344304eb59474c48ad3a7706f665edb69c61c9",
"size": "32156"... |
import json
import sys
def get_root(body) :
for part in body["part"] :
if part["root"] :
return part
def get_part(id_, body) :
for part in body["part"] :
if part["id"] == id_ :
return part
def fix_param(val) :
return round(val * 10000)/10000.0
def write_part(out... | {
"content_hash": "9843b4b5497fa2be378edf405071581e",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 70,
"avg_line_length": 32.632075471698116,
"alnum_prop": 0.5096848800231281,
"repo_name": "portaloffreedom/robot-baby",
"id": "812de8282603c615bfa7ada81e4f235b8f5fe8aa",
"... |
from msrest.serialization import Model
class SasDefinitionCreateParameters(Model):
"""The SAS definition create parameters.
:param parameters: Sas definition creation metadata in the form of
key-value pairs.
:type parameters: dict
:param sas_definition_attributes: The attributes of the SAS defin... | {
"content_hash": "7690b111820fa525e7ea5bd88511e7ed",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 94,
"avg_line_length": 35.766666666666666,
"alnum_prop": 0.6672879776328052,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "a8e6cd3e7b7c1f82f6e32f901f26bd653f0050f1",
... |
from util import PySettings
class Config(PySettings):
FONT = 'sans 16'
FONT_DOC = 'Font used in text entries'
KEYBOARD = 'n130'
KEYBOARD_DOC = 'Keyboard model and zones layout. One of (n130, n130_sdfv, n130_dvp)'
TUTOR = 'en.basic'
TUTOR_DOC = 'Tutor generator. One of (en.basic, en.advanced, ... | {
"content_hash": "047fb47cc247eb26d96651d4eb273fc9",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 88,
"avg_line_length": 26.541666666666668,
"alnum_prop": 0.5816326530612245,
"repo_name": "baverman/typetrainer",
"id": "c57f48c821ffa4923367ce4f2bf02435a26fde03",
"size": ... |
def extractLnfreeWordpressCom(item):
'''
Parser for 'lnfree.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Imouto sae ireba ii', 'Imouto sae ireba ii', ... | {
"content_hash": "d34b7dd21c0cb5b79b66ac93487f0cda",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 104,
"avg_line_length": 27.842105263157894,
"alnum_prop": 0.665406427221172,
"repo_name": "fake-name/ReadableWebProxy",
"id": "981a6592574c826b198f66efde935e8d6b9af0f7",
"s... |
"""
.. module:: constants
:platform: linux
:synopsis:
.. moduleauthor:: Paul Fanelli <paul.fanelli@gmail.com>
.. modulecreated:: 6/26/15
"""
from os.path import join
from planet_alignment import constants
from planet_alignment.utils import path
TEST_ETC_DIR = path.get_test_etc_dir()
TEST_PLUGINS_DIR = path.g... | {
"content_hash": "b1b92401f81ce897f63c33d1d76f8110",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 80,
"avg_line_length": 27.34090909090909,
"alnum_prop": 0.7098919368246052,
"repo_name": "paulfanelli/planet_alignment",
"id": "de11e924b5e69606de3a32d0ed0285830ee6666b",
"... |
import requests
import records
import passlib
r = requests.get("http://google.com")
print(r.status_code)
r = requests
r = records
p = passlib | {
"content_hash": "875c5e621e6ad2fab05378e063ffd223",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 37,
"avg_line_length": 4.410256410256411,
"alnum_prop": 0.6162790697674418,
"repo_name": "mikeckennedy/write-pythonic-code-demos",
"id": "a95e9a2260c01584494b0608dfa5b0c663f0... |
"""
A Hyper-V Nova Compute driver.
"""
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.virt import driver
from nova.virt.hyperv import hostops
from nova.virt.hyperv import livemigrationops
from nova.virt.hyperv import migrationops
from nova.virt.hyperv import... | {
"content_hash": "bd951e4bc6d346b0c18c490248bc0551",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 79,
"avg_line_length": 44.71212121212121,
"alnum_prop": 0.568056026205806,
"repo_name": "shhui/nova",
"id": "35a5118a833083ea2a4295133887bdf4722117ee",
"size": "9509",
"... |
"""
sentry.permissions
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import six
from django.conf import settings
from django.db.models import Q
from functools import wraps
from se... | {
"content_hash": "759efda116098e967e5f88943a4495fc",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 85,
"avg_line_length": 22.10091743119266,
"alnum_prop": 0.6737235367372354,
"repo_name": "1tush/sentry",
"id": "59e768398d43d095f5d01b928e1af9e3d227f3e4",
"size": "4818",
... |
"""
vtkImageExportToArray - a NumPy front-end to vtkImageExport
This class converts a VTK image to a numpy array. The output
array will always have 3 dimensions (or 4, if the image had
multiple scalar components).
To use this class, you must have numpy installed (http://numpy.scipy.org)
Methods
SetInputConnectio... | {
"content_hash": "8a203673ec931ffa0d4b249b04d3fcaa",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 77,
"avg_line_length": 29.50862068965517,
"alnum_prop": 0.6394975167981303,
"repo_name": "cjh1/VTK",
"id": "5891b415f19d757b273be4a13178c535db8c84dc",
"size": "3423",
"b... |
import sys
from pdfminer.pdfparser import PDFDocument, PDFParser
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter, process_pdf
from pdfminer.pdfdevice import PDFDevice, TagExtractor
from pdfminer.converter import XMLConverter, HTMLConverter, TextConverter
from pdfminer.cmapdb import CMapDB
from pdf... | {
"content_hash": "77ca01a17aa181b86ca178042747f150",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 114,
"avg_line_length": 36.36538461538461,
"alnum_prop": 0.5674246430460074,
"repo_name": "sahat/cloudbucket",
"id": "2d233f95e2c9fb734fe63de307241566c013d614",
"size": "3... |
from ._clusters_operations import ClustersOperations
from ._configuration_operations import ConfigurationOperations
from ._namespaces_operations import NamespacesOperations
from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations
from ._private_link_resources_operations import PrivateL... | {
"content_hash": "6a80dea650a0c6676201217a31f2d228",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 90,
"avg_line_length": 42.19047619047619,
"alnum_prop": 0.8261851015801355,
"repo_name": "Azure/azure-sdk-for-python",
"id": "11daeaa7c220bfc78b50abcadf34542074d239f6",
"si... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_events', '0004_eventbase_part_of'),
]
operations = [
migrations.AddField(
model_name='eventbase',
name='price_line',
... | {
"content_hash": "8591750039e2c5fb02082543d3a44a20",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 192,
"avg_line_length": 34.26086956521739,
"alnum_prop": 0.6154822335025381,
"repo_name": "ic-labs/django-icekit",
"id": "a7bda0b59eda2038978717c86cf357857a3ec8a6",
"size":... |
from __future__ import unicode_literals
import csv
import pytz
from furl import furl
from datetime import datetime, timedelta
from django.db.models import Q
from django.views.defaults import page_not_found
from django.views.generic import FormView, DeleteView, ListView, TemplateView
from django.contrib.auth.mixins imp... | {
"content_hash": "ecbf1c0e75b6b7f3e2a40b8b64a8fc74",
"timestamp": "",
"source": "github",
"line_count": 619,
"max_line_length": 126,
"avg_line_length": 35.61389337641357,
"alnum_prop": 0.5940576094352461,
"repo_name": "caseyrollins/osf.io",
"id": "f44fa7a4c1e9572765a76bfc8e54e99a5c0986e3",
"size": ... |
import os
PACKAGE = "timezonefinder"
VERSION_FILE = "VERSION"
VIRT_ENVS = ["APIenv"]
VIRT_ENV_COMMAND = ". ~/miniconda3/etc/profile.d/conda.sh; conda activate {virt_env}; "
PY_VERSION_IDS = [
"36",
"37",
"38",
] # the supported python versions to create wheels for
PYTHON_TAG = ".".join([f"py{v}" for v in ... | {
"content_hash": "f474353761f4803cce13bd048e257aa8",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 102,
"avg_line_length": 35.67567567567568,
"alnum_prop": 0.656060606060606,
"repo_name": "MrMinimal64/timezonefinder",
"id": "2e9f53d0996d52011e7966a02efb3135f0c958bc",
"si... |
from datetime import timedelta
from sqlalchemy import func
from sqlalchemy.orm import column_property
from sqlalchemy.sql.expression import case
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import (
Column, Integer, String, Numeric, DateTime, Date, Interval, Table,
Sequence)
Base = d... | {
"content_hash": "08fbfe91ba5afa96ac4eb27aaaf34192",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 70,
"avg_line_length": 23.042168674698797,
"alnum_prop": 0.6083660130718954,
"repo_name": "Kozea/pystil",
"id": "77265233fb1d0585f0f42054af39ddb287ac5f1c",
"size": "3972",... |
"""
从stock里获取网络数据,存放在数据库里
"""
import datetime
import socket
import pandas as pd
from stock import (get_stock_basics, get_k_data,
get_report_data, get_profit_data,
get_operation_data, get_growth_data,
get_debtpaying_data, get_cashflow_data,
... | {
"content_hash": "3a3c974d71480686697a97ca14b01170",
"timestamp": "",
"source": "github",
"line_count": 352,
"max_line_length": 113,
"avg_line_length": 34.24147727272727,
"alnum_prop": 0.5901435327304405,
"repo_name": "flychensc/orange",
"id": "99740f8e9452a6c93c8286c803e355587ae0b0e2",
"size": "12... |
import subprocess
import traceback
import sys
import os
from SimpleXMLRPCServer import SimpleXMLRPCServer as Server
PID_FILE = 'c:\wpf_service.pid'
try:
with file(PID_FILE, 'r') as f:
pid = f.read()
proc = subprocess.Popen(['tasklist', '/fi', 'imagename eq ipy.exe', '/fi', 'pid eq ' + str(pid)], st... | {
"content_hash": "e237f60909efc2d80fbc156f4c4eddbb",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 129,
"avg_line_length": 27.645833333333332,
"alnum_prop": 0.6088922381311228,
"repo_name": "renorzr/uimap",
"id": "b47d0207c0ac8959ed0754de0a6293a626490d83",
"size": "1327"... |
"""This code example gets all creative sets.
To create creative sets, run create_creative_sets.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication information... | {
"content_hash": "46682fcb04ba5919ff14985004f3d7e6",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 77,
"avg_line_length": 31.093023255813954,
"alnum_prop": 0.6843679880329095,
"repo_name": "wubr2000/googleads-python-lib",
"id": "e6b6e42bb4c0a749c6c7a67c01185b0e5e6b91d6",
... |
import random
import sqlalchemy as sa
from tacker.db.vm import vm_db
from tacker.openstack.common import log as logging
from tacker.plugins.common import constants
LOG = logging.getLogger(__name__)
class ChanceScheduler(object):
"""Select a Device that can serve a service in a random way."""
def schedul... | {
"content_hash": "4f220113cf4e4c610a6a84de99af5836",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 78,
"avg_line_length": 41.407407407407405,
"alnum_prop": 0.5100626118067979,
"repo_name": "SripriyaSeetharam/tacker",
"id": "a14398109bc1c93225619b9f826472a3ff847285",
"si... |
import _plotly_utils.basevalidators
class GaugeValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="gauge", parent_name="indicator", **kwargs):
super(GaugeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "945c66ea05c9a20483ce9ec705dfc379",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 79,
"avg_line_length": 37.95454545454545,
"alnum_prop": 0.5341317365269461,
"repo_name": "plotly/plotly.py",
"id": "e4fa1825566590f46e009385a39dd84b15746ee3",
"size": "1670... |
import json
from ..utils.data_utils import get_file
from .. import backend as K
CLASS_INDEX = None
CLASS_INDEX_PATH = 'https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json'
def preprocess_input(x, data_format=None):
"""Preprocesses a tensor encoding a batch of images.
# Argu... | {
"content_hash": "ae5b51a7282b02e68eb77562fc073606",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 105,
"avg_line_length": 39.31884057971015,
"alnum_prop": 0.5241430151124217,
"repo_name": "sankit1/cv-tricks.com",
"id": "6ec8c2d89b37985208746baafe435644464144ed",
"size"... |
from enum import Enum
from textwrap import dedent
from typing import Optional, cast
from pants.core.project_info.list_target_types import TargetTypesOptions, list_target_types
from pants.engine.target import BoolField, IntField, RegisteredTargetTypes, StringField, Target
from pants.engine.unions import UnionMembership... | {
"content_hash": "3cf568797bf3712c449dd8fae11d039e",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 95,
"avg_line_length": 24.47953216374269,
"alnum_prop": 0.6144290492116579,
"repo_name": "tdyas/pants",
"id": "8e50fe8ad0dbe5ac4d79701552680314100c4808",
"size": "4318",
... |
import datetime
from django.db import models
from django.utils import timezone
# Create your models here.
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
# Helpful representation of this object
def __str__(self): # __uni... | {
"content_hash": "5abe14dd2e279df79dd43079480140c0",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 77,
"avg_line_length": 36.59375,
"alnum_prop": 0.6840307429547395,
"repo_name": "roman-kachanovsky/django-polls-tutorial19",
"id": "d372bab22c3c021664bbd1c35ac5770ebcd8ef54",... |
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine.resources.openstack.neutron import neutron
from heat.engine import support
class VPNService(neutron.NeutronResource):
"""
A resource for VPN service in Neut... | {
"content_hash": "8e3e59acf5817f7ccb9e1779ce43f504",
"timestamp": "",
"source": "github",
"line_count": 762,
"max_line_length": 79,
"avg_line_length": 35.89238845144357,
"alnum_prop": 0.5429616087751371,
"repo_name": "miguelgrinberg/heat",
"id": "b7017026c4e370d9e71d551413af3ed32474455f",
"size": "... |
import _plotly_utils.basevalidators
class TicklenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="ticklen", parent_name="isosurface.colorbar", **kwargs
):
super(TicklenValidator, self).__init__(
plotly_name=plotly_name,
parent_na... | {
"content_hash": "12401a4aa8b77adf1d98094b5420e87c",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 80,
"avg_line_length": 32.92857142857143,
"alnum_prop": 0.5943600867678959,
"repo_name": "plotly/plotly.py",
"id": "2184e2a0501e84280b5a57028b59c0307175de1e",
"size": "461"... |
"""
* Created by Synerty Pty Ltd
*
* This software is open source, the MIT license applies.
*
* Website : http://www.synerty.com
* Support : support@synerty.com
"""
import json
from typing import Any, Dict, Optional
from vortex.Tuple import Tuple, addTupleType, TupleField
@addTupleType
class TupleSelector(Tupl... | {
"content_hash": "3bd8161c7849c775969050588021e8c3",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 86,
"avg_line_length": 28.716666666666665,
"alnum_prop": 0.6111433546140452,
"repo_name": "Synerty/vortexpy",
"id": "dd718f4694624323353b07fef609c65017e4ed02",
"size": "172... |
from pandac.PandaModules import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.fsm import StateData
from toontown.toon import ToonAvatarPanel
from toontown.friends import ToontownFriendSecret
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from... | {
"content_hash": "3f7dea7a999bbefe226e8d29b3e5fe49",
"timestamp": "",
"source": "github",
"line_count": 679,
"max_line_length": 430,
"avg_line_length": 43.08100147275405,
"alnum_prop": 0.5490564747709559,
"repo_name": "linktlh/Toontown-journey",
"id": "63919cd5d558fdf3fde5b3ef8e5fe557e19b5327",
"si... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bulletin', '0007_add_model_scheduled_post'),
]
operations = [
migrations.AddField(
model_name='ad',
name='display_weight',
... | {
"content_hash": "c2cf76ede46c13ee970f9b3a0df3983b",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 116,
"avg_line_length": 25.166666666666668,
"alnum_prop": 0.6269315673289183,
"repo_name": "AASHE/django-bulletin",
"id": "7e98452ec9bfb0bce20754942de3b82801eca5e4",
"size"... |
"""
WSGI config for seattlestats project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_... | {
"content_hash": "26c66b471210c19a2bb0b93e0d33c408",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 25.0625,
"alnum_prop": 0.7755610972568578,
"repo_name": "lindsayrgwatt/citystats",
"id": "89f03280b3d2fb99d79fff6ca12bbed0b7d72790",
"size": "401",
... |
try:
from subprocess import check_output
except ImportError:
from subprocess import Popen, PIPE, CalledProcessError
def check_output(*popenargs, **kwargs):
# Add subprocess.check_output for python 2.6
# https://gist.github.com/edufelipe/1027906
process = Popen(stdout=PIPE, *popenarg... | {
"content_hash": "e6f6babef08ad3719da522985f928dab",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 58,
"avg_line_length": 35.26315789473684,
"alnum_prop": 0.6044776119402985,
"repo_name": "laserson/eggo",
"id": "1e28e7c4486f2cc8497fa886e0a360651ef59f5e",
"size": "1443",
... |
"""Line-like geometrical entities.
Contains
========
LinearEntity3D
Line3D
Ray3D
Segment3D
"""
from __future__ import print_function, division
from sympy.core import S, C, Dummy, nan
from sympy.simplify.simplify import simplify
from sympy.solvers import solve
from sympy.geometry.exceptions import GeometryError
from ... | {
"content_hash": "d2b8cbb76055f2a1554b837a91633c8e",
"timestamp": "",
"source": "github",
"line_count": 1474,
"max_line_length": 84,
"avg_line_length": 27.6763907734057,
"alnum_prop": 0.4894472361809045,
"repo_name": "AunShiLord/sympy",
"id": "fad862cde3195771bdb004afc862a01e2e10391d",
"size": "407... |
details = {'email': 'jiding7@gmail.com', 'password': '', 'recipient': 'dingji97@outlook.com'}
| {
"content_hash": "f95a7e06bda8d5298dd9d318abf48815",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 93,
"avg_line_length": 94,
"alnum_prop": 0.6595744680851063,
"repo_name": "fomhko/courseHunter",
"id": "a9318930de56884c77a230eb60e9539d0ce73ba3",
"size": "94",
"binary": ... |
import os
import sys
from contextlib import contextmanager
from copy import deepcopy
from typing import Any, Dict, List, Optional
from absl import logging
from blessings import Terminal
from googleapiclient import discovery
from sqlalchemy import create_engine
from sqlalchemy.engine.base import Engine
from sqlalchemy.... | {
"content_hash": "fa568b8967c0181c97666bd5ff7774dc",
"timestamp": "",
"source": "github",
"line_count": 541,
"max_line_length": 98,
"avg_line_length": 28.752310536044362,
"alnum_prop": 0.6124718739954998,
"repo_name": "google/caliban",
"id": "f414d192bd1ce8575abe95445c5560b5ca9ed20a",
"size": "1615... |
import os.path
import time
from cmsplugin_feed.processors import FEED_PROCESSORS
def test_image_hrefs(parsed_feed):
assert len(parsed_feed) != 0
entries = parsed_feed.get("entries")
for en in entries:
# it can be unicode
if "image" in en:
assert isinstance(en.get("image"), bas... | {
"content_hash": "0ba845301d0207664511af0fbc25b94e",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 80,
"avg_line_length": 30.023809523809526,
"alnum_prop": 0.5313243457573354,
"repo_name": "pbs/cmsplugin-feed",
"id": "2f7e78f336bf192a69057696fce35bda0384974a",
"size": "2... |
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
from quantum.db.models_v2 import model_base
from quantum.db import model_base
from quantum.db.model_base import BASEV2
class RuijieVlanAllocation(model_base.BASEV2):
"""Represents allocation state of vlan_id on physical network"""
__tablenam... | {
"content_hash": "cb4834871adb1f659a50ca989f418db5",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 99,
"avg_line_length": 38.06206896551724,
"alnum_prop": 0.5915926798333031,
"repo_name": "ruijie/quantum",
"id": "ba5ea6336b45e920affd4857ebf346e20423b6e9",
"size": "6247"... |
from __future__ import annotations
import logging
from dataclasses import dataclass
from typing import Iterable
from pants.backend.helm.resolve import artifacts
from pants.backend.helm.resolve.artifacts import ThirdPartyHelmArtifactMapping
from pants.backend.helm.subsystems.helm import HelmSubsystem
from pants.backen... | {
"content_hash": "d8442f6b2ab5e560f884fe5788961800",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 98,
"avg_line_length": 36.03636363636364,
"alnum_prop": 0.7208207198116381,
"repo_name": "pantsbuild/pants",
"id": "bf5de0b32bb448a7e04c7464a7f41982d4554c62",
"size": "607... |
from __future__ import division
import sys
import pandas as pd
import numpy as np
from numpy import sin, cos, tan, log, log10, pi, average, sqrt, std, deg2rad, rad2deg, linspace, asarray
from numpy.random import random, randint, normal, shuffle
import itertools
import os
import statsmodels.api as sm
import matplotlib.... | {
"content_hash": "5f44f77020926f9287892ebbc836b968",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 154,
"avg_line_length": 39.671875,
"alnum_prop": 0.6301693580149665,
"repo_name": "pbeukema/rsaRemap",
"id": "144973b79edb395f059b0afd6c83f0e8d711e28c",
"size": "12695",
... |
from .action import *
from .combat import *
from .control import *
from .entity import *
from .movement import *
from .skill import *
| {
"content_hash": "9b0d474c365d89d0d2bb3ba2a6e3a324",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 23,
"avg_line_length": 19.285714285714285,
"alnum_prop": 0.725925925925926,
"repo_name": "Kromey/roglick",
"id": "4e613b7d9241018dce27a4b30eb80c9ed88ef3ea",
"size": "135",
... |
import jsonschema
from rally.env import env_mgr
from rally.env import platform
from tests.unit import test
class PlatformBaseTestCase(test.TestCase):
def _check_schema(self, schema, obj):
jsonschema.validate(obj, schema)
def _check_health_schema(self, obj):
self._check_schema(env_mgr.EnvMa... | {
"content_hash": "ef89bacb15e4d5464ee3737fe7fba2ca",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 79,
"avg_line_length": 33.625,
"alnum_prop": 0.677819083023544,
"repo_name": "openstack/rally",
"id": "0ca99a0bf7bb1f64bbde68cc1943762944ef3dd2",
"size": "2212",
"binary"... |
from pkgutil import walk_packages
import os
import os.path
def global_import(name):
p = __import__(name, globals(), locals(), level=1)
lst = p.__all__ if '__all__' in dir(p) else dir(p)
for k in lst:
globals()[k] = p.__dict__[k]
for _, module_name, _ in walk_packages(
[os.path.dirname(__fi... | {
"content_hash": "e25135528dec07fed3896fc847b7806b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 54,
"avg_line_length": 27,
"alnum_prop": 0.5876543209876544,
"repo_name": "czhu95/ternarynet",
"id": "b5895a7d0fcee47cdd5cf85019a57f3a083c1b52",
"size": "493",
"binary": ... |
from glob import glob
from pathlib import Path
from pluginsmanager.observer.autosaver.persistence import Persistence
from pluginsmanager.util.persistence_decoder import PersistenceDecoder
class BanksFiles(object):
def __init__(self, data_path):
"""
:param Path data_path: Path that contains the b... | {
"content_hash": "77fce67509734cbf28eb211148b92ad5",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 91,
"avg_line_length": 28.328767123287673,
"alnum_prop": 0.5957446808510638,
"repo_name": "PedalPi/PluginsManager",
"id": "58745e7281b31c86920af2d3366f782243c36b92",
"size"... |
"""`LinearOperator` that wraps a [batch] matrix."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.linalg.python.ops import linear_operator
from tensorflow.contrib.linalg.python.ops import linear_operator_util
from tensorflow.python... | {
"content_hash": "4a3b2bf808c9cd90cde691026789d00d",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 80,
"avg_line_length": 35.5945945945946,
"alnum_prop": 0.6522399392558846,
"repo_name": "LUTAN/tensorflow",
"id": "64ab561457789776003ce56038c47ca32dacffdd",
"size": "7274... |
""" This provides some useful code used by other modules. This is not to be
used by the end user which is why it is hidden. """
import string, sys
class LinkError(Exception):
pass
def refine_import_err(mod_name, extension_name, exc):
""" Checks to see if the ImportError was because the library
itself was... | {
"content_hash": "a2cf4a623bfb517d59b0f5c1b3b0bca6",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 76,
"avg_line_length": 29.727272727272727,
"alnum_prop": 0.6636085626911316,
"repo_name": "Wuteyan/VTK",
"id": "7529c2f4906487813e8d22cce8a86189b760306d",
"size": "981",
... |
"""Provides Qt3DCore classes and functions."""
# Local imports
from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError
if PYQT5:
from PyQt5.Qt3DCore import *
elif PYQT6:
from PyQt6.Qt3DCore import *
elif PYSIDE6:
from PySide6.Qt3DCore.Qt3DCore import *
elif PYSIDE2:
# https://bugreports.qt.io/proj... | {
"content_hash": "5852b6eb7e2ef01a71cbdfffce2a16ca",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 65,
"avg_line_length": 29.842105263157894,
"alnum_prop": 0.7072310405643739,
"repo_name": "davvid/qtpy",
"id": "57f1ef1c65f68a2d993c1aa141f8775611668d21",
"size": "856",
... |
"""Unified in-memory receipt model."""
from oslo_log import log
from oslo_serialization import msgpackutils
from oslo_utils import reflection
from keystone.auth import core
from keystone.common import cache
from keystone.common import provider_api
from keystone import exception
from keystone.identity.backends import ... | {
"content_hash": "87b6292a0608c7f5fcd670d91c05bc58",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 79,
"avg_line_length": 31.54014598540146,
"alnum_prop": 0.6068039805600556,
"repo_name": "openstack/keystone",
"id": "bb015b17271ed8792afe8e9945f09dad26560d2b",
"size": "4... |
from __future__ import absolute_import
import numpy as np
import os
import PIL.Image
import PIL.ImageDraw
import digits
from digits.utils import subclass, override
from .forms import ConfigForm
from ..interface import VisualizationInterface
CONFIG_TEMPLATE = "config_template.html"
VIEW_TEMPLATE = "view_template.html... | {
"content_hash": "dc09519912454636ea3011055dee83d6",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 91,
"avg_line_length": 32.883720930232556,
"alnum_prop": 0.5874587458745875,
"repo_name": "jmancewicz/DIGITS",
"id": "32de6aab77459c7f98a6e887e1be3a4b1b830303",
"size": "4... |
"""Provides a common base for Apache proxies"""
import os
import shutil
import subprocess
import mock
import zope.interface
from certbot import configuration
from certbot import errors as le_errors
from certbot_apache import configurator
from certbot_apache import constants
from certbot_compatibility_test import erro... | {
"content_hash": "bfc58e68623187ea77f81fe735c67542",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 83,
"avg_line_length": 36.37614678899082,
"alnum_prop": 0.6189155107187894,
"repo_name": "jtl999/certbot",
"id": "64170ca728a02c38f184996acfae0bd0babf9f97",
"size": "3965"... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("ipn", "0001_initial"),
]
operations = [
migrations.AddField(
model_name="paypalipn",
name="mp_id",
field=models.CharField(max_length=128, null=True, blan... | {
"content_hash": "9639739c1efc5986eba2653a0e2139fc",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 74,
"avg_line_length": 22.41176470588235,
"alnum_prop": 0.5643044619422573,
"repo_name": "spookylukey/django-paypal",
"id": "b3a54dd752c480a93400fda956f39dba7f8b772c",
"siz... |
from OpenGL.GL import *
from OpenGL.GLU import *
import pygame
import os.path
class Material(object):
def __init__(self):
self.name = ""
self.texture_fname = None
self.texture_id = None
class FaceGroup(object):
def __init__(self):
self.tri_indices = []
self.materi... | {
"content_hash": "41dc91465518123cb1d9ab7d6ab49be3",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 97,
"avg_line_length": 28.925925925925927,
"alnum_prop": 0.4947869032376075,
"repo_name": "PythonProgramming/Beginning-Game-Development-with-Python-and-Pygame",
"id": "096b9... |
"""
Volume driver for NetApp NFS storage.
"""
import os
from oslo_log import log as logging
import six
from cinder import exception
from cinder.i18n import _
from cinder import interface
from cinder import utils
from cinder.volume.drivers.netapp.dataontap.client import client_7mode
from cinder.volume.drivers.netapp.... | {
"content_hash": "544dbeb263a879b4dcb2d81a15f99e87",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 79,
"avg_line_length": 40.99591836734694,
"alnum_prop": 0.6012544802867383,
"repo_name": "NetApp/cinder",
"id": "15a74483027d2fa2250d662163f539eda4a5f1ed",
"size": "11019"... |
"""poster module
Support for streaming HTTP uploads, and multipart/form-data encoding
```poster.version``` is a 3-tuple of integers representing the version number.
New releases of poster will always have a version number that compares greater
than an older version of poster.
New in version 0.6."""
import vistrails.c... | {
"content_hash": "ce589480eac2efd6ffb747ae9232cc81",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 78,
"avg_line_length": 36.5,
"alnum_prop": 0.7831050228310502,
"repo_name": "celiafish/VisTrails",
"id": "bd04291ed4ed97ca53f7483ddf0c5436b24cf8fc",
"size": "3413",
"bina... |
import pytest
from six.moves import reload_module
# HACK: if the plugin is imported before the coverage plugin then all
# the top-level code will be omitted from coverage, so force it to be
# reloaded within this unit test under coverage
import pytest_fixture_config
reload_module(pytest_fixture_config)
from pytest_fi... | {
"content_hash": "fd2ea3da6048ab437cdf1bbfc1879866",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 80,
"avg_line_length": 24.33823529411765,
"alnum_prop": 0.6888217522658611,
"repo_name": "manahl/pytest-plugins",
"id": "4008bf401e89db5989479de80cae7131412fec79",
"size": ... |
from __future__ import absolute_import
from mercurial.pycompat import getattr
from mercurial import (
context as hgcontext,
dagop,
extensions,
hgweb,
patch,
util,
)
from . import (
context,
revmap,
)
class _lazyfctx(object):
"""delegates to fctx but do not construct fctx when unn... | {
"content_hash": "1df2c36cdd765da28063cc4ac585c939",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 80,
"avg_line_length": 30.153846153846153,
"alnum_prop": 0.6380102040816327,
"repo_name": "Maccimo/intellij-community",
"id": "5844c5d48d4db6126f941df2f6ded695b7a0bbd2",
"... |
import requests
import os
from hautomation_restclient import RestApiException
from simplejson import JSONDecodeError
DEVICE_URL = "rest/manage/device/"
DEVICE_BY_PROTOCOL_URL = "rest/manage/device?protocol={protocol}"
DEVICE_BY_ID_URL = "rest/manage/device/{protocol}/{did}"
PROTOCOL_URL = "rest/manage/protocol/"
de... | {
"content_hash": "6c4299b024c1b6c059adbd04d7a1bab1",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 116,
"avg_line_length": 35.82608695652174,
"alnum_prop": 0.6474514563106796,
"repo_name": "jpardobl/hautomation_restclient",
"id": "6049e2e14274489fbc60969d764e3a477ff60dc1",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.