text stringlengths 4 1.02M | meta dict |
|---|---|
import webob
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.consoleauth import rpcapi as consoleauth_rpcapi
from nova.openstack.common.gettextutils import _
authorize = extensions.extension_authorizer('compute', 'console_auth_tokens')
class ConsoleAuthTokensController(wsgi.... | {
"content_hash": "c1fc5a87682c902739871f90bb996631",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 79,
"avg_line_length": 37.9622641509434,
"alnum_prop": 0.6232604373757455,
"repo_name": "ycl2045/nova-master",
"id": "c6aa9e07a5c22e7cbbbc836cc1a9825437679137",
"size": "26... |
import io
import json
import os
import unittest
from . import episodeofcare
from .fhirdate import FHIRDate
class EpisodeOfCareTests(unittest.TestCase):
def instantiate_from(self, filename):
datadir = os.environ.get('FHIR_UNITTEST_DATADIR') or ''
with io.open(os.path.join(datadir, filename), 'r', ... | {
"content_hash": "f0d38088021500abe6e69fb88e122ad1",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 104,
"avg_line_length": 57.08196721311475,
"alnum_prop": 0.6875358989086732,
"repo_name": "all-of-us/raw-data-repository",
"id": "f5b6f7449fb011de0ca2d45281b55fc6adbc58e9",
... |
"""
Performs exponentiation, similarly to the built-in pow() or ** functions.
Allows also for calculating the exponentiation modulo.
"""
def power(a: int, n: int, mod: int = None):
"""
Iterative version of binary exponentiation
Calculate a ^ n
if mod is specified, return the result modulo mod
Time... | {
"content_hash": "ba4f7696c12d18872893a07b435e26dd",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 73,
"avg_line_length": 21.791666666666668,
"alnum_prop": 0.5210325047801148,
"repo_name": "keon/algorithms",
"id": "70d8587de4af16ef89b050ae12048a73d743ea26",
"size": "1046... |
from a10sdk.common.A10BaseClass import A10BaseClass
class PriorityList(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param priority: {"description": "Set priority for Designated Router election (Priority value)", "format": "number", "default": 64, "maximum": 127, "min... | {
"content_hash": "3efc73ca6ba574adc91300cb9a397acb",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 554,
"avg_line_length": 50.73134328358209,
"alnum_prop": 0.6176816710797294,
"repo_name": "amwelch/a10sdk-python",
"id": "d566db871c72c046e468b50e3fd9ca34875ae1fd",
"size"... |
import pymc
import testmodel
import matplotlib.pyplot as plt
#load the testmodel
R = pymc.MCMC(testmodel, db='pickle', dbname='test.pickle')
# populate and run it
R.sample(iter=100000, burn=10000, thin=2)
print 'a:', R.a.stats()
print 'b:', R.b.stats()
print 'c:', R.c.stats()
print 'd:', R.d.stats()
#generate plots
... | {
"content_hash": "653e481704f48c4f0b2791f7fea358a6",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 97,
"avg_line_length": 27.16216216216216,
"alnum_prop": 0.6288557213930348,
"repo_name": "sniemi/SamPy",
"id": "bb06bc0fce57b41bb2790f7ee9861e43cec8b434",
"size": "1005",
... |
import re
from models import Package
from models import ModulePackageState
from constants import PackageState
from base import BaseSoftwarePackageParser, BaseInventoryParser
from models import get_db_session_logger
class EXRSoftwarePackageParser(BaseSoftwarePackageParser):
def set_host_packages_from_cli(self, c... | {
"content_hash": "46ecc7d0a0f6c9742711ee34d174bad4",
"timestamp": "",
"source": "github",
"line_count": 369,
"max_line_length": 119,
"avg_line_length": 39.6260162601626,
"alnum_prop": 0.5549856380796061,
"repo_name": "smjurcak/csm",
"id": "fd3049b2ff9e3d961eb90c30050723788a9b8e9d",
"size": "16113",... |
import numpy as np
import os
from pathlib import Path
import unittest
import ray
import ray.rllib.agents.marwil as marwil
from ray.rllib.evaluation.postprocessing import compute_advantages
from ray.rllib.offline import JsonReader
from ray.rllib.utils.framework import try_import_tf, try_import_torch
from ray.rllib.util... | {
"content_hash": "73d7adb56b6acc3b1539188de10c2ef2",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 79,
"avg_line_length": 42.48039215686274,
"alnum_prop": 0.5551580890837757,
"repo_name": "pcmoritz/ray-1",
"id": "29c6b678ecf2ce27cae113654acd2a8fdfdc851a",
"size": "8666"... |
__author__ = 'mr.S'
from bottle import request, FileUpload
from PIL import Image
import os
def is_ajax():
return True if request.headers.get('X-Requested-With') == 'XMLHttpRequest' else False
def image_thumbnail(image, width, height, position=('center', 'center'), fill='contain'):
try:
if ... | {
"content_hash": "da5f426598475fb57d56ad82fb839aaf",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 89,
"avg_line_length": 32.17894736842105,
"alnum_prop": 0.5086686293752044,
"repo_name": "s-tar/project_kate",
"id": "562a42ae0a2a52e003b90ebf360c2cd228e488b6",
"size": "31... |
print "Test message one"
print "Test message two"
print "Test message three" | {
"content_hash": "8b6b0b238385e67d20a5b0fe137d49e8",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 26,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.7763157894736842,
"repo_name": "priyam3nidhi/pnSeattle",
"id": "8557503b1c600cb567016a8991d52b114177be32",
"size":... |
import wx
import armid
import WidgetFactory
from Borg import Borg
class CharacteristicReferenceTypeDialog(wx.Dialog):
def __init__(self,parent,ciName,elName,currentValue):
wx.Dialog.__init__(self,parent,armid.CHARACTERISTICREFERENCETYPE_ID,'Edit Characteristic Reference Type',style=wx.DEFAULT_DIALOG_STYLE|wx.MAX... | {
"content_hash": "c3dd798f0c1d608820f5a0d919ab9557",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 202,
"avg_line_length": 51.83582089552239,
"alnum_prop": 0.7771379211056724,
"repo_name": "RobinQuetin/CAIRIS-web",
"id": "90b42d9a31aad00bb114c830240e32cad2069af0",
"size"... |
import os
import shutil
import sys
import tempfile
import unittest
from array import array
from pyspark.testing.utils import ReusedPySparkTestCase, SPARK_HOME
class InputFormatTests(ReusedPySparkTestCase):
@classmethod
def setUpClass(cls):
ReusedPySparkTestCase.setUpClass()
cls.tempdir = tem... | {
"content_hash": "38aa4e7f1f10e30ee54f5fa0650cc09e",
"timestamp": "",
"source": "github",
"line_count": 483,
"max_line_length": 100,
"avg_line_length": 48.107660455486545,
"alnum_prop": 0.5710535376140472,
"repo_name": "actuaryzhang/spark",
"id": "734b7e4789f614d4ec4daa935168d8541d098428",
"size": ... |
from kivy.graphics import Color, Line
from kivy.properties import NumericProperty, ListProperty
from kivy.uix.widget import Widget
class SquareGrid(Widget):
cols = NumericProperty(16)
rows = NumericProperty(9)
cell = ListProperty([0, 0])
line_width = NumericProperty(1)
line_color = ListProperty([... | {
"content_hash": "7bff9b02d3a7c2211a7ffaf429571fb9",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 80,
"avg_line_length": 32.93617021276596,
"alnum_prop": 0.5361757105943152,
"repo_name": "victor-rene/kivy-gamelib",
"id": "f36befd6669838a5aa8c5ec8f09ada8e2695f453",
"size... |
from bisect import bisect_left
from couchdb import Server
from datetime import datetime
class Metric(dict):
def __init__(self, timestamp, host="ALL", metrics={}):
self.timestamp = timestamp
self.host = host
self.metrics = metrics
super(Metric, self).__init__(metrics)
class Crafts... | {
"content_hash": "8a68243861f0c9f3812a31abea7c8e6d",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 78,
"avg_line_length": 30.22340425531915,
"alnum_prop": 0.5255191833861317,
"repo_name": "crafts/crafts-core",
"id": "ba463e687e9392b14909e3ba8568d8d67bf19e13",
"size": "28... |
"""
Basic functionality to aid in the definition of in-memory test doubles.
"""
import os
from weakref import WeakKeyDictionary
import attr
import txaws.credentials
class ControllerState(object):
def __get__(self, oself, type):
return oself._controller.get_state(oself.creds)
@attr.s
class MemoryClie... | {
"content_hash": "99b977d4edf333114cf2697508af8289",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 78,
"avg_line_length": 28.155844155844157,
"alnum_prop": 0.6452952029520295,
"repo_name": "oubiwann/txaws",
"id": "2f73b22aa1f0c6bd54c060c9e387d46a310d4f42",
"size": "2247"... |
from google.cloud import aiplatform_v1beta1
async def sample_delete_specialist_pool():
# Create a client
client = aiplatform_v1beta1.SpecialistPoolServiceAsyncClient()
# Initialize request argument(s)
request = aiplatform_v1beta1.DeleteSpecialistPoolRequest(
name="name_value",
)
# Ma... | {
"content_hash": "0da11c65e437abf65003f8699dc3c729",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 85,
"avg_line_length": 27.130434782608695,
"alnum_prop": 0.7371794871794872,
"repo_name": "googleapis/python-aiplatform",
"id": "7d0343f8360721eb889a09f0cefc582b5c4b2f72",
... |
"""ThreadSafeSingleton provider async mode tests."""
import asyncio
from dependency_injector import providers
from pytest import mark
@mark.asyncio
async def test_async_mode():
instance = object()
async def create_instance():
return instance
provider = providers.ThreadSafeSingleton(create_inst... | {
"content_hash": "b8a9b17834ccf319b2f25859b95902b4",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 83,
"avg_line_length": 22.44736842105263,
"alnum_prop": 0.7291910902696366,
"repo_name": "ets-labs/dependency_injector",
"id": "13654150e8c3ae915f54e777972e2db64282ace0",
"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0011_auto_20161005_1253'),
]
operations = [
migrations.AddField(
model_name='entry',
name='author',
fiel... | {
"content_hash": "aaf9373512ac15f20d77adaee360a53e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 73,
"avg_line_length": 21.944444444444443,
"alnum_prop": 0.5924050632911393,
"repo_name": "bane138/nonhumanuser",
"id": "4e1502a271b4f809f0c15a5e57b0e5989652e352",
"size": ... |
from supriya.system.SupriyaObject import SupriyaObject
class OscCallback(SupriyaObject):
"""
An OSC callback.
::
>>> import supriya.osc
>>> callback = supriya.osc.OscCallback(
... address_pattern='/*',
... procedure=lambda x: print('GOT:', x),
... )
... | {
"content_hash": "f0581114f0256f9882052aeeb2d1ae85",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 88,
"avg_line_length": 23.182795698924732,
"alnum_prop": 0.5139146567717996,
"repo_name": "Pulgama/supriya",
"id": "f7e28cb379dbd8ef9f762083914892978af4a43f",
"size": "2156... |
"""The tests the for Traccar device tracker platform."""
from unittest.mock import patch
import pytest
from homeassistant import data_entry_flow
from homeassistant.components import traccar, zone
from homeassistant.components.device_tracker import DOMAIN as DEVICE_TRACKER_DOMAIN
from homeassistant.components.traccar ... | {
"content_hash": "21c026b9235831bd82e9fa4fe91f1d8a",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 87,
"avg_line_length": 32.34552845528455,
"alnum_prop": 0.6404423777805706,
"repo_name": "turbokongen/home-assistant",
"id": "c7e031b2ca6f18865dc951e6618c1b58e2ee277d",
"s... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../sphinxext'))
# -- General... | {
"content_hash": "c9775693874ce73ce275095fb3512b0e",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 130,
"avg_line_length": 34.632716049382715,
"alnum_prop": 0.6942340254879245,
"repo_name": "bert9bert/statsmodels",
"id": "2b155e9d5deff952aa21cb86c07d095aa5f2da44",
"size... |
"""OAuth 2.0 utilities for Django.
Utilities for using OAuth 2.0 in conjunction with
the Django datastore.
"""
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
import oauth2client
import base64
import pickle
from django.db import models
from oauth2client.client import Storage as BaseStorage
class CredentialsFie... | {
"content_hash": "e629d00c3f06e8775c3f7f2d57cc9a51",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 80,
"avg_line_length": 26.18,
"alnum_prop": 0.6963330786860199,
"repo_name": "jjinux/party-playlist-picker",
"id": "c818ea244f620c10096abe7377de648c1919e022",
"size": "319... |
import os
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
ADMINS = (
('DnDtools', 'dndtools.eu@gmail.com'),
)
MANAGERS = ADMINS
TIME_ZONE = 'Europe/Prague'
LANGUAGE_CODE = 'en-us'
MEDIA_URL = '/media/'
STATIC_URL = '/static/'
USE_I18N = Fa... | {
"content_hash": "16d32cc00cb286aac78a1e204510893c",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 67,
"avg_line_length": 25.710526315789473,
"alnum_prop": 0.7195496417604913,
"repo_name": "FreezyExp/dndtools",
"id": "34dd6dbcfce18a21961470f1c9e0d506455a66dd",
"size": "1... |
"""
Bootstrapper for test framework plugins.
The entire rationale for this system is to get the modules in plugin/
imported without importing all of the supporting library, so that we can
set up things for testing before coverage starts.
The rationale for all of plugin/ being *in* the supporting library in the
first ... | {
"content_hash": "bcd29916a795ed00021f9b7cf836f6fb",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 74,
"avg_line_length": 32.62222222222222,
"alnum_prop": 0.7377384196185286,
"repo_name": "kawamon/hue",
"id": "a95c947e2002842d88385e2482d17e805829e64a",
"size": "1468",
... |
import argparse
from six.moves import configparser, StringIO
import logging
import os
import platform
import sys
import yaml
import jenkins_jobs.version
from jenkins_jobs.builder import Builder
from jenkins_jobs.errors import JenkinsJobsException
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
D... | {
"content_hash": "28bf747ac1ecb47a274cc04a7ac36866",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 79,
"avg_line_length": 36.91269841269841,
"alnum_prop": 0.5949258224037841,
"repo_name": "waynr/jenkins-job-builder",
"id": "498066d2b920559df2db59d6ca9febf28a20adcb",
"si... |
from django.conf.urls import url, include, handler404, handler500
from django.contrib import admin
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseServerError
admin.autodiscover()
handler404 = 'allaccess.tests.urls.test_404'
handler500 = 'allaccess.tests.urls.test_500'
def error(request):
... | {
"content_hash": "2a8d27dc7c9092049091f312e394a7af",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 83,
"avg_line_length": 21,
"alnum_prop": 0.7130325814536341,
"repo_name": "dpoirier/django-all-access",
"id": "6cff8dd4405d42392b4e0d91fab3e1bcd426a174",
"size": "798",
"... |
from django.db import models
from django.test import TestCase
# use immediate_update on tests
from django.conf import settings
settings.SEARCH_BACKEND = 'search.backends.immediate_update'
from search import register
from search.core import SearchManager, startswith
# ExtraData is used for ForeignKey tests
class Ext... | {
"content_hash": "bdda3857105282b99d3b9eaf78c5987e",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 89,
"avg_line_length": 36.99029126213592,
"alnum_prop": 0.6456692913385826,
"repo_name": "redebian/documentation",
"id": "58842f74aa83fdded6fb96496214e28642dffd83",
"size"... |
from msrest.paging import Paged
class ApplicationInsightsComponentPaged(Paged):
"""
A paging container for iterating over a list of :class:`ApplicationInsightsComponent <azure.mgmt.applicationinsights.models.ApplicationInsightsComponent>` object
"""
_attribute_map = {
'next_link': {'key': 'ne... | {
"content_hash": "0e71c132e77703573d8a3e7e46e7c213",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 165,
"avg_line_length": 34.875,
"alnum_prop": 0.6738351254480287,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "7283609bd08a014231122bff93fac8aff362a1e6",
"size": ... |
import warnings
from factory import base
from factory import declarations
from factory import enums
from factory import errors
from .compat import unittest
class TestObject(object):
def __init__(self, one=None, two=None, three=None, four=None):
self.one = one
self.two = two
self.three = t... | {
"content_hash": "22d7a8935f3f47e95a20cf090a8b2763",
"timestamp": "",
"source": "github",
"line_count": 539,
"max_line_length": 88,
"avg_line_length": 30.508348794063078,
"alnum_prop": 0.6237533446849914,
"repo_name": "rrauenza/factory_boy",
"id": "5e5c27b47a1e6e19658c2c9a16abdc41a6cb1cf9",
"size":... |
import os
import unittest
import random
from test import support
import _thread as thread
import time
import weakref
from test import lock_tests
NUMTASKS = 10
NUMTRIPS = 3
POLL_SLEEP = 0.010 # seconds = 10 ms
_print_mutex = thread.allocate_lock()
def verbose_print(arg):
"""Helper function for printing out debug... | {
"content_hash": "fb0b872251a892d891f4ad5c138d28c4",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 83,
"avg_line_length": 32.357142857142854,
"alnum_prop": 0.5500174276751482,
"repo_name": "batermj/algorithm-challenger",
"id": "9f4801f47e3aaa456c87a713d71e8021dd7932e4",
... |
"""
Copyright 2022 Google LLC
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | {
"content_hash": "1e011a29e18e26ed4c0eb122ec19733a",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 72,
"avg_line_length": 31.38095238095238,
"alnum_prop": 0.7298937784522003,
"repo_name": "GoogleCloudPlatform/document-intake-accelerator",
"id": "b08dad08e0b4b57679d5b565268... |
from dbaas_zabbix import database_providers
class ProviderFactory(object):
@classmethod
def get_provider_class(cls, driver_name, is_ha,):
for klass in available_providers():
name_eq_klass = driver_name == klass.__provider_name__
is_ha_eq_klass = is_ha == klass.__is_ha__
... | {
"content_hash": "f659507bc4628c7f9ba025a2203af820",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 67,
"avg_line_length": 32.351351351351354,
"alnum_prop": 0.6090225563909775,
"repo_name": "globocom/dbaas-zabbix",
"id": "381f0cfa445492595a32c94a547c9adaf575d505",
"size":... |
import os
import subprocess
class AbstractBrowser:
_binary = None
def __init__(self, url, user_data_dir):
self.user_data_dir = os.path.join(user_data_dir, self._binary)
self.url = url
if not os.path.exists(self.user_data_dir):
os.makedirs(self.user_data_dir)
@stati... | {
"content_hash": "92815df3ee29a85b04eb102adb175290",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 70,
"avg_line_length": 21.763636363636362,
"alnum_prop": 0.5693400167084378,
"repo_name": "wendlers/edubot-snap",
"id": "79094b1325f9f2bc6884b041da0987bd432b2b90",
"size":... |
"""
Finds gaps between consecutive protein residues in the PDB.
Detects gaps both by a distance criterion or discontinuous residue numbering.
Only applies to protein residues.
Usage:
python pdb_gap.py <pdb file>
Example:
python pdb_gap.py 1CTF.pdb
This program is part of the `pdb-tools` suite of utilities a... | {
"content_hash": "a4a983a06407f9970ae76d0df41d66cb",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 79,
"avg_line_length": 27.154411764705884,
"alnum_prop": 0.5410235580828595,
"repo_name": "haddocking/pdb-tools",
"id": "55db6332fa7373ede9ef86f6f08ab0466f415cbf",
"size":... |
import requests
import base64
def strip_username(repo):
return repo['full_name'].split('/')[1]
def repo_pretty_info(repo):
return strip_username(repo).ljust(32) + \
"[last commit on {:s}]".format(repo['pushed_at'])
def list_repos(user, verbose=True):
"""This function will return a list o... | {
"content_hash": "8e0316631fa029cba0a84928a5d4669e",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 79,
"avg_line_length": 28.70689655172414,
"alnum_prop": 0.6156156156156156,
"repo_name": "PedroMDuarte/pmd-github-profile",
"id": "3c097618e5369bd017f685461e6de32b81256131",
... |
from zerver.lib.actions import do_create_user, do_mark_hotspot_as_read
from zerver.lib.hotspots import ALL_HOTSPOTS, INTRO_HOTSPOTS, get_next_hotspots
from zerver.lib.test_classes import ZulipTestCase
from zerver.models import UserHotspot, UserProfile, get_realm
# Splitting this out, since I imagine this will eventua... | {
"content_hash": "0ea05384f113d193cde1eeb25df6c9a9",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 90,
"avg_line_length": 43.130434782608695,
"alnum_prop": 0.6502016129032258,
"repo_name": "punchagan/zulip",
"id": "0927a54da7b697c75dd598ceca0ed6d3beaabdf0",
"size": "2976... |
import wx
import ImageTransferNotebook as imageNotebook
import SettingsFrame as prefs
import WifiDialog as wifi
import packages.rmnetwork as network
from packages.lang.Localizer import *
import sys, os, shutil
if platform.system() == "Linux":
from wx.lib.pubsub import setupkwargs
from wx.lib.pubsub import pub a... | {
"content_hash": "e2f8db16c681e9de627da26f579c6d0b",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 161,
"avg_line_length": 39.11290322580645,
"alnum_prop": 0.6028865979381444,
"repo_name": "peter9teufel/raspmedia",
"id": "fac0da37664101ea742b488f6a83a69cc4f5d318",
"size... |
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.tests.arrays.masked_shared import (
ComparisonOps,
NumericOps,
)
class TestComparisonOps(NumericOps, ComparisonOps):
@pytest.mark.parametrize("other", [True, False, pd.NA, -1.0, 0.0, 1])
def test_scalar(self, other, comparison... | {
"content_hash": "bd4e67222d3e9a6eacca2a403f185aee",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 78,
"avg_line_length": 34.22222222222222,
"alnum_prop": 0.6396103896103896,
"repo_name": "jorisvandenbossche/pandas",
"id": "c4163c25ae74d36a11be97cc59a159c8498b1a15",
"siz... |
import unittest
import json
import requests
from mldb_py_runner.mldb_py_runner import MldbRunner
class MldbMergedDatasetTest(unittest.TestCase):
def setUp(self):
self.mldb = MldbRunner()
self.port = self.mldb.port
self.base_url = 'http://localhost:' + str(self.port) + '/v1'
def tearD... | {
"content_hash": "0c01b5e763b1402afff4270a595bc2b0",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 72,
"avg_line_length": 28.602739726027398,
"alnum_prop": 0.4803639846743295,
"repo_name": "mldbai/mldb",
"id": "dc51e4b27d4d6f6cf85696dbbb45d0a74ccea8f0",
"size": "2277",
... |
from http import client as http_client
from io import BytesIO
import json
import mimetypes
import os
import webob
import zipfile
from zipfile import ZipFile
from glance_store import exceptions as store_exceptions
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import encodeutils
from os... | {
"content_hash": "603e21479fab7f3f472e8bb145b4ec99",
"timestamp": "",
"source": "github",
"line_count": 658,
"max_line_length": 79,
"avg_line_length": 43.62917933130699,
"alnum_prop": 0.5717570015326738,
"repo_name": "stackforge/tacker",
"id": "eaf95e90bcc04a52bf7ff9d093b0c51dab0ad0a4",
"size": "29... |
import webbrowser
import os
import base64
import launcher_log
import pygtk
pygtk.require('2.0')
import gtk
gtk.gdk.threads_init()
try:
import pynotify
pynotify.init('OSS-FTP Notify')
except:
launcher_log.warn("import pynotify fail, please install python-notify if possiable.")
pynotify = None
import... | {
"content_hash": "784233a10005380dd97c2ee8b33eede1",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 147,
"avg_line_length": 27.0561797752809,
"alnum_prop": 0.592607973421927,
"repo_name": "johnkeepmoving/oss-ftp",
"id": "ecbd0a29b6b912257742f473c45b858b0b55f5ab",
"size": ... |
from __future__ import print_function
import argparse
import unittest
from biggraphite import metric as bg_metric
from biggraphite import settings as bg_settings
from biggraphite.cli import command_list
from tests import test_utils as bg_test_utils
class TestCommandList(bg_test_utils.TestCaseWithFakeAccessor):
... | {
"content_hash": "ecc96ca3f51b8682aeb7194a5215a1b5",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 84,
"avg_line_length": 31.275,
"alnum_prop": 0.6738609112709832,
"repo_name": "iksaif/biggraphite",
"id": "f5c49ce693d9f57fc039b7de5479b623fcd23c56",
"size": "1843",
"bin... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def StoragePlacementSpec(vim, *args, **kwargs):
'''StoragePlacementSpec encapsulates all o... | {
"content_hash": "8e6c50782fe5c6bab0f6b2fef1788f84",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 124,
"avg_line_length": 36.97142857142857,
"alnum_prop": 0.625193199381762,
"repo_name": "xuru/pyvisdk",
"id": "4bfa028530abc8ea8f957f7c5b30e9f56ba0fdb5",
"size": "1295",
... |
class RegionStub:
def end(self):
return 'dummy region end'
def empty(self):
return False
class EmptyRegionStub:
def __init__(self):
self.dummy_region_end = 'dummy region end'
def end(self):
return self.dummy_region_end
def empty(self):
return True
| {
"content_hash": "00c6326c34982cad63ba7d920d67b3e2",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 50,
"avg_line_length": 18.41176470588235,
"alnum_prop": 0.597444089456869,
"repo_name": "ldgit/hours-calculator",
"id": "ce7fa2c7491ad20795b2fe650fe37e00a4e12128",
"size": ... |
import copy
import sys
import os
import operator
import shlex
import warnings
import heapq
import bisect
import random
from subprocess import Popen, PIPE
from threading import Thread
from collections import defaultdict
from itertools import chain
from functools import reduce
from math import sqrt, log, isinf, isnan, po... | {
"content_hash": "40d6f6ff0fd56271ef4b19df575b2b42",
"timestamp": "",
"source": "github",
"line_count": 5469,
"max_line_length": 100,
"avg_line_length": 31.92887182300238,
"alnum_prop": 0.5409376986467681,
"repo_name": "shaneknapp/spark",
"id": "5f4f4d494e13c476b242d2e2307bf21a11dbd644",
"size": "1... |
"""Package that handles non-debug, non-file output for run-webkit-tests."""
import math
import optparse
from webkitpy.tool import grammar
from webkitpy.layout_tests.models import test_expectations
from webkitpy.layout_tests.models.test_expectations import TestExpectations, TestExpectationParser
from webkitpy.layout_t... | {
"content_hash": "b5101c5077336048f6c6fca1ffcc6c41",
"timestamp": "",
"source": "github",
"line_count": 405,
"max_line_length": 166,
"avg_line_length": 45.590123456790124,
"alnum_prop": 0.5998700173310225,
"repo_name": "lordmos/blink",
"id": "598f638a81f7e2502668e5ff30ebe4b20b2c3739",
"size": "2000... |
from inliner.transformers.BaseFunctionHandler import BaseFunctionHandler
import ast
class SimpleFunctionHandler(BaseFunctionHandler):
def inline(self, node, func_to_inline):
# Its a simple function we have here. That means it is one statement and we can simply replace the
# call with the inlined f... | {
"content_hash": "d0961a624ecfda32be18da201441efa9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 106,
"avg_line_length": 39.92307692307692,
"alnum_prop": 0.7148362235067437,
"repo_name": "orf/inliner",
"id": "38bdac91cc219562c29c1527c5cc9e47e150761a",
"size": "519",
... |
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gis.gdal.prototypes import ds as capi, geom as geom_api
fro... | {
"content_hash": "15ccdd6f0d2912774d9fef56e7942c58",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 84,
"avg_line_length": 34.417391304347824,
"alnum_prop": 0.6243052046488126,
"repo_name": "mattseymour/django",
"id": "47e8bb1ae31c9efc0e07e6cf3f534d328fe541c6",
"size": "... |
"""Module containing our file processor that tokenizes a file for checks."""
import contextlib
import io
import logging
import sys
import tokenize
import flake8
from flake8 import defaults
from flake8 import exceptions
from flake8 import utils
LOG = logging.getLogger(__name__)
PyCF_ONLY_AST = 1024
NEWLINE = frozenset... | {
"content_hash": "83e484136a65f1263a102f881d8c6dd1",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 78,
"avg_line_length": 34.87899543378995,
"alnum_prop": 0.5729528048700661,
"repo_name": "Aorjoa/aiyara-ceph-dash",
"id": "44024e5aeebe7d050b3fd20d60652674a44a2ff8",
"size... |
"""Central place for package metadata."""
from pkg_resources import DistributionNotFound, get_distribution
__name__ = "resolwe-runtime-utils"
__title__ = "Resolwe Runtime Utilities"
__summary__ = "Runtime utilities for Resolwe dataflow engine"
__url__ = "https://github.com/genialis/resolwe-runtime-utils"
__git_repo_u... | {
"content_hash": "b950c51eedaff4b29551535f772be3fe",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 64,
"avg_line_length": 29.428571428571427,
"alnum_prop": 0.6747572815533981,
"repo_name": "genialis/resolwe-runtime-utils",
"id": "67c72bb8067bd28eff32b9f8b5f78d4ce1706941",
... |
import asyncio
from unittest import mock
from zope.interface import implementer
from aiorm import registry
from aiorm.interfaces import IDriver
class DummyCursor:
last_query = None
last_parameters = None
# set many query results in those vars
return_many = [None,]
return_one = [None]
@asynci... | {
"content_hash": "6cc957c233d5030fac62fb04adf423b7",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 64,
"avg_line_length": 22.460526315789473,
"alnum_prop": 0.6438195664909198,
"repo_name": "mardiros/aiorm",
"id": "726803c213e7e94223a387055c524157855d2139",
"size": "1708"... |
"""
Use this module to contain static data. Static data is directly used by the
codebase and should never be changed without a commit, as opposed to data
stored in the database that can change at any moment and whose values are not
necessarily constant.
Note: DO NOT re-use enum values unless you know exactly what you ... | {
"content_hash": "94241a6d6bf040c5732ba4057c73acf2",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 77,
"avg_line_length": 24.38888888888889,
"alnum_prop": 0.7198177676537585,
"repo_name": "RuddockHouse/RuddockWebsite",
"id": "8435c3b98ab4d7a523104a862ca79f118b8e3c15",
"s... |
import ast
import math
import os.path
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import units
import six
from cinder import exception
from cinder.i18n import _, _LE, _LI, _LW
from cinder.objects import fields
from cinder.volume.drivers.emc import emc_vmax_fast
from cinder.volume.d... | {
"content_hash": "89f07aa8b5319dcf739a05c1bd0214c7",
"timestamp": "",
"source": "github",
"line_count": 4589,
"max_line_length": 79,
"avg_line_length": 44.219001961211596,
"alnum_prop": 0.5764410780550067,
"repo_name": "cloudbase/cinder",
"id": "df509ccab29c92b22453d626b866b6488992ab38",
"size": "2... |
import builtins
import functools
import importlib
import inspect
import os
import pprint
from subprocess import call
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.statemachine import ViewList
from jinja2 import Template
from sphinx.util.nodes import nested_parse_with_titles
from ... | {
"content_hash": "13890b29c48c7e688f9080c7cfca98bd",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 94,
"avg_line_length": 31.46113989637306,
"alnum_prop": 0.5802042160737813,
"repo_name": "tych0/qtile",
"id": "6c7cd359ccf349908338ae320ae62f876a84101b",
"size": "7160",
... |
import tempfile
import schema as s
import caliban.util.schema as us
import pytest
def test_directory(tmpdir):
# Proper directories pass validation.
assert us.Directory.validate(tmpdir) == tmpdir
# random dirs that I made up dont!
with pytest.raises(s.SchemaError):
assert us.Directory.validate('random')... | {
"content_hash": "008ed07847f8fc143c2b603ec2555198",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 49,
"avg_line_length": 23.48,
"alnum_prop": 0.7308347529812607,
"repo_name": "google/caliban",
"id": "af9bb5642108d600dd67621ce257a828608760b9",
"size": "1183",
"binary":... |
import argparse
import os
import tensorflow as tf
import tfmodel
import csv
parser = argparse.ArgumentParser()
parser.add_argument("--train_csv", type=str)
parser.add_argument("--test_csv", type=str)
parser.add_argument("--output_path", type=str, default="outputs")
parser.add_argument("--learning_rate", type=float, de... | {
"content_hash": "7dbe73a307ed0d804ab27fae7954b69e",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 104,
"avg_line_length": 34.7906976744186,
"alnum_prop": 0.6450534759358288,
"repo_name": "sfujiwara/tfmodel",
"id": "a3abd809ae2ea427259adfa23f765e5a6f77b55d",
"size": "301... |
"""
Important classes of Spark SQL and DataFrames:
- :class:`pyspark.sql.SQLContext`
Main entry point for :class:`DataFrame` and SQL functionality.
- :class:`pyspark.sql.DataFrame`
A distributed collection of data grouped into named columns.
- :class:`pyspark.sql.Column`
A column expressi... | {
"content_hash": "b797ccd866edab96e483122335ecc90d",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 100,
"avg_line_length": 37.41379310344828,
"alnum_prop": 0.6926267281105991,
"repo_name": "andrewor14/iolap",
"id": "ad9c891ba1c04963fc8d20ff167700bdb633c502",
"size": "295... |
import bisect
import functools
import imath
import six
import weakref
import IECore
import Gaffer
import GafferUI
from Qt import QtCore
from Qt import QtGui
from Qt import QtWidgets
from ._TableView import _TableView
## The MessageWidget class displays a list of messages using the IECore MessageHandler
# format. T... | {
"content_hash": "88e8af0db02c29aaacfcc107135ba06f",
"timestamp": "",
"source": "github",
"line_count": 1453,
"max_line_length": 152,
"avg_line_length": 32.68066070199587,
"alnum_prop": 0.718732231230915,
"repo_name": "boberfly/gaffer",
"id": "e08eb19ec00acb59091fe6fc7e9675d12581e536",
"size": "492... |
from setuptools import setup
VERSION = '0.26'
if __name__ == '__main__':
setup(
name='biofits',
packages=['biofits'],
version=VERSION,
description='Common biochemical data fitting functions',
author='Jim Rybarski',
author_email='jim@rybarski.com',
url='https... | {
"content_hash": "0a2b9db17ac80ab296f6fd3b9ba3b8f5",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 250,
"avg_line_length": 45.05882352941177,
"alnum_prop": 0.6331592689295039,
"repo_name": "jimrybarski/biofits",
"id": "7682c8525b29705e7b21b3346fe37abc1a27d168",
"size": "... |
import sys
import os
from setuptools import setup
import wb_scm_version
import py2app
min_py2app = [0, 11] # 0.11
py2app_version = [int(part) for part in py2app.__version__.split('.')]
if py2app_version < min_py2app:
raise ValueError( 'build requires at least version %d.%d of py2app' % tuple(min_py2app) )
v... | {
"content_hash": "54ba6bdac5163e9c8a85f30b84b5cff0",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 131,
"avg_line_length": 28.78846153846154,
"alnum_prop": 0.5170340681362725,
"repo_name": "barry-scott/scm-workbench",
"id": "dfa538ac4b8ef0f649bd0ddf6f9f025df41d7ddb",
"si... |
import hashlib
from webapp.web import BaseHandler
from model import dbapi
class RegisterHandler(BaseHandler):
def check_xsrf(self):
if self.check_xsrf_cookie() == False:
return False
return True
def get(self, error=""):
xsrf_token = self.xsrf_from_html()
params =... | {
"content_hash": "2664d4c7b3bd0b01d801a82c88b4aa9e",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 74,
"avg_line_length": 32.127272727272725,
"alnum_prop": 0.5070741369552915,
"repo_name": "vincentpc/yagra_for_wsgi",
"id": "79166b57a82592f23a7f8b94fd44aa0d57d17b17",
"siz... |
import copy
from datetime import datetime
from django.core.management.color import no_style
from django.core.management.sql import sql_create, sql_delete, sql_indexes
from django.db import connection, transaction, settings, models
from django.db.backends.util import truncate_name
from django.db.models.loading import c... | {
"content_hash": "63d9e2bc9e9580172ccb41ac46dd864f",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 109,
"avg_line_length": 37.35675675675676,
"alnum_prop": 0.59238894515989,
"repo_name": "broderboy/ai-stager",
"id": "6a6f1e0bc35763f5f52e7380605a9bc224829e06",
"size": "6... |
{
'name' : 'Netherlands - Accounting',
'version' : '2.0',
'category': 'Localization',
'description': """
This is the module to manage the accounting chart for Netherlands in Odoo.
=============================================================================
This module installs the a standard chart of a... | {
"content_hash": "74919aed75517bf93634acf2eaddad84",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 86,
"avg_line_length": 37.911764705882355,
"alnum_prop": 0.6051202482544609,
"repo_name": "vileopratama/vitech",
"id": "f04033aa86a2d7567b666c06a6e7ac759d5146ac",
"size": "... |
"""
Created on Thu Oct 5 07:43:59 2017
@author: ddboline
"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
import os
import json
from dateutil.parser import parse
import datetime
from threading import Condition
import argparse
from trakt import Trakt
from movie_collection_app.... | {
"content_hash": "6e45314120dfc0317f17b7fc5989e85b",
"timestamp": "",
"source": "github",
"line_count": 504,
"max_line_length": 99,
"avg_line_length": 37.96230158730159,
"alnum_prop": 0.5356713531594627,
"repo_name": "ddboline/movie_collection_app",
"id": "3f12b2d51c6fe6c57d39348cc5e9cad6e63c4180",
... |
"""Map of test units to improvement direction."""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from google.appengine.ext import ndb
from dashboard.models import anomaly
class UnitsToDirection(ndb.Model):
"""Data about improvement direction for one ty... | {
"content_hash": "ff08ffdb58107e1b3640cbc67a390e02",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 77,
"avg_line_length": 34.91379310344828,
"alnum_prop": 0.7239506172839506,
"repo_name": "endlessm/chromium-browser",
"id": "ac1c7e5def27876212ec64e4e29737815e3fedcd",
"siz... |
import os, os.path, unittest
from django.contrib.gis.gdal import DataSource, Envelope, OGRException, OGRIndexError
from django.contrib.gis.gdal.field import OFTReal, OFTInteger, OFTString
from django.contrib import gis
# Path for SHP files
data_path = os.path.join(os.path.dirname(gis.__file__), 'tests' + os.sep + 'dat... | {
"content_hash": "79a999d0085cc7f5f8e196aeee410bfa",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 171,
"avg_line_length": 44.63681592039801,
"alnum_prop": 0.5600757913508694,
"repo_name": "chirpradio/chirpradio-volunteers",
"id": "30ce4624758b5898c8ed5cf993a093c1b574b5c7... |
"""
line.client
~~~~~~~~~~~
LineClient for sending and receiving message from LINE server.
:copyright: (c) 2014 by Taehoon Kim.
:license: BSD, see LICENSE for more details.
"""
import re
import requests
import sys
from api import LineAPI
from models import LineGroup, LineContact, LineRoom, LineMe... | {
"content_hash": "6217ffa0bd6932fe9d333db26fd6e4da",
"timestamp": "",
"source": "github",
"line_count": 583,
"max_line_length": 98,
"avg_line_length": 30.1663807890223,
"alnum_prop": 0.5182236879513277,
"repo_name": "hitobias/line",
"id": "a965037d5d9f83459b5755b4dd60fe733c0cbdb9",
"size": "17611",... |
import os
PROJECT_DIR = os.path.split(os.path.abspath(__file__))[0]
STATIC_DIR = os.path.join(PROJECT_DIR, "static")
TEMPLATE_DIR = os.path.join(PROJECT_DIR, "templates")
OUT_DIR = os.path.join(PROJECT_DIR, "out")
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGER... | {
"content_hash": "fee6fc3b6b512d258529da429305a304",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 79,
"avg_line_length": 31.554621848739497,
"alnum_prop": 0.7169107856191744,
"repo_name": "hashedin/django-sql-reports",
"id": "127037f264f745666f3967061b5cf09a93ece3e8",
... |
import json
import imghdr
import posixpath
from django.shortcuts import render, get_object_or_404
from django.contrib import messages
from django.utils.six import text_type
from django.http import HttpResponse
from sendfile import sendfile
from waliki.models import Page
from waliki.acl import permission_required
from .... | {
"content_hash": "e458b55a5e3638e2ab45b79f8c8f6df4",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 135,
"avg_line_length": 47.22222222222222,
"alnum_prop": 0.7176470588235294,
"repo_name": "OlegGirko/waliki",
"id": "a4047d1e00740d9da04fb071bf0fe88e53824fbc",
"size": "214... |
"""New citree-based codeintel evaluation engine.
A 'citree' is basically an ElementTree of a CIX document with some tweaks.
The idea is to use these for completion/calltip evaluation instead of the
CIDB. This is mainly about performance but also about fixing some
limitations, bugs, and having a better code design (i.e... | {
"content_hash": "45ac704112913b8f6ce751c1b33c08cf",
"timestamp": "",
"source": "github",
"line_count": 683,
"max_line_length": 87,
"avg_line_length": 39.412884333821374,
"alnum_prop": 0.5135406218655968,
"repo_name": "anisku11/sublimeku",
"id": "30e0fe1af88ce23dc5995001d29a26a36da3d111",
"size": "... |
import os
from xobj import xobj
if not os.environ.has_key('DJANGO_SETTINGS_MODULE'):
os.environ['DJANGO_SETTINGS_MODULE'] = 'mint.django_rest.settings'
class LinkElement(object):
_xobj = xobj.XObjMetadata(
attributes = {
'href' : str,
},
)
def __init__(self, uri... | {
"content_hash": "a60b33598b01d08c52392a91437ed330",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 70,
"avg_line_length": 22.666666666666668,
"alnum_prop": 0.5053475935828877,
"repo_name": "sassoftware/mint",
"id": "5fc6eff10ba9b24423921cfa0ad66be22de5f5cb",
"size": "133... |
from __future__ import print_function
import glob
import sys
# drivers
from PIL import BdfFontFile
from PIL import PcfFontFile
VERSION = "0.4"
if len(sys.argv) <= 1:
print("PILFONT", VERSION, "-- PIL font compiler.")
print()
print("Usage: pilfont fontfiles...")
print()
print("Convert given font ... | {
"content_hash": "631c78696ff81be8ed853ae6222b1213",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 68,
"avg_line_length": 19.08888888888889,
"alnum_prop": 0.5820721769499418,
"repo_name": "Sarah-Alsinan/muypicky",
"id": "0f5df829f71e7a9e0ed433db1da785d1975f845d",
"size":... |
from handlers.base import BaseController
from tornado import gen
from model.question.answer import Answer
from model.question.question import Question
from model.question.score import Score
class AnswerHandler(BaseController):
@gen.coroutine
def get(self):
pass
@gen.coroutine
def post(self):
... | {
"content_hash": "bb0530c537851b010a4c78b89b9c0632",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 98,
"avg_line_length": 32.54666666666667,
"alnum_prop": 0.5604260548955347,
"repo_name": "VMatrixTeam/open-matrix",
"id": "9898055a4f9ac83a1e6292678b75bf254bc48327",
"size"... |
"""
Auxiliary classes and functions for used by the other AMFM_decompy modules.
Version 1.0.11
23/Jan/2021 Bernardo J.B. Schmitt - bernardo.jb.schmitt@gmail.com
"""
import numpy as np
from scipy.signal import lfilter
"""
Creates a signal object.
"""
class SignalObj(object):
def __init__(self, *args, **kwargs)... | {
"content_hash": "24b19503fcdae3a1ea028bbcb5d0508a",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 86,
"avg_line_length": 30.46846846846847,
"alnum_prop": 0.5987581312832644,
"repo_name": "bjbschmitt/AMFM_decompy",
"id": "129defe3b1d12ca3a5c185e96c6e2626ee2a3cec",
"size... |
import numpy
from prpy.tsr.tsrlibrary import TSRFactory
from prpy.tsr.tsr import *
@TSRFactory('herb', 'plastic_bowl', 'grasp')
def bowl_grasp(robot, bowl, manip=None):
'''
@param robot The robot performing the grasp
@param bowl The bowl to grasp
@param manip The manipulator to perform the grasp,
... | {
"content_hash": "d59996f32b803e3b37409a852154795d",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 100,
"avg_line_length": 38.83582089552239,
"alnum_prop": 0.6149116064565718,
"repo_name": "Shushman/herbpy",
"id": "881de8c5cf5b214e6c8d8deffbc2d62e74706c90",
"size": "2602... |
"""Support for RSS/Atom feeds."""
from datetime import datetime, timedelta
from logging import getLogger
from os.path import exists
from threading import Lock
import pickle
import voluptuous as vol
import feedparser
from homeassistant.const import EVENT_HOMEASSISTANT_START, CONF_SCAN_INTERVAL
from homeassistant.helpe... | {
"content_hash": "0da306f85693ceba288abe0cd62b6666",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 85,
"avg_line_length": 38.52252252252252,
"alnum_prop": 0.580799812909261,
"repo_name": "joopert/home-assistant",
"id": "27b164e4edf27e6d3bed6d95956ab97d80bc84e8",
"size":... |
"""Utilities related to searching Elastic."""
from __future__ import absolute_import
from __future__ import print_function
from pprint import pprint
from django.conf import settings
from .indexes import PageIndex, ProjectIndex, SectionIndex
from readthedocs.builds.constants import LATEST
from readthedocs.projects.mo... | {
"content_hash": "d5964ed72319f8bcba7156749720c3e4",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 87,
"avg_line_length": 32.61693548387097,
"alnum_prop": 0.440351094078378,
"repo_name": "pombredanne/readthedocs.org",
"id": "994601032d74620f7305fc854125e11db65f25cc",
"s... |
__version__=''' $Id: test_docs_build.py 3694 2010-04-06 12:54:39Z rgbecker $ '''
"""Tests that all manuals can be built.
"""
from reportlab.lib.testutils import setOutDir,SecureTestCase, printLocation
setOutDir(__name__)
import os, sys, unittest
class ManualTestCase(SecureTestCase):
"Runs all 3 manual-builders fro... | {
"content_hash": "ac2f57fdfbb43c3d5ecb73d051c7bdf8",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 117,
"avg_line_length": 35.43181818181818,
"alnum_prop": 0.6369467607440668,
"repo_name": "mattjmorrison/ReportLab",
"id": "175587c353fff4143f74900b8a3c717a6758a6f4",
"size... |
from .repocribro import create_app
#: Default Flask app for standard usage (export FLASK_APP)
app = create_app()
| {
"content_hash": "f78dae5b7c3b514cb8d4b80103436fab",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 58,
"avg_line_length": 28.5,
"alnum_prop": 0.7543859649122807,
"repo_name": "MarekSuchanek/repocribro",
"id": "a3ad9285e57855712b72c56bb4fffdb5ce82a381",
"size": "114",
"b... |
import os
from app import create_app, db
from app.models import users, backhosts, customers,backarchives,config
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'production')
manager = Manager(app)
migrate = Migrate(... | {
"content_hash": "e83c3b97b929ba4251d5f034e87ab92b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 123,
"avg_line_length": 32.34615384615385,
"alnum_prop": 0.7217598097502973,
"repo_name": "linuxyan/BackManager",
"id": "0e8bbef928cf73652112549573d5b434d0b0ce5f",
"size": ... |
import sys
import time
args = sys.argv
if args[1:]:
# The 1st argument is taken to be the type
set = args[1]
else:
# default to sample
set = "sample"
secs = time.mktime(time.localtime())
# Override authorization
auth.override = True
session.s3.roles.append(ADMIN)
stylesheet_dir = os.path.join(reques... | {
"content_hash": "a11e922537dbf1899aa025dbfb2e2eee",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 85,
"avg_line_length": 29.25,
"alnum_prop": 0.6653517422748192,
"repo_name": "code-for-india/sahana_shelter_worldbank",
"id": "f36dc8f29ddfc33c5757f0f9a1fc0c92433dc0e1",
"s... |
from collections import defaultdict, OrderedDict
from django.contrib.contenttypes.models import ContentType
from apps.people.models import Membership
from apps.merchandise.music.models import Album, Single
def call_attributes(instance, attribute_list):
for attribute in attribute_list:
if hasattr(instanc... | {
"content_hash": "3fd1e1a3973a4911470b61c69a53a995",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 131,
"avg_line_length": 40.84615384615385,
"alnum_prop": 0.703578154425612,
"repo_name": "hello-base/web",
"id": "35eb881fa0eb9220813c4122dab387ee13066c13",
"size": "2679",... |
"""
meerkat_api.py
Root Flask app for the Meerkat API.
"""
from meerkat_api.app import create_app
from meerkat_api.resources import alerts
from meerkat_api.resources import locations
from meerkat_api.resources import frontpage
from meerkat_api.resources import data
from meerkat_api.resources import export_data
from m... | {
"content_hash": "9e0cca0f09028bcd7ea9eae0c604906e",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 70,
"avg_line_length": 28.8125,
"alnum_prop": 0.789587852494577,
"repo_name": "who-emro/meerkat_api",
"id": "f2e1b437c0d1463b163ae5f823d95ca09035dbe7",
"size": "922",
"bi... |
"""
Training in batch
Reading data from a Python function
1. Feed data from a Python generator
2. Batch gradient descent for ridge regression
3. Reusing theta calculated in the previous batch
Gopi Subramanian
13-March-2016
"""
import tensorflow as tf
import numpy as np
from sklearn.datasets import make_regres... | {
"content_hash": "2647652299e85389de621403f04de3f8",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 110,
"avg_line_length": 25.824742268041238,
"alnum_prop": 0.67624750499002,
"repo_name": "subramgo/tflow",
"id": "654a4d2e7e8903ce60cabe906a8fb6eb8c22d7c4",
"size": "2505",... |
__version__='3.3.0'
__doc__="""This modules defines a collection of markers used in charts.
The make* functions return a simple shape or a widget as for
the smiley.
"""
from reportlab.lib import colors
from reportlab.graphics.shapes import Rect, Line, Circle, Polygon
from reportlab.graphics.widgets.signsandsymbols im... | {
"content_hash": "5d84776a9317aab4dc144fa1e32d4f40",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 71,
"avg_line_length": 20.012820512820515,
"alnum_prop": 0.6386931454196029,
"repo_name": "sandeepkoduri/GAE-html-to-pdf",
"id": "f02f6fc6f1b05ec4d8e8913032a584999bd76597",
... |
'''
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
def test():
global test_obj_dict
test_util.test_... | {
"content_hash": "0b4333d1dfa0182368842a7183efac47",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 63,
"avg_line_length": 27.321428571428573,
"alnum_prop": 0.673202614379085,
"repo_name": "zstackio/zstack-woodpecker",
"id": "1bf7d2b2d01582af17bde017e1d164243a9e441c",
"si... |
class Element:
def __init__(self, key, value, pre=None, next=None):
self.key = key
self.value = value
self.pre = pre
self.next = next
class LRUCache:
# @param capacity, an integer
def __init__(self, capacity):
self.capacity = capacity
self.mapping = {}
... | {
"content_hash": "6e3cdbf756901ec5dfdadba94ab27843",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 56,
"avg_line_length": 26.93421052631579,
"alnum_prop": 0.5007327796775769,
"repo_name": "pikeszfish/Leetcode.py",
"id": "9561f77432ccc5b1242353b257969084c0133586",
"size":... |
carPrice = int(input("Enter the amount of a car (in dollars only,no cents)"))
tax = 0.07
fees = 0.03
hiddenFees = 0.01
grandTotal = int(carPrice*tax) + int(carPrice*fees) + int(carPrice*hiddenFees) + carPrice
print("\nTax is: ", int(carPrice*tax))
print("fees are: ", int(carPrice*fees))
print("Hidden fees are: ", int... | {
"content_hash": "b434c2625ca26b72da94d8187dac023c",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 89,
"avg_line_length": 30,
"alnum_prop": 0.6976190476190476,
"repo_name": "Ry09/Python-projects",
"id": "1d20ffa7c76766ee33103edd93a5358de084a860",
"size": "654",
"binary... |
"""Test for the ee.element module."""
import unittest
import ee
from ee import apitestcase
class ElementTestCase(apitestcase.ApiTestCase):
def testSet(self):
"""Verifies Element.set() keyword argument interpretation."""
image = ee.Image(1)
# Constant dictionary.
def AssertProperties(expected, ... | {
"content_hash": "dad1b97088a3767a8a7d0b7eeb38ee41",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 79,
"avg_line_length": 33.06,
"alnum_prop": 0.6212946158499697,
"repo_name": "wemanuel/smry",
"id": "2039c2f5bcc412d30327f7a51c2c9c2627d20466",
"size": "1675",
"binary": ... |
"""
Support for interacting with Snapcast clients.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.snapcast/
"""
import logging
import socket
import voluptuous as vol
from homeassistant.components.media_player import (
DOMAIN, PLATFORM_... | {
"content_hash": "478d33df250ad926c98d05fb44f46918",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 79,
"avg_line_length": 30.46511627906977,
"alnum_prop": 0.6208651399491094,
"repo_name": "tinloaf/home-assistant",
"id": "cfe2f997295580b4bd563aa0b472fdd10cd4bed3",
"size"... |
"""
:synopsis: Define the specialize script classes that will generate the script code.
"""
from .base import AbstractScript
class BashScript(AbstractScript):
"""Extended `AbstractScript` class for Bash script code generation.
Fills code variables for the request from `bash_template`.
Overrides `_gene... | {
"content_hash": "96e207f6d47974bac1a046885b71adaa",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 106,
"avg_line_length": 30.402985074626866,
"alnum_prop": 0.6740304369170349,
"repo_name": "dhruvagarwal/http-request-translator",
"id": "2253b0b853182562cb4221c3b421882a6a85... |
'''
Created by auto_sdk on 2014.11.04
'''
from top.api.base import RestApi
class WlbTradeorderGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.sub_trade_id = None
self.trade_id = None
self.trade_type = None
def getapiname(self):
... | {
"content_hash": "1bbb84e33e8fbc9e6e80484bd213bae7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 55,
"avg_line_length": 27.53846153846154,
"alnum_prop": 0.6843575418994413,
"repo_name": "colaftc/webtool",
"id": "76ecf8c4a1cb1bef122fa9bb905333252c4c1f6f",
"size": "358",... |
from .base import Base
from .list import List
from .matrix import Matrix
from .tree import *
| {
"content_hash": "e9d7bc55cf5ef5970866143e0d149308",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 26,
"avg_line_length": 23.25,
"alnum_prop": 0.7741935483870968,
"repo_name": "zlsun/VisualAlgorithm",
"id": "202689bdb6633408db8398a1e2c649395fb24605",
"size": "94",
"bina... |
from pandas import DataFrame
import numpy as np
import nltk
from collections import Counter
from collections import OrderedDict
from sklearn.feature_extraction.text import TfidfVectorizer
def extract_sim_words(model, brand, result_path, freq_dist, min_count, save=True, topn=20):
df = DataFrame(columns=[['word', 's... | {
"content_hash": "a4e7a34ba7338b15088b5f3cd2be7cdc",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 91,
"avg_line_length": 36.42690058479532,
"alnum_prop": 0.6217691443249318,
"repo_name": "dedert/Brand2Vec",
"id": "80c95f667bceaae16770ace602335044413b9c6c",
"size": "637... |
"""
Convenience functions for the construction of spatial weights based on
contiguity and distance criteria.
"""
__author__ = "Sergio J. Rey <srey@asu.edu> "
from Contiguity import buildContiguity, Queen, Rook
from Distance import knnW, Kernel, DistanceBand
from util import get_ids, get_points_array_from_shapefile, m... | {
"content_hash": "76dea52a14fd3e9ecc4f5bca2fc5ad46",
"timestamp": "",
"source": "github",
"line_count": 1141,
"max_line_length": 524,
"avg_line_length": 29.879929886064854,
"alnum_prop": 0.5466518053559382,
"repo_name": "ljwolf/pysal_core",
"id": "21144d696660f4f475e89efc296710b43da721be",
"size": ... |
from __future__ import absolute_import, unicode_literals
from .comment_handler import CommentHandler
from .error_handler import Error
from .jsx_parser import JSXParser
from .jsx_syntax import JSXSyntax
from .objects import toDict
from .parser import Parser
from .syntax import Syntax
from .tokenizer import Tokenizer
fr... | {
"content_hash": "b74933d5eec0e8b7c265a13599f2b500",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 79,
"avg_line_length": 28.714285714285715,
"alnum_prop": 0.6606965174129353,
"repo_name": "mp-coder/translate-dev-tools",
"id": "b22455100e6f8be070ff584e5f4c1e4d71b421db",
... |
from tkinter import Tk, Text, BOTH, DISABLED, NORMAL, END
APPNAME = "WRITER TEST"
WELCOME_MSG = "Welcome to {}\n".format(APPNAME)
class Output(Text):
def __init__(self, parent):
Text.__init__(self, parent)
self.parent = parent
self.initUI()
def initUI(self):
... | {
"content_hash": "fb472fbe5dd0dfd520d452fde24ba981",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 81,
"avg_line_length": 29.076923076923077,
"alnum_prop": 0.5758377425044092,
"repo_name": "daviaws/missionText",
"id": "020786b949349a53cf4db9ee348166f29a7eb6d5",
"size": "... |
from collections.abc import Awaitable
from inspect import CO_ITERABLE_COROUTINE
from types import CoroutineType
from types import GeneratorType
async def do_await(obj):
return await obj
def do_yield_from(gen):
return (yield from gen)
def await_(obj):
obj_type = type(obj)
if (
obj_type is C... | {
"content_hash": "f0553b03eb96b877a13b76f7522f8338",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 65,
"avg_line_length": 20.216666666666665,
"alnum_prop": 0.606760098928277,
"repo_name": "ionelmc/python-lazy-object-proxy",
"id": "99945f460b2efaaa9cc35c1a3a9612a31f30a41d",... |
import zookeeper, time, threading
f = open("out.log","w")
zookeeper.set_log_stream(f)
connected = False
conn_cv = threading.Condition( )
def my_connection_watcher(handle,type,state,path):
global connected, conn_cv
print("Connected, handle is ", handle)
conn_cv.acquire()
connected = True
conn_cv.n... | {
"content_hash": "557e9bd65b9af735c03548d0fa79ef89",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 153,
"avg_line_length": 29.25,
"alnum_prop": 0.6273504273504273,
"repo_name": "apache/zookeeper",
"id": "24986e3aac8a55d9f996ea07e082ef7bc4aba831",
"size": "2539",
"binar... |
import datetime
from Models.Submission import Submission
from Core.Database import Database
from Core.Scorer import Scorer
from Core.Executer import Executer
from Core.Parser import Parser
class Grader():
def __init__(self):
self._session = Database.session()
def run(self, anonymous_student_id, stud... | {
"content_hash": "1c469cd97eb342c8d647749a7e495665",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 129,
"avg_line_length": 43.84,
"alnum_prop": 0.6386861313868614,
"repo_name": "brnomendes/grader-edx",
"id": "92a5c4abb10045ba60521150fcb257f838c2d9c5",
"size": "3293",
"... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/item/component/shared_item_electronic_power_conditioner.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
r... | {
"content_hash": "c6436500edaa65867bc530fe43340bf1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 103,
"avg_line_length": 25.53846153846154,
"alnum_prop": 0.7108433734939759,
"repo_name": "obi-two/Rebelion",
"id": "e4365e3821cb2c6c7233ed40d76c66849030e4ce",
"size": "477... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.