text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import absolute_import
from mayavi.modules.vectors import *
| {
"content_hash": "aad817aed437dafde79a076489b12bfb",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 38,
"avg_line_length": 38,
"alnum_prop": 0.7894736842105263,
"repo_name": "enthought/etsproxy",
"id": "374af0008a35d3dac44c8ccee2712cc824eb5da8",
"size": "91",
"binary": f... |
"""
WSGI config for hr 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_SETTINGS_M... | {
"content_hash": "25c7b57adfa9a87d6f6d15dfdd841acf",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 23.8125,
"alnum_prop": 0.7637795275590551,
"repo_name": "Miles-Yao/HR",
"id": "20b0450cad720029a55fb8d14ed47eb2433760f9",
"size": "381",
"binary": ... |
"""Reproduce an input boolean state."""
import asyncio
import logging
from typing import Iterable, Optional
from homeassistant.const import (
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_ON,
STATE_OFF,
ATTR_ENTITY_ID,
)
from homeassistant.core import Context, State
from homeassistant.helpers.typing imp... | {
"content_hash": "f502b4911dd97a02c90463e2dd217c0e",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 87,
"avg_line_length": 26.19298245614035,
"alnum_prop": 0.6624246483590087,
"repo_name": "Cinntax/home-assistant",
"id": "b8bc18edfac9a782304518334199dff71aad517b",
"size":... |
import os
import boto3
from bar import bar
from bar.baz import baz
from foo import foo
_ = os
_ = boto3
_ = bar
_ = baz
_ = foo
| {
"content_hash": "0ceed00d133db9180fb60c3784fb2df7",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 23,
"avg_line_length": 10.833333333333334,
"alnum_prop": 0.6615384615384615,
"repo_name": "bazelbuild/rules_python",
"id": "2b5b04425795453ee211686bd21e28cf205ddfad",
"size... |
import _plotly_utils.basevalidators
class YcalendarValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="ycalendar", parent_name="surface", **kwargs):
super(YcalendarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "189579d5fbc3714ab29ac86fc6b1e7da",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 81,
"avg_line_length": 31.625,
"alnum_prop": 0.38537549407114624,
"repo_name": "plotly/plotly.py",
"id": "22cb7e6eec75ecd94382cb51eb9530285b7bedee",
"size": "1012",
"bina... |
"""Get all hardware notifications associated with the passed hardware ID."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
@click.command(cls=SoftLayer.CLI.command.SLCommand, )
@click.argument('identifier')
@en... | {
"content_hash": "cab63400774f63a8194b7a0fd86f9d56",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 114,
"avg_line_length": 35.516129032258064,
"alnum_prop": 0.6775658492279746,
"repo_name": "softlayer/softlayer-python",
"id": "0612dcba7ea98c98c03b095ef83a1510b76c4126",
"... |
import logging
from unittest import TestCase
from dephp.scanner import lexer, scan_string
from dephp.plyparser import parser, parse_string
from dephp import phpast as ast
from tests._util import log_level
class ExpressionTestCase(TestCase):
def test_assign_with_double_quotes(self):
# PHP Scanner doesn't wo... | {
"content_hash": "8db553e624f185a241af61c9450aaa6f",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 91,
"avg_line_length": 42.15094339622642,
"alnum_prop": 0.6257833482542524,
"repo_name": "bnkr/dephp",
"id": "a53b187e520342dbcf245fbcc69648415e74aa54",
"size": "2234",
"... |
"""Handles all requests to the conductor service."""
from oslo.config import cfg
from oslo import messaging
from nova import baserpc
from nova.conductor import manager
from nova.conductor import rpcapi
from nova.i18n import _LI, _LW
from nova.openstack.common import log as logging
from nova import utils
conductor_op... | {
"content_hash": "7bcc6c44f6be4ceb9320b9da99c168eb",
"timestamp": "",
"source": "github",
"line_count": 376,
"max_line_length": 79,
"avg_line_length": 46.59308510638298,
"alnum_prop": 0.5827958216793196,
"repo_name": "mgagne/nova",
"id": "5d5f30ba82d6ff149f502343bd9930f89b0d7766",
"size": "18124",
... |
"""
Deuce Client - Block API
"""
import hashlib
import json
from stoplight import validate
from deuceclient.common.validation import *
class Block(object):
@staticmethod
def make_id(data):
sha1 = hashlib.sha1()
sha1.update(data)
return sha1.hexdigest().lower()
# TODO: Add a val... | {
"content_hash": "34884529dffc9ba999db990ad19c232f",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 77,
"avg_line_length": 31.962162162162162,
"alnum_prop": 0.5574158633519364,
"repo_name": "rackerlabs/deuce-client",
"id": "a5dcf269c3e055b1bfd68ae34fd0cbd3642517df",
"siz... |
from murano.dsl import exceptions
import murano.dsl.type_scheme as type_scheme
class PropertyUsages(object):
In = 'In'
Out = 'Out'
InOut = 'InOut'
Runtime = 'Runtime'
Const = 'Const'
Config = 'Config'
All = set([In, Out, InOut, Runtime, Const, Config])
Writable = set([Out, InOut, Runti... | {
"content_hash": "77e7f379a112e90a9e1f4f9c5a3c2b00",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 72,
"avg_line_length": 28.28301886792453,
"alnum_prop": 0.6077384923282189,
"repo_name": "chenyujie/hybrid-murano",
"id": "5fcebbe4d5d3fc0d34f96c1edc0f68a92a5532e1",
"size"... |
from functools import WRAPPER_ASSIGNMENTS
from django.apps import apps
__all__ = ['is_installed', 'installed_apps']
def is_installed(app_name):
return apps.is_installed(app_name)
def installed_apps():
return [app.name for app in apps.get_app_configs()]
def available_attrs(fn):
return WRAPPER_ASSIGNMENT... | {
"content_hash": "68f01deef949d592bae643ee9c499dc8",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 55,
"avg_line_length": 23,
"alnum_prop": 0.7267080745341615,
"repo_name": "rsalmaso/django-cms",
"id": "f65a9709c661a3bc2ea31f2c3f3bafeb6deb6683",
"size": "322",
"binary"... |
import os
import shutil
from unittest import TestCase
from mlimages.gather.imagenet import ImagenetAPI
import testss.env as env
class TestImagenetAPI(TestCase):
def test_gather_wnid(self):
p = env.get_data_folder()
api = ImagenetAPI(p)
api.gather("n11531193")
path = env.get_path(... | {
"content_hash": "4367e9ba71a540e2a6d6e1ff748e964f",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 79,
"avg_line_length": 27.419354838709676,
"alnum_prop": 0.6270588235294118,
"repo_name": "icoxfog417/mlimages",
"id": "57a8a4afd45d54b862e9e801d29d850d7618a5fc",
"size": "... |
"""Model class for WMS Resource"""
from django.contrib.gis.db import models
__author__ = 'Christian Christelis <christian@kartoza.com>'
__date__ = '04/2015'
__license__ = "GPL"
__copyright__ = 'kartoza.com'
class NationalCertificateVocational(models.Model):
id = models.AutoField(primary_key=True)
national_c... | {
"content_hash": "afd23d7b7b75f135f14f7816db26d409",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 67,
"avg_line_length": 28.076923076923077,
"alnum_prop": 0.6712328767123288,
"repo_name": "cchristelis/feti",
"id": "3a88df93d385a90ff8fb5d3a6caab9a6380ad1ea",
"size": "745... |
import sys
from pyasn1 import error
from pyasn1.type import tag
from pyasn1.type import univ
__all__ = ['NumericString', 'PrintableString', 'TeletexString', 'T61String', 'VideotexString',
'IA5String', 'GraphicString', 'VisibleString', 'ISO646String',
'GeneralString', 'UniversalString', 'BMPStrin... | {
"content_hash": "d3769bbe1cacccf92a9069fd4e042cc9",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 99,
"avg_line_length": 33.695238095238096,
"alnum_prop": 0.6411343508573583,
"repo_name": "endlessm/chromium-browser",
"id": "8986b7038979974eec223c4eea91646cb89bf024",
"s... |
import os
import sh
import sys
class Keychain:
identities = []
identities_str = 'need find_identity first'
def __init__(self, name, password=''):
home = os.path.expanduser("~")
# home = os.getenv('HOME')
filename = os.path.join(home, 'Library', 'Keychains', name)
self.f... | {
"content_hash": "c5f98bb79173528fe3d99a0eaae026f7",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 150,
"avg_line_length": 38.66019417475728,
"alnum_prop": 0.5434455047714716,
"repo_name": "oylbin/iOSCodeSign",
"id": "392ad7d5aa1ce8978fb5b0055e5056f45faba0b9",
"size": "... |
from __future__ import print_function
import os
from .wrapped_decorator import signature_safe_contextmanager
from . import core
__all__ = [
'convert_reader_to_recordio_file', 'convert_reader_to_recordio_files'
]
@signature_safe_contextmanager
def create_recordio_writer(filename,
compre... | {
"content_hash": "d1fd6296d0bee262bce1c35f641cbd49",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 90,
"avg_line_length": 36.04237288135593,
"alnum_prop": 0.588055490242182,
"repo_name": "baidu/Paddle",
"id": "aa581f23a191639fdc026e7781897d5d996823a9",
"size": "4866",
... |
from core import perf_benchmark
from measurements import startup
import page_sets
from telemetry import benchmark
class _StartupCold(perf_benchmark.PerfBenchmark):
"""Measures cold startup time with a clean profile."""
options = {'pageset_repeat': 5}
@classmethod
def Name(cls):
return 'startup'
def C... | {
"content_hash": "cc5e22d82c9ab34924513719d91cd6d3",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 72,
"avg_line_length": 27.904255319148938,
"alnum_prop": 0.7251239039268014,
"repo_name": "SaschaMester/delicium",
"id": "a54f55fd09336019cfb7a63835daff43a80a0c73",
"size":... |
""" Fit subunits for multiple cells simultaneously.
This script has the extensions of single cell models from earlier
as well as new population subunit models -
most notably the almost convolutional model - where each subunit is
summation of mother subunit and subunit specific modification.
"""
import sys
import os.p... | {
"content_hash": "1489a8bc0e654c10be8c61c496e09269",
"timestamp": "",
"source": "github",
"line_count": 651,
"max_line_length": 147,
"avg_line_length": 42.01996927803379,
"alnum_prop": 0.5885212940961433,
"repo_name": "googlearchive/rgc-models",
"id": "5c82b5ed8def8cddb3921b3d8b54a2472c7cf104",
"si... |
import abc
from engine import dataseries
from engine.dataseries import bards
from engine import bar
from engine import resamplebase
class AggFunGrouper(resamplebase.Grouper):
def __init__(self, groupDateTime, value, aggfun):
super(AggFunGrouper, self).__init__(groupDateTime)
self.__values = [valu... | {
"content_hash": "491bbe3ca1bc1bfadadb7aac14e9d8a7",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 110,
"avg_line_length": 37.59285714285714,
"alnum_prop": 0.6482994489834695,
"repo_name": "Yam-cn/potato",
"id": "bbefa9d3b06945c979d7f3f8491d16cf5d47b713",
"size": "5877"... |
"""Tests for database migrations for the API database.
These are "opportunistic" tests which allow testing against all three databases
(sqlite in memory, mysql, pg) in a properly configured unit test environment.
For the opportunistic testing you need to set up DBs named 'openstack_citest'
with user 'openstack_citest... | {
"content_hash": "9568fb755395c31e73806596cf3dae5c",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 79,
"avg_line_length": 34.285234899328856,
"alnum_prop": 0.6643828912596652,
"repo_name": "mahak/nova",
"id": "3b9b17aab206b4108218a144ebfca58686f7b350",
"size": "10790",
... |
import logging
from pycsw.core.etree import PARSER
from pycsw import __version__
LOGGER = logging.getLogger(__name__)
class StaticContext(object):
"""core configuration"""
def __init__(self, prefix='csw30'):
"""initializer"""
LOGGER.debug('Initializing static context')
self.version =... | {
"content_hash": "5c5648f5d01b666326dc4c699bd5fc56",
"timestamp": "",
"source": "github",
"line_count": 582,
"max_line_length": 105,
"avg_line_length": 47.10481099656357,
"alnum_prop": 0.3779317891665147,
"repo_name": "ricardogsilva/pycsw",
"id": "155f241d655e46d6b15cb4e012e6732222383e84",
"size": ... |
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_creature_lair_boar_wolf.iff"
result.attribute_template_id = -1
result.stfName("poi_n","base_poi_building")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "f2f0962e37f6188c643930c182a071bc",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 75,
"avg_line_length": 23.76923076923077,
"alnum_prop": 0.6925566343042071,
"repo_name": "anhstudios/swganh",
"id": "3135f2a1c69c841df8a3c1af0924f98caa35473e",
"size": "454... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from flexget import plugin
from flexget.event import event
from . import series as plugin_series
from . import db
class FilterSeriesPremiere(plugin_series.FilterSeriesB... | {
"content_hash": "218bca58a541d40d87e39669b9851d48",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 95,
"avg_line_length": 38.46534653465346,
"alnum_prop": 0.5884169884169884,
"repo_name": "tobinjt/Flexget",
"id": "3e416fcf86fbfcc04a0276b3ffb1cce324d69dd4",
"size": "3885... |
import os, io
import sys, getopt
import random
import codecs
#sys.stdout = codecs.getwriter('utf8')(sys.stdout)
#sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf8')
#print sys.stdout.encoding
HeadProperty = ['a','art','ad','conj','prep','pron','int','n','num','v','vi','vt']
def ChAlign(string, length... | {
"content_hash": "941de2c3a162954e531c88523ca81e9c",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 91,
"avg_line_length": 32.845454545454544,
"alnum_prop": 0.48906725712704124,
"repo_name": "howmind/tools",
"id": "d50efa23d411697af0198ea66d21a3da4206dd78",
"size": "3662... |
import os
import re
from datetime import datetime
import pytz
class AwsNexradFile(object):
"""
This class contains metadata about the remote NEXRAD file on AWS
:var key: AWS key for this NEXRAD file
:vartype key: str
:var last_modified: when the file was last modified on AWS
:vartype last_mo... | {
"content_hash": "c4e97b97f1a3adeaab155d31c26c837b",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 97,
"avg_line_length": 35.223684210526315,
"alnum_prop": 0.6264475158759806,
"repo_name": "aarande/nexradaws",
"id": "5ec9bc09b9624b91d9afdf83f4601a34d00ba96f",
"size": "26... |
import logging
__author__ = 'rolandh'
from pymongo import Connection
#import cjson
import time
from datetime import datetime
from saml2 import time_util
from saml2.cache import ToOld
from saml2.time_util import TIME_FORMAT
logger = logging.getLogger(__name__)
class Cache(object):
def __init__(self, server=Non... | {
"content_hash": "ea75fa22c79af747e0e27ccd63e7203f",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 80,
"avg_line_length": 34.68181818181818,
"alnum_prop": 0.5402650356778798,
"repo_name": "Runscope/pysaml2",
"id": "2f5d9c45ba0e6f2af741d02d49cb152d73d0c659",
"size": "688... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0009_auto_20210322_1837'),
]
operations = [
migrations.AlterField(
model_name='banner',
name='color',
field=models.CharField(default='hs-yello... | {
"content_hash": "1e554a2a56b7d805f9c563b7876d6b11",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 262,
"avg_line_length": 45.064516129032256,
"alnum_prop": 0.6227630637079457,
"repo_name": "hackerspace-ntnu/website",
"id": "94835fa7c2ac5b8cca998876136245887e9d7fad",
"si... |
import os
import subprocess
import numpy as np
import scipy.misc
try:
from subprocess import DEVNULL # py3k
except ImportError:
DEVNULL = open(os.devnull, 'wb')
def which(program):
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(pro... | {
"content_hash": "c6e1b92615c0d93c6f9dc22edb81c1fe",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 78,
"avg_line_length": 32.49122807017544,
"alnum_prop": 0.5134989200863931,
"repo_name": "andersbll/vae_gan",
"id": "e02f2efb7db10b6b060526dc205f975462410d18",
"size": "37... |
import nengo
from nengo.exceptions import ConfigError
import pytest
from rig import place_and_route as par
from nengo_spinnaker import Simulator, add_spinnaker_params
from nengo_spinnaker.config import CallableParameter
from nengo_spinnaker import node_io
def test_add_spinnaker_params():
"""Test adding SpiNNaker... | {
"content_hash": "60954ccda6516ce76f0b9762a8caca1c",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 79,
"avg_line_length": 34.78350515463917,
"alnum_prop": 0.6437462951985774,
"repo_name": "project-rig/nengo_spinnaker",
"id": "2a7c60861603beed09272706aa6c71e10512c3ce",
"s... |
from __future__ import unicode_literals
from django.db import migrations, models
def raise_error(apps, schema_editor):
# Test operation in non-atomic migration is not wrapped in transaction
Publisher = apps.get_model('migrations', 'Publisher')
Publisher.objects.create(name='Test Publisher')
... | {
"content_hash": "b34e6e44767bf2e1feb14ff65ec6f6f2",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 101,
"avg_line_length": 30.870967741935484,
"alnum_prop": 0.58098223615465,
"repo_name": "yephper/django",
"id": "65cd53b497e45760eb16c55c9a03827fbd6d57cc",
"size": "982",
... |
from unittest.mock import Mock, call, patch
from expecter import expect
from gitman import system
def describe_launch():
@patch('platform.system', Mock(return_value="Windows"))
@patch('gitman.system._launch_windows')
def it_opens_files(startfile):
system.launch("fake/path")
expect(startf... | {
"content_hash": "69f429f8b8be95eb95b3976fe2550e56",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 59,
"avg_line_length": 30.555555555555557,
"alnum_prop": 0.68,
"repo_name": "jacebrowning/gdm",
"id": "44d9e131223d3b073178d866968e768535f7bd0c",
"size": "609",
"binary":... |
""" Panel4D: a 4-d dict like collection of panels """
from pandas.core.panelnd import create_nd_panel_factory
from pandas.core.panel import Panel
Panel4D = create_nd_panel_factory(klass_name='Panel4D',
orders=['labels', 'items', 'major_axis',
... | {
"content_hash": "171a52962b5a5ec038e64c14d08456db",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 79,
"avg_line_length": 40.68888888888889,
"alnum_prop": 0.523211359912616,
"repo_name": "BigDataforYou/movie_recommendation_workshop_1",
"id": "33bd79195cc779644980fe88daae2e... |
import sys
sys.path[0:0] = [""]
import unittest
from mongoengine import *
from mongoengine.connection import get_db
__all__ = ("GeoFieldTest", )
class GeoFieldTest(unittest.TestCase):
def setUp(self):
connect(db='mongoenginetest')
self.db = get_db()
def _test_for_expected_error(self, Cls,... | {
"content_hash": "e662556bf50a804132d08eda1fc4ccc8",
"timestamp": "",
"source": "github",
"line_count": 390,
"max_line_length": 152,
"avg_line_length": 41.44358974358974,
"alnum_prop": 0.5967951494153313,
"repo_name": "elephanter/mongoengine",
"id": "8193d87e90635143c39dbc27178a79f1e5271e8e",
"size... |
"""Trigger the GitHub action to build our kits."""
import sys
import requests
repo_owner = sys.argv[1]
# The GitHub URL makes no mention of which workflow to use. It's found based on
# the event_type, which matches the types in the workflow:
#
# on:
# repository_dispatch:
# types:
# - build-kits... | {
"content_hash": "a867cd7ebff01ba1125cc6622cbd5e09",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 21.82608695652174,
"alnum_prop": 0.6673306772908366,
"repo_name": "nedbat/coveragepy",
"id": "0485df10a3c78d83c342075d01776a7e99ad4a5d",
"size": "658... |
from kivy.tests.common import GraphicUnitTest
from kivy.input.motionevent import MotionEvent
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.slider import Slider
from kivy.base import EventLoop
class UTMotionEvent(MotionEvent):
def depack(self, args):
self.is_touch = True
self.sx = args['x... | {
"content_hash": "f074ecb62c9cb4bca95e59fdc912a355",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 65,
"avg_line_length": 30.265060240963855,
"alnum_prop": 0.464171974522293,
"repo_name": "matham/kivy",
"id": "9c88fe9bc61957402e916d9e89638b4529330570",
"size": "5024",
... |
from tests.testcase import TestCase
from edmunds.foundation.applicationmiddleware import ApplicationMiddleware
class TestMiddleware(TestCase):
"""
Test the Middleware
"""
cache = None
def set_up(self):
"""
Set up the test case
"""
super(TestMiddleware, self).set_... | {
"content_hash": "9060bafc4bab20f02f1bbedc187e69b1",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 130,
"avg_line_length": 37.61417322834646,
"alnum_prop": 0.6790872932803015,
"repo_name": "LowieHuyghe/edmunds",
"id": "3aa49501aa213a68af65b304f25af2a6e1122b84",
"size": ... |
from .proc_base import ProcBase
class ProcMounts(ProcBase):
'''Object represents the /proc/mounts file.'''
format_str = '{0:15} | {1:25} | {2:15} | {3}'
def __init__(self, pid):
'''
Read file by calling base class constructor
then parse the contents.
'''
super()._... | {
"content_hash": "fff13d96b9354f5fda09b99046b4533b",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 71,
"avg_line_length": 28.943396226415093,
"alnum_prop": 0.5052151238591917,
"repo_name": "EwanC/pyProc",
"id": "727475cee51b6a99151c39b286d4febb522bddad",
"size": "1558",
... |
import os.path
from flask import Flask, request, jsonify, send_file
from iiif2 import IIIF, web
PATH = os.path.dirname(os.path.realpath(__file__))
app = Flask(__name__)
@app.route('/<identifier>/info.json')
def info(identifier):
return jsonify(web.info(request.url, resolve(identifier), identifier))
@app.route(... | {
"content_hash": "5ba6d1aebe63dd036ddfc8dc0e22a9a2",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 74,
"avg_line_length": 28.6,
"alnum_prop": 0.6748251748251748,
"repo_name": "mekarpeles/iiif2",
"id": "1ae5323f4e1013964f432baa1576dfe3feb12332",
"size": "858",
"binary":... |
import io
from ....tests.helper import pytest
import numpy as np
from ..column import Column
from ..diff import (FITSDiff, HeaderDiff, ImageDataDiff, TableDataDiff,
HDUDiff, report_diff_values)
from ..hdu import HDUList, PrimaryHDU, ImageHDU
from ..hdu.table import BinTableHDU
from ..header import... | {
"content_hash": "87582a4cbae5751f8a45880fb9139d00",
"timestamp": "",
"source": "github",
"line_count": 814,
"max_line_length": 94,
"avg_line_length": 38.342751842751845,
"alnum_prop": 0.5456729999038801,
"repo_name": "joergdietrich/astropy",
"id": "790000b54a4e0905709a132c7468cbe9d0ee5b75",
"size"... |
from __future__ import with_statement
import os
import sys
from nose.tools import eq_, ok_
from fabric.state import env, output
from fabric.context_managers import (cd, settings, lcd, hide, shell_env, quiet,
warn_only, prefix, path)
from fabric.operations import run, local
import six
from six import BytesIO as ... | {
"content_hash": "44caf7acdc7253db6941be191efde94d",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 91,
"avg_line_length": 25.5609756097561,
"alnum_prop": 0.5888994910941476,
"repo_name": "pashinin/fabric",
"id": "9c3ffaca69bd48a2c5e7f2cc7f6cd82d27841f89",
"size": "6288"... |
import numpy as np
import pandas as pd
import multiprocessing
import pathos.multiprocessing as multi
def pdSafe(s):
'''Transform name into Pandas-safe name (i.e., dot-notation-accessible).'''
s = s.translate(None, '\\/ ?!@#$%^&*()-+=\`~|][{}<>,')
s = s.replace('.', '_')
return s
#def applyParallel(g... | {
"content_hash": "64d91f08be1e2bc2080dabf79c9725f3",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 96,
"avg_line_length": 38.55813953488372,
"alnum_prop": 0.6504825090470446,
"repo_name": "jllanfranchi/pygeneric",
"id": "e3a0b1fd16c7dbdc5c38959cee71eb05ff0612be",
"size":... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import unittest
from pants.backend.jvm.tasks.jvm_compile.execution_graph import (ExecutionFailure, ExecutionGraph,
... | {
"content_hash": "5de9f05573f67394e25b46ef9fb9b4ea",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 98,
"avg_line_length": 35.260416666666664,
"alnum_prop": 0.5921713441654357,
"repo_name": "digwanderlust/pants",
"id": "96375b1be138f7938d0887a21dc6d69f90a997fc",
"size": ... |
''' Silta STM32F407 Discovery Bridge
--- Supported Pins
I2C:
* PB6 - I2C1 SCL
* PB7 - I2C1 SDA (optional)
* PB8 - I2C1 SCL (optional)
* PB9 - I2C1 SDA
SPI:
* PA5 - SPI1 SCK
* PA6 - SPI1 MISO
* PA7 - SPI1 MOSI
ADC:
* PA0 - ADC1_0
* PA1 - ADC1_1
* PA2 - ADC1_2
* PA3 - ADC1_3
* PA4 - ADC1_4 (Will disable DAC)
* PA5 - A... | {
"content_hash": "c7ee340714eec557f32fbf2a4ffce555",
"timestamp": "",
"source": "github",
"line_count": 560,
"max_line_length": 79,
"avg_line_length": 25.401785714285715,
"alnum_prop": 0.49729349736379613,
"repo_name": "alvarop/silta",
"id": "0dba9155c0a7f1beec4d4145378ff18e71292484",
"size": "1422... |
import io
import json
import os
import unittest
from . import flag
from .fhirdate import FHIRDate
class FlagTests(unittest.TestCase):
def instantiate_from(self, filename):
datadir = os.environ.get('FHIR_UNITTEST_DATADIR') or ''
with io.open(os.path.join(datadir, filename), 'r', encoding='utf-8') ... | {
"content_hash": "d91ee370f170dd3d64a5b18da30c21b4",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 151,
"avg_line_length": 47.5735294117647,
"alnum_prop": 0.6593508500772798,
"repo_name": "all-of-us/raw-data-repository",
"id": "63f53a57f519c1d9f12ae17310dda2c472cae7d5",
... |
"""Support for RFXtrx lights."""
import logging
import voluptuous as vol
from homeassistant.components import rfxtrx
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
Light,
)
from homeassistant.const import CONF_NAME
from homeassistant.helpers import c... | {
"content_hash": "cdad2fc2918006e66e9a942cc890b574",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 77,
"avg_line_length": 28.138297872340427,
"alnum_prop": 0.6287334593572779,
"repo_name": "fbradyirl/home-assistant",
"id": "d2d2e842c0aa8c2511cec6a42b9142fe9607c24b",
"siz... |
"""Base test cases for all neutron tests.
"""
import contextlib
import gc
import logging as std_logging
import os
import os.path
import random
import weakref
import eventlet.timeout
import fixtures
import mock
from oslo_concurrency.fixture import lockutils
from oslo_config import cfg
from oslo_messaging import conffi... | {
"content_hash": "3132cd3912b27e30af01dd7ad6389a2e",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 79,
"avg_line_length": 34.58536585365854,
"alnum_prop": 0.636459802538787,
"repo_name": "eonpatapon/neutron",
"id": "d9b6e0b6e131260cd0cb900a6f53d97de8e29b50",
"size": "14... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('radio', '0050_city'),
]
operations = [
migrations.AddField(
model_name='city',
name='ems_se... | {
"content_hash": "089053b5a844e8bd477c8abe5d522ae6",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 154,
"avg_line_length": 35,
"alnum_prop": 0.6216748768472906,
"repo_name": "ScanOC/trunk-player",
"id": "332fcdd552fbd5079efdef461a7e32c232869f06",
"size": "1088",
"binar... |
from django.contrib import admin
from .models import *
from django.forms import CheckboxSelectMultiple
from .forms import *
from comunicacion.lugar.models import *
from nested_inline.admin import NestedStackedInline, NestedModelAdmin, NestedTabularInline
from django.utils.translation import ugettext_lazy as _
# Regist... | {
"content_hash": "dc150b3dc719dc71a59924f15715a3b0",
"timestamp": "",
"source": "github",
"line_count": 365,
"max_line_length": 180,
"avg_line_length": 32.92602739726028,
"alnum_prop": 0.7066067565318689,
"repo_name": "ErickMurillo/ciat_plataforma",
"id": "6b88e015e0ac9a71e17bb80e32bcc47ce5028fc4",
... |
"""
Created on Wed Oct 4 17:54:07 2017
@author: slerp4
"""
# import keras deep learning essentials
from keras.applications.vgg16 import VGG16, preprocess_input
from keras.preprocessing import image
from keras.models import Model
import numpy as np
# import other api
from timeit import default_timer as timer
def vgg... | {
"content_hash": "26702a13ad12e44c338dcd2775435197",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 106,
"avg_line_length": 31.692307692307693,
"alnum_prop": 0.7046925566343042,
"repo_name": "ywang037/delta-ntu-slerp4",
"id": "48d880400ceaab53630bf4f0940616915e4c9dea",
"s... |
class MarshmallowSQLAlchemyError(Exception):
"""Base exception class from which all exceptions related to
marshmallow-sqlalchemy inherit.
"""
pass
class ModelConversionError(MarshmallowSQLAlchemyError):
"""Raised when an error occurs in converting a SQLAlchemy construct
to a marshmallow object.... | {
"content_hash": "6a0777376f362f5b0516d0014d72f53e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 71,
"avg_line_length": 30.727272727272727,
"alnum_prop": 0.742603550295858,
"repo_name": "jmcarp/marshmallow-sqlalchemy",
"id": "638124b4b47e0ffd0c5ec1e5eb3b8bb7c9af1b9d",
... |
from __future__ import unicode_literals
from django.template import Context, Template, TemplateDoesNotExist
from django.test import TestCase
from .models import Story
class MultipleIncludeTest(TestCase):
def setUp(self):
self.story1 = Story.objects.create(title='story1', category_slug='category1')
... | {
"content_hash": "5f7526f069d6c3bd9aca19e3627fe9ed",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 199,
"avg_line_length": 46.47435897435897,
"alnum_prop": 0.6692413793103448,
"repo_name": "fcurella/django-multiple-include",
"id": "4504c3cf6d4bd5c85a79d10576ac47dbdc990fc2"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ringapp', '0017_auto_20150121_1839'),
]
operations = [
migrations.AlterModelTable(
name='comminvariance',
table='comm_proper... | {
"content_hash": "a82ecff02680158c4c1876a051816557",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 47,
"avg_line_length": 22.666666666666668,
"alnum_prop": 0.5945378151260504,
"repo_name": "rschwiebert/RingApp",
"id": "f9df674b4e85a1b27a792e9c33ef534d1f88992b",
"size": "... |
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.exc import DatabaseError
from sqlalchemy.sql import func
from sqlalchemy.sql.expression import union_all
from socket import inet_aton, inet_ntoa
from struct import unpack, pack, error as struct_error
from passlib.hash import bcrypt_sha256
import datetime
import ... | {
"content_hash": "f6a1d3bb5931d29a74a56683d957da65",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 169,
"avg_line_length": 34.24842767295598,
"alnum_prop": 0.5971903406482416,
"repo_name": "RITC3/RC3_CTFD",
"id": "7998b97b08326a53a31afe2ca149e65f514766d0",
"size": "1089... |
import unittest
import logging
from nose.tools import * # flake8: noqa (PEP8 asserts)
from framework.auth.core import Auth
from website import settings
import website.search.search as search
from website.search import elastic_search
from website.search.util import build_query
from website.search_migration.migrate im... | {
"content_hash": "3d6d68ac01607488c58264b5c33e2ec5",
"timestamp": "",
"source": "github",
"line_count": 518,
"max_line_length": 121,
"avg_line_length": 34.465250965250966,
"alnum_prop": 0.6164230101383521,
"repo_name": "revanthkolli/osf.io",
"id": "0c9aeb20c0aa8254d8c8cbfeb4fa3f5011298d6e",
"size":... |
"""service-management describe command."""
from googlecloudsdk.api_lib.service_management import services_util
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.service_management import arg_parsers
from googlecloudsdk.command_lib.service_management import common_flags
class Describe(base.Desc... | {
"content_hash": "130f3ad7f40894f127f5443bc5557502",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 80,
"avg_line_length": 30.818181818181817,
"alnum_prop": 0.7315634218289085,
"repo_name": "KaranToor/MA450",
"id": "8b60631f649bb85dc5a9db1c32866092a610c7af",
"size": "1952... |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abs... | {
"content_hash": "998cb33390417b0909504a1e3891485e",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 80,
"avg_line_length": 34.716981132075475,
"alnum_prop": 0.6885869565217392,
"repo_name": "dhalbert/Adafruit_CircuitPython_HID",
"id": "0278044bca9e8428765af242919bd90137229d... |
"""
Copyright (c) 2017-2022, Vanessa Sochat
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the fo... | {
"content_hash": "85e26f860ea36b364d5716309aa263d6",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 78,
"avg_line_length": 39.673469387755105,
"alnum_prop": 0.7731481481481481,
"repo_name": "expfactory/expfactory",
"id": "5be9c3b1a67a33694d9c8a6c2f92f8549ba34f7c",
"size":... |
import os
from oslo_concurrency import processutils
from nova import exception as nova_exception
from nova.i18n import _
from nova.i18n import _LE
from nova.i18n import _LI
from nova.openstack.common import fileutils
from nova.openstack.common import log as logging
from nova import utils
LOG = logging.getLogger(__n... | {
"content_hash": "abf1eb624b933dc9627f6de055444163",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 75,
"avg_line_length": 33.01538461538462,
"alnum_prop": 0.6374650512581547,
"repo_name": "sajeeshcs/nested_quota_final",
"id": "a4ed046cc02fd5e482475a37fcd922f71062fd17",
"... |
"""
util tests
"""
import os
import stat
import sys
import time
import shutil
import tempfile
import pytest
from mock import Mock, patch
from pip.exceptions import HashMismatch, HashMissing, InstallationError
from pip.utils import (egg_link_path, get_installed_distributions,
untar_file, unzip_... | {
"content_hash": "94d71e3ad65fcd8f0b831d4d06cd27db",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 79,
"avg_line_length": 39.29398663697105,
"alnum_prop": 0.6140679022841921,
"repo_name": "willingc/pip",
"id": "8c3ec2477028a8be61f462115a87a8e2c18cd2fa",
"size": "17643",... |
from django.conf import settings
class UrlUtils():
@staticmethod
def addPathToOwnURL(path):
path = str(path)
return "https://"+settings.ROOT_USERNAME+":"+settings.ROOT_PASSWORD+"@"+settings.VTAM_IP+":"+settings.VTAM_PORT+path
@staticmethod
def getOwnCallbackURL():
return UrlUtils.addPathToOwnURL("/xmlrp... | {
"content_hash": "655ad98a2cc42bc6e468b358bff0c675",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 118,
"avg_line_length": 25.384615384615383,
"alnum_prop": 0.7363636363636363,
"repo_name": "ict-felix/stack",
"id": "3a7e8543400151fb89d002d2f9076fe66486d47c",
"size": "464... |
import os
import sys
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from h2o.automl import H2OAutoML
from h2o.exceptions import H2OValueError
from tests import pyunit_utils as pu
def import_dataset(seed=0):
df = h2o.import_file(path=pu.locate("smalldata/prostate/prostate.csv"))
target = "CAPSULE... | {
"content_hash": "3c5533552c0bea79750601f4ecdc023c",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 146,
"avg_line_length": 34.103896103896105,
"alnum_prop": 0.6565118050266565,
"repo_name": "michalkurka/h2o-3",
"id": "4a12626a242a94a98adbcccc61c17949a824194b",
"size": "2... |
"""Implicit plotting module for SymPy
The module implements a data series called ImplicitSeries which is used by
``Plot`` class to plot implicit plots for different backends. The module,
by default, implements plotting using interval arithmetic. It switches to a
fall back algorithm if the expression cannot be plotted ... | {
"content_hash": "a9bfcfbaee2923c43a6fcc6b88a57e2d",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 83,
"avg_line_length": 38.54293628808864,
"alnum_prop": 0.5929279862009487,
"repo_name": "dennisss/sympy",
"id": "660085ef7dbf3d1761457142711f89485766d652",
"size": "13914... |
import json
from datetime import datetime, timedelta
# django
from django.views.generic import View
from django.http import HttpResponse
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
# local django
from user.decorators import is_health_professional
from... | {
"content_hash": "8e91ca94dfdd7f5b58280f94f76a9f0a",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 113,
"avg_line_length": 38.16981132075472,
"alnum_prop": 0.5803262481463174,
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"id": "2d7745f777bdb8e386739f547e60451d6128... |
from aux import version
from datetime import datetime
import ConfigParser, os
import logging
class LogController(object):
summary = dict()
config = None
def __init__(self, config):
self.config = config
self.loggers = dict()
self.log_directory = config.options.log_directory
... | {
"content_hash": "7ce580573a432cad2c02da3b9fede54b",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 87,
"avg_line_length": 42.47115384615385,
"alnum_prop": 0.540638442381707,
"repo_name": "bischjer/auxiliary",
"id": "5cfcf255d865ab81150ef74cf35bc95b3f085002",
"size": "44... |
from django.conf.urls import re_path as url
from corehq.apps.app_manager.views import (
download_app_strings,
download_index,
download_media_profile,
download_media_suite,
download_odk_media_profile,
download_odk_profile,
download_practice_user_restore,
download_profile,
download_su... | {
"content_hash": "850805c455ae2d60ebf63052d6897ca2",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 110,
"avg_line_length": 44.81481481481482,
"alnum_prop": 0.6628099173553719,
"repo_name": "dimagi/commcare-hq",
"id": "0ca2f8eb140ec4cccd5be4d109ba6f608b7793f5",
"size": "1... |
import os
import re
import random
import hashlib
import hmac
from string import letters
import webapp2
import jinja2
from google.appengine.ext import db
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
jinja_env = jinja2.Environment(loader = jinja2.FileSystemLoader(template_dir),
... | {
"content_hash": "78d7963e1d124b90c8313e966b181bbf",
"timestamp": "",
"source": "github",
"line_count": 657,
"max_line_length": 260,
"avg_line_length": 30.30441400304414,
"alnum_prop": 0.5755399296835761,
"repo_name": "randyhoffner/FSND-Proj-3",
"id": "c2144aefdce7cd240f40b111b318417af19f1742",
"si... |
from bluesky.plans import rel_scan
from bluesky.callbacks import LiveTable, LivePlot
subs = [LiveTable(['dcm_b', 'xray_eye3_stats1_total', 'xray_eye3_stats2_total']),
LivePlot('xray_eye3_stats1_total', 'dcm_b')]
print(dcm.b.read())
RE(rel_scan([xray_eye3], dcm.b, -.1, .1, 3), subs)
print(dcm.b.read())
| {
"content_hash": "2d825c0fa02399fff0f9712b14c5a0fa",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 82,
"avg_line_length": 34.888888888888886,
"alnum_prop": 0.6751592356687898,
"repo_name": "NSLS-II-CHX/ipython_ophyd",
"id": "96a7ed6c4b7aab5504a3d68bda964913fefaadb7",
"siz... |
from oslo_config import cfg
from senlin.common import utils
from senlin.events import base
from senlin.objects import notification as nobj
class MessageEvent(base.EventBackend):
"""Message driver for event dumping"""
@classmethod
def _notify_cluster_action(cls, ctx, level, cluster, action, **kwargs):
... | {
"content_hash": "87a90eb11dcd28821e90f80b0084efbb",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 76,
"avg_line_length": 40.87719298245614,
"alnum_prop": 0.6510729613733905,
"repo_name": "openstack/senlin",
"id": "352422b9ee02f1243dd7a72c650ed9f34db485c4",
"size": "2879... |
"""Constructs a VM."""
# Verify that both ways of hierarchical imports work.
from helpers import common
import helpers.extra.common2
def GenerateConfig(evaluation_context):
"""Generates config of a VM."""
return """
resources:
- name: %s
type: compute.v1.instance
properties:
description: %s
machineSi... | {
"content_hash": "0cc855f27825ffa1254982dac0df3732",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 62,
"avg_line_length": 26.7,
"alnum_prop": 0.704119850187266,
"repo_name": "jackgr/helm",
"id": "2ea1fb8edc7c02c9a5db992012696b16227c0fc3",
"size": "534",
"binary": false... |
from contentbase.json_renderer import json_renderer
from contentbase.util import get_root_request
from elasticsearch import Elasticsearch
from elasticsearch.connection import Urllib3HttpConnection
from elasticsearch.serializer import SerializationError
from pyramid.settings import (
asbool,
aslist,
)
from .inte... | {
"content_hash": "4d21998cee751db0f38538d99596b154",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 99,
"avg_line_length": 32.34653465346535,
"alnum_prop": 0.6685032139577594,
"repo_name": "kidaa/encoded",
"id": "afa186d80645cfe6cb164b49c6ad8863e92df6f4",
"size": "3267",... |
from numpy.testing import TestCase
from parameterized import parameterized
from .. import stripe_painter as sp
class StripePainterTest(TestCase):
def setUp(self):
self.painter = sp.StripePainter()
@parameterized.expand(
[("BECBBDDEEBABDCADEAAEABCACBDBEECDEDEACACCBEDABEDADD", 26),
("... | {
"content_hash": "1c33a3c5e79401d85a268cbe95e18d00",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 69,
"avg_line_length": 30.11111111111111,
"alnum_prop": 0.6752767527675276,
"repo_name": "aliciawyy/dmining",
"id": "45de8c3b24b673222dab027ea40da9fee56caba4",
"size": "542... |
import json
import logging
import os
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import reverse
from django.utils.decorators i... | {
"content_hash": "1870553313042d1488cc2d03c015fc2a",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 89,
"avg_line_length": 30.88888888888889,
"alnum_prop": 0.706115107913669,
"repo_name": "dkarchmer/django-aws-template",
"id": "3342817045f0c41ef16be783fb6425490bbf4f64",
"... |
"""Strongly connected components.
"""
# Copyright (C) 2004-2016 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils.decorators import not_implemented_for
__authors__ = "... | {
"content_hash": "16ec8641b1a98a1531284aab2ae25ad6",
"timestamp": "",
"source": "github",
"line_count": 423,
"max_line_length": 82,
"avg_line_length": 28.189125295508273,
"alnum_prop": 0.5662529352566253,
"repo_name": "Sixshaman/networkx",
"id": "c2a91606b7fc3d6a83e99e563ab08fbf3ff04cf3",
"size": "... |
"""Test the cli module."""
| {
"content_hash": "57f48b208e1d6b9983d881b3413fa3bd",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 26,
"avg_line_length": 27,
"alnum_prop": 0.5925925925925926,
"repo_name": "nstoik/farm_monitor",
"id": "40b8857c4cbe62e29b3c78bd020b58bf67cc6d2b",
"size": "27",
"binary": ... |
"""OpenStackClient plugin for Workflow service."""
import logging
from osc_lib import utils
LOG = logging.getLogger(__name__)
DEFAULT_WORKFLOW_API_VERSION = '2'
API_VERSION_OPTION = 'os_workflow_api_version'
API_NAME = 'workflow_engine'
API_VERSIONS = {
'2': 'mistralclient.api.v2.client.Client',
}
def make_cl... | {
"content_hash": "deea3371d4eaaa09a74f84c2cc1e461a",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 79,
"avg_line_length": 26.183673469387756,
"alnum_prop": 0.6500389711613406,
"repo_name": "StackStorm/python-mistralclient",
"id": "f1869b427469c877c815d2bf450321246da14a6b",... |
"""Add a unique constraint on tenant_id and ha_vr_id of l3 ha router
Revision ID: efcfc172aca4
Revises: efcfc171aca4
Create Date: 2014-06-27 18:35:28.148680
"""
revision = 'efcfc172aca4'
down_revision = 'efcfc171aca4'
migration_for_plugins = [
'*'
]
from alembic import op
from neutron.db import migration
TA... | {
"content_hash": "8f9f207c9054633b7da0210ecaf86b2a",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 71,
"avg_line_length": 20.522727272727273,
"alnum_prop": 0.6733111849390919,
"repo_name": "CingHu/neutron-ustack",
"id": "1496ea88de5affaa03c8d3e602bf52cf7649c2a5",
"size":... |
from ....testing import assert_equal
from ..maths import ApplyMask
def test_ApplyMask_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_file=dict(argstr='%s',
mandatory=Tr... | {
"content_hash": "8cd76d2de497a01940f5e4ced8d267c5",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 78,
"avg_line_length": 24.203703703703702,
"alnum_prop": 0.6082631981637338,
"repo_name": "FCP-INDI/nipype",
"id": "d3745676623fb83eb58c7b193761f3619f37a108",
"size": "1361... |
from datetime import datetime, timedelta
from django.test import TestCase
from couchforms.models import XFormInstance, XFormArchived
from couchforms.signals import xform_archived, xform_unarchived
from couchforms import fetch_and_wrap_form
class TestFormArchiving(TestCase):
def testArchive(self):
form = ... | {
"content_hash": "fbd9164716f57f7ca7a941a0657ff6e8",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 71,
"avg_line_length": 35.397260273972606,
"alnum_prop": 0.6486068111455109,
"repo_name": "puttarajubr/commcare-hq",
"id": "d03e47ca5df6a5869aeadc438030473ef341778b",
"size... |
import logging
# Non-stdlib imports
from pylons import c
from ming.utils import LazyProperty
from ming.orm.ormsession import ThreadLocalORMSession
# Pyforge-specific imports
import allura.tasks.repo_tasks
from allura.lib import helpers as h
from allura import model as M
from allura.controllers.repository import Repo... | {
"content_hash": "5c361dcf82580aba7ae9cb92e2315bb8",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 95,
"avg_line_length": 36.92537313432836,
"alnum_prop": 0.6709781729991916,
"repo_name": "leotrubach/sourceforge-allura",
"id": "ff5c0bc5d2c73eb2ff0adf6ae3d1383368e26163",
... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CodeFile'
db.create_table(u'survey_admin_codefile', (
(u'id', self.gf('django.db.models.fields.AutoField... | {
"content_hash": "81bea11c838ce95eebbecc3688ee547a",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 107,
"avg_line_length": 37,
"alnum_prop": 0.5976833976833977,
"repo_name": "sbreslav/mimic",
"id": "cd1b82fdeefb4fc11f3a4f3d012a8b49659bbbd8",
"size": "1319",
"binary": f... |
__author__ = 'Eric Bidelman <ebidel@>'
import logging
import json
import webapp2
PUSH_MANIFEST = 'push_manifest.json'
manifest_cache = {} # filename -> list of push URL mapping.
def use_push_manifest(filename):
global manifest_cache
push_urls = {}
# Read file only if it's not in memory.
if filename in ma... | {
"content_hash": "6507aa631dbc606165efe7e3aa146581",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 28.804054054054053,
"alnum_prop": 0.6586910626319493,
"repo_name": "StickmanVentures/ginger",
"id": "91ec0f340170c33fa5f71825f6967b78a326d7fe",
"siz... |
from .inputs import write_molcas_input
from .output import parse_molcas, Output, Orb, HDF
| {
"content_hash": "94ca7556f02d2d539b9f2f3ecac1768c",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 50,
"avg_line_length": 45,
"alnum_prop": 0.7888888888888889,
"repo_name": "exa-analytics/exatomic",
"id": "b846fa18ffa1681e307ad210981a234c9cdb7feb",
"size": "228",
"binar... |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("https://www.crunchbase.com/funding-rounds")
first_name = driver.find_element_by_id('first_name')
last_name = driver.find_element_by_id('last_name')
email = driver.find_element_by_id('email')... | {
"content_hash": "615ef8809e7b348ca2f0c7c3e9fd33ec",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 55,
"avg_line_length": 26.458333333333332,
"alnum_prop": 0.7196850393700788,
"repo_name": "ZubairHussain/Crunchbase-Startups-Analysis",
"id": "8a91a4368f3100899463245d14dd65d... |
import unittest
from cors import constants
from cors import cors_handler
class TestCorsRequest(unittest.TestCase):
def test_defaultInstance(self):
req = cors_handler.CorsRequest()
self.assertIsNone(req.http_method)
self.assertIsNone(req.origin)
self.assertIsNone(req.request_method... | {
"content_hash": "cac3acc06cfa0a7c42972e076c2369d2",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 78,
"avg_line_length": 34.734375,
"alnum_prop": 0.6437246963562753,
"repo_name": "monsur/cors-python",
"id": "9a28c93a58e7d94cbc01e733f191d8568a5b4f44",
"size": "2223",
"... |
"""Tests for test_utils."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
import numpy as np
from deeplab.evaluation import test_utils
class TestUtilsTest(absltest.TestCase):
def test_read_test_image(self):
im... | {
"content_hash": "c9f7b1a2b3bce9e7980e527df872462d",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 77,
"avg_line_length": 32.016949152542374,
"alnum_prop": 0.6363155108523028,
"repo_name": "alexgorban/models",
"id": "9e9bed37e4bf721304e60d7fa12e6cfa9c4b7ef8",
"size": "26... |
import os
import hashlib
from django.db import models
from django.core.files.storage import FileSystemStorage
from django.conf import settings
from django.utils.encoding import force_bytes, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
try:
f... | {
"content_hash": "68a8bd8a1cf85e8f507bad9547785835",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 74,
"avg_line_length": 29.97530864197531,
"alnum_prop": 0.6692751235584844,
"repo_name": "correctiv/correctiv-chartbuilder",
"id": "d983bbbcdf6f46477a0f238a434624008aa867db",... |
'''Trains two recurrent neural networks based upon a story and a question.
The resulting merged vector is then queried to answer a range of bAbI tasks.
The results are comparable to those for an LSTM model provided in Weston et al.:
"Towards AI-Complete Question Answering: A Set of Prerequisite Toy Tasks"
http://arxiv... | {
"content_hash": "1b9cae6eaf89f6d616c200db366c8b70",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 123,
"avg_line_length": 38.83734939759036,
"alnum_prop": 0.6533271288971615,
"repo_name": "DingKe/nn_playground",
"id": "4d3c0ad77ace95803776dcf9660f4d7dda8f4c26",
"size":... |
"""Implementation of DPLL algorithm
Features:
- Clause learning
- Watch literal scheme
- VSIDS heuristic
References:
- http://en.wikipedia.org/wiki/DPLL_algorithm
"""
from __future__ import print_function, division
from collections import defaultdict
from heapq import heappush, heappop
from sympy.core impor... | {
"content_hash": "beba809bf7c2ded6935e87ed67a1bc8b",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 81,
"avg_line_length": 31.914332784184513,
"alnum_prop": 0.512543877761718,
"repo_name": "kmacinnis/sympy",
"id": "c07e89d1134bb0de86d3ff93235962ce6104484d",
"size": "1937... |
from __future__ import unicode_literals
import calendar
import datetime
import re
import sys
try:
from urllib import parse as urllib_parse
except ImportError: # Python 2
import urllib as urllib_parse
import urlparse
urllib_parse.urlparse = urlparse.urlparse
from email.utils import formatdate
fro... | {
"content_hash": "acb0d92da45dc93954b6ec61b4b6413a",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 95,
"avg_line_length": 34.47540983606557,
"alnum_prop": 0.6371849738468854,
"repo_name": "eltonsantos/django",
"id": "f4911b4ec0015b2d42e4ce6c4de55ec2c410a206",
"size": "8... |
"""Very quick and dirty module to do basic GPIO stuff on /sys/class/gpio/ (to which normal users can be given access with relative safety,
/dev/mem, which RPi.GPIO uses is definitely root-only -land)"""
import os
#TODO: Steal the epoll idea from https://github.com/derekstavis/python-sysfs-gpio/blob/master/src/sysfs/g... | {
"content_hash": "670ba3abe03505b280c2057d0f78774e",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 139,
"avg_line_length": 32.31884057971015,
"alnum_prop": 0.6322869955156951,
"repo_name": "jautero/nfc_lock",
"id": "6b8e9cc6be7be6dcc46ee7eb026086f428695ddf",
"size": "227... |
from datetime import datetime
from dateutil.parser import parse
import inspect
import itertools
import json
import pytz
import re
from requests.exceptions import HTTPError
import six
import sys
from onecodex.exceptions import (
MethodNotSupported,
OneCodexException,
PermissionDenied,
ServerError,
)
fro... | {
"content_hash": "ba655950bdd78376119791dc0acdee2a",
"timestamp": "",
"source": "github",
"line_count": 631,
"max_line_length": 100,
"avg_line_length": 37.729001584786054,
"alnum_prop": 0.567522157348679,
"repo_name": "onecodex/onecodex",
"id": "da7288e0837f920e0289d88260906812aeec6e06",
"size": "2... |
import os
import unittest
import mock
import pyfakefs.fake_filesystem_unittest as fake_filesystem_unittest
from dem.project.environment import EnvironmentBuilder
from dem.project.reader import Config
class TestEnvironmentBuilder(fake_filesystem_unittest.TestCase):
def setUp(self):
self.setUpPyfakefs()
... | {
"content_hash": "341554f33375a0057dd27247f7f0a443",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 96,
"avg_line_length": 38.57692307692308,
"alnum_prop": 0.7088733798604188,
"repo_name": "nitehawck/dem",
"id": "35a3b89f68f46f4f26da5b3061f071351f2d66c7",
"size": "2006",
... |
from setuptools import setup
__author__ = 'leandroloi'
__license__ = "GPL"
__version__ = "0.0.1"
__maintainer__ = "Leandro Loi"
__email__ = "leandroloi at gmail dot com"
setup(
name='bov-eod-scrapper',
version='1',
author='Leandro Loi',
description=('A End Of Day scrapper and API for Bovespa'),
li... | {
"content_hash": "d1454dba21ec485f91376ea727d7f129",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 62,
"avg_line_length": 21.375,
"alnum_prop": 0.6345029239766082,
"repo_name": "leandroloi/bovespa-eod",
"id": "7413b27ff33090033ff09d35d4292fc5b30e27f9",
"size": "366",
"... |
import tkinter
import subprocess
import signal
import shlex
import threading
from subprocess import Popen
def mouse_only_ui(cmd_arg):
cmd = (shlex.split(cmd_arg)
if isinstance(cmd_arg, (str,))
else cmd_arg)
if not isinstance(cmd, (list,)):
raise ValueError()
#
app_state... | {
"content_hash": "d6e7a2d1f187d482aa058b0f9066ac26",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 80,
"avg_line_length": 29.253333333333334,
"alnum_prop": 0.46604375569735645,
"repo_name": "ransomw/dotfiles",
"id": "74203e40029ec6ec8a0231029a3ac772ec5360e6",
"size": "4... |
from msrest.serialization import Model
class UnmanagedFileSystemReference(Model):
"""Details of the file system to mount on the compute cluster nodes.
All required parameters must be populated in order to send to Azure.
:param mount_command: Required. Command used to mount the unmanaged file
system... | {
"content_hash": "dcf07d7565d156f69a623c3013b400a3",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 78,
"avg_line_length": 38.696969696969695,
"alnum_prop": 0.6742364917776038,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "5f1e465c1d1fb10bac92d92190616bf5dc3c499a",
... |
""" Sample command-line program for listing Google Dataproc Clusters"""
import argparse
import os
from apiclient import discovery
from google.cloud import storage
from oauth2client.client import GoogleCredentials
# Currently only the "global" region is supported
REGION = 'global'
DEFAULT_FILENAME = 'pyspark_sort.py'... | {
"content_hash": "7ae79b3b0b51cb6c8f907a3f0561b5fc",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 79,
"avg_line_length": 33.591928251121075,
"alnum_prop": 0.6290214924576158,
"repo_name": "clarko1/Cramd",
"id": "426a73e5c78224ee6d81e31dff258f4a3daedac0",
"size": "8054"... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../../'))
# -- General ... | {
"content_hash": "c408581098fba5261bd08c897848c7a8",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 85,
"avg_line_length": 31.846774193548388,
"alnum_prop": 0.7065079767029627,
"repo_name": "openeventdata/phoenix_pipeline",
"id": "32e53bb81a1f6e0f89c4fc3aaa8633dabd1b0c99",... |
from marshmallow import Schema, fields, validate
from app.basemodels import db, CRUD
class {Resources}(db.Model, CRUD):
id = db.Column(db.Integer, primary_key=True)
{db_rows}
def __init__(self, {init_args}):
{init_self_vars}
class {Resources}Schema(Schema):
not_blank = valida... | {
"content_hash": "d7d4a433f0d1ae32620c4b1b94cd64e5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 69,
"avg_line_length": 22.894736842105264,
"alnum_prop": 0.6137931034482759,
"repo_name": "Leo-G/T",
"id": "9676b3eb92fc4c72fa09d9f6a70b53381f13dde1",
"size": "435",
"bin... |
import os
from pathlib import Path
from pytorch_lightning.callbacks import ModelCheckpoint
from deepspeech_pytorch.configs.lightning_config import ModelCheckpointConf
class CheckpointHandler(ModelCheckpoint):
def __init__(self, cfg: ModelCheckpointConf):
super().__init__(
dirpath=cfg.dirpat... | {
"content_hash": "f4a475ac4eb1e8ac00a2a4d877f098fb",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 83,
"avg_line_length": 33.17391304347826,
"alnum_prop": 0.6310615989515073,
"repo_name": "SeanNaren/deepspeech.pytorch",
"id": "279c588595e9c5d5841822fb26ea38ec9acf8776",
"... |
from webViews.view import normalView
from webViews.dockletrequest import dockletRequest
from flask import redirect, request, abort, render_template
class registerView(normalView):
template_path = 'register.html'
@classmethod
def post(self):
form = dict(request.form)
if (request.form.get('u... | {
"content_hash": "a57162f89fb1e324fa4725402c4cee4a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 235,
"avg_line_length": 41.111111111111114,
"alnum_prop": 0.6891891891891891,
"repo_name": "FirmlyReality/docklet",
"id": "bae545723e66dfe266c8ff0af52596ecfb49053a",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.