text stringlengths 4 1.02M | meta dict |
|---|---|
"""
hello
Scenario for Hello World module
:copyright: (c) 2013 by Openlabs Technologies & Consulting (P) Limited
:license: Modified BSD, see LICENSE for more details.
"""
import uuid
MODEL = 'hello.hello'
METHOD = 'create'
def generate():
return {
'args': [
[{
... | {
"content_hash": "db0f794f145bddf2e170945557869d3a",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 74,
"avg_line_length": 17.24,
"alnum_prop": 0.5150812064965197,
"repo_name": "openlabs/tryton-bench",
"id": "cbddcbfe4aba9250c9428199d0ec8e032476f30a",
"size": "455",
"bi... |
import json
import requests
from airflow.exceptions import AirflowException
from airflow.providers.http.hooks.http import HttpHook
class DingdingHook(HttpHook):
"""
This hook allows you send Dingding message using Dingding custom bot.
Get Dingding token from conn_id.password. And prefer set domain to
... | {
"content_hash": "f887a8a9fe97d2661a9b813d242a51fe",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 94,
"avg_line_length": 38,
"alnum_prop": 0.5782608695652174,
"repo_name": "wooga/airflow",
"id": "00e8b4e6f49684e90a7e155efbca412af65304e5",
"size": "5158",
"binary": fa... |
from _pytest.assertion.util import assertrepr_compare
from springfield import Entity
def pytest_assertrepr_compare(config, op, left, right):
"""
Provide field-by-field comparisons if someone
uses `assert a==b` to compare two entities.
"""
left_ent = isinstance(left, Entity)
right_ent = isinsta... | {
"content_hash": "dae9732a138ed968397a4616bbd734e3",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 55,
"avg_line_length": 30.38888888888889,
"alnum_prop": 0.6691042047531993,
"repo_name": "six8/springfield",
"id": "9b01e04c1a45d086fd1496984f1a665e5ae5054e",
"size": "547"... |
from __future__ import unicode_literals
from datetime import date
from json import loads
from django.core.serializers import serialize
from django.test import TestCase
from django.utils.six import StringIO
from multigtfs.models import Feed, Frequency, Route, Service, Trip
from multigtfs.models.fields import Seconds
... | {
"content_hash": "8a1e9e954bf5bbf22e72f8d80c532af0",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 74,
"avg_line_length": 40.9609375,
"alnum_prop": 0.6517261110051498,
"repo_name": "inmagik/django-multi-gtfs",
"id": "4151ac331f9139702fddf345aaaa1d9632331f67",
"size": "5... |
from selenium import webdriver
from fixture.session import SessionHelper
from fixture.mantis_project import ProjectHelper
from fixture.james import JamesHelper
from fixture.mail import MailHelper
from fixture.signup import SignupHelper
from fixture.soap import SoapHelper
class Application:
def __init__(self, brow... | {
"content_hash": "94c33b0f771a1db80d005ec9a09cbd37",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 66,
"avg_line_length": 29.69047619047619,
"alnum_prop": 0.6174819566960705,
"repo_name": "ainur-fa/python_training_mantis",
"id": "0f75826530dfce84f8f1c0f3abd7de65c93d7327",
... |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
from tasklog import views
urlpatterns = patterns('',
# Examples:
url(r'^$', views.home, name='home'),
)
| {
"content_hash": "c9e9b323db723baef58fb7d84852f741",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 51,
"avg_line_length": 23.083333333333332,
"alnum_prop": 0.7111913357400722,
"repo_name": "lrsjohnson/time-log",
"id": "ffb4ab084cc7960994923ce9944154a2c526269d",
"size": "... |
from setuptools import setup, find_packages
from pip.req import parse_requirements
from pip.download import PipSession
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.t... | {
"content_hash": "dd9e204cab5f92c675529e5cb6fd3b52",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 119,
"avg_line_length": 33.67567567567568,
"alnum_prop": 0.6725521669341894,
"repo_name": "edgarklerks/composablepairingheap",
"id": "79f6d5cf1b148e730eca8d27c977610624336aa8... |
"""
@author: David John Gagne (djgagne@ou.edu)
"""
from collections import OrderedDict
import numpy as np
from scipy.ndimage import find_objects
class EnhancedWatershed(object):
"""
The enhanced watershed performs image segmentation using a modified version of the traditional watershed technique.
It inc... | {
"content_hash": "aa2de63dccb951cc4580e9908a652136",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 141,
"avg_line_length": 43.8411214953271,
"alnum_prop": 0.5507709798905706,
"repo_name": "djgagne/hagelslag",
"id": "c5622a2f59947787f49bcc1e86383fcdcacf334f",
"size": "14... |
import StringIO
import hashlib
from math import floor
from PySide.QtGui import QPixmap
def transformToLists(*args):
params = []
for arg in args:
if arg is not None and not isinstance(arg, list):
params.append([arg])
else:
params.append(arg)
return params
def inv_duration(duracion_string):
l = duracion... | {
"content_hash": "188f693462901527d39811231b38bb0e",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 59,
"avg_line_length": 21.94,
"alnum_prop": 0.6768459434822243,
"repo_name": "andimarafioti/intercomunicador",
"id": "89d94f6354f2946e0683ce7d573fd03d930d2b1d",
"size": "2... |
import weakref
from . import attributes
from .. import util
from .. import exc as sa_exc
from . import util as orm_util
class IdentityMap(object):
def __init__(self):
self._dict = {}
self._modified = set()
self._wr = weakref.ref(self)
def keys(self):
return self._dict.keys()
... | {
"content_hash": "afdccf4eb0dc13d9340ce34d490b4af9",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 77,
"avg_line_length": 28.617210682492583,
"alnum_prop": 0.5404396515968478,
"repo_name": "williamfeng323/py-web",
"id": "8f4304ad2633f70a2d31a5639cf1bf67a7c6c153",
"size"... |
tests=[
("python","UnitTestDbConnect.py",{}),
("python","UnitTestDbUtils.py",{}),
("python","UnitTestDbResultSet.py",{}),
("python","StorageUtils.py",{}),
]
longTests=[
]
| {
"content_hash": "c66d89b9d2bbce858ead792cb3ba6be9",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 41,
"avg_line_length": 16.90909090909091,
"alnum_prop": 0.5860215053763441,
"repo_name": "strets123/rdkit",
"id": "b2ffe5ee54bf41d2252049f11d4624a6e5212ea0",
"size": "187",... |
from __future__ import absolute_import, division, print_function
import sys
import textwrap
import _pytest.assertion as plugin
import py
import pytest
from _pytest.assertion import util
from _pytest.assertion import truncate
PY3 = sys.version_info >= (3, 0)
@pytest.fixture
def mock_config():
class Config(objec... | {
"content_hash": "a1cf844082a79dbfdb0510716d6b5c6d",
"timestamp": "",
"source": "github",
"line_count": 1030,
"max_line_length": 114,
"avg_line_length": 33.24563106796116,
"alnum_prop": 0.5027888911602372,
"repo_name": "flub/pytest",
"id": "c385f6aa100da6810d9b85ff45dbcaf024d590d7",
"size": "34288"... |
"""
MozTrap root URLconf.
"""
from django.conf.urls import patterns, url, include
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from moztrap.model import mtadmin
admin.site = mtadmin.MTAdminSite()
admin.autodiscover()
import session_csrf
session_csrf... | {
"content_hash": "fa1f986e597a4a4918464803ad23be62",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 78,
"avg_line_length": 32.67272727272727,
"alnum_prop": 0.4557595993322204,
"repo_name": "mccarrmb/moztrap",
"id": "39407192e8575b0d4386234ea9457c40c50da1c4",
"size": "1797... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/scout/camokit/shared_camokit_rori.iff"
result.attribute_template_id = -1
result.stfName("item_n","camokit_rori")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "868a3533aac9bf8ce6c1fd65a29c9409",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 74,
"avg_line_length": 23.384615384615383,
"alnum_prop": 0.694078947368421,
"repo_name": "anhstudios/swganh",
"id": "d7fec1f82a9fc2a965d98df131f95c11e8e16e42",
"size": "449... |
import praw
import time
# initializes reddit api stuff
user_agent = ("username getter 1.0 by /u/darkfire613 "
"https://github.com/darkfire613/username-getter")
r = praw.Reddit(user_agent = user_agent)
# load sublist
sublist = []
with open('sublist') as file:
for line in file:
sublist.append(... | {
"content_hash": "fae45d2f9bf8893ebe78fe9ba7163997",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 91,
"avg_line_length": 27.022222222222222,
"alnum_prop": 0.6381578947368421,
"repo_name": "darkfire613/username-getter",
"id": "37f266fa2b14e0605ff0e4abe547a40362ea1578",
"... |
import functools
from typing import Tuple
from acme.specs import EnvironmentSpec
from acme.tf import networks
import sonnet as snt
import tensorflow as tf
def make_value_func_bsuite(environment_spec: EnvironmentSpec,
value_layer_sizes: str = '50,50',
adversarial_... | {
"content_hash": "11fbee3d0f3d434236991570fc940392",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 68,
"avg_line_length": 36.86206896551724,
"alnum_prop": 0.6576239476145931,
"repo_name": "liyuan9988/IVOPEwithACME",
"id": "7b3836229ef712176c40a856a2274ae2235060b7",
"size... |
import sys
for line in sys.stdin:
data = line.strip().split("GET ")
if len(data) > 1:
filename = data[1].split(" ")[0]
print "{0}\t".format(filename)
| {
"content_hash": "a627fb759e7be510d22d5e0caa912485",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 40,
"avg_line_length": 22,
"alnum_prop": 0.5511363636363636,
"repo_name": "np1810/Hadoop_and_MapReduce",
"id": "8f39c569bef0fa1b2139304f21f88df9b1fdd61f",
"size": "346",
"... |
"""Custom implementation of multiprocessing.Pool with custom pickler.
This module provides efficient ways of working with data stored in
shared memory with numpy.memmap arrays without inducing any memory
copy between the parent and child processes.
This module should not be imported if multiprocessing is not
availabl... | {
"content_hash": "7889b53c4bccdcf1ceba0036d95fba1c",
"timestamp": "",
"source": "github",
"line_count": 650,
"max_line_length": 79,
"avg_line_length": 40.44307692307692,
"alnum_prop": 0.6321895922093731,
"repo_name": "RTHMaK/RPGOne",
"id": "aca8db5a15af6e13773a3ac954d28d6cb87dd119",
"size": "26288"... |
def lum_contrast(clip, lum = 0, contrast=0, contrast_thr=127):
""" luminosity-contrast correction of a clip """
def fl_image(im):
im = 1.0*im # float conversion
corrected = im + lum + factor*(im-thr)
corrected[corrected < 0] = 0
corrected[corrected > 255] = 255
retur... | {
"content_hash": "4047e02975dff6b34310ed77e4fc7bc0",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 62,
"avg_line_length": 35.27272727272727,
"alnum_prop": 0.5979381443298969,
"repo_name": "DevinGeo/moviepy",
"id": "992b420e71e0ca163b88f8de5528a6ea95fb7e84",
"size": "388"... |
"""
Some fixture methods
"""
import os
import pytest
import autobreadcrumbs
class FixturesStorageParameters(object):
"""Mixin containing some basic settings"""
def __init__(self):
# Base fixture datas directory
self.tests_dir = 'project_test/tests'
self.fixtures_dir = 'data_fixtures'
... | {
"content_hash": "a66c3fb1be5e68fa5de63c5df5723706",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 75,
"avg_line_length": 28.37704918032787,
"alnum_prop": 0.6637781629116117,
"repo_name": "sveetch/autobreadcrumbs",
"id": "c9e312df867ce5f4c816ba6abcb09501b104912c",
"size"... |
"""
Python representations of the JSON Schema Test Suite tests.
"""
from functools import partial
from pathlib import Path
import json
import os
import re
import subprocess
import sys
import unittest
import attr
from jsonschema.validators import _VALIDATORS
import jsonschema
def _find_suite():
root = os.enviro... | {
"content_hash": "da76d1675f9401a8ea3caa42b0fd6771",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 78,
"avg_line_length": 29.261410788381742,
"alnum_prop": 0.5520419739081112,
"repo_name": "python-jsonschema/jsonschema",
"id": "f3129e045fc938d96ba43b227865f7177d14eda1",
... |
import version_independent as ind
namespace = "http://www.dmg.org/PMML-4_0"
class PMML(ind.PMML):
"""Represents a <PMML> tag in v4.0 and provides methods to convert to PFA."""
def __init__(self, attribs):
super(PMML, self).__init__()
self.version = None
for key, value in at... | {
"content_hash": "9f8b36ba645a0c009defc406eacff0c4",
"timestamp": "",
"source": "github",
"line_count": 2715,
"max_line_length": 306,
"avg_line_length": 36.9171270718232,
"alnum_prop": 0.5968971365858525,
"repo_name": "opendatagroup/hadrian",
"id": "39ff0a050b29575a93865d2727cdbc86c09500d0",
"size"... |
import dataclasses
import json # type: ignore
import re
from typing import Callable, Dict, List, Optional, Sequence, Tuple, Union
import warnings
from google.api_core import gapic_v1, path_template, rest_helpers, rest_streaming
from google.api_core import exceptions as core_exceptions
from google.api_core import retr... | {
"content_hash": "ea46d8406b240f36ae668321db84cede",
"timestamp": "",
"source": "github",
"line_count": 1005,
"max_line_length": 105,
"avg_line_length": 40.43482587064677,
"alnum_prop": 0.5849595196495805,
"repo_name": "googleapis/python-compute",
"id": "406ed7aa63c5eb47a1319ac61009fc054189eb5f",
"... |
import numpy as np
from cs231n.layers import *
from cs231n.rnn_layers import *
class CaptioningRNN(object):
"""
A CaptioningRNN produces captions from image features using a recurrent
neural network.
The RNN receives input vectors of size D, has a vocab size of V, works on
sequences of length T, has an RN... | {
"content_hash": "9110f637f1129f379600b36c62cb9999",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 91,
"avg_line_length": 37.175925925925924,
"alnum_prop": 0.6344956413449564,
"repo_name": "5hubh4m/CS231n",
"id": "c0dfa782b9e0f36d468bf4819ec63b91ea4857ba",
"size": "8030... |
from windmill.authoring import WindmillTestClient
def setup_module(module):
module.client = WindmillTestClient(__name__)
def testPass():
client.click(id=u'story')
client.type(text=u'asdfaasdf', id=u'story')
client.click(id=u'flavor')
client.select(option=u'Strawberry', id=u'flavor')
client.cli... | {
"content_hash": "8be42834e5ee3602cf243a6ae7732e5b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 87,
"avg_line_length": 38.25,
"alnum_prop": 0.6993464052287581,
"repo_name": "windmill/windmill",
"id": "4bba593ed7829f518a5cf07b403d3676f73a6f99",
"size": "661",
"binary... |
from abc import abstractmethod
class Observer():
"""
Implements Observer entity from Observer pattern.
An Observer can subscribe to an Observable to receive all future notifications.
"""
def __init__(self, name="observer"):
"""
Creates Observer.
An Observer is uniquely def... | {
"content_hash": "b959f1db73d666e0b50c00c5d8038324",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 83,
"avg_line_length": 27.341772151898734,
"alnum_prop": 0.6148148148148148,
"repo_name": "ssls/beetle-agent",
"id": "0074a85a3f0baffa4b55720b2800be72278c3e9b",
"size": "21... |
from dynamic_rest.viewsets import DynamicModelViewSet
from restapi.models import (
CasProtein,
Locus,
LocusSpacerRepeat,
Organism,
OrganismCasProtein,
OrganismSelfSpacer,
Repeat,
Spacer
)
from restapi.serializers import (
CasProteinSerializer,
LSRSerializer,
LocusSerializer,... | {
"content_hash": "b3917ae9afc2899e41e744f740f7e4eb",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 71,
"avg_line_length": 23.897727272727273,
"alnum_prop": 0.7113647170708511,
"repo_name": "goyalsid/phageParser",
"id": "c360734acf1239ea9668b726dd0670f97b736323",
"size": ... |
import base64
import unittest
import mock
IMAGE_CONTENT = b'/9j/4QNURXhpZgAASUkq'
IMAGE_SOURCE = 'gs://some/image.jpg'
PROJECT = 'PROJECT'
B64_IMAGE_CONTENT = base64.b64encode(IMAGE_CONTENT).decode('ascii')
def _make_credentials():
import google.auth.credentials
return mock.Mock(spec=google.auth.credential... | {
"content_hash": "c22775e412be694fbe78607eff68a69a",
"timestamp": "",
"source": "github",
"line_count": 457,
"max_line_length": 79,
"avg_line_length": 42.77242888402626,
"alnum_prop": 0.6410190822121041,
"repo_name": "Fkawala/gcloud-python",
"id": "af6e23a6b01a0c97b40acdf8f4a91fa833d0f73b",
"size":... |
from libsaas import http, parsers
from libsaas.services import base
from .resource import BasecampResource
class AttachmentResource(BasecampResource):
path = 'attachments'
@base.apimethod
def get(self, page=None):
"""
Fetch all resources.
:var page: the page that will be return.
... | {
"content_hash": "ba2c2b594f066037a0498841f1dcbc4e",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 61,
"avg_line_length": 24,
"alnum_prop": 0.6612903225806451,
"repo_name": "80vs90/libsaas",
"id": "c69f53c2f8cc3f772b5980ddcec9b588d552b652",
"size": "744",
"binary": fal... |
from __future__ import print_function
import abc
import collections
import threading
import time
from supriya.tools import osctools
from supriya.tools.systemtools.SupriyaValueObject import SupriyaValueObject
class Request(SupriyaValueObject):
### CLASS VARIABLES ###
__slots__ = (
'_condition',
... | {
"content_hash": "e768ce89e17bd5589e37397fd44415a3",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 76,
"avg_line_length": 28.94871794871795,
"alnum_prop": 0.604074402125775,
"repo_name": "andrewyoung1991/supriya",
"id": "7331be235b36def625c5759078dc41426c7ec126",
"size"... |
from datetime import timedelta
from django.core.management import call_command
from tests.test_case import AppTestCase
from wagtailstreamforms.models import Form, FormSubmission
class Tests(AppTestCase):
fixtures = ["test"]
def test_command(self):
form = Form.objects.get(pk=1)
to_keep = For... | {
"content_hash": "4cca3b3599e9153138fb9bf4ae4582db",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 74,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.7,
"repo_name": "AccentDesign/wagtailstreamforms",
"id": "71bcb5296a3739d9e37fc034c60c318a915da6a2",
"size": "760... |
"""Implementation of JSONDecoder
"""
import re
import sys
import struct
from scanner import make_scanner
def _import_c_scanstring():
try:
raise ImportError # because assumes simplejson in path
from simplejson._speedups import scanstring
return scanstring
except ImportError:
retu... | {
"content_hash": "8170ab879c6c108f0ec3205314a1534e",
"timestamp": "",
"source": "github",
"line_count": 423,
"max_line_length": 78,
"avg_line_length": 35.93617021276596,
"alnum_prop": 0.5448983619498717,
"repo_name": "Jai-Chaudhary/termite-data-server",
"id": "0f7d5f1c122ba8a723ba88d45e3759bc4db03d48... |
from pandas_ml.misc.patsy_wraps import transform_with_patsy # noqa
| {
"content_hash": "303d7d8342698146ab0c79464e778fde",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 69,
"avg_line_length": 36.5,
"alnum_prop": 0.7397260273972602,
"repo_name": "sinhrks/pandas-ml",
"id": "b2a63263ad878bd118ddb9ab9a703da42510725d",
"size": "96",
"binary": ... |
import os
import platform
import subprocess
from sys import exit
FILE_CREAT = 'start_gn_nexmo'
def pip_install(osx=''):
if osx == 'red':
subprocess.call(['sudo easy_install pip'],shell=True)
subprocess.call(['sudo pip install django==1.8.5'],shell=True)
subprocess.call(['sudo pi... | {
"content_hash": "09246b0f78fd7e04782bcbfa317e381a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 110,
"avg_line_length": 39.23880597014925,
"alnum_prop": 0.5850133130467858,
"repo_name": "AdvaiyaLabs/Google-Cloud-with-Nexmo-SMS",
"id": "af929fab5e45b8b89cdef991e262538cfd... |
import copy
import itertools
import re
import operator
from datetime import datetime, timedelta, date
from collections import defaultdict
import numpy as np
from numpy import percentile as _quantile
from pandas.core.base import PandasObject
from pandas.core.common import (_possibly_downcast_to_dtype, isnull, _NS_DTY... | {
"content_hash": "eaa6c736f6d8a29e3287081eb42e3650",
"timestamp": "",
"source": "github",
"line_count": 4969,
"max_line_length": 79,
"avg_line_length": 34.072851680418594,
"alnum_prop": 0.5421185059182082,
"repo_name": "BigDataforYou/movie_recommendation_workshop_1",
"id": "abfc5c989056ee03ce5ca181cc... |
"""
Abstract base class upon which all front-ends are built.
"""
class IFrontEnd:
def __init__(self):
pass
def go(self):
print "OVERLOAD ME!"
pass
def submit(self, input, user):
"Submits a line of input for Howie to process, from a particular user."
# must delay th... | {
"content_hash": "fe06dfa84c3864b5a89b6ced36259b1d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 79,
"avg_line_length": 24.90909090909091,
"alnum_prop": 0.6204379562043796,
"repo_name": "mpetyx/pychatbot",
"id": "c633ff688a99fe26f8e11cf0ad8efa7036e3faef",
"size": "548"... |
import os
import sys
# ------------------------------------------------------------------------
#
# #TODO #FIXME Airflow 2.0
#
# Old import machinary below.
#
# This is deprecated but should be kept until Airflow 2.0
# for compatibility.
#
# ------------------------------------------------------------------------
# ... | {
"content_hash": "aee023735722868518d3130699dd61a4",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 74,
"avg_line_length": 31.69736842105263,
"alnum_prop": 0.5350767953507679,
"repo_name": "gtoonstra/airflow",
"id": "38a7dcfebed2cdd0a2b5a6d24bf609ef502c93be",
"size": "322... |
import scrapy
from scrapy.selector import Selector
from XboxBC.items import MetacriticXbox360Item
import re
class MetacriticXbox360(scrapy.Spider):
name = "MetacriticXbox360"
allowed_domains = ["metacritic.com"]
start_urls = (
'http://www.metacritic.com/browse/games/score/metascore/all/xbox360/all?... | {
"content_hash": "a0a9a3eea733727d6441e779357003ff",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 124,
"avg_line_length": 51.90625,
"alnum_prop": 0.6219145093317279,
"repo_name": "NickTalavera/Xbox-One-Backwards-Compatibility-Predictions",
"id": "1e1efe60e8f3a5e3965adbc75... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('maps', '0002_auto_20170202_0028'),
]
operations = [
migrations.CreateModel(
name='Album',
f... | {
"content_hash": "de503e92a44c1b76fc36372708dc3e0c",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 132,
"avg_line_length": 38.8125,
"alnum_prop": 0.5829307568438004,
"repo_name": "agilman/django_maps2",
"id": "b87270b1cac747baf0bd40d979970b9979e1649f",
"size": "1313",
... |
import pytest
from cactusbot.api import CactusAPI
from cactusbot.handlers import CommandHandler
from cactusbot.packets import MessagePacket
command_handler = CommandHandler(
"TestChannel", CactusAPI("test_token", "test_password"))
def verify(message, expected, *args, **kwargs):
"""Verify target substitution... | {
"content_hash": "f892f1f25ecc43cc6ae8967c18c37d0c",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 67,
"avg_line_length": 20.899159663865547,
"alnum_prop": 0.548854041013269,
"repo_name": "CactusDev/CactusBot",
"id": "6b2483248d0ee89882ebde89de09e57c78ba1a0d",
"size": "... |
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import types
import fnmatch
from os.path import basename
from pygments.lexers._mapping import LEXERS
from pygments.plugin... | {
"content_hash": "4e7a63a4229f3c82eaebe3f732fe1a52",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 78,
"avg_line_length": 32.46120689655172,
"alnum_prop": 0.6113397955118842,
"repo_name": "sergioska/EvernoteSyntaxHighlight",
"id": "20f9c01c6c536ee43e293c47545768fe2ae35973... |
from __future__ import annotations
import typing
from ..core import Add, Basic, Integer, Lambda, Mul, Pow, Symbol
from ..core.mul import _keep_coeff
from ..core.relational import Relational
from ..core.sympify import sympify
from ..utilities import default_sort_key
from .precedence import precedence
from .str import ... | {
"content_hash": "f9f974c2b7d6254fc07d72554a48c13b",
"timestamp": "",
"source": "github",
"line_count": 508,
"max_line_length": 103,
"avg_line_length": 38.253937007874015,
"alnum_prop": 0.561210312355272,
"repo_name": "diofant/diofant",
"id": "206a24dfb15f78fbd3ac7750af7a1904dffa0cb4",
"size": "194... |
"""Unit tests for the utility functions used by the placement API."""
import fixtures
from oslo_middleware import request_id
import webob
from nova.api.openstack.placement import microversion
from nova.api.openstack.placement import util
from nova import objects
from nova import test
from nova.tests import uuidsenti... | {
"content_hash": "a23a9855ea156142cdca4ff8ed6ee978",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 79,
"avg_line_length": 37.08637873754153,
"alnum_prop": 0.582907820478366,
"repo_name": "rajalokan/nova",
"id": "48e9ad0750e710a2c00497792df8c3098f797882",
"size": "11737"... |
def load(provider, name, **kargs):
try:
if provider == 'ec2':
from ec2 import Provider
return Provider(name, **kargs)
print 'Error: no such provider: %s' % provider
return False
except BaseException, e:
print e | {
"content_hash": "5acc8b5052757a21353036240b18eb0e",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 48,
"avg_line_length": 22.8,
"alnum_prop": 0.6754385964912281,
"repo_name": "tiwilliam/ecluster",
"id": "fe27198509ef968dadf644da9d18e82400335a5d",
"size": "228",
"binary... |
"""
test_examples
~~~~~~~~~~~~~
:copyright: 2015 by Daniel Neuhäuser
:license: BSD, see LICENSE.rst for details
"""
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'examples'))
import math_expr
class TestMath(object):
"""
Tests for the `examples/math_expr.py` ... | {
"content_hash": "dbecb940c21e18fe690067fffb5a3fc9",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 71,
"avg_line_length": 26.204545454545453,
"alnum_prop": 0.603642671292281,
"repo_name": "DasIch/pratt",
"id": "84424edbfed3205f70eae5929af6883ff155aeed",
"size": "1172",
... |
import os
import re
import sys
from pom_handlers import DependencyInfo
from pom_utils import PomUtils
class PomProperties(object):
def safe_property_name(self, property_name):
"""Replace characters that aren't safe for bash variables with an underscore"""
return re.sub(r'\W', '_', property_name)
def ... | {
"content_hash": "8e141110d135306fc110ac9c5bce6f51",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 94,
"avg_line_length": 28.078125,
"alnum_prop": 0.6633277685030606,
"repo_name": "ericzundel/mvn2pants",
"id": "985f028786f944f60474c128a48808e47d6c1539",
"size": "1966",
... |
from sympy.polys import Poly, LexPoly, roots, \
SymbolsError, PolynomialError
from sympy.polys.algorithms import poly_groebner
from sympy.utilities import any, all
def solve_poly_system(system, *symbols):
"""Solves a system of polynomial equations.
Returns all possible solutions over C[x_1, x_2, ..., ... | {
"content_hash": "6c2bd9b79902a2aa26a59367ff6f46a4",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 71,
"avg_line_length": 33.78991596638655,
"alnum_prop": 0.6023377269335987,
"repo_name": "fperez/sympy",
"id": "78fe757a12b4e4c7f117175ff6a4cf879869727c",
"size": "4021",
... |
import getopt
import socket
import sys
from coapthon.client.helperclient import HelperClient
from coapthon.utils import parse_uri
__author__ = 'Giacomo Tanganelli'
client = None
def usage(): # pragma: no cover
print "Command:\tcoapclient.py -o -p [-P]"
print "Options:"
print "\t-o, --operation=\tGET|P... | {
"content_hash": "e4b697e59128894f1f1a3f70840c2f73",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 105,
"avg_line_length": 29.67080745341615,
"alnum_prop": 0.5128741888214361,
"repo_name": "mcfreis/CoAPthon",
"id": "a903a1ce27fb1d312d129eb75aab16c94d14be65",
"size": "47... |
from __future__ import division
import ast
import _ast
try:
# Python 3+
NameConstant = _ast.NameConstant
except AttributeError:
# Python 2.7
NameConstant = _ast.Name
class NotSafeExpression(Exception):
pass
class UnsafeNode(Exception):
pass
class Evaler(object):
ALLOWED_NODES = {
... | {
"content_hash": "63c5249d77b0a74fb9eae688815145ae",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 70,
"avg_line_length": 24.43046357615894,
"alnum_prop": 0.5264299268094335,
"repo_name": "utter-step/exleval",
"id": "341bf0d3de2f84090193877a393b3ca231b0049c",
"size": "3... |
from django.views.generic import ListView, DetailView, CreateView, \
DeleteView, UpdateView, \
ArchiveIndexView, DateDetailView, \
DayArchiveView, MonthArchiveView, \
TodayArchiveView, Wee... | {
"content_hash": "89ba5d3b9ce20b007d0353d2dbf57441",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 74,
"avg_line_length": 28.937062937062937,
"alnum_prop": 0.6897051715804736,
"repo_name": "tnemisteam/cdf-steps",
"id": "648c23b71a85421c97f9af1ceb5f4f247031c2a3",
"size":... |
import os
import sys
import json
import time
import random
import urllib
import hashlib
from datetime import datetime
try:
from urllib.parse import quote, quote_plus, urlparse
except:
from urllib import quote, quote_plus
from urlparse import urlparse
from qingcloud.conn.auth import QSSignatureAuthHandler
... | {
"content_hash": "afcbd35fab43de02937b679927d4f661",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 81,
"avg_line_length": 34.552123552123554,
"alnum_prop": 0.543859649122807,
"repo_name": "Xuanwo/qingcloud-sdk-python",
"id": "89c61b5119330aad4244232d4b083bb8c3f01a84",
"... |
import re
# from https://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case
def snake_case(string):
''' Takes a string that represents for example a class name and returns
the snake case version of it. It is used for model-to-key conversion '''
s1 = re.sub('(.)(... | {
"content_hash": "cddb88c309b49425aac74a0c781fa98e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 109,
"avg_line_length": 28.78048780487805,
"alnum_prop": 0.5949152542372881,
"repo_name": "getfleety/coralillo",
"id": "d78bf6192fe22fdbef0564bbe25baa70deadc77e",
"size": "... |
class LivingRoom(object):
light = False
def set_light(self, light):
self.light = light
def get_light(self):
return self.light
| {
"content_hash": "b13fa2197cc38a79956c75d0f07cb623",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 31,
"avg_line_length": 19.5,
"alnum_prop": 0.6089743589743589,
"repo_name": "metaodi/hostages",
"id": "3383cf73c11ddbbe0051c09f6d1d6e40399a87c8",
"size": "156",
"binary": ... |
"""
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re
# python 2 and python 3 ... | {
"content_hash": "acc558786336749b08e046aa459549ec",
"timestamp": "",
"source": "github",
"line_count": 1529,
"max_line_length": 268,
"avg_line_length": 42.00457815565729,
"alnum_prop": 0.5467497080576099,
"repo_name": "project-ncl/pnc-cli",
"id": "99ea3f26196827574c6495e63d54019abf9839bc",
"size":... |
"""Facilities for displaying status messages with job progress.
"""
from googlecloudsdk.core import log
STATUS_REPORTING_NONE = 'none'
STATUS_REPORTING_CHANGES = 'changes'
STATUS_REPORTING_PERIODIC = 'periodic'
class ProgressReporter(object):
"""Wraps an object implementing the AbstractWaitPrinter interface.
... | {
"content_hash": "09c96af0d003a23d186f8d542d739011",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 79,
"avg_line_length": 31.827868852459016,
"alnum_prop": 0.6886428019572496,
"repo_name": "wemanuel/smry",
"id": "9811927c862fbdcf135ba2aa75ed91ee933a2b62",
"size": "3934"... |
from . import bar
def progressbar(iterator, min_value=0, max_value=None,
widgets=None, prefix=None, suffix=None, **kwargs):
progressbar = bar.ProgressBar(
min_value=min_value, max_value=max_value,
widgets=widgets, prefix=prefix, suffix=suffix, **kwargs)
for result in progressb... | {
"content_hash": "c01962f48997b13719f5be41de99f89a",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 66,
"avg_line_length": 32.27272727272727,
"alnum_prop": 0.6619718309859155,
"repo_name": "WoLpH/python-progressbar",
"id": "f882a5a23a93d52cc276d59bda00872481b65b06",
"size... |
from __future__ import print_function
import subprocess
import sys
import os
import json
from util import appendline, get_ip_address
if __name__ == "__main__":
path = os.path.dirname(os.path.realpath(__file__))
config = json.load(open(path+'/cluster-config.json'));
for node in config['nodes']:
files = subprocess.... | {
"content_hash": "94450cf4b770c6a570c5c9acbfe66017",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 127,
"avg_line_length": 41.23529411764706,
"alnum_prop": 0.6861626248216833,
"repo_name": "wangyangjun/StreamBench",
"id": "d6ca0382a7b7cff4298d6a754c2cde4747340163",
"size... |
__author__ = 'max'
from unittest import TestCase
from mock import patch
from mockriak import create_mock_riak_client
from drow import models
from drow.errors import InvalidConfig
def decoder(value):
pass
def encoder(value):
pass
def creation_validator(data):
pass
def storage_validator(data):
pa... | {
"content_hash": "15f1b73906f5f5b5f02be612d49af21d",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 78,
"avg_line_length": 34.55232558139535,
"alnum_prop": 0.585562847046946,
"repo_name": "Sendhub/drow",
"id": "0c3166ecb2ecc9261a4535bb56ced17a5ecfe4d3",
"size": "5943",
... |
import time
_hello_resp = '''\
<html>
<head>
<title>Hello {name}</title>
</head>
<body>
<h1>Hello {name}!</h1>
</body>
</html>'''
def hello_world(environ, start_response):
start_response('200 OK', [ ('Content-type','text/html')])
params = environ['params']
resp = _hello_resp.format(na... | {
"content_hash": "002849dc5882a41fc31fdbae9316d57b",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 69,
"avg_line_length": 26.595744680851062,
"alnum_prop": 0.624,
"repo_name": "SysCompass/compass-adapters",
"id": "75b24d05f6f285d74d7f4554acd33ca758928959",
"size": "1250"... |
import fiona
import os
import shutil
import tempfile
import unittest
from fiona.ogrext import calc_gdal_version_num, get_gdal_version_num
"""
OGR 54bit handling: https://trac.osgeo.org/gdal/wiki/rfc31_ogr_64
Shapefile: OFTInteger fields are created by default with a width of 9
characters, so to be unambiguously read... | {
"content_hash": "7c9a681e67bfa098469f0c1194cf7376",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 79,
"avg_line_length": 38.69565217391305,
"alnum_prop": 0.6183520599250937,
"repo_name": "perrygeo/Fiona",
"id": "35f4eaa66fc5144d7c4b503d6b778781584898de",
"size": "2670",... |
"""Support for Salda Smarty XP/XV Ventilation Unit Sensors."""
import datetime as dt
import logging
from homeassistant.core import callback
from homeassistant.const import (
TEMP_CELSIUS,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_TIMESTAMP,
)
import homeassistant.util.dt as dt_util
from homeassistant.helpers... | {
"content_hash": "00e703ce323b6f51cc38cffaa6a5d051",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 88,
"avg_line_length": 29.778350515463917,
"alnum_prop": 0.6025618833304484,
"repo_name": "fbradyirl/home-assistant",
"id": "16d910beeb5b576e947e2ce4b4da927adb5056e3",
"si... |
from flask import Flask, render_template, request
from tenseflow.database import db_session
from tenseflow.models import Answer
from tenseflow import change_tense
app = Flask(__name__)
@app.teardown_appcontext
def shutdown_session(exception=None):
db_session.remove()
@app.route('/', methods=['GET', 'POST'])
... | {
"content_hash": "f5cd9c5b4cf90440134ab9cac0296ca8",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 104,
"avg_line_length": 25.576923076923077,
"alnum_prop": 0.630827067669173,
"repo_name": "bendichter/tenseflow",
"id": "751a23eead228cf5557c93756e690aa055cc485b",
"size": ... |
import pkg_resources
__VERSION__ = pkg_resources.require('omise')[0].version
| {
"content_hash": "3176986cae124ca77537019b18bce6c9",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 55,
"avg_line_length": 38.5,
"alnum_prop": 0.7402597402597403,
"repo_name": "omise/omise-python",
"id": "3c3e4835519935541579fb93e78cdc6ee3d6a41a",
"size": "77",
"binary":... |
from __future__ import with_statement
import os
import os.path
try:
import unittest2 as unittest
except ImportError:
import unittest
from fabric.api import *
from fabric.state import connections
import fabtools
from fabtools import require
def version():
"""
Get the vagrant version as a tuple
... | {
"content_hash": "a9fdb412b453bb2bbdcf8b7333d32b52",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 77,
"avg_line_length": 27.18617021276596,
"alnum_prop": 0.5494032478966934,
"repo_name": "pahaz/fabtools",
"id": "9c1765c789bb34c794f6400d268a459c9a2fc541",
"size": "5111"... |
import json
import sys
sys.path.append('..')
from spytify import Spotify
from spytify import AuthorizationCode, ClientCredentials
def load_config():
with open('config.json') as config_file:
return json.loads(config_file.read())
def create_spotify():
config = load_config()
auth = ClientCredentia... | {
"content_hash": "594787729cb95184d70a5d2189fbc1d7",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 74,
"avg_line_length": 21.1,
"alnum_prop": 0.7109004739336493,
"repo_name": "cauebs/spytify",
"id": "6011ec81f2344926c49213db1cd7302c72a04080",
"size": "422",
"binary": f... |
"""A WSGI server implementation using a shared thread pool."""
import collections
import errno
import httplib
import logging
import select
import socket
import threading
import time
import google
from cherrypy import wsgiserver
from google.appengine.tools.devappserver2 import errors
from google.appengine.tools.dev... | {
"content_hash": "0a6ca806daddd98c84025c814cc64dcc",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 80,
"avg_line_length": 33.44887780548628,
"alnum_prop": 0.6566018042197868,
"repo_name": "yencarnacion/jaikuengine",
"id": "14fd3f83e422551146932cfc0e1cd9ebc51cd6b3",
"siz... |
from __future__ import absolute_import, division, print_function
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed w... | {
"content_hash": "427393d1921e08f4798970c5d6bc0d72",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 78,
"avg_line_length": 29.51851851851852,
"alnum_prop": 0.5508155583437893,
"repo_name": "JWDebelius/scikit-bio",
"id": "e0b6eddfb325e9b252a71742af54294631ef90cc",
"size": ... |
from homebrain import Agent, Dispatcher, Event
from websocket_server import WebsocketServer
import threading
import logging
import json
class WebSocket(Agent):
autostart = True
def __init__(self):
super(WebSocket, self).__init__()
self.target = self.identifier
self.server = Websocket... | {
"content_hash": "f624867c7b95b9da3820ed1c598ca4af",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 87,
"avg_line_length": 36.80263157894737,
"alnum_prop": 0.5652484805148373,
"repo_name": "Homebrain/Homebrain",
"id": "85e8b458cf356cb36f4ff37c9574732025034d89",
"size": "2... |
import lxml.html
from mock import Mock
from preggy import expect
from holmes.config import Config
from holmes.reviewer import Reviewer
from holmes.validators.anchor_without_any_text import (
AnchorWithoutAnyTextValidator
)
from holmes.utils import _
from tests.unit.base import ValidatorTestCase
from tests.fixtures... | {
"content_hash": "e8d6b0a974f6370c174e99a3ef8aad01",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 111,
"avg_line_length": 31.420289855072465,
"alnum_prop": 0.6166974169741697,
"repo_name": "holmes-app/holmes-api",
"id": "333b03a54bf13cc793169a80c1eddb04ff1710d8",
"size"... |
import datetime
import sys
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
from ... import _serialization
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
... | {
"content_hash": "5f6afca5787b50a34b086dcf1c1f5760",
"timestamp": "",
"source": "github",
"line_count": 2952,
"max_line_length": 283,
"avg_line_length": 41.073170731707314,
"alnum_prop": 0.6441838215888097,
"repo_name": "Azure/azure-sdk-for-python",
"id": "62019aca48610c3b44cf6b705cc2b1498bced00b",
... |
"""Provides functions for computing minors of a graph."""
from itertools import chain
from itertools import combinations
from itertools import permutations
from itertools import product
import networkx as nx
from networkx import density
from networkx.exception import NetworkXException
from networkx.utils import arbitr... | {
"content_hash": "ff92a145fa50eea0fb8b191a2fdb4395",
"timestamp": "",
"source": "github",
"line_count": 461,
"max_line_length": 96,
"avg_line_length": 39.23861171366595,
"alnum_prop": 0.6197136381226159,
"repo_name": "andnovar/networkx",
"id": "059d8daa545d458f3a36b45567b0c1cf1d2b0dcf",
"size": "18... |
"""
Provides a function to report all internal modules for using freezing tools
pytest
"""
def freeze_includes():
"""
Returns a list of module names used by pytest that should be
included by cx_freeze.
"""
import py
import _pytest
result = list(_iter_all_modules(py))
result += list(_i... | {
"content_hash": "5d6a30d116e6732f1b0d27b482d2ba14",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 84,
"avg_line_length": 25.681818181818183,
"alnum_prop": 0.5690265486725664,
"repo_name": "randyzingle/tools",
"id": "f9d613a2b641adcf597b392422a16f95834a28ce",
"size": "11... |
from collections import namedtuple
from pykit.dictutil import FixedKeysDict
RSConfig = namedtuple('RSConfig', 'data,parity')
def _replica(n=None):
# data_replica can not be smaller than 1
if n is None:
return 1
n = int(n)
if n < 1:
raise ValueError('N.O. replica must >=1')
retu... | {
"content_hash": "765092452c4d430334d28616214a4d81",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 55,
"avg_line_length": 19.818181818181817,
"alnum_prop": 0.5978593272171254,
"repo_name": "sejust/pykit",
"id": "cf18464467fd54eb0f05cd0ef2495c4f7ad37141",
"size": "693",
... |
__author__ = 'Martin Galpin'
__contact__ = 'm@66laps.com'
__version__ = '1.0'
__license__ = 'Apache License, Version 2.0'
def lap_difference(session, lap):
'''Gets the time difference between this lap and the previous lap.'''
index = lap.index
return None if not index else lap.length - session.laps[index - 1].l... | {
"content_hash": "61e49e8a24992a5f7928afb1aba88375",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 80,
"avg_line_length": 38.11764705882353,
"alnum_prop": 0.6957304526748971,
"repo_name": "galpin/python-openmotorsport",
"id": "e92becde58c16960bd1c58b5805e6a17a4072d48",
... |
"""
Composite Panel (:mod:`structmanager.structelem.panelcomp`)
========================================================
.. currentmodule:: structmanager.structelem.panelcomp
"""
import numpy as np
from .base import SE2D
class PanelComp(SE2D):
"""Composite Panel
This class should be used for cylindrical p... | {
"content_hash": "a80edaee54fa036c489815ee896d1734",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 93,
"avg_line_length": 31.116883116883116,
"alnum_prop": 0.5425709515859767,
"repo_name": "saullocastro/structMan",
"id": "595095f5a22b02859e590d379c478d4c09140250",
"size"... |
from __future__ import unicode_literals
import re
import sys
from .columns import ColumnList
from .preferences import BomPref
from . import units
from . import debug
from .sort import natural_sort
# String matches for marking a component as "do not fit"
DNF = [
"dnf",
"dnl",
"dnp",
"do not fit",
... | {
"content_hash": "0863eee69714e80fb4771a1e88b07c77",
"timestamp": "",
"source": "github",
"line_count": 699,
"max_line_length": 111,
"avg_line_length": 30.454935622317596,
"alnum_prop": 0.5325535512965051,
"repo_name": "SchrodingersGat/KiBoM",
"id": "95dd89c3603a9e0f10cbdc0ea9bbdd241cd15823",
"size... |
#!/usr/bin/env python
#
# Appcelerator Titanium Module Packager
#
#
import os, subprocess, sys, glob, string
import zipfile
from datetime import date
cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
os.chdir(cwd)
required_module_keys = ['architectures', 'name','version','moduleid','descripti... | {
"content_hash": "934d53031a048dd43072b947adb21a85",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 137,
"avg_line_length": 31.647686832740213,
"alnum_prop": 0.6758124367480041,
"repo_name": "caffeinalab/ti.material",
"id": "25a9281a2c98a00bf482f263ef860bbdadadf7d5",
"si... |
import os
import Globals
import Engine, World
import aiMove, aiBattle
mobsFromFile = Globals.mobsFromFile
fileList = []
for region in Globals.RegionsList:
directoryFiles = os.listdir('blueprints/mob/'+str(region)+'/')
for obj in directoryFiles:
path = str(region)+'/'+ obj
fileList.append(path)
def loadMobs(... | {
"content_hash": "0c00f802b647a37d80c0e766a0cdee43",
"timestamp": "",
"source": "github",
"line_count": 542,
"max_line_length": 225,
"avg_line_length": 31.59409594095941,
"alnum_prop": 0.683426769446391,
"repo_name": "buckets1337/MotherMUD",
"id": "5e826abb0cc05978ac81992a05a7cf22e67aa60a",
"size":... |
import idaapi
import idc
import sark
def message(*messages):
for msg in messages:
for line in msg.splitlines():
idaapi.msg("[Autostruct] {}\n".format(line))
class AutoStruct(idaapi.plugin_t):
flags = idaapi.PLUGIN_PROC
comment = "AutoStruct struct creator"
help = "Automagically C... | {
"content_hash": "f42c5f4fa9c05d2c5cb34924a8422b63",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 90,
"avg_line_length": 32.80555555555556,
"alnum_prop": 0.5956816257408976,
"repo_name": "HackerTool/Sark",
"id": "54d5dae1f6bfb3f5197b47097320665420707ab4",
"size": "2362"... |
from yum.plugins import TYPE_CORE
from os import walk, path, fstat
requires_api_version = '2.3'
plugin_type = (TYPE_CORE,)
VERBOSE_DEBUGLEVEL = 3
def _stat_ino_fp(fp):
"""
Get the inode number from file descriptor
"""
return fstat(fp.fileno()).st_ino
def get_file_list(rpmpath):
"""
Enumerat... | {
"content_hash": "c20ce2f05af343485872d9392e42b4ba",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 110,
"avg_line_length": 25.32758620689655,
"alnum_prop": 0.607215793056501,
"repo_name": "ax2d/ansible-docker",
"id": "fe55805326d668cc3a53f22e5ee2217bba098182",
"size": "1... |
#!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | {
"content_hash": "8232a81efe6ebcef6f70329b69655f4c",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 98,
"avg_line_length": 31.456521739130434,
"alnum_prop": 0.5710665745219995,
"repo_name": "xieta/mincoin",
"id": "6bf36f05ec132eb88881fa464f6ceac80c4bec75",
"size": "4341"... |
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from collections import namedtuple
class Reporter(object):
"""Formats and emits reports.
Subclasses implement the callback methods, to provide specific reportin... | {
"content_hash": "6fabc0678abed387a475cfa25f1ba7e8",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 93,
"avg_line_length": 32.53623188405797,
"alnum_prop": 0.6837416481069042,
"repo_name": "Ervii/garage-time",
"id": "f13784f3d2a2bad4d70f1248611840871d0518d9",
"size": "239... |
from .static import StaticCalculation
from .relax import IonRelaxation
__author__ = 'Guillermo Avendano-Franco'
| {
"content_hash": "b7e023f6a9e80883967369c700b76754",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 40,
"avg_line_length": 28.25,
"alnum_prop": 0.7964601769911505,
"repo_name": "MaterialsDiscovery/PyChemia",
"id": "c71f7c825a4a081262a56308ba36711bb6ee3c31",
"size": "113",
... |
"""
Copyright (c) 2015, NeverEatYellowSnow (NEYS)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditio... | {
"content_hash": "74d893cb7415bd7487e7362a358d4f2a",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 93,
"avg_line_length": 34.47794117647059,
"alnum_prop": 0.619321817018554,
"repo_name": "flitzi/acplugins",
"id": "3e3b8f2d4c0b93f83a6efce13c7e3fe99cbdebab",
"size": "4689... |
import sys
sys.path.append('../models/')
from ModelBase import Status, SessionFactory
import codecs
session = SessionFactory()
print unicode(session.query(Status)[0])
| {
"content_hash": "22e17cdff865115834e4329364d12ec7",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 44,
"avg_line_length": 21.125,
"alnum_prop": 0.7751479289940828,
"repo_name": "groceryheist/UWBotThings",
"id": "03514a566e8becf35f14e28e37bc9dbdf367f116",
"size": "169",
... |
import time
from matrixbot import utils
class EchoPlugin:
def __init__(self, bot, settings):
self.name = "EchoPlugin"
self.bot = bot
self.logger = utils.get_logger()
self.logger.info(settings)
self.settings = settings
self.period = self.settings.get('period', 3) #... | {
"content_hash": "f288c8bc5e5b4c987d10b1c1f5f1a6d1",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 67,
"avg_line_length": 31.121951219512194,
"alnum_prop": 0.5963949843260188,
"repo_name": "psaavedra/matrix-bot",
"id": "dd2ea8b47f62c8b4061b0601fd6aafe2d7c7a259",
"size": ... |
import uuid
import re
import hashlib
import time
import formencode
from datetime import datetime, timedelta
from markupsafe import escape
import tornado.auth
from tornado.web import asynchronous, HTTPError
from tornado.options import options
from tornado import escape
from lib.utils import string2int, html_escape
f... | {
"content_hash": "d7ded32aebfdae2a3d517a74f69e4737",
"timestamp": "",
"source": "github",
"line_count": 396,
"max_line_length": 215,
"avg_line_length": 37.5479797979798,
"alnum_prop": 0.5972156836370973,
"repo_name": "feilaoda/FlickBoard",
"id": "afce9a2781ad2464e6751f5989d78d97740df2e9",
"size": "... |
'''
"install" plugin for cocos command line tool
'''
__docformat__ = 'restructuredtext'
import sys
import os
import json
import inspect
from xml.dom import minidom
import shutil
import cocos
class CCPluginDeploy(cocos.CCPlugin):
"""
Install a project
"""
@staticmethod
def depends_on():
... | {
"content_hash": "48e967a10e34235d33b172394f84da06",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 110,
"avg_line_length": 31.470588235294116,
"alnum_prop": 0.6172897196261682,
"repo_name": "AnySDK/Sample_CPP_Cocos2dx",
"id": "cc158431a71cd73981b8f03d5c39c83dc8597c53",
... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('quotetron', '0004_auto_20141224_1213'),
]
operations = [
migrations.RemoveField(
model_name='quote',
name='votes',
)... | {
"content_hash": "90659ec60e5d44cf885ed93232781c6a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 73,
"avg_line_length": 25.862068965517242,
"alnum_prop": 0.564,
"repo_name": "CMU-Robotics-Club/roboticsclub.org",
"id": "4d973c5d588f17ad4db3ebd0b8cccca12d2ddcca",
"size":... |
from functools import wraps
try:
from unittest import mock
except ImportError:
import mock
def _cleanUpPatch(fn):
@wraps(fn)
def cleaned(self, *args, **kwargs):
patch = fn(*args, **kwargs)
self.addCleanup(patch.stop)
return patch.start()
return cleaned
class PatchMixin(o... | {
"content_hash": "9203dd010129da245e8b52b6c0eabd5b",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 50,
"avg_line_length": 22.095238095238095,
"alnum_prop": 0.6724137931034483,
"repo_name": "Julian/Ivoire",
"id": "13d770b75808f0b4e090904e33117073fbdcc0c5",
"size": "464",
... |
"""
Guest tools for ESX to set up network in the guest.
On Windows we require pyWin32 installed on Python.
"""
import array
import gettext
import logging
import os
import platform
import socket
import struct
import subprocess
import sys
import time
gettext.install('nova', unicode=1)
PLATFORM_WIN = 'win32'
PLATFORM_L... | {
"content_hash": "3f4f4514789634b809db1f9cc6ce2648",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 79,
"avg_line_length": 40.485788113695094,
"alnum_prop": 0.5778657135562931,
"repo_name": "anbangr/trusted-nova",
"id": "8c8b4dfc5d8b2a9715f86fd13109c794a13c059a",
"size":... |
import pygame
class spritesheet(object):
def __init__(self, filename):
try:
self.sheet = pygame.image.load(filename).convert()
except pygame.error, message:
print 'Unable to load spritesheet image:', filename
raise SystemExit, message
# Load a specific image... | {
"content_hash": "e5c943946b1d6a1a8760510c0eb02a18",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 64,
"avg_line_length": 36.37777777777778,
"alnum_prop": 0.6096518020769701,
"repo_name": "andersx/myrpg",
"id": "d151742c35166d9550a1f6a03e2f420d8c5f9ac8",
"size": "1637",
... |
from __future__ import print_function
import json
import numpy as np
from app.models import Game
from app.models.tag import compute_reverse_index
from app.utils import data_file
if __name__ == '__main__':
games = list(Game.get_all())
reverse_index = compute_reverse_index(games)
doc_tag_matrix = np.zeros(... | {
"content_hash": "5246be577f66fa57d92370699270ab2e",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 81,
"avg_line_length": 34.875,
"alnum_prop": 0.6463560334528077,
"repo_name": "PapaCharlie/SteamyReviews",
"id": "5878d182f454a5552daf6542aca07b15a49a3218",
"size": "837",
... |
from __future__ import unicode_literals
from __future__ import unicode_literals
from django.db import migrations, connection
from bluebottle.clients import properties
from bluebottle.clients.models import Client
from bluebottle.clients.utils import LocalTenant
from bluebottle.utils.utils import update_group_permissio... | {
"content_hash": "22cbb477d6581951945c1946725b4818",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 74,
"avg_line_length": 26.930232558139537,
"alnum_prop": 0.6010362694300518,
"repo_name": "onepercentclub/bluebottle",
"id": "06806bdbc02dea4aacd055a1151d8142541d460c",
"si... |
"""Tests for direct_fisher_rao."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import direct_fisher_rao as dfr
import numpy as np
import tensorflow as tf
class DirectFisherRaoTest(tf.test.TestCase):
perturbation = 1e-4
rtol = 1e-2
def test_empi... | {
"content_hash": "8899795cca5c935d87ad3ac6b3adb9d5",
"timestamp": "",
"source": "github",
"line_count": 586,
"max_line_length": 80,
"avg_line_length": 41.38737201365188,
"alnum_prop": 0.6005442625654558,
"repo_name": "brain-research/fisher-rao-regularization",
"id": "e0f09c83a0fd617a3f55f7a060b0cd442... |
import mock
from nova.cells import utils as cells_utils
from nova import objects
from nova.tests.functional.api_sample_tests import api_sample_base
class HypervisorsSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
ADMIN_API = True
sample_dir = "os-hypervisors"
def test_hypervisors_list(self):
... | {
"content_hash": "26a9609c4d964c3e49b52d4f694c9fa0",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 79,
"avg_line_length": 38.05769230769231,
"alnum_prop": 0.6013137948458818,
"repo_name": "rajalokan/nova",
"id": "0b14343a709d451dc897982dfa56b7a0b25eeb42",
"size": "6569"... |
import json
from django.forms import Widget, MultipleChoiceField
from django.forms.utils import flatatt
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.utils.translation... | {
"content_hash": "7f78b98ec50cf64d9ece6464a7bae029",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 80,
"avg_line_length": 39.81645569620253,
"alnum_prop": 0.5903671912255604,
"repo_name": "anushbmx/kitsune",
"id": "4c1c99f3c44fccd6cbec95d1e064bf2e3798bb32",
"size": "629... |
import os
import glob
print('Running all modules in tests/')
for file in glob.glob("tests/*.py"):
os.system('nosetests -v ' + file)
| {
"content_hash": "77f46b112c9b8a4059fa429b66b02867",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 38,
"avg_line_length": 17.375,
"alnum_prop": 0.6690647482014388,
"repo_name": "Schille/weimar-graphstore",
"id": "db71ef35e097be808dd9ab871f1a334a1b1fe639",
"size": "210",
... |
import _plotly_utils.basevalidators
class ValueValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="value",
parent_name="heatmap.colorbar.tickformatstop",
**kwargs
):
super(ValueValidator, self).__init__(
plotly_name=plot... | {
"content_hash": "4a04e46420839105042112287ab381e4",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 67,
"avg_line_length": 29.58823529411765,
"alnum_prop": 0.5765407554671969,
"repo_name": "plotly/python-api",
"id": "3c942d0f92fa8ea648d7df1bfede40e46caaf77d",
"size": "503... |
import unittest
import test.util.stress as stress_util
import test.unit.configuration as configuration_module
import voodoo.configuration as ConfigurationManager
import voodoo.sessions.manager as SessionManager
import voodoo.sessions.session_type as SessionType
class SessionManagerTestCase(unittest.TestCase):
... | {
"content_hash": "2c83203691c7595de7a5420b6ef690e4",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 80,
"avg_line_length": 32.06976744186046,
"alnum_prop": 0.6272661348803481,
"repo_name": "zstars/weblabdeusto",
"id": "3cfef89717a2533dbfa3ba95b7820ddcb462df71",
"size": "1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.