text stringlengths 4 1.02M | meta dict |
|---|---|
import variable
import string
statement_ = ""
type_ = ""
is_value = True
def is_whitespace(character):
for i in range(0,len(string.whitespace)):
if character == string.whitespace[i]:
return True
return False
def get_third_parameter(temptext1):
text = temptext1.strip()
if text == ... | {
"content_hash": "b5d8fa739d09100665e9a67d738a0182",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 66,
"avg_line_length": 22.314917127071823,
"alnum_prop": 0.5446892795246349,
"repo_name": "wangxiaozhi123/wuniLang",
"id": "63086f916d9652921c55ae81546f74620907c1b6",
"siz... |
"""
byceps.services.board.topic_command_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from datetime import datetime
from typing import Tuple
from ...database import db
from ...events.board import (
BoardTopicCre... | {
"content_hash": "ff6ace90bdb24b26a2182abed6a89c83",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 80,
"avg_line_length": 25.982456140350877,
"alnum_prop": 0.6737002025658338,
"repo_name": "m-ober/byceps",
"id": "0b879bba7144e9d225c19ff9cb596b7bfa78c265",
"size": "5924"... |
from . import coredata as cdata
from .mesonlib import MachineChoice
import os.path
import pprint
import textwrap
def add_arguments(parser):
parser.add_argument('--all', action='store_true', dest='all', default=False,
help='Show data not used by current backend.')
parser.add_argument('... | {
"content_hash": "7ab5dfa45bb4df4416fd770200e5dacc",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 100,
"avg_line_length": 40.313131313131315,
"alnum_prop": 0.5339513906289151,
"repo_name": "becm/meson",
"id": "5463f162511671b2fb045fe876a99716f4c10f72",
"size": "4580",
... |
from __future__ import unicode_literals
import os
import tempfile
import shutil
import codecs
from django.utils.six import StringIO
from django.test import TestCase
from django.test.utils import override_settings
from django.core.management import call_command
from powerpages.models import Page
from powerpages.sync ... | {
"content_hash": "b938ce69bd26c95d3d59c0a9ef9f0928",
"timestamp": "",
"source": "github",
"line_count": 1045,
"max_line_length": 78,
"avg_line_length": 32.03732057416268,
"alnum_prop": 0.5535111562471997,
"repo_name": "Open-E-WEB/django-powerpages",
"id": "26666b26cacec5d164f722932465baf6c9ee17c4",
... |
"""Support to send data to a Splunk instance."""
import asyncio
from http import HTTPStatus
import json
import logging
import time
from aiohttp import ClientConnectionError, ClientResponseError
from hass_splunk import SplunkPayloadError, hass_splunk
import voluptuous as vol
from homeassistant.const import (
CONF_... | {
"content_hash": "113e2b718910548af984e47cb550957b",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 88,
"avg_line_length": 29.5625,
"alnum_prop": 0.6136363636363636,
"repo_name": "aronsky/home-assistant",
"id": "6b40f9b7d58392a2be162f00d5852bd1e08b2a0e",
"size": "3784",
... |
"""
HTTP server for controlling the Motion process and serving the Android
application. The module consists of the motion process and the functions for
routing the HTTP requests.
"""
from bottle import abort, get, post, request, run, static_file, parse_auth
from events import SnapshotEventHandler
from notifier import A... | {
"content_hash": "2a3824d3b7eb3b9c3c0cf5eb00abefb9",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 79,
"avg_line_length": 26.558823529411764,
"alnum_prop": 0.6231608922638823,
"repo_name": "platzhirsch/security-cam",
"id": "bcd7e5f50dfcbdcfc1862443b2d1ecdcd9af0614",
"si... |
from django.conf import settings
from django.conf.urls import include, url
from cms import views
from cms.apphook_pool import apphook_pool
from cms.appresolver import get_app_patterns
from cms.constants import SLUG_REGEXP
if settings.APPEND_SLASH:
regexp = r'^(?P<slug>%s)/$' % SLUG_REGEXP
else:
regexp = r'^(... | {
"content_hash": "1721fdc8288417e542df4ca0442716ea",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 63,
"avg_line_length": 29.321428571428573,
"alnum_prop": 0.6845310596833131,
"repo_name": "yakky/django-cms",
"id": "c578c84f5f64ac2bd856c4115d4ea30ca1868e2b",
"size": "845... |
__author__ = 'Neil Butcher'
from PyQt4 import QtGui
class CommandChangePerson(QtGui.QUndoCommand):
def __init__(self, person, key, value):
super(CommandChangePerson, self).__init__('Changed the ' + key + ' of ' + person.name)
self.person = person
self.key = key
self.value = value
... | {
"content_hash": "a2c315778a01fde5b07384b8c025916f",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 95,
"avg_line_length": 34.016666666666666,
"alnum_prop": 0.5825575698187163,
"repo_name": "ergoregion/Rota-Program",
"id": "ef83e310fc467788bb8cdd28e8c708563bd78a99",
"size... |
import sys
import os.path
import pprint
sys.path.append(os.path.abspath(__file__ + "\..\.."))
import windows
import windows.test
import windows.debug
from windows.generated_def.winstructs import *
class MyDebugger(windows.debug.Debugger):
def on_exception(self, exception):
code = exception.ExceptionRec... | {
"content_hash": "66ebfefae7b5a65c714056d044861b95",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 70,
"avg_line_length": 29.217391304347824,
"alnum_prop": 0.6696428571428571,
"repo_name": "hakril/PythonForWindows",
"id": "cfcfd370d303a6d96251b5ea4fab2c41670c0a94",
"size... |
"""
.. module:: helpers
:synopsis: XNAT utility functions.
"""
import os
import re
import itertools
from datetime import datetime
from pyxnat.core.resources import Scan
from .constants import (XNAT_TYPES, UNLABELED_TYPES, ASSESSOR_SYNONYMS,
EXPERIMENT_SYNONYM, EXPERIMENT_PATH_TYPES,
... | {
"content_hash": "8ccd7570983167139d12c3e2199deb97",
"timestamp": "",
"source": "github",
"line_count": 342,
"max_line_length": 79,
"avg_line_length": 31.51169590643275,
"alnum_prop": 0.6125081191426185,
"repo_name": "ohsu-qin/qixnat",
"id": "996901e80cde7937497ef819bec9210044c63caa",
"size": "1077... |
import sys
from twisted.internet import defer, protocol
from twisted.protocols.policies import TimeoutMixin
from zope.interface.verify import verifyObject
import six
from txHL7.receiver import IHL7Receiver
class MinimalLowerLayerProtocol(protocol.Protocol, TimeoutMixin):
"""
Minimal Lower-Layer Protocol (ML... | {
"content_hash": "a1721a7c73ac5ef2fc8ed879b5c4264e",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 97,
"avg_line_length": 36.19469026548673,
"alnum_prop": 0.6388753056234718,
"repo_name": "johnpaulett/txHL7",
"id": "f86b2818c6c88b5e670ba7ba2c7abc617c591289",
"size": "40... |
from unittest.mock import patch
import os
# test success under python3.6
def fake_remove(path, *a, **k):
print("remove done")
@patch('os.remove', fake_remove)
def test():
try:
os.remove('%$!?&*') # fake os.remove
except OSError as e:
print(e)
else:
print('test success')
test()
| {
"content_hash": "41f0820163633abe3a9b667d1df4a2e7",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 44,
"avg_line_length": 21.266666666666666,
"alnum_prop": 0.6018808777429467,
"repo_name": "tencrance/cool-config",
"id": "f8adb1d5dc7bca854d39fdb1ca99811ae6c593dc",
"size":... |
from collections import namedtuple
import re
Question = namedtuple('Question', ['id', 'question', 'correct_answer',
'A', 'B', 'C', 'D'])
def generate_next_question(question_file):
with open(question_file) as question_file:
for line in question_file:
yield Question(*line.... | {
"content_hash": "f31ce064712f3483b9720eb15dcec357",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 80,
"avg_line_length": 35.71641791044776,
"alnum_prop": 0.6259924780610113,
"repo_name": "sjvasquez/AIChallenge",
"id": "a0fbc97eba339e889eac65cae1fcb112fa8706dd",
"size": ... |
from auth import connect_sqlite, create_user, initialize_sqlite
from azure import azure_login, azure_create_server
import json
print "lapis - Minecraft + Azure = Wonders"
print "First, you'll need to link your Azure account."
azure_login()
print "Cool! Now, pick a name for your service."
name = raw_input("Name: ")
... | {
"content_hash": "42e58b5250cc51af581a3cf5beee8404",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 84,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.7166469893742621,
"repo_name": "Takmo/lapis",
"id": "b28a9db2b359302d0482a6d19eaa1b007598d003",
"size": "885",
... |
from mox import IsA # noqa
from django.core.urlresolvers import reverse # noqa
from django.core.urlresolvers import reverse_lazy # noqa
from django import http
from horizon.workflows import views
from openstack_dashboard import api
from openstack_dashboard.api import lbaas
from openstack_dashboard.test import hel... | {
"content_hash": "59ec0d2a2b2633f93b5d3adde6d6df1e",
"timestamp": "",
"source": "github",
"line_count": 863,
"max_line_length": 79,
"avg_line_length": 38.684820393974505,
"alnum_prop": 0.5698367530327991,
"repo_name": "ikargis/horizon_fod",
"id": "cc4f524c6d7aac08e9d4c95086c997b4f3a91d99",
"size": ... |
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(name='pymorse',
version='0.1',
description='Python bindings for the Modular OpenRobots Simulation Engine (MORSE)',
author='Séverin Lemaignan',
author_email='severin.lemaignan@laas.fr',
url='http://morse.openrobots.org',
... | {
"content_hash": "6e10556094007e4f2d39c4677e832c1f",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 89,
"avg_line_length": 29.5,
"alnum_prop": 0.6440677966101694,
"repo_name": "Arkapravo/morse-0.6",
"id": "36f21c7869aa52925c26a9d1b86e31f603ae040e",
"size": "355",
"binar... |
import random
import itertools
from simpleai.search import CspProblem, backtrack, min_conflicts
# En el juego Munchkin, cada jugador tiene un personaje al que puede mejorar aplicando diferentes cartas.
# Estas cartas incluyen cosas como armas, armaduras, pociones, maldiciones, y otros modificadores que incrementan el ... | {
"content_hash": "24bef0cd45f9efa069a52d2e26a02377",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 146,
"avg_line_length": 53.36065573770492,
"alnum_prop": 0.7093701996927804,
"repo_name": "MaxiTalenti/IA",
"id": "6b0dbdec4abc7a7bf9a15fc1f5c0a6c3bc48415e",
"size": "3287"... |
"""
Legendre Series (:mod: `numpy.polynomial.legendre`)
===================================================
.. currentmodule:: numpy.polynomial.polynomial
This module provides a number of objects (mostly functions) useful for
dealing with Legendre series, including a `Legendre` class that
encapsulates the usual arith... | {
"content_hash": "f765edd96a540674d8eb1aa1a991a03e",
"timestamp": "",
"source": "github",
"line_count": 1653,
"max_line_length": 87,
"avg_line_length": 31.732607380520268,
"alnum_prop": 0.6015556487589125,
"repo_name": "MSeifert04/numpy",
"id": "281982d0b66c0cecf14ae6a50c45baa8d24306cc",
"size": "5... |
from ctypes import CDLL, py_object
import cv
from os.path import abspath, dirname, join
DN = dirname(abspath(__file__))
def sample(inimage):
out = cv.CreateMat(inimage.height, inimage.width, cv.CV_32FC1)
CDLL(join(DN, '_sample.so')).sample(
py_object(inimage),
py_object(out),
)
re... | {
"content_hash": "24b4e05600a6acc42b88ba426752a0e2",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 66,
"avg_line_length": 21.57894736842105,
"alnum_prop": 0.6121951219512195,
"repo_name": "nwilming/bifl",
"id": "a1cc69826e71708c2de8ac6fb3f01bf61599b010",
"size": "410",
... |
from django.db import models
from six import python_2_unicode_compatible
@python_2_unicode_compatible
class TModelOne(models.Model):
name = models.CharField(max_length=200)
level_one = models.CharField(max_length=20, blank=True, default='one')
def __str__(self):
return self.name
@python_2_unic... | {
"content_hash": "e42a74cdff54ef0a8855471e9deb3fd1",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 74,
"avg_line_length": 22.641509433962263,
"alnum_prop": 0.6325,
"repo_name": "yourlabs/django-autocomplete-light",
"id": "7318ece7cb3eb5f9b9b27f5622ffc2514e6a3120",
"size"... |
import datetime
import errno
from os import getpgid
from os.path import isfile, join as join_paths
from tempfile import gettempdir
from pyramid.settings import asbool
from sqlalchemy.util._collections import lightweight_named_tuple
import venusian
from ines import DOMAIN_NAME, lazy_import_module, NOW, PROCESS_ID, SYS... | {
"content_hash": "77d3aae63ecc5017d5ca377ca5061b8c",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 102,
"avg_line_length": 35.415189873417724,
"alnum_prop": 0.5419257988419472,
"repo_name": "hugobranquinho/ines",
"id": "278ebf22448939070d9adccc139704c3bf4b58e7",
"size":... |
from django.shortcuts import get_object_or_404
from django.template import Context, loader as template_loader
from django.conf import settings
from rest_framework import decorators, permissions, viewsets, status
from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAPIRenderer
from rest_framework.... | {
"content_hash": "4910c436e3d8563b3c0f17dfe0d763df",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 86,
"avg_line_length": 41.34,
"alnum_prop": 0.6942428640541848,
"repo_name": "Acidburn0zzz/readthedocs.org",
"id": "4010e71a9f84dfca6fd9daee80b756bbc9f69505",
"size": "2067... |
"""
Django settings for backend project.
Generated by 'django-admin startproject' using Django 1.10.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os... | {
"content_hash": "119de3b204cfd6e62c857bc6dd03cec2",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 91,
"avg_line_length": 26.139344262295083,
"alnum_prop": 0.6870492317340859,
"repo_name": "harryyyy/berry",
"id": "c7bf211311936eabe464863b25f6299cf15aac92",
"size": "3189... |
"""The tests for the device tracker component."""
# pylint: disable=protected-access
import asyncio
import json
import logging
import unittest
from unittest.mock import call, patch
from datetime import datetime, timedelta
import os
from homeassistant.core import callback
from homeassistant.bootstrap import setup_compo... | {
"content_hash": "da7b3b5af3f60718d14ffea03c1457a4",
"timestamp": "",
"source": "github",
"line_count": 532,
"max_line_length": 79,
"avg_line_length": 41.037593984962406,
"alnum_prop": 0.5880359105899597,
"repo_name": "dmeulen/home-assistant",
"id": "c3087b108e9a816612b3769d54f6ee9c2985f87c",
"size... |
from unittest import mock
import pytest
from openapi_core.testing.datatypes import ResultMock
from openapi_core.validation.shortcuts import validate_response
class TestSpecValidateData:
@mock.patch(
"openapi_core.validation.shortcuts.openapi_response_validator.validate"
)
def test_validator_vali... | {
"content_hash": "924f7e57b789932891f1d64b178d9aae",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 79,
"avg_line_length": 33.60526315789474,
"alnum_prop": 0.7032106499608457,
"repo_name": "p1c2u/openapi-core",
"id": "fbdcfeec7523d7f2bac31eebabee91fa6a991482",
"size": "12... |
import threading, time, requests, json
from raspberric import get_yesterday_consumption, get_informations, get_date_now
POLLING = False
SERVER = "http://devgone.herokuapp.com"
#SERVER = "http://localhost:3000"
def polling(timeInterval, callback, raspberricIds):
i = 0
while True:
callback(i, raspberricIds)
time... | {
"content_hash": "021dd2c6e775ae9326ee810ed4735a15",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 153,
"avg_line_length": 31.2,
"alnum_prop": 0.7387820512820513,
"repo_name": "DevGone/flask",
"id": "ddb5b282fbbfa25cd038324932080f03432ca78c",
"size": "2496",
"binary": ... |
"""
The Desired Capabilities implementation.
"""
class DesiredCapabilities(object):
"""
Set of default supported desired capabilities.
Use this as a starting point for creating a desired capabilities object for
requesting remote webdrivers for connecting to selenium server or selenium grid.
Usag... | {
"content_hash": "f716afdf13cd1630cb877df6c16ff77c",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 84,
"avg_line_length": 23.789473684210527,
"alnum_prop": 0.543141592920354,
"repo_name": "ASOdesk/selenium-pytest-fix",
"id": "a75e4f3e82c618f57a9bb229f12b6c66e0cb81f4",
"... |
"""Add points to TestableResult.
Revision ID: 305b60854a99
Revises: 4d7019b218d4
Create Date: 2013-10-27 22:07:10.819122
"""
# revision identifiers, used by Alembic.
revision = '305b60854a99'
down_revision = '1cf84ddb034c'
from alembic import op
from collections import defaultdict
from sqlalchemy.sql import table, ... | {
"content_hash": "620130aec921da5167425053444ab94d",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 78,
"avg_line_length": 39.44444444444444,
"alnum_prop": 0.5512676056338028,
"repo_name": "ucsb-cs/submit",
"id": "667fddafde19f9d7202a6219244fb7cb8b5f1697",
"size": "3550",... |
from typing import Optional, List
from thinc.types import Floats2d
from thinc.api import Model, reduce_mean, Linear, list2ragged, Logistic
from thinc.api import chain, concatenate, clone, Dropout, ParametricAttention
from thinc.api import SparseLinear, Softmax, softmax_activation, Maxout, reduce_sum
from thinc.api imp... | {
"content_hash": "927fb3621c884be28ef3b0e508d481a4",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 88,
"avg_line_length": 39.83458646616541,
"alnum_prop": 0.6457153642884107,
"repo_name": "spacy-io/spaCy",
"id": "0234530e65dd39bd15305da9c754f1bcfc3e55c0",
"size": "5298"... |
"""'dns changes list' command."""
from apiclient import errors
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
from googlecloudsdk.core import properties
from googlecloudsdk.dns.lib import util
class List(base.Command):
"""List Cloud DNS resource record set changes."""
DE... | {
"content_hash": "f1139bce4b4e4bb3c52c714e975a4590",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 80,
"avg_line_length": 35.65979381443299,
"alnum_prop": 0.6227233304423244,
"repo_name": "ychen820/microblog",
"id": "fc6f8ae84e57cb467bec888fad1bbd398fb1ba81",
"size": "35... |
from random import Random
import numpy as np
import scipy.sparse as sp
from nose.tools import assert_equal
from nose.tools import assert_true
from nose.tools import assert_false
from numpy.testing import assert_array_equal
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_selection import Sel... | {
"content_hash": "63f5ee68a25ac452a92dc80f86405142",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 76,
"avg_line_length": 31.426966292134832,
"alnum_prop": 0.5974258133714694,
"repo_name": "mrshu/scikit-learn",
"id": "ea31f723c36e5d5464185c731b1fb1f0acbd945f",
"size": "2... |
import math
import numpy
class ElasticNet:
def __init__(self, cities, param):
self._cities = cities
self._param = param
self._num_iter = 0
self._k = self._param['init_k']
self._num_neurons = int(self._param['num_neurons_factor'] \
* self._... | {
"content_hash": "b429ec82e7b1795f515832f55ab093ae",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 80,
"avg_line_length": 31.045801526717558,
"alnum_prop": 0.5320875338087042,
"repo_name": "larose/ena",
"id": "6d66cf44f374803d81b1e7ecb065dcdfca69c1db",
"size": "4067",
... |
from django.test import TestCase
from django.http import HttpRequest, HttpResponse, HttpResponseBadRequest
from django.template import Template, Context
from django.template.loader import render_to_string
from django.conf import settings
from honeypot.middleware import HoneypotViewMiddleware, HoneypotResponseMiddleware... | {
"content_hash": "a3303c322698f78d31fe031addb68f5d",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 110,
"avg_line_length": 45.68862275449102,
"alnum_prop": 0.672346002621232,
"repo_name": "mikek/django-honeypot",
"id": "c8b81410f909f617168c05c9d76d996bf06cd7ea",
"size":... |
from __future__ import absolute_import
import binascii
from twisted.internet.protocol import Factory
from twisted.protocols.basic import Int32StringReceiver
from twisted.internet.error import ConnectionDone
from autobahn.twisted.util import peer2str, transport_channel_id
from autobahn.wamp.exception import ProtocolE... | {
"content_hash": "e6a786ffb54f9fc009221ce9f25091e5",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 209,
"avg_line_length": 37.38363171355499,
"alnum_prop": 0.6029965109119518,
"repo_name": "RyanHope/AutobahnPython",
"id": "88bd736039d96eba5cc25f8afe8490044fd83eda",
"siz... |
import numpy as np
class Train:
"""
Iterator class that runs theano functions over data while gathering
the resulting monitoring values for plotting.
"""
def __init__(self, channels, n_batches={'train':None,
'valid':None,
... | {
"content_hash": "b1295fbfcbf2a63142f606aaf2b44fa8",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 80,
"avg_line_length": 45.40229885057471,
"alnum_prop": 0.5506329113924051,
"repo_name": "gngdb/holo-nets",
"id": "ed38c61296494e19ac38f30f413d3721d96e1a4c",
"size": "3973"... |
"""
Misc. useful functions that can be used at many places in the program.
"""
import subprocess as sp
import sys
import warnings
def sys_write_flush(s):
""" Writes and flushes without delay a text in the console """
sys.stdout.write(s)
sys.stdout.flush()
def verbose_print(verbose, s):
""" Only pri... | {
"content_hash": "6d04065ca3d7a61fef606cfb60f3af18",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 80,
"avg_line_length": 28.074468085106382,
"alnum_prop": 0.5930276619931792,
"repo_name": "DevinGeo/moviepy",
"id": "7278c38c90deb0845fab0e4b7b1655124ed91501",
"size": "263... |
import argparse
import collections
import os
import sys
from spinnaker.run import check_run_and_monitor
from spinnaker.run import check_run_quick
from spinnaker.run import run_and_monitor
from spinnaker.run import run_quick
def get_repository_dir(name):
"""Determine the local directory that a given repository is i... | {
"content_hash": "79c60d604e2e3524d5d2ae1f7bb33f56",
"timestamp": "",
"source": "github",
"line_count": 593,
"max_line_length": 80,
"avg_line_length": 40.693086003372684,
"alnum_prop": 0.6109983009406987,
"repo_name": "Roshan2017/spinnaker",
"id": "370581ec148f75ddbc9c5d65f0337270e7036240",
"size":... |
from pocket_change.ui import core
from pocket_change import sqlalchemy_db
from flask import render_template
@core.route('/case_execution_details/<int:case_execution_id>')
def case_execution_details(case_execution_id):
CaseExecution = sqlalchemy_db.models['CaseExecution']
execution = (sqlalchemy_db.sessio... | {
"content_hash": "f5def90c776e8bfa6e7992ae86e34ba7",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 62,
"avg_line_length": 38.57142857142857,
"alnum_prop": 0.687037037037037,
"repo_name": "psusloparov/sneeze",
"id": "0504a9662b87d57b314891b681ca6d4cdbf5a238",
"size": "540... |
from functools import update_wrapper
class Task:
def __init__(self, func):
self.__wrapped__ = None
update_wrapper(self, func)
def __call__(self, *args, **kwargs):
return self.__wrapped__(*args, **kwargs)
def __str__(self):
return "<{cls} {name}()>".format(
cls... | {
"content_hash": "d669f8f62b896cf69d5965437ae64738",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 71,
"avg_line_length": 21.476190476190474,
"alnum_prop": 0.5232815964523282,
"repo_name": "odrling/peony-twitter",
"id": "5f3354eacc00904a3365655e408328bb8d421ba7",
"size":... |
from __future__ import print_function
import os
import sys
sys.path.insert(0, os.path.abspath(os.pardir))
import pyos
from util import option_chooser
pyos.set_setting("identity_type", "rackspace")
creds_file = os.path.expanduser("~/.rackspace_cloud_credentials")
pyos.set_credential_file(creds_file)
cm = pyos.cloud... | {
"content_hash": "c8ea9eb6d5f5d843c30b5d90073f9a23",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 77,
"avg_line_length": 30.53488372093023,
"alnum_prop": 0.7273419649657273,
"repo_name": "emonty/pyos",
"id": "1e30bb71fbebff719c28b83a969c5db0a3162755",
"size": "1997",
... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^blog/', include('blog.urls')),
url(r'^$', 'opos.views.dashboard', name='dashboard'),
url(r'^admin/', include(admin.site.urls)),
url(r'^customer... | {
"content_hash": "66041b91af062c32298b41ccd8a3de5a",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 101,
"avg_line_length": 41.13636363636363,
"alnum_prop": 0.6607734806629835,
"repo_name": "Pr0jectX/O2",
"id": "4b47038bbd182ba01ec97d91bbe29347698d20f6",
"size": "905",
... |
'''
This file is part of uvscada
Licensed under 2 clause BSD license, see COPYING for details
'''
'''
smartctl --scan doesn't seem to work very well, it misses my external HDD
Bug of feature?
[mcmaster@gespenst icons]$ hddtemp /dev/sda
WARNING: Drive /dev/sda doesn't seem to have a temperature sensor.
WARN... | {
"content_hash": "5b3c965650d48d7bb1cb05091c6b2f9a",
"timestamp": "",
"source": "github",
"line_count": 370,
"max_line_length": 152,
"avg_line_length": 29.994594594594595,
"alnum_prop": 0.6473238421337177,
"repo_name": "JohnDMcMaster/uvscada",
"id": "e565cc7ac4c4c22340aa255a25e8652730339e1b",
"size... |
"""Defines fixtures available to all tests."""
import pytest
from webtest import TestApp
from op_mon.app import create_app
from op_mon.database import db as _db
from op_mon.settings import TestConfig
from .factories import UserFactory
@pytest.yield_fixture(scope='function')
def app():
"""An application for the... | {
"content_hash": "bd578b888a02f469a3aca484fdbbbc26",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 46,
"avg_line_length": 19.2,
"alnum_prop": 0.6572916666666667,
"repo_name": "joyider/op_mon",
"id": "b7f8491177ba06968834e451154edf840af6f6bc",
"size": "984",
"binary": f... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/base/shared_poi_all_lair_bones_evil_fire_small.iff"
result.attribute_template_id = -1
result.stfName("lair_n","bones")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "675eca64a064a8f1142833ab5cf9ddeb",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 92,
"avg_line_length": 24.23076923076923,
"alnum_prop": 0.692063492063492,
"repo_name": "obi-two/Rebelion",
"id": "09371a3f0212f5a1c3b521d8a8eedeb5b7f5a0bc",
"size": "460",... |
"""Python client for Google Calendar V3 REST API.
"""
__author__ = 'static@siftcal.com (Ashutosh Priyadarshy)'
from requests_oauthlib import OAuth2Session
class GoogleCalendarAPI(object):
def __init__(self, client_id=None, client_secret=None,
acc_token=None, ref_token=None, expires_in=None,
... | {
"content_hash": "dd61a32ab3f2fa09ab5b571f2ccef32e",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 101,
"avg_line_length": 40.16015625,
"alnum_prop": 0.6347631553350841,
"repo_name": "priyadarshy/google-calendar-v3",
"id": "d31f507034cc0712927b58ff4afa5d580ac0c8b8",
"si... |
import os
from digoie.conf.storage import __reverb_input_dir__, __elastic_search_dir__, REVERB_INPUT_EXT
from digoie.core.http.stream.httpclient import HTTPClient
from digoie.core.http.elasticsearch.query import *
from digoie.core.http.elasticsearch.url import NAMESTREAM_URL, SENTENCESTREAM_URL
from digoie.core.parser.... | {
"content_hash": "5fc3e2d9f42a479decab65fa5b0cac79",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 94,
"avg_line_length": 35.26190476190476,
"alnum_prop": 0.700877785280216,
"repo_name": "ZwEin27/digoie-annotation",
"id": "4a2c38f7d8c25e2e4f8d9510a30853c76deb4251",
"size... |
"""Datasets class to provide images and labels in tf batch.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import flags
import abc
import json
import os
import tensorflow.compat.v1 as tf
from tensorflow.contrib.data import AUTOTUNE
from ten... | {
"content_hash": "0266af290aa513d31426f8ed088e5dad",
"timestamp": "",
"source": "github",
"line_count": 383,
"max_line_length": 80,
"avg_line_length": 36.467362924281986,
"alnum_prop": 0.6412257464022338,
"repo_name": "google-research/s4l",
"id": "61ebbf2a0705cc3457e2bdc56464df4b009e43cf",
"size": ... |
class RawResult:
def __init__(self, title, authors, url):
self.title = title
self.authors = authors
self.url = url
@property
def can_download(self):
return bool(self.url)
def __repr__(self):
return '{}(title={}, authors={}, url={})'.format(
self.__cl... | {
"content_hash": "f2e7d616bf1794c5195e1cbab65c326f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 57,
"avg_line_length": 25.647058823529413,
"alnum_prop": 0.49311926605504586,
"repo_name": "dduong42/Booksee",
"id": "07bfb1d9d241f2f96d6a6846f76a9225b129b52d",
"size": "43... |
"Pythonic simple JSON RPC Client implementation"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2011 Mariano Reingart"
__license__ = "LGPL 3.0"
__version__ = "0.05"
import urllib
from xmlrpclib import Transport, SafeTransport
from cStringIO import StringIO
import random
import sy... | {
"content_hash": "6ad56a250b7a279fddd5c2e541c41774",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 76,
"avg_line_length": 30.70921985815603,
"alnum_prop": 0.6036951501154735,
"repo_name": "jefftc/changlab",
"id": "5143cea7a1cb97554ee2372c61cb41467c00867d",
"size": "4857... |
import json
from udparsers.helpers.errludP_Helpers import hexDump, memConcat, hexConcat, intConcat
class errludP_expscom:
#Explorer Active (RAM) Log Data
def UdParserExpActiveLog(subType, ver, data):
# ***** Memory Layout *****
# Header
# 2 bytes : Ordering byte (0=first packet)
... | {
"content_hash": "ba8b767c3e186d1bf07300c01fc7dc6b",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 87,
"avg_line_length": 35.53191489361702,
"alnum_prop": 0.5967065868263473,
"repo_name": "open-power/hostboot",
"id": "f307746f33b9629e63a428fcd76b4fede6d39023",
"size": "4... |
from django.views.generic import TemplateView, FormView, DetailView, ListView
from django.shortcuts import render,render_to_response
from .models import Post
from django.core.urlresolvers import reverse_lazy
from django.template import RequestContext
from .forms import ConfessForm
# from uuslug import uuslug
# Import P... | {
"content_hash": "a5aa7d6e27d99a6453fdac78591ef322",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 77,
"avg_line_length": 29.48913043478261,
"alnum_prop": 0.7025433099889421,
"repo_name": "amartinez1/confessions",
"id": "345df1455e0871a07a6e6e430ea4bdaa41c2ddab",
"size":... |
'''
NetNS
=====
A NetNS object is IPRoute-like. It runs in the main network
namespace, but also creates a proxy process running in
the required netns. All the netlink requests are done via
that proxy process.
NetNS supports standard IPRoute API, so can be used instead
of IPRoute, e.g., in IPDB::
# start the main... | {
"content_hash": "b75e92d6a9ff4025dd4d029229577d9a",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 77,
"avg_line_length": 31.813504823151124,
"alnum_prop": 0.6016777845158682,
"repo_name": "little-dude/pyroute2",
"id": "6fbd9928422d43c73c999cc80eee1a7e5876d892",
"size":... |
import logging
import subprocess
import sys
import time
from pathlib import Path
cmd_index = "python3 ./build.py index".split()
logging.basicConfig(
format="%(asctime)s %(message)s", level=logging.INFO, stream=sys.stdout
)
for path_str in sys.argv[1:]:
path = Path(path_str)
if path.is_file():
con... | {
"content_hash": "45efe161898e0ceab20ab933a2931e04",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 25.083333333333332,
"alnum_prop": 0.6611295681063123,
"repo_name": "johntellsall/shotglass",
"id": "9cdfc40173e7778a06ae22f17174205409e5023e",
"size"... |
"""
views for the mysmeuh timeline application.
this module grows and gets bloated ... needs a serious refactoring soon, with
an abstraction over pages with meta things over timeline, photos, tracks and
blogs is strongly needed.
"""
import datetime
from django.db.models import Q
from django.views.generic import Te... | {
"content_hash": "c0a12224832d4c0d59466c17e9fe7b1c",
"timestamp": "",
"source": "github",
"line_count": 633,
"max_line_length": 198,
"avg_line_length": 41.467614533965246,
"alnum_prop": 0.5926321002704865,
"repo_name": "amarandon/smeuhsocial",
"id": "fbd679154ae25e1244dbf6e091a3f54b14f1e701",
"size... |
"""Tests of grpc.channel_ready_future."""
import threading
import unittest
import logging
import grpc
from tests.unit.framework.common import test_constants
from tests.unit import thread_pool
class _Callback(object):
def __init__(self):
self._condition = threading.Condition()
self._value = None... | {
"content_hash": "16831e9f68b32a3289d6e9470e7a1d7c",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 71,
"avg_line_length": 34.44047619047619,
"alnum_prop": 0.6543380573798825,
"repo_name": "sreecha/grpc",
"id": "cda157d5c5692e18275f4fa1231d0f59f7ad3359",
"size": "3470",
... |
from pandac.PandaModules import URLSpec
class InstalledHostData:
""" A list of instances of this class is returned by
AppRunner.scanInstalledPackages(). Each of these corresponds to a
particular host that has provided packages that have been
installed on the local client. """
def __init__(sel... | {
"content_hash": "35f2059a58ab531dda683297cc48e2dd",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 72,
"avg_line_length": 37.22727272727273,
"alnum_prop": 0.6422466422466423,
"repo_name": "toontownfunserver/Panda3D-1.9.0",
"id": "470c300da32627924269053828883bf7804abf4a",
... |
from __future__ import unicode_literals
def format_track_data(track):
try:
if track:
artist = ', '.join(track.artists)
title = track.name
return '%u - %u' % (artist, title)
else:
return '<Nothing playing>'
except:
return '<(Exception in f... | {
"content_hash": "a29b6b1160854b8ae0b671044e46c2f3",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 58,
"avg_line_length": 25.92,
"alnum_prop": 0.5169753086419753,
"repo_name": "ismailof/mopidy-btsource",
"id": "a9e1717d7fc3e4d26dd3f334bf39d721faa2800c",
"size": "648",
... |
from model.contact import Contact
def test_add_new_contact(app, db, json_contact):
contact = json_contact
old_contacts_list = db.get_contacts_list()
app.contact.create(contact)
# assert len(old_contacts_list) + 1 == app.contact.count()
new_contacts_list = db.get_contacts_list()
old_contacts_li... | {
"content_hash": "c818b589632edcd28e55c11ef40fdb5e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 111,
"avg_line_length": 41,
"alnum_prop": 0.7095343680709535,
"repo_name": "tkapriyan/python_training",
"id": "932f892a069b38e5d66f243cbad555c85876cf11",
"size": "475",
"... |
"""Provide the CGI graphing interface to the sniffer data."""
import cgi
import os
GRAPHS = '/var/www/graphs/graph-data'
print 'Content-Type: text/html\n'
def IsValidImage(imgfname):
if '/' in imgfname or not os.path.exists(os.path.join(GRAPHS, imgfname)):
return False
return True
def GetMatchingImg(file... | {
"content_hash": "62a6d813e9963f7b00ecd69235d94c75",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 78,
"avg_line_length": 32.47089947089947,
"alnum_prop": 0.5994785725924718,
"repo_name": "steve-goog/apcas",
"id": "a10fdf87a2e90dc470f2d3e3eb943b933bb09144",
"size": "675... |
from tempest.api.identity import base
from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
class DomainConfigurationTestJSON(base.BaseIdentityV3AdminTest):
custom_config = {
"identi... | {
"content_hash": "3d01fbd012489a5922ac28844c855589",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 79,
"avg_line_length": 43.857988165680474,
"alnum_prop": 0.6314085267134377,
"repo_name": "Juniper/tempest",
"id": "f7316970b0437dcd982b168d5fcd16d064c8cb16",
"size": "804... |
import re
from optparse import OptionParser
from ..old_extractors import features
from ..feature_extractors import tokenizer
from ..util import file_handling as fh, defines
def main():
# Handle input options and arguments
usage = "%prog"
parser = OptionParser(usage=usage)
#parser.add_option('-d', des... | {
"content_hash": "cf4dea1a2f6f6d3107ed8e6e5d0d34c5",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 115,
"avg_line_length": 32.922222222222224,
"alnum_prop": 0.567667904151198,
"repo_name": "dallascard/guac",
"id": "4b2b0a3f9ae6a4049e9c041e86e93b3c3c70d28a",
"size": "2963... |
import csv
def unicode_csv_reader(filename, **kw):
for line in csv.reader(filename, **kw):
yield [unicode(c, 'utf-8') for c in line]
| {
"content_hash": "a3499123c161a8141670532644eec516",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 49,
"avg_line_length": 24.5,
"alnum_prop": 0.6326530612244898,
"repo_name": "openvenues/address_normalizer",
"id": "004c0f3ee655bb92aba7ad17c0b6f660be303dc4",
"size": "147",... |
"""Makes figure with gradient-weighted class-activation maps (Grad-CAM)."""
import os
import pickle
import argparse
import numpy
import matplotlib
matplotlib.use('agg')
from matplotlib import pyplot
from PIL import Image
from gewittergefahr.gg_utils import general_utils
from gewittergefahr.gg_utils import radar_utils
... | {
"content_hash": "e78b61d6efe8e3fd035561e8d2766ba3",
"timestamp": "",
"source": "github",
"line_count": 647,
"max_line_length": 80,
"avg_line_length": 37.67078825347759,
"alnum_prop": 0.6611414269888811,
"repo_name": "thunderhoser/GewitterGefahr",
"id": "3c23b3414c4ee06e52e8dbbb271fa0736661f288",
"... |
"""
Django settings for vip project.
Merged with 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
from __future__ i... | {
"content_hash": "7edc1d20c82d3220a415d317d002c6a8",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 114,
"avg_line_length": 30.434343434343436,
"alnum_prop": 0.6886823763690674,
"repo_name": "andyneff/voxel-globe",
"id": "edccd6ca5907592e777b15721441bfcd50bcab3e",
"size"... |
import mock
import netaddr
from neutron_lib import constants
from neutron_lib import exceptions as n_exc
from neutron.common import constants as n_const
from neutron import context
from neutron.ipam.drivers.neutrondb_ipam import db_models
from neutron.ipam.drivers.neutrondb_ipam import driver
from neutron.ipam import ... | {
"content_hash": "d988214343c821b81f87b400f657310c",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 79,
"avg_line_length": 44.72355769230769,
"alnum_prop": 0.5860790110185434,
"repo_name": "cloudbase/neutron",
"id": "4183f990dff4ef55428710ba1e3cd90424e664fe",
"size": "19... |
from __future__ import unicode_literals
import webnotes
@webnotes.whitelist()
def update(ml):
"""update modules"""
webnotes.conn.set_global('hidden_modules', ml)
webnotes.msgprint('Updated')
webnotes.clear_cache() | {
"content_hash": "55f2287b872ddd2ff68f1851d1c1d1f1",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 47,
"avg_line_length": 24.22222222222222,
"alnum_prop": 0.7477064220183486,
"repo_name": "rohitw1991/innoworth-lib",
"id": "5e4d6e0261037de5978c75be07a5b21d4a5de2c5",
"size"... |
"""Provide trimming of input reads from Fastq or BAM files.
"""
import os
import sys
from bcbio import utils
from bcbio.utils import (file_exists, append_stem, replace_directory)
from bcbio.log import logger
from bcbio.distributed import objectstore
from bcbio.provenance import do
from Bio.Seq import Seq
from bcbio.di... | {
"content_hash": "a9e632fdd120bf71975fe06cc91f944c",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 95,
"avg_line_length": 42.90604026845637,
"alnum_prop": 0.645236977944627,
"repo_name": "elkingtonmcb/bcbio-nextgen",
"id": "628561175417a1fc63c00dd0839e43ce70d768b1",
"si... |
"""
Copyright (c) 2020 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute... | {
"content_hash": "c171a882c1c13f49734be3313db70435",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 89,
"avg_line_length": 27.73548387096774,
"alnum_prop": 0.6662014421958595,
"repo_name": "alexforencich/xfcp",
"id": "647ea7fd2f508da1e8a44e0b5aab60e8d6a13a38",
"size": "4... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/booster/shared_bst_moncal_charged_heavy.iff"
result.attribute_template_id = 8
result.stfName("space/space_item","bst_moncal_charged_heavy_n")
#### BEGIN MODIFICATIONS ####
#### END MODIFIC... | {
"content_hash": "0cb78cbf097e2f77957e1e043b116892",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 96,
"avg_line_length": 26.846153846153847,
"alnum_prop": 0.7163323782234957,
"repo_name": "obi-two/Rebelion",
"id": "a5cd1d903a0a58b37287b993a42ea2926e8030c6",
"size": "494... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "8052aa25f75b5f58c8cb9810bf9baf64",
"timestamp": "",
"source": "github",
"line_count": 657,
"max_line_length": 154,
"avg_line_length": 48.336377473363775,
"alnum_prop": 0.6206505652297132,
"repo_name": "arenadata/ambari",
"id": "6607c4c31308475599ea9c32406b3b6ed2b62fb9",
"size": "3... |
from django import forms
from django.db import models
from django.contrib.auth.models import User
from gym_app.models import User, Athlete, Tracker, Exercise, PersonalTrainer, BodyScreening
from django.db.models import Q
class UserForm(forms.ModelForm):
username = forms.CharField(widget=forms.TextInput(attrs={'cla... | {
"content_hash": "2d9d58017928e0bf856620384dd8c825",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 193,
"avg_line_length": 34.388888888888886,
"alnum_prop": 0.5870759289176091,
"repo_name": "brunoliveira8/managyment",
"id": "7523ee7530dcd222b9da73baf3134ef30be54283",
"s... |
from cosmo_tester.framework import util
from cosmo_tester.framework.examples import get_example_deployment
def _infra(image_based_manager, ssh_key, logger, tenant, test_config):
example = get_example_deployment(
image_based_manager, ssh_key, logger, tenant, test_config,
upload_plugin=False)
e... | {
"content_hash": "6295b457fa9049e368b21234785cf389",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 78,
"avg_line_length": 39.77777777777778,
"alnum_prop": 0.6887470071827614,
"repo_name": "cloudify-cosmo/cloudify-system-tests",
"id": "902dc27e9d80fd1cb0e843d12bb542c8406280... |
"""Signature Version 4 test suite.
AWS provides a test suite for signature version 4:
https://github.com/awslabs/aws-c-auth/tree/v0.3.15/tests/aws-sig-v4-test-suite
This module contains logic to run these tests. The test files were
placed in ./aws4_testsuite, and we're using nose's test generators to
dynamically ge... | {
"content_hash": "ddcf44020562ed7634084abbbd41fde7",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 78,
"avg_line_length": 36.979166666666664,
"alnum_prop": 0.6384507042253521,
"repo_name": "pplu/botocore",
"id": "6183ddc123e05c8935050a102131e17ab93f5896",
"size": "7667"... |
from backends import Backend, register_backend
import subprocess
import os
class Text(Backend):
def __init__(self, name):
Backend.__init__(self, name, '.diff')
self._pdftotext = os.path.join(self._utilsdir, 'pdftotext');
def create_refs(self, doc_path, refs_path):
out_path = os.path.j... | {
"content_hash": "720aa30a98a0d8437f1a6f3701dc0d51",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 102,
"avg_line_length": 31.166666666666668,
"alnum_prop": 0.6149732620320856,
"repo_name": "zhongzw/skia-sdl",
"id": "10b660a3e20278b82f727d741bf40ec0b34d758a",
"size": "17... |
"""This module contains description of objects returned by the
conductor.
The actual objects returned are located in resource.py, which aim
is to hide some necessary magic. Current module describes objects
fields via docstrings and contains implementation of helper methods.
"""
from oslo.config import cfg
from sahar... | {
"content_hash": "b459b9c96fd7a5387e4149d420081bda",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 78,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.6548271301719252,
"repo_name": "keedio/sahara",
"id": "6df9a7668b9c85f4791940a48998edb30670ccfd",
"size": "5876"... |
import pytest
@pytest.mark.asyncio
@pytest.mark.usefixtures('mocked_meta_path')
async def test_remote_descriptor():
import importlib
from implant import core
class Foo(core.Command):
foobar = core.Parameter(description='foobar')
remote = core.CommandRemote('foobar_module.Foobar')
mod... | {
"content_hash": "67f052e538fd19a24e18ec088ce0f9af",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 59,
"avg_line_length": 20.70967741935484,
"alnum_prop": 0.6090342679127726,
"repo_name": "diefans/debellator",
"id": "f001a3e691e38e64705e4bfcfcb636cb349ca75e",
"size": "12... |
import asyncio
import logging
from .client import Client
from .client import InsertError
from .client import PoolError
from .client import QueryError
from .client import ServerError
from .client import UserAuthError
from .helpers import cleanup
from .helpers import gen_data
from .helpers import gen_points
from .helpers... | {
"content_hash": "3df3886e3bd623c04c178e5ce65e3c2c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 64,
"avg_line_length": 25.155555555555555,
"alnum_prop": 0.7402826855123675,
"repo_name": "transceptor-technology/siridb-server",
"id": "9ce56c322f355ba52bc75134257a83a0f77eb... |
""" Classes for interpolating values.
"""
from __future__ import division, print_function, absolute_import
__all__ = ['interp1d', 'interp2d', 'spline', 'spleval', 'splmake', 'spltopp',
'ppform', 'lagrange', 'PPoly', 'BPoly', 'NdPPoly',
'RegularGridInterpolator', 'interpn']
import itertools
fro... | {
"content_hash": "fb4d92c665b3d82a262315ae47f24dd9",
"timestamp": "",
"source": "github",
"line_count": 3055,
"max_line_length": 111,
"avg_line_length": 34.852700490998366,
"alnum_prop": 0.547170697346795,
"repo_name": "maniteja123/scipy",
"id": "78aa770e80f1d52f48db8de56f1dff1c021364c3",
"size": "... |
"""
A context object for caching a function's return value each time it
is called with the same input arguments.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import os
import shutil
import sys
import time
import pydoc
tr... | {
"content_hash": "72f2df82795876ed73590981ac3c43e2",
"timestamp": "",
"source": "github",
"line_count": 578,
"max_line_length": 79,
"avg_line_length": 39.733564013840834,
"alnum_prop": 0.5213794304624227,
"repo_name": "splunk/splunk-app-splunkgit",
"id": "296e410578d132e80d3218e225963e34c6c5ba8f",
... |
from netforce.model import Model, fields
from netforce import access
class ReasonCode(Model):
_name = "reason.code"
_string = "Reason Code"
_key = ["code"]
_fields = {
"type": fields.Selection([["fault", "Fault Code"], ["service_multi_visit", "Service Multi-Visit"], ["service_late_response", "... | {
"content_hash": "801e50f072ba4a4855d561d913132c3a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 264,
"avg_line_length": 42.22222222222222,
"alnum_prop": 0.6381578947368421,
"repo_name": "nfco/netforce",
"id": "c1133ac269d9306ac302fb182c5ca4791a4d1495",
"size": "1865",... |
class Solution(object):
def strStr(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
try:
return haystack.index(needle)
except ValueError:
return -1
| {
"content_hash": "90b2332f0ba1290aa3e6c3dae254ed60",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 41,
"avg_line_length": 24.181818181818183,
"alnum_prop": 0.5,
"repo_name": "Junnplus/leetcode",
"id": "9b1126b8b2ec897fc194de34910d62cacb202ed5",
"size": "266",
"binary":... |
"""
This module tests the Connector. He's a cool guy. He tries to connect to
Eventstore and doesn't quit until he's exhausted every option. He only deals
with TCP connections, StreamReaders, and StreamWriters, so we can test him with
a simple echo server.
When he makes a connection, loses a connection, or quits trying... | {
"content_hash": "f18b0bcd9e43cdb9ead025b3d82ade1a",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 87,
"avg_line_length": 29.91194968553459,
"alnum_prop": 0.6846089150546678,
"repo_name": "madedotcom/photon-pump",
"id": "bb7e077dccb73957d422aec6e11bbf37c9a1957f",
"size"... |
import inspect
import os.path
from robot import utils
from robot.errors import DataError
from .loggerhelper import AbstractLoggerProxy
from .logger import LOGGER
if utils.is_jython:
from java.lang import Object
from java.util import HashMap
class _RecursionAvoidingMetaclass(type):
"""Metaclass to wrap ... | {
"content_hash": "42888347074567a182d1e8b0bc573db5",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 83,
"avg_line_length": 38.1931330472103,
"alnum_prop": 0.559051578829082,
"repo_name": "qitaos/robotframework-mabot",
"id": "4caa26d4873b66fe7d77f2d4ebec8ff9efb97bb9",
"si... |
__author__ = 'Michael'
from src import PClass
# Test for bias addition and correctness of range in init function
testClass = PClass(3)
assert testClass.weightList.size() == 4
for x in range(0, testClass.numInputs):
assert -1 <= testClass.weightList[x] & testClass.weightList[x] <= 1
| {
"content_hash": "50a2bcc961d92516fcbf21647d1ae46f",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 71,
"avg_line_length": 32.111111111111114,
"alnum_prop": 0.726643598615917,
"repo_name": "michaellee1/ANN-PCML",
"id": "04fdfb7f4b23167325d2f0d16b8587ed003c1b3c",
"size": "2... |
import argparse
import learning.selector as ls
import logging as log
import MySQLdb
import numpy as np
import pandas as pd
import pandas.io.sql as pdsql
import processors.selector as ps
import processors.utils as processor_utils
import sys
import transformation.categorical as categorical
import validation.kfold as kfol... | {
"content_hash": "4793727415bb536bb545d4d804faa523",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 118,
"avg_line_length": 38.3469387755102,
"alnum_prop": 0.6101649813730707,
"repo_name": "jansyk13/ml-rate-limiting",
"id": "bd0fd31c46817b9295228d883edd9a087375cc54",
"siz... |
import os
import sys
import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
import fitelp.constants as constants
import fitelp.read_fits_file
constants.init()
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '../Input_Data_Files'))
def read_spectra(filename, scaleFlux... | {
"content_hash": "a3bc4ccc7e919556876f1785a86b9abd",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 116,
"avg_line_length": 39.45744680851064,
"alnum_prop": 0.6255055270962524,
"repo_name": "daniel-muthukrishna/EmissionLineAnalysis",
"id": "e69966ecb8d046b1343701219443f3def... |
import logging
from django.utils.translation import ugettext_lazy as _
from horizon import messages
from horizon import tabs
from openstack_dashboard import api
from openstack_dashboard.dashboards.project.stacks.api import d3_data
from openstack_dashboard.dashboards.project.stacks.tables import EventsTable
from open... | {
"content_hash": "5210354a2c97909c82150e751a6606b1",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 31.068627450980394,
"alnum_prop": 0.6333228147680656,
"repo_name": "tuskar/tuskar-ui",
"id": "9a736bb21f5ca934fcbc90861d867e57f0085744",
"size": "37... |
__all__ = ["best_likelihood", "bootstrap", "likelihood_calculation",
"likelihood_function", "likelihood_tree", "models",
"pairwise_distance", "parameter_controller", "predicate",
"simulate", "substitution_calculation", "substitution_model",
"coevolution"]
__author__ = ""
__c... | {
"content_hash": "0e538c3a554e5713457351b1db5373ff",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 72,
"avg_line_length": 44.375,
"alnum_prop": 0.6,
"repo_name": "sauloal/cnidaria",
"id": "a949cbf84967add7c145cf4b6cb8c1610e08b321",
"size": "733",
"binary": false,
"co... |
"""Estimate resources required for processing a set of tasks.
Uses annotations provided in multitasks.py for each function to identify utilized
programs, then extracts resource requirements from the input bcbio_system file.
"""
import copy
import math
from bcbio.pipeline import config_utils
from bcbio.log import logg... | {
"content_hash": "d71ca4f7c96761b1ad8f4fed2a1b2adc",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 101,
"avg_line_length": 40.792929292929294,
"alnum_prop": 0.594651479509719,
"repo_name": "fw1121/bcbio-nextgen",
"id": "63b913b160337fe0276ed7449edfdf90d4d97801",
"size":... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/furniture/shared_furniture_radar_table.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "1151ee416d7a0f5a0db5ba1fa5da6537",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 86,
"avg_line_length": 24.23076923076923,
"alnum_prop": 0.7015873015873015,
"repo_name": "obi-two/Rebelion",
"id": "8b14314aa5b9580f179eaab2e21c1bbc7b12fb3b",
"size": "460"... |
from SimpleCV.base import cv2, np, LazyProperty, copy
from SimpleCV.ImageClass import Image
from SimpleCV.Features import Blob, FeatureSet
from SimpleCV.Color import Color
class SLIC:
"""
**SUMMARY**
This class contains an implementation of the SLIC Superpixel
algorithm by Achanta et al. (PAMI'12, vol... | {
"content_hash": "48a2e1fa6dc79b0d64e8648ae9ebf737",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 104,
"avg_line_length": 36.60535117056856,
"alnum_prop": 0.5229785290086798,
"repo_name": "jayrambhia/SimpleCV2",
"id": "e549d99e215fd558361d3cc34c03b6d0237958c4",
"size":... |
"""Creates Github links from @user and #issue text.
Bascially a much simplified version of sphinxcontrib.issuetracker
with support for @user.
"""
import re
import sys
from docutils import nodes
from docutils.transforms import Transform
GITHUB_ISSUE_URL = "https://github.com/{0}/issues/{1}"
GITHUB_USER_URL = "https:... | {
"content_hash": "e791c31666d22679bd66cf834ee60c5a",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 69,
"avg_line_length": 27.057142857142857,
"alnum_prop": 0.6541710665258712,
"repo_name": "unintended/Cohen",
"id": "1c2583e1bb973c43ae1ca3196125b2f188b5f65f",
"size": "189... |
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
import hashlib
import time
import random
from oauth_provider.models import Consumer
class Command(BaseCommand):
help = 'Creates a key and secret for clients connecting to the server'
option_list = BaseCommand.o... | {
"content_hash": "9a5162ecfb5c379bb0ee5bddee04f305",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 78,
"avg_line_length": 36.891891891891895,
"alnum_prop": 0.5384615384615384,
"repo_name": "vegitron/servicemap",
"id": "edbd0d9c9e3b7cec1e270749149e1c9f4089ec58",
"size": "... |
import os
import numpy as np
from tensorflow.python.checkpoint import checkpoint as util
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.platform import test
from tensorflow.python.trackable import autotrackable
from tensorflow.python.trackable impor... | {
"content_hash": "f3c68581863eb3baad565ee042e1e332",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 77,
"avg_line_length": 38.42748091603053,
"alnum_prop": 0.6781883194278904,
"repo_name": "tensorflow/tensorflow-pywrap_saved_model",
"id": "bf86b8055b64a25e870e7d21a00668579... |
from flask import url_for
from .conftest import DEFAULT_GROUP_ID
from .conftest import DEFAULT_GROUP_NAME
from .conftest import create_group
from .conftest import create_package
@create_package(name='foo', version='1.2.3-4')
@create_group(id=DEFAULT_GROUP_ID, packages=['foo'], affected='1.2.3-3', fixed='1.2.3-4')
de... | {
"content_hash": "2da74c9f6c4f326c5f9a56974c2d7965",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 98,
"avg_line_length": 39.61538461538461,
"alnum_prop": 0.6946601941747573,
"repo_name": "jelly/arch-security-tracker",
"id": "255aec49dcee48b2236b27dffc494be8472f4832",
"s... |
from datetime import timedelta
from functools import update_wrapper
import json
import os
from flask import make_response, request, current_app
import redis
# initialize redis connection for local and CF deployment
def connect_redis_db(redis_service_name = 'p-redis'):
if os.environ.get('VCAP_SERVICES') is None: #... | {
"content_hash": "5e10156ad0916b8aa966fd61b5863230",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 80,
"avg_line_length": 36.875,
"alnum_prop": 0.5804143126177025,
"repo_name": "lwalstad-pivotal/unified-demonstration-sentiment_01",
"id": "9b482de6f570187c2a61daf889871cecd3... |
from mparallel import runner
Runner = runner.Runner
| {
"content_hash": "7ec07d8847620ace6e1939663bb256f6",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 28,
"avg_line_length": 13.5,
"alnum_prop": 0.7962962962962963,
"repo_name": "andersonvom/mparallel",
"id": "6b761b7d166c27463f8b884910267a37537fd9ee",
"size": "54",
"binar... |
import sys
import os
import shlex
# 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('.... | {
"content_hash": "69bae392abe7ab5a752b70483bfece48",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 79,
"avg_line_length": 33.065934065934066,
"alnum_prop": 0.683394261659466,
"repo_name": "Sherlock9/Seriously",
"id": "7b7242b883464f8143857fa009e3c2cccd7b11ec",
"size": "... |
"""Tests for compute service."""
import base64
import contextlib
import datetime
import operator
import sys
import time
import traceback
import uuid
from eventlet import greenthread
import mock
import mox
from oslo.config import cfg
from oslo import messaging
from oslo.serialization import jsonutils
from oslo.utils i... | {
"content_hash": "3fbe66a1d527bee289334380c18d79f0",
"timestamp": "",
"source": "github",
"line_count": 11322,
"max_line_length": 79,
"avg_line_length": 44.26055467231938,
"alnum_prop": 0.5671338886250344,
"repo_name": "angdraug/nova",
"id": "6584d63db5ef2da5b1e382ad5a58f76b93122351",
"size": "5019... |
import contextlib
import copy
import mock
from pysensu_yelp import Status
from pytest import raises
from paasta_tools import chronos_tools
from paasta_tools import setup_chronos_job
from paasta_tools.utils import compose_job_id
from paasta_tools.utils import NoDeploymentsAvailable
class TestSetupChronosJob:
fa... | {
"content_hash": "711b6530668a79e90c38f1413e1e39c5",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 117,
"avg_line_length": 44.743142144638405,
"alnum_prop": 0.568721435737376,
"repo_name": "gstarnberger/paasta",
"id": "7683ec0c8ee0140574db6d3ab7b986b50d6ad762",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.