text stringlengths 4 1.02M | meta dict |
|---|---|
from unittest2 import TestCase
# from aux.protocol.rest.jsondl import JSONDL
from aux.protocol.soap.wsdl import WSDLClient
from wsdldatatmp import ssp_wsdl
WSDL_MOCK = '''<wsdl:definitions name="TestService"
targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns:wsdl="http://schemas.xmlsoap.org/w... | {
"content_hash": "19fae21a498ebea2bbc0724d2e9a56ee",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 72,
"avg_line_length": 26.571428571428573,
"alnum_prop": 0.6810035842293907,
"repo_name": "protojour/aux",
"id": "aba6a97e1dfc31c417fa52f8f092ed6eb0e44482",
"size": "1116",... |
import os
import configparser
def read_conf(env_name):
home = os.path.expanduser("~")
file = '.kong'
file_path = os.path.join(home, file)
try:
if os.path.exists(file_path):
pygd_parser = configparser.ConfigParser()
pygd_parser.read(file_path)
return pygd_pa... | {
"content_hash": "00d6fa7ae29e8e2f5f26227bbee5b143",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 53,
"avg_line_length": 24.22222222222222,
"alnum_prop": 0.5963302752293578,
"repo_name": "paraizofelipe/kong-wrapper",
"id": "a2c4e03c4418c6023e3a27af3b9d4251d90679ea",
"si... |
import os
import finder
import re
import sys
def makefilter(name, xtrapath=None):
typ, nm, fullname = finder.identify(name, xtrapath)
if typ in (finder.SCRIPT, finder.GSCRIPT, finder.MODULE):
return ModFilter([os.path.splitext(nm)[0]])
if typ == finder.PACKAGE:
return PkgFilter([fullname])
... | {
"content_hash": "defc0f8cfe03dbe4c27a022830a1a485",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 80,
"avg_line_length": 33.48091603053435,
"alnum_prop": 0.5809393524851801,
"repo_name": "toontownfunserver/Panda3D-1.9.0",
"id": "aa0c0203e2e0ed4617b08fc04ca9b6c7330ac920",... |
from subprocess import call
from os import makedirs
from os import path
from shutil import copy
from jinja2 import Environment
from subprocess import Popen, PIPE
def do_step(context):
if not path.isdir("bosh/manifests"):
makedirs("bosh/manifests")
if not path.isdir("bosh/certs"):
makedirs("b... | {
"content_hash": "5564f448ccfcbdc280093887010fdaed",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 238,
"avg_line_length": 36.074074074074076,
"alnum_prop": 0.6663244353182751,
"repo_name": "cf-platform-eng/bosh-azure-template",
"id": "9641ffa907e88915c6673a238c4e9a1eab722... |
"""I2S client library functions. Find implementation details in LPC17xx
CMSIS-Compliant Standard Peripheral Firmware Driver Library documentation.
"""
from internals import robocaller, cstruct
__author__ = "Neil MacMunn"
__credits__ = ["Neil MacMunn", "NXP MCU SW Application Team"]
__maintainer__ = "Neil M... | {
"content_hash": "90192cfe8945f6ec50807bd58e0ecea4",
"timestamp": "",
"source": "github",
"line_count": 577,
"max_line_length": 83,
"avg_line_length": 27.760831889081455,
"alnum_prop": 0.652078911224872,
"repo_name": "robovero/python",
"id": "7c550407506004b1d94cfb489b3969e11c346ef2",
"size": "1601... |
"""
ABPRefFromBigCSV.py
convert CVS data to xml (ref format)
26,000 csv format
need a list of ABP image keys to extract the correct line (S_Passau_Hals_008_0084)
H. Déjean
copyright NLE 2017
READ project
Developed for the EU project READ. The READ project has rece... | {
"content_hash": "c3113cbf20a16b3aee5f5be3dbfa119c",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 262,
"avg_line_length": 42.01716738197425,
"alnum_prop": 0.5229826353421859,
"repo_name": "Transkribus/TranskribusDU",
"id": "658fffa742efdf4473f45d9cf4a20473cd3e5277",
"s... |
from nanpy.arduinoboard import ArduinoObject
from nanpy.arduinoboard import arduinoobjectmethod
class Lcd(ArduinoObject):
cfg_h_name = 'USE_LiquidCrystal'
def __init__(self, pins, begin, connection=None):
'''
:param pins: [rs, enable, d4, d5, d6, d7]
:param begin: [cols, rows]
... | {
"content_hash": "36b06ba4eda2ebf426058dbcb2985fb7",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 59,
"avg_line_length": 22.853658536585368,
"alnum_prop": 0.6221985058697972,
"repo_name": "nanpy/nanpy",
"id": "49b6b370e55c6d52808b60e580104897f41cb9af",
"size": "937",
... |
import copy
import sys
import uuid
import eventlet
import mock
from oslo.config import cfg
import testtools
from neutron.agent.common import config
from neutron.agent import dhcp_agent
from neutron.agent.linux import dhcp
from neutron.agent.linux import interface
from neutron.common import config as common_config
fro... | {
"content_hash": "941a26072fad287fd98230e9ccf2e14b",
"timestamp": "",
"source": "github",
"line_count": 1493,
"max_line_length": 79,
"avg_line_length": 43.68050904219692,
"alnum_prop": 0.5675228091696696,
"repo_name": "jumpstarter-io/neutron",
"id": "c6f98643fe8e309f1fbb20bc2aa4e0e90d1c4ea0",
"size... |
import string
import sublime
import sublime_plugin
class Transformer(sublime_plugin.TextCommand):
def run(self, edit):
self.transform(self.transformer[0], self.view, edit)
def transform(self, f, view, edit):
for s in view.sel():
if s.empty():
s = view.word(s)
... | {
"content_hash": "54d78633365e5b6b8c1271ab90e814fc",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 61,
"avg_line_length": 27.18421052631579,
"alnum_prop": 0.6069699903194579,
"repo_name": "robotwholearned/dotfilesCustom",
"id": "a19451300a4d9316052c7afc8d2c22713e0d170e",
... |
'''
Example for autodoc
'''
import oauth2 as oauth
import multiprocessing
import sys, time, datetime
import bson.json_util
import requests
import httplib
# local
from drenaj.client.config.config import *
class StreamCatcher(multiprocessing.Process):
'''
This is a fantastic class!
'''
def __ini... | {
"content_hash": "8ec8f5344521325e0da67b3276b174ea",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 154,
"avg_line_length": 32.38174273858921,
"alnum_prop": 0.5665043567401332,
"repo_name": "boun-cmpe-soslab/drenaj",
"id": "f98afcca14b430235bd2ead52e9a229929b61c68",
"siz... |
from os import mkdir
from azflow.Task import Task
from azflow.AzflowException import AzflowException
from collections import deque
class DAG():
""" Define a directed acyclic graph of tasks.
Render tasks as Azkaban jobs, with a final
task representing the DAG as an Azkaban "flow".
"""
def ... | {
"content_hash": "4f36288497273e66f77f8dda4bc9b03e",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 80,
"avg_line_length": 32.702127659574465,
"alnum_prop": 0.5322055953155498,
"repo_name": "aslotnick/azflow",
"id": "d4c5ac1bea479cf6445fa893e66a05b5d3dfb49a",
"size": "307... |
"""The tests device sun light trigger component."""
# pylint: disable=protected-access
from datetime import datetime
import pytest
from homeassistant.components import (
device_sun_light_trigger,
device_tracker,
group,
light,
)
from homeassistant.components.device_tracker.const import DOMAIN
from home... | {
"content_hash": "50ef2c95aa549adfc18c9886a5a6970a",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 88,
"avg_line_length": 32.80508474576271,
"alnum_prop": 0.609015758202015,
"repo_name": "tchellomello/home-assistant",
"id": "19715577e2ae13cd744fd5ed39ad7845446f6f07",
"s... |
from nailgun.api.v1.handlers.base import DBSingletonHandler
from nailgun.api.v1.validators.master_node_settings \
import MasterNodeSettingsValidator
from nailgun import objects
class MasterNodeSettingsHandler(DBSingletonHandler):
single = objects.MasterNodeSettings
validator = MasterNodeSettingsValidat... | {
"content_hash": "4720c3d24b752c2590c47ccc1177dd67",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 59,
"avg_line_length": 26.928571428571427,
"alnum_prop": 0.8063660477453581,
"repo_name": "zhaochao/fuel-web",
"id": "a5800a4dae2f83e7a5a7e0c7d95fbf802fba1802",
"size": "98... |
import os
import time
import requests
from .utils import ResponseStream
from .exceptions import CartoException
VALID_TYPES = [
'STRING', 'BYTES', 'INTEGER', 'INT64', 'FLOAT',
'FLOAT64', 'BOOLEAN', 'BOOL', 'TIMESTAMP', 'DATE', 'TIME',
'DATETIME', 'GEOMETRY'
]
TYPES_MAPPING = {
'GEOMETRY': 'GEOGRAPHY'
}... | {
"content_hash": "ba0fb08d488b01b8c2c64840ae13bb8b",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 116,
"avg_line_length": 35.217514124293785,
"alnum_prop": 0.5565893960054544,
"repo_name": "CartoDB/cartodb-python",
"id": "780509e7af66ad164ebf7aa348617047fdc0398a",
"siz... |
import Adafruit_BluefruitLE
from Adafruit_BluefruitLE.services import UART, DeviceInformation
# Get the BLE provider for the current platform.
ble = Adafruit_BluefruitLE.get_provider()
# Main function implements the program logic so it can run in a background
# thread. Most platforms require the main thread to han... | {
"content_hash": "d5ecfca81938c358b9e4a0a931dbd851",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 85,
"avg_line_length": 41.43037974683544,
"alnum_prop": 0.689275893675527,
"repo_name": "adafruit/Adafruit_Python_BluefruitLE",
"id": "bf735c505e50f9bd718cd4ecf28192d046db8c0... |
"""Support for recording details."""
import asyncio
from collections import namedtuple
import concurrent.futures
from datetime import datetime, timedelta
import logging
import queue
from sqlite3 import Connection
import threading
import time
from typing import Any, Dict, Optional
from sqlalchemy import create_engine, ... | {
"content_hash": "50d5cf865537cee00b600a894254198a",
"timestamp": "",
"source": "github",
"line_count": 471,
"max_line_length": 88,
"avg_line_length": 33.62632696390658,
"alnum_prop": 0.5500063139285263,
"repo_name": "postlund/home-assistant",
"id": "af34d4dd9f631873e6c15e5647e40b8ba9cb8b8f",
"size... |
"""Package for bundle management. "Bundle" refers to system-level
packages managed by specialized systems such as RedHat's RPM, Debian
and Ubuntu's APT, OSX's fink, etc."""
from vistrails.core.bundles.pyimport import py_import
from vistrails.core.bundles.installbundle import install
| {
"content_hash": "d66edf79e653c8677e09d326444809a3",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 68,
"avg_line_length": 56.8,
"alnum_prop": 0.8028169014084507,
"repo_name": "Nikea/VisTrails",
"id": "14a819bdaed102f49ce1b8c691de1db7a575f53e",
"size": "2165",
"binary": ... |
import os
from setuptools import setup
required = [
'requests',
]
packages = [
'pymercadopago',
]
description = "A library to interact with the MercadoPago gateway payment"
setup(
name="pymercadopago",
version="0.0.5",
author="Angel Velasquez, Diego Ramirez",
author_email="angel.velasquez@e... | {
"content_hash": "6fcf74cfa47d1a7754ad4460ecf4cea2",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 74,
"avg_line_length": 25.866666666666667,
"alnum_prop": 0.6116838487972509,
"repo_name": "angvp/pymercadopago",
"id": "5417d16238d3e9e783c32f7837ac0d37448a985d",
"size": "... |
import data_io
class tree(object):
def __init__(self, phrase, words):
self.phrase = phrase
self.embeddings = []
self.representation = None
def populate_embeddings(self, words):
phrase = self.phrase.lower()
arr = phrase.split()
for i in arr:
self.emb... | {
"content_hash": "ebb7c8286bed56d83bd76e5cc61a3911",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 62,
"avg_line_length": 25.235294117647058,
"alnum_prop": 0.5990675990675991,
"repo_name": "YingyuLiang/SIF_mini_demo",
"id": "aed64326d3e1b36ac1c5b221a4fdc09fadff58e3",
"si... |
import os
import re
def mkdir(*args):
try:
return os.mkdir(*args)
except:
return
def ls(path='.'):
return os.listdir(path)
def cd(path):
return os.chdir(path)
def touch(path):
return os.system('touch ' + path)
def pwd():
return os.curdir
def cat():
return
def echo():
... | {
"content_hash": "0dec699c8aac8249ee86b579437715fa",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 37,
"avg_line_length": 11.222222222222221,
"alnum_prop": 0.5767326732673267,
"repo_name": "geekan/psu",
"id": "9c9e10f777a9e7f71c9b80443f1cba9b16acc389",
"size": "404",
"... |
import json
import csv
from collections import OrderedDict
from PyQt4 import QtGui, QtCore
from eventEngine import *
from vtFunction import *
from vtGateway import *
#----------------------------------------------------------------------
def loadFont():
"""载入字体设置"""
try:
f = file("VT_setting.json")
... | {
"content_hash": "ffdc7dd38e4a1bd2b7558ba5639284b8",
"timestamp": "",
"source": "github",
"line_count": 1115,
"max_line_length": 91,
"avg_line_length": 36.75874439461884,
"alnum_prop": 0.49931683989655007,
"repo_name": "freeitaly/Trading-System",
"id": "691500344d3179701977adfc2044c160f72dbb91",
"s... |
"""Main setup script for GLUDB."""
from codecs import open
from os import path
# Always prefer setuptools over distutils
from setuptools import setup
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
# Note that we are using README.rst - it is generated from README.md in
#... | {
"content_hash": "f3505846f4c12f9bd5679617c35dc665",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 71,
"avg_line_length": 29.027397260273972,
"alnum_prop": 0.6087777253421425,
"repo_name": "memphis-iis/GLUDB",
"id": "3c021d769dbe9e48ca669a58ff129de5d79e3ab0",
"size": "21... |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class DjangoTwitterPhotoApiConfig(AppConfig):
name = 'django_twitter_photo_api'
verbose_name = _("Twitter photostream backend") | {
"content_hash": "dc4b7e1b50e135f8ff92e18e6d2a0b52",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 54,
"avg_line_length": 32.285714285714285,
"alnum_prop": 0.7787610619469026,
"repo_name": "softformance/django-twitter-photo-api",
"id": "6be37050acb25f10bc7090520a99c358f550f... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ProgramObservation'
db.create_table(u'director_programobservation', (
(u'id', self.gf('django.db.models.... | {
"content_hash": "ac6a5f748dcb8863fa69d9fa7d183c28",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 228,
"avg_line_length": 68.75925925925925,
"alnum_prop": 0.5838405601939133,
"repo_name": "ngageoint/geoevents",
"id": "f440364c41c792a508b5b2b8fff3d8b8e49b7efe",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations
import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
('wallposts', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='reaction',
options... | {
"content_hash": "5caaeccba4bc4a67b8668213c1c14f6b",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 156,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.5394736842105263,
"repo_name": "onepercentclub/bluebottle",
"id": "80a472b8fa978d9b91c11a751720851b0b8d631e",
"s... |
import os
import platform
import sys
if sys.platform.startswith("win"):
import win32api
import win32con
import win32evtlog
import win32security
import win32evtlogutil
sys.path.append('../../../libbeat/tests/system')
from beat.beat import TestCase
class BaseTest(TestCase):
@classmethod
d... | {
"content_hash": "ecb41984e99a94c4ff3974418bf359e7",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 86,
"avg_line_length": 33.65873015873016,
"alnum_prop": 0.5772223532185805,
"repo_name": "christiangalsterer/execbeat",
"id": "fe79757f624aa0503500019dcb11606976a7d440",
"... |
import numpy as N
from traits.api import Range
from traitsui.api import View, VGroup, Item, EnumEditor
from TransformPlugin import TransformPlugin
class Rotator(TransformPlugin):
rotation_angle = Range(0, 3)
view = View(
VGroup(
Item('active'),
Item('rotation_angle', editor=E... | {
"content_hash": "eea9839af91b018b9ec1ebac2ec3cfd8",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 61,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.5422077922077922,
"repo_name": "ptomato/Beams",
"id": "5316cf5745480d711ae77ca02902780c0df8e40d",
"size": "634",
... |
import os
import sys
# 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('../../'))
sys.path.inser... | {
"content_hash": "e35467d2f8805d2666cd81b4b41c37c7",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 79,
"avg_line_length": 30.994871794871795,
"alnum_prop": 0.7220383851753805,
"repo_name": "emonty/burrow",
"id": "6c2cf03ec47b6fccc3ffaac495d147e2f3dafc89",
"size": "7026"... |
import os
import traceback
from mock import Mock, patch
def get_test_dir():
return os.path.abspath(os.path.join(os.path.dirname(__file__), 'gem'))
def test_gem_detect():
from rosdep2.platforms.gem import gem_detect
m = Mock()
# test behavior with empty freeze
m.return_value = ''
val = ge... | {
"content_hash": "7e0cb303376b8e85591e00a34e7d561e",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 76,
"avg_line_length": 32.733333333333334,
"alnum_prop": 0.5955193482688391,
"repo_name": "sorki/rosdep",
"id": "d9b80798e3492debbc31114f1a16b5ae9f8bc229",
"size": "4171",
... |
import multiprocessing as mp
import traceback
from contextlib import contextmanager
import six
import tensorflow as tf
from tfsnippet.utils import (is_tensor_object,
is_tensorflow_version_higher_or_equal)
from .misc import cached
__all__ = ['detect_gpus', 'average_gradients', 'MultiGPU']... | {
"content_hash": "13b16ad221d716ca160c27d9092bf913",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 80,
"avg_line_length": 35.86294416243655,
"alnum_prop": 0.5630573248407643,
"repo_name": "korepwx/tfsnippet",
"id": "fbb8531255233fb33dfd0df22a07bdb4eabbbbef",
"size": "14... |
"""
Utility for creating **accounts.yaml** file for concurrent test runs.
Creates one primary user, one alt user, one swift admin, one stack owner
and one admin (optionally) for each concurrent thread. The utility creates
user for each tenant. The **accounts.yaml** file will be valid and contain
credentials for created... | {
"content_hash": "2c99351391e5ec304f038a2d69b91432",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 79,
"avg_line_length": 39.205,
"alnum_prop": 0.5630659354674149,
"repo_name": "rakeshmi/tempest",
"id": "ce7728e68a4a21f59b54d75ad6fc201ac65a0b5e",
"size": "16306",
"bin... |
from pyvows import Vows, expect
from thumbor.handlers import BaseHandler
from thumbor.context import Context
from thumbor.config import Config
from thumbor.app import ThumborServiceApp
from mock import MagicMock
@Vows.batch
class BaseHandlerVows(Vows.Context):
class ShouldStoreHeaderOnContext(Vows.Context):
... | {
"content_hash": "2bba3ac462bb692df13d60ba12e838fc",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 81,
"avg_line_length": 39,
"alnum_prop": 0.6752136752136753,
"repo_name": "camargoanderso/thumbor",
"id": "5205d3956051ada74e63881ade8f0bc4296ae1a3",
"size": "1305",
"bin... |
"""Test rest module"""
import operator
from fiblary.common import event
from fiblary.common import exceptions
from fiblary.tests import utils
event_name = "event_1"
def fake_handler():
pass
class TestEventHook(utils.TestCase):
def setUp(self):
super(TestEventHook, self).setUp()
self.ev... | {
"content_hash": "fc635ab5188d2d5d7c1ed71bfeaf02d6",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 67,
"avg_line_length": 24.253968253968253,
"alnum_prop": 0.5922774869109948,
"repo_name": "kstaniek/fiblary",
"id": "cb4359ff96d83a95e6d17dfb52e311ff4902b027",
"size": "210... |
from django.http import HttpResponseForbidden
from django.utils.deprecation import MiddlewareMixin
class BlockDodgyUserAgentMiddleware(MiddlewareMixin):
# Used to test that we're correctly handling responses returned from middleware during page
# previews. If a client with user agent "EvilHacker" calls an adm... | {
"content_hash": "657702c05f6a7e20cc7ad5be024d26e6",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 98,
"avg_line_length": 50.44444444444444,
"alnum_prop": 0.7191629955947136,
"repo_name": "zerolab/wagtail",
"id": "cb6521edd3ce25a7ca9afe26831882ecd6965e20",
"size": "908",... |
import os
import uuid
from keystoneclient.contrib.ec2 import utils as ec2_utils
from keystone import tests
from keystone.tests import test_keystoneclient
class KcMasterSqlTestCase(test_keystoneclient.KcMasterTestCase):
def config_files(self):
config_files = super(KcMasterSqlTestCase, self).config_files(... | {
"content_hash": "b1536550e3764cf6b2ebf23aa5e472cf",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 79,
"avg_line_length": 43.15300546448088,
"alnum_prop": 0.585665442573129,
"repo_name": "rodrigods/keystone",
"id": "fdbd167cf2d97d4019517908e02b3cf9d281d7a4",
"size": "16... |
"""
MicroNFCBoard Python API
Copyright (c) 2014-2015 AppNearMe Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | {
"content_hash": "650c5f10749ccbeae43f0adb327cf9a4",
"timestamp": "",
"source": "github",
"line_count": 407,
"max_line_length": 201,
"avg_line_length": 35.1007371007371,
"alnum_prop": 0.6171776564468711,
"repo_name": "jautero/micronfcboard-python",
"id": "00c2f331a596ba4694c566f08a79dbdba9398877",
... |
import os
import pkg_resources
import tornado.gen
import tornado.web
from raven.contrib.tornado import SentryMixin
import waterbutler.core.utils
import waterbutler.server.utils
import waterbutler.core.exceptions
from mfr.core import utils
from mfr.server import settings
from mfr.core import exceptions
CORS_ACCEPT_... | {
"content_hash": "fde555fb7df24617860d993a9165d5aa",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 167,
"avg_line_length": 31.7578125,
"alnum_prop": 0.6169741697416974,
"repo_name": "haoyuchen1992/modular-file-renderer",
"id": "160d236a06224617b6d90b76f841be1ad9437d1e",
... |
"""
AMF metadata (inside Flash video, FLV file) parser.
Documentation:
- flashticle: Python project to read Flash (formats SWF, FLV and AMF)
http://undefined.org/python/#flashticle
Author: Victor Stinner
Creation date: 4 november 2006
"""
from hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt16,... | {
"content_hash": "ac559371bb6dbf5f9065132fdf44a104",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 70,
"avg_line_length": 28.463636363636365,
"alnum_prop": 0.5927818588310444,
"repo_name": "Yukinoshita47/Yuki-Chan-The-Auto-Pentest",
"id": "496c5c1d6c1c7bdb9e6c94edf5a424b3... |
"""
Copyright (c) 2011, 2012, Regents of the University of California
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this l... | {
"content_hash": "fd69d7d594ef42b2f3b6dc989ab4a469",
"timestamp": "",
"source": "github",
"line_count": 540,
"max_line_length": 92,
"avg_line_length": 36.48148148148148,
"alnum_prop": 0.5818781725888325,
"repo_name": "samboiki/smap-data",
"id": "9ac2248d2cdc547f04a38c35997f7b4bb30d29e5",
"size": "1... |
import os
import geoip2.database
from ConfigParser import SafeConfigParser
from flask.helpers import find_package
from rfk.exc.base import NoConfigException
CONFIG = SafeConfigParser()
geoip = None
def init(enable_geoip=True):
global geoip
prefix, package_path = find_package(__name__)
config_locations ... | {
"content_hash": "549f4c019a1406a22ed7735d702080c3",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 87,
"avg_line_length": 32.464285714285715,
"alnum_prop": 0.6908690869086909,
"repo_name": "buckket/weltklang",
"id": "3a6be6f2d87a93b37f085623aa5736f7954fe405",
"size": "90... |
from __future__ import unicode_literals
import re
import string
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.translation import ugettext_lazy as _
from . import checksums
from .countries.iso_3166 import ISO_3166_1_ALPH... | {
"content_hash": "ee2c3804b2c6eb9c5204cf6c4d2b99a8",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 135,
"avg_line_length": 43.80769230769231,
"alnum_prop": 0.4906057945566286,
"repo_name": "agustin380/django-localflavor",
"id": "9605266794be1ffaaec7b79c58a29a01cc2a0c47",
... |
from flask import Blueprint, url_for
api = Blueprint('api', __name__)
version = 'v1.0'
from . import mail, event, errors, utils
from .decorators import json
def endpoints():
"""Get the main endpoints for the RESTful API """
return {
'Retrieve the collection of all the email [GET]': url_for('api.get_m... | {
"content_hash": "835ff30b1fc6e74ea9aa2af2b4a0233d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 99,
"avg_line_length": 25.727272727272727,
"alnum_prop": 0.6431095406360424,
"repo_name": "prisconapoli/mercury",
"id": "21547b0c7ac51a096bf035d2ac3764cf2e53ec6a",
"size": ... |
"""
This module contains Google BigQuery Data Transfer Service operators.
"""
from typing import Optional, Sequence, Tuple
from google.api_core.retry import Retry
from google.protobuf.json_format import MessageToDict
from airflow.models import BaseOperator
from airflow.providers.google.cloud.hooks.bigquery_dts import... | {
"content_hash": "182e68897471df96231416ea0537f6b1",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 108,
"avg_line_length": 41.23728813559322,
"alnum_prop": 0.6642005754212906,
"repo_name": "mtagle/airflow",
"id": "0c904500a93aa9855e27f210606daeb1fd34a3db",
"size": "1051... |
"""Script updating local taxonomy database.
Script allows to update local taxonomy database using new taxonomy dumps from
NCBI taxonomy database.
Requirements:
Names file - path to NCBI taxonomy dmp file containing mapping of s
scientific names onto Taxonomy ID's. Default is 'names.dmp'.
Node... | {
"content_hash": "d8a72d7dcdd7887005cea18ca5a2f5b7",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 80,
"avg_line_length": 29.151162790697676,
"alnum_prop": 0.6657359393697646,
"repo_name": "mkorycinski/BioTaxIDMapper",
"id": "82f89235a253e715027ea7dba7692735073ef088",
"s... |
'''
Blueprint of the /organizations route.
This route will be registered in `server.py`.
'''
import os
import flask
import app.utilities.load as Load
from rq import Queue
from redis import Redis
from app.classes.ckan import CKAN
from app.functions.manage_queue import getStatus
from app.functions.fetch_store import f... | {
"content_hash": "80bdcd647fbdf0011b244963b9160a62",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 104,
"avg_line_length": 28.62,
"alnum_prop": 0.6533892382948987,
"repo_name": "luiscape/hdx-monitor-sql-collect",
"id": "1c3ff266537c7e8841b7ba6a4f333c82427eadf9",
"size": ... |
"""
WSGI config for PortFolio project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... | {
"content_hash": "a8cc7b4d2e3c4e5b522dde7e009f1152",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 79,
"avg_line_length": 40.714285714285715,
"alnum_prop": 0.8008771929824562,
"repo_name": "dubzzz/django-portfolio",
"id": "b985b3d306b0c90751d42f0e97d041c8148f689d",
"size... |
"""Manages and runs tests from the current working directory.
This will traverse the current working directory and look for python files that
contain subclasses of GlslCTest.
If a class has an @inside_glslc_testsuite decorator, an instance of that
class will be created and serve as a test case in that testsuite. The... | {
"content_hash": "4b9372d7e3b9a501b92aaac087d14069",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 101,
"avg_line_length": 40.169642857142854,
"alnum_prop": 0.6327331999703638,
"repo_name": "endlessm/chromium-browser",
"id": "3d4bc173989e9f1c77ebf55bbbe6bc2468fa93a4",
"... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class FilterPlacesByTopLevelCategory(Choreography):
def __init__(self, temboo_session):
"""... | {
"content_hash": "27ba23445153774466e3a58467ae58ad",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 216,
"avg_line_length": 48.96511627906977,
"alnum_prop": 0.7150320588933745,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "3b4cee2960de02a840b14210d93702d7622db8aa",
"siz... |
from cx_Freeze import main
main.main()
| {
"content_hash": "8fc80849f33d93d1e7748a36aafda8a2",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 26,
"avg_line_length": 13.333333333333334,
"alnum_prop": 0.75,
"repo_name": "Zamiell/RebirthItemTracker",
"id": "e6b94ffdfca56bc8ef4186f8461f0c933b7df04e",
"size": "133",
... |
import logging
from rest_framework import permissions
from bluebottle.members.models import MemberPlatformSettings
logger = logging.getLogger(__name__)
class PermissionsException(Exception):
pass
class IsOwner(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
"""
... | {
"content_hash": "57719bb19912de9b92689ba935e63999",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 104,
"avg_line_length": 34.80988593155894,
"alnum_prop": 0.6242490442381212,
"repo_name": "onepercentclub/bluebottle",
"id": "8299b1b2cca0a63028d86328ef68ba88fea5c8bf",
"s... |
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
url(r'^grappelli/', include('grappelli.urls')),
url(r'^admin/', include(admin.site.urls)),
] + static(settings.MEDIA_URL, document_root=settings... | {
"content_hash": "ab0b389117ad08c05f51eaf011d78a7b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 65,
"avg_line_length": 37,
"alnum_prop": 0.7507507507507507,
"repo_name": "CodeforLeipzig/fog",
"id": "f86822c7cfb0ff2257c8c57c0c193b3330787536",
"size": "357",
"binary": ... |
"""
Collects metrics from the gunicorn web server.
http://gunicorn.org/
"""
# stdlib
import time
# 3rd party
import psutil
# project
from checks import AgentCheck
class GUnicornCheck(AgentCheck):
# Config
PROC_NAME = 'proc_name'
# Number of seconds to sleep between cpu time checks.
CPU_SLEEP_SECS... | {
"content_hash": "3cb66880a3c63702f6a511db3d77ad47",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 106,
"avg_line_length": 37.61788617886179,
"alnum_prop": 0.5975794251134644,
"repo_name": "mderomph-coolblue/dd-agent",
"id": "05766dbd0e62fa319557f0d002b1d0c0530dea68",
"... |
import mock
import pytest
from mock import Mock
from nose.tools import eq_
from olympia import amo
from olympia.amo import models as amo_models
from olympia.amo.tests import TestCase
from olympia.amo import models as context
from olympia.addons.models import Addon
from olympia.users.models import UserProfile
pytestm... | {
"content_hash": "44a2f69dcda28bf899b8db8dbd8697ea",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 79,
"avg_line_length": 33.71176470588235,
"alnum_prop": 0.6126330483336242,
"repo_name": "jpetto/olympia",
"id": "15127054eeed20731acc38c96940587aa97535a5",
"size": "5731"... |
"""The matrix bot component."""
import logging
import os
from functools import partial
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import ATTR_TARGET, ATTR_MESSAGE
from homeassistant.const import (
CONF_USERNAME,
CONF_PASSWORD,
CONF_VE... | {
"content_hash": "bc09689ea6bd01acf54bfeca35901d11",
"timestamp": "",
"source": "github",
"line_count": 372,
"max_line_length": 87,
"avg_line_length": 32.89784946236559,
"alnum_prop": 0.5603856839352835,
"repo_name": "joopert/home-assistant",
"id": "4a9435808bbf6637e9a1bba2b3f9a1673b88a3e2",
"size"... |
import sys
import re
import datetime
import time
import pymongo
from bson.objectid import ObjectId
# The Blog Post Data Access Object handles interactions with the Posts collection
class PointsDAO:
# constructor for the class
def __init__(self, database):
self.db = database
self.points = data... | {
"content_hash": "11469e1ae23c324bb9b3001893876723",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 111,
"avg_line_length": 40.78703703703704,
"alnum_prop": 0.5595913734392736,
"repo_name": "jac2130/BettingIsBelieving",
"id": "95f8495bd5132401cec24a55fcbfb4d321993605",
"... |
"""Common imports for generated sqladmin client library."""
# pylint:disable=wildcard-import
import pkgutil
from googlecloudsdk.third_party.apitools.base.py import *
from googlecloudsdk.third_party.apis.sqladmin.v1beta3.sqladmin_v1beta3_client import *
from googlecloudsdk.third_party.apis.sqladmin.v1beta3.sqladmin_v1... | {
"content_hash": "313099edaddf75573fbaccac24b2d54b",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 88,
"avg_line_length": 39.6,
"alnum_prop": 0.7904040404040404,
"repo_name": "flgiordano/netcash",
"id": "8c6f3ec680bf6d72daaf62102f1bca68c1a05b5e",
"size": "396",
"binary... |
class PymqiException(Exception):
"""
PymqiException is used when there's an issue running pymqi
"""
| {
"content_hash": "304ec04770f7b4795c4908c1b89937ed",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 62,
"avg_line_length": 28,
"alnum_prop": 0.6875,
"repo_name": "DataDog/integrations-core",
"id": "903277d8c14f74f7325ead902710e83751b3994e",
"size": "229",
"binary": false... |
"""Library of helper functions for working with TensorFlow `tf.Variable`."""
import contextlib
import operator
import numpy as np
import tensorflow as tf
@contextlib.contextmanager
def record_variable_creation_scope():
"""Creates a single use contextmanager for capture variable creation calls."""
variable_list ... | {
"content_hash": "64d79346718d6a1f8696f31ff399ef08",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 88,
"avg_line_length": 31.116591928251122,
"alnum_prop": 0.6620550511601095,
"repo_name": "tensorflow/federated",
"id": "641c6e4084971720c8b9f3870bbab560f523884a",
"size":... |
"""
DurableDNS Driver
"""
import sys
from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import ensure_string
from libcloud.dns.types import Provider, RecordType
from libcloud.dns.base import Record, Zone
from libcloud.dns.base import DNSDriver
from libcloud.dns.types import ZoneDoesNotExistError, ZoneAlrea... | {
"content_hash": "9b528a2d8166fda87ca97184106d06c4",
"timestamp": "",
"source": "github",
"line_count": 646,
"max_line_length": 79,
"avg_line_length": 39.907120743034056,
"alnum_prop": 0.5264158262218774,
"repo_name": "wido/libcloud",
"id": "5d2fbe81d1af26fb4d4d665394f5932bc94392ac",
"size": "26561... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
DOCUMENTATION = '''
---
module: mongodb_user
short_description: Adds or removes a user from a MongoDB database.
description:
- Adds or removes a user from a MongoDB database.
version_ad... | {
"content_hash": "a7a39d4b49309d88b00b3eff7702b48b",
"timestamp": "",
"source": "github",
"line_count": 433,
"max_line_length": 255,
"avg_line_length": 34.595842956120094,
"alnum_prop": 0.6214285714285714,
"repo_name": "nwiizo/workspace_2017",
"id": "7fbcf332268a67c15340205695e4b5d0b45342b2",
"size... |
"""
#
# By: Charles Brandt [code at charlesbrandt dot com]
# On: *2013.06.05
# License: MIT
# Requires:
# medley, moments
# Description:
#
# be sure to edit source_root and destination_root before running, then run:
cd ~/public/repos/medley/scripts
python copy_playlist_media.py /media/path/to.m3u
copy_media(sourc... | {
"content_hash": "cf7b2e79b4d954cedf2a0906d1f4fe8a",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 101,
"avg_line_length": 28.546296296296298,
"alnum_prop": 0.5676289328576062,
"repo_name": "charlesbrandt/medley",
"id": "915eab8937b0a5134821cb7bcedea34238d18cda",
"size"... |
"""Copyright 2014 Cyrus Dasadia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | {
"content_hash": "ec886748cfc14cb7e1feb33c7ed36195",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 122,
"avg_line_length": 49.68333333333333,
"alnum_prop": 0.5585374035558538,
"repo_name": "CitoEngine/cito_plugin_server",
"id": "4fcdc20b6d0515c372e263aeac9d5fcadc5f2427",
... |
import numpy as np
class LSTM_state:
''' Class holding all the states of LSTM unit '''
def __init__(self, input_dim, output_dim, num_mem_cells):
'''At time t=0 initialize the states to zeros'''
self.xc = np.zeros(input_dim)
self.g = np.zeros(num_mem_cells)
self.i = np.zeros(n... | {
"content_hash": "8e26f71c6d731a5aac33214d37a63051",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 61,
"avg_line_length": 32.05555555555556,
"alnum_prop": 0.5892547660311959,
"repo_name": "nrupatunga/multi-layer-lstm",
"id": "4bb5ab6797880dfb0421ed6d67f9d4c4f3c08a17",
"s... |
import argparse
import csv
import os
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from collections import defaultdict
sns.set(style="darkgrid")
import scipy as sp
import scipy.stats
def collect_experiment_data(source='/', runs=1, servers=1, agents=3,hfo=True):
# loa... | {
"content_hash": "24bb107636f633614cb165b88ab8b4f8",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 155,
"avg_line_length": 44.96686746987952,
"alnum_prop": 0.5558979168062161,
"repo_name": "cowhi/HFO",
"id": "a7c92168310182bf54c6c23d51c0651f58b81f35",
"size": "14929",
... |
from __future__ import unicode_literals
import os
import shutil
from unittest import skipIf
from django.core.exceptions import ImproperlyConfigured
from django.core.files import File
from django.core.files.images import ImageFile
from django.test import TestCase
from django.test.testcases import SerializeMixin
from d... | {
"content_hash": "416e264595bb5802d9023e15e78e6b6e",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 80,
"avg_line_length": 36.24384787472036,
"alnum_prop": 0.6361335720017283,
"repo_name": "krisys/django",
"id": "a27476ff8d23d1b4181cb0d31c256f162f9f7b0b",
"size": "16201"... |
from rdlm.request_handler import RequestHandler, admin_authenticated
from rdlm.lock import LOCK_MANAGER_INSTANCE
from rdlm.hal import Resource
class ResourcesHandler(RequestHandler):
"""Class which handles the /resources URL"""
SUPPORTED_METHODS = ['GET', 'DELETE']
@admin_authenticated
def delete(se... | {
"content_hash": "0e0b1d31014c35c1d47838053595071d",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 97,
"avg_line_length": 37.645161290322584,
"alnum_prop": 0.6580976863753213,
"repo_name": "thefab/restful-distributed-lock-manager",
"id": "8be376bf6762201df4ebbbfc504ced8576... |
import sys
import toml
import os
path = toml.load("pyproject.toml")["tool"]["towncrier"]["directory"]
fragments = os.listdir(path)
fragments.remove("README.rst")
fragments.remove("template.rst")
if fragments:
print("The following files were not found by towncrier:")
print(" " + " \n".join(fragments))
... | {
"content_hash": "f9089254b77d4efb6a6aef92f57a9ead",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 68,
"avg_line_length": 23.928571428571427,
"alnum_prop": 0.6835820895522388,
"repo_name": "WarrenWeckesser/numpy",
"id": "c2e03154945d01770f3c765e0515be198c73aea5",
"size":... |
from django import forms
class AuthorizeRequestTokenForm(forms.Form):
oauth_token = forms.CharField(widget=forms.HiddenInput)
authorize_access = forms.BooleanField(required=True)
| {
"content_hash": "2c7628e19b42693ed03d1d3cd359255d",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 59,
"avg_line_length": 31.5,
"alnum_prop": 0.7936507936507936,
"repo_name": "tttthemanCorp/CardmeleonAppEngine",
"id": "078fdf3fe9e897113544c1bcc742a560ffce41b4",
"size": "1... |
import random
from khmer import SmallCounttable
from . import khmer_tst_utils as utils
# This mostly tests the underlying NibbleStorage class
def test_single_add():
sct = SmallCounttable(4, 1e6, 4)
sct.add("AAAA")
assert sct.get("AAAA") == 1
def test_split_byte_murmur():
# check the byte is corre... | {
"content_hash": "e08fd5a4dae9bec85619aca38650833d",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 74,
"avg_line_length": 23.225806451612904,
"alnum_prop": 0.6203703703703703,
"repo_name": "souravsingh/khmer",
"id": "24943bb24c0126fd69bfe3e3d225e0b6f9f8f578",
"size": "38... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('reviews_manager', '0014_auto_20170609_1336'),
]
operations = [
migrations.CreateModel(... | {
"content_hash": "671880bfd1db114ea3b335b228ce4504",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 208,
"avg_line_length": 51.75757575757576,
"alnum_prop": 0.6610070257611241,
"repo_name": "lucalianas/ProMort",
"id": "2a8bd429e79f14113afbf3f85fcbd1aa74250c80",
"size": "2... |
"""Support for Broadlink switches."""
from __future__ import annotations
from abc import ABC, abstractmethod
import logging
from broadlink.exceptions import BroadlinkException
import voluptuous as vol
from homeassistant.components.switch import (
PLATFORM_SCHEMA,
SwitchDeviceClass,
SwitchEntity,
)
from h... | {
"content_hash": "d3edee4bbc27f882509fd0fe38d6d657",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 83,
"avg_line_length": 30.97517730496454,
"alnum_prop": 0.6244991413852318,
"repo_name": "rohitranjan1991/home-assistant",
"id": "6a015748bd0edbbdb88318f58c06022f3bea5b15",
... |
from gpiozero import LED
from gpiozero import Button
import time
import pigpio
import rotary_encoder
import uinput
device = uinput.Device([
uinput.KEY_X,
uinput.KEY_N,
uinput.KEY_M,
])
led = LED(17)
button = Button(2)
def pushedme():
print('You pushed me')
device.emit_click(uinput.KEY_X)
... | {
"content_hash": "d5c481d5ed6df8c0bea718a8ec40e651",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 52,
"avg_line_length": 15.523809523809524,
"alnum_prop": 0.6595092024539877,
"repo_name": "philipbeber/karaoke",
"id": "395446b61ada8b4da3ae24c46c96a1c009b5e8da",
"size": "... |
"""
A coin is a collectable object. All the coins need tob e collected before allowing the player to
take off in the space ship.
"""
from gameobject import GameObject
import assets
import components
import statevars
import statemgr
class Coin(GameObject):
def __init__(self, scene, name, x, y, **kwargs):
... | {
"content_hash": "87e2ab634b569add0f547e06e64bc093",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 117,
"avg_line_length": 39.64,
"alnum_prop": 0.649848637739657,
"repo_name": "ArmchairArmada/COS125Project01",
"id": "9a7174da859ae6c734e0d227cdb2bc02537f66fe",
"size": "20... |
from flask import (
request,
jsonify as flask_jsonify,
)
from urllib.parse import urlparse, urlunparse
from .structures import CaseInsensitiveDict
import json
ENV_HEADERS = (
'X-Varnish',
'X-Request-Start',
'X-Heroku-Queue-Depth',
'X-Real-Ip',
'X-Forwarded-Proto',
'X-Forwarded-Protocol'... | {
"content_hash": "45c259deaf6da0d3a6512af559c44d21",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 102,
"avg_line_length": 28.48447204968944,
"alnum_prop": 0.6033580462276493,
"repo_name": "Azure/azure-sdk-for-python",
"id": "132fb6874b63c6cd6e034847eb3156aeb0a9d369",
"... |
from celery import Celery
from textblob import TextBlob
app = Celery('tasks', backend='amqp', broker='amqp://guest@localhost//')
@app.task
def sentiment(row):
blob = TextBlob(row[3]) # tweet text
return row[0], blob.sentiment.polarity
| {
"content_hash": "ee1e534b66ba4cd95e7f5d38b90b2fb7",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 72,
"avg_line_length": 22.545454545454547,
"alnum_prop": 0.7056451612903226,
"repo_name": "Nozdi/movies-popularity",
"id": "bc40cabf9be68f8e1cb0b43faadb8ee59da870fa",
"size... |
"""Unit tests for reviewboard.diffviewer.commit_utils."""
from __future__ import unicode_literals
from django.utils import six
from kgb import SpyAgency
from reviewboard.diffviewer.commit_utils import (CommitHistoryDiffEntry,
diff_histories,
... | {
"content_hash": "f318f3c38a134d2dbfc7da268869b9b8",
"timestamp": "",
"source": "github",
"line_count": 808,
"max_line_length": 78,
"avg_line_length": 34.40717821782178,
"alnum_prop": 0.5060969029891011,
"repo_name": "chipx86/reviewboard",
"id": "42c33567571b6f531d9a75618f5fe80c4759e84a",
"size": "... |
import os
import cv2
import rospy
import actionlib
from cv_bridge import CvBridge
from camera_control_msgs.msg import GrabSequenceAction, GrabSequenceResult
__author__ = 'nikolas'
server = None
bridge = CvBridge()
def load_folder(folder):
file_list = os.listdir(folder)
print file_list
file_map_ = dict... | {
"content_hash": "5fe5fabe2ab72004907be1168f88f179",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 94,
"avg_line_length": 25.728395061728396,
"alnum_prop": 0.6113243761996161,
"repo_name": "suzlab/Autoware",
"id": "3a7256925c6d7621766c2c0fd5a7d85fb5da4793",
"size": "2130... |
"""
.. module: lemur.certificate.cli
:platform: Unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import arrow
import sys
from flask import current_app
from flask_principal import Identit... | {
"content_hash": "57f2340f75d2e08afabd57d95cb63eca",
"timestamp": "",
"source": "github",
"line_count": 1156,
"max_line_length": 209,
"avg_line_length": 36.28546712802768,
"alnum_prop": 0.5971487150145425,
"repo_name": "Netflix/lemur",
"id": "a6091ce55fc5103c0d359222131b5e3701e5c6a2",
"size": "4194... |
"""
Copyright (c) 2015, Aman Deep
All rights reserved.
A simple keylogger witten in python for linux platform
All keystrokes are recorded in a log file.
The program terminates when grave key(`) is pressed
grave key is found below Esc key
"""
import pyxhook
#change this to your log file's path
log_file='/home/aman/... | {
"content_hash": "5ace588611f96ce514264794c781b4e0",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 65,
"avg_line_length": 22.970588235294116,
"alnum_prop": 0.7413572343149808,
"repo_name": "hiamandeep/py-keylogger",
"id": "8a5d636a52ce2c75124eca2d09e0e578dbb56c65",
"size... |
from grovepi import *
from grove_rgb_lcd import *
dht_sensor_port = 7
dht_sensor_type = 0
ultrasonic_ranger = 4
distance_threshold = 20
try:
(temp, hum) = dht(dht_sensor_port, dht_sensor_type)
distance = ultrasonicRead(ultrasonic_ranger)
if (distance <= distance_threshold):
setRGB(0,255,0)
... | {
"content_hash": "9d61dd306fa60f72df642c20c98f45b8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 81,
"avg_line_length": 24.26086956521739,
"alnum_prop": 0.6164874551971327,
"repo_name": "davidone/misc",
"id": "cf1e14541729aad77d949e37ed4afa3df5b8790d",
"size": "581",
... |
from nltk.corpus import wordnet
import re
from .pos_tagger import POS_tag_cleaner
# Method to determine if a phrase is a collocation based on dictionary based technique
# Uses WordNet from NLTK corpus to obtain definitions of the words when both
# the word and it's sense are passed as inputs
def Collocations_Method_1... | {
"content_hash": "a72f21ef6c16b67fa12b4b82d111a148",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 174,
"avg_line_length": 54.98924731182796,
"alnum_prop": 0.6576065701994525,
"repo_name": "shahryarabaki/ICE",
"id": "dc1e549c56bc117daf9afcc4cfc861cdef4f5893",
"size": "51... |
import numpy as np
from bokeh.models import Button
from bokeh.palettes import RdYlBu3
from bokeh.plotting import figure, curdoc, vplot
# create a plot and style its properties
p = figure(x_range=(0, 100), y_range=(0, 100), toolbar_location=None)
p.border_fill_color = 'black'
p.background_fill_color = 'black'
p.outlin... | {
"content_hash": "42f59c6a6c9874dcea9c42544328abb9",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 69,
"avg_line_length": 27.176470588235293,
"alnum_prop": 0.698051948051948,
"repo_name": "ChinaBackGo/airmonitor",
"id": "dad4947f2f4409c099fd76007b14bd821f7fd8e6",
"size":... |
import time
from fabric.api import env, run
from fabric.context_managers import cd
from fabric.operations import get
# Declare remote host
env.hosts = ['login.osgconnect.net']
# Declare remote username and key info (optional)
with open('C:/gh/data2/username.txt','r') as myfile:
env.user = myfile.read()
with open(... | {
"content_hash": "a7d492a78d5aa8690282eab1016d8624",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 72,
"avg_line_length": 34.44827586206897,
"alnum_prop": 0.6436436436436437,
"repo_name": "srcole/qwm",
"id": "2ac91e7be75b99d2ca688d34e4db25f2814be2ed",
"size": "1066",
"... |
from typing import Dict, Iterable, List, Optional, Union
import orjson
from django.db import transaction
from django.utils.translation import gettext as _
from zerver.lib.exceptions import JsonableError
from zerver.lib.external_accounts import DEFAULT_EXTERNAL_ACCOUNTS
from zerver.lib.streams import render_stream_des... | {
"content_hash": "b6c3b7f551006f706d6d5cefd2e5effd",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 100,
"avg_line_length": 38.24285714285714,
"alnum_prop": 0.6604407919312664,
"repo_name": "andersk/zulip",
"id": "7fb0ad31cf0b3bc31ca74324288aae3c9aecc5fd",
"size": "8031"... |
from __future__ import print_function
import os
import sys
import tempfile
import time
sys.path.insert(1, os.path.join("..","..",".."))
from h2o.automl import H2OAutoML
from tests import pyunit_utils as pu
from _automl_utils import import_dataset
def automl_mojo():
ds = import_dataset()
aml = H2OAutoML(max_... | {
"content_hash": "91b58cfc7e88073a5b1e0ae8700a29d1",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 76,
"avg_line_length": 28.03030303030303,
"alnum_prop": 0.6572972972972972,
"repo_name": "h2oai/h2o-3",
"id": "d7b6b2032e5fd5cf1bb957ce19c2be2ccf17fe17",
"size": "925",
"... |
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from cosinnus.views.profile import UserProfileUpdateView
from cosinnus.views.user import UserListView
class BusListView(UserListView):
template_name = 'ecobasa/bus_list.html'
def get_context_data(self, **kwargs):
c... | {
"content_hash": "4144c5b5425dbf080dab62f43fc7e36a",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 90,
"avg_line_length": 27.46153846153846,
"alnum_prop": 0.7240896358543417,
"repo_name": "ecobasa/ecobasa",
"id": "5a6b1297e87c1372acd4e30df566771a7b492793",
"size": "738",... |
import os
import re
import json
import argparse
from os.path import join, isdir
from sys import argv, exit
from urllib2 import HTTPError
from goslate import Goslate
from settings import USE_SSL, GOOGLE_DOMAINS
service_urls = [('https://' if USE_SSL else 'http://') + 'translate' + domain for domain in GOOGLE_DOMAINS]
... | {
"content_hash": "9a269b1649ecf38fa964781f44421372",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 107,
"avg_line_length": 32.27450980392157,
"alnum_prop": 0.6215066828675577,
"repo_name": "maxdeviant/linguist",
"id": "81a82f951a33b0f356ba7210014074c45b84b4b7",
"size": ... |
"""ttLib/sfnt.py -- low-level module to deal with the sfnt file format.
Defines two public classes:
SFNTReader
SFNTWriter
(Normally you don't have to use these classes explicitly; they are
used automatically by ttLib.TTFont.)
The reading and writing of sfnt files is separated in two distinct
classes, since whene... | {
"content_hash": "01af67ad14d9e4da6056064ffd20f89a",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 116,
"avg_line_length": 32.26007326007326,
"alnum_prop": 0.693539230157829,
"repo_name": "shadowmint/nwidget",
"id": "6019d5fad561370f7541a01e7769102bd218649d",
"size": "8... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "2e4bb297f3cf59c5c2eeb645a6ff43ba",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 64,
"avg_line_length": 27.375,
"alnum_prop": 0.7077625570776256,
"repo_name": "stephrdev/brigitte",
"id": "448a7a7ac3b402010447eff4b06fc0456f49f5c9",
"size": "241",
"binar... |
import MySQLdb
import logging
import datetime
from settings import db_password, db_name, MdbUser, MdbPassword, Mdb, MdbIP
from functions import getPhoneID, getFaxID, getAddressID
logging.basicConfig(filename='logs/detector.log', level=logging.DEBUG)
# logger = logging.getLogger(__name__)
def check_new_orders(lastOi... | {
"content_hash": "e9261076086bc4fed894cf976e09a9a3",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 79,
"avg_line_length": 35.90865384615385,
"alnum_prop": 0.6209666622037756,
"repo_name": "0--key/lib",
"id": "b901031bd027183f096435e1372ae9185be90a1d",
"size": "7469",
... |
from __future__ import absolute_import, unicode_literals
import mock
import avalon.log
import avalon.tags.read
import avalon.tags.crawl
class DummyWalk(object):
"""Dummy implementation of os.walk that allows us to return \
some exact list of files
"""
def __init__(self, files):
self._files =... | {
"content_hash": "d38f98cbf7bb9a7a7ff39100a4acf534",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 97,
"avg_line_length": 36.493975903614455,
"alnum_prop": 0.6368438428524266,
"repo_name": "tshlabs/avalonms",
"id": "d9ddd7ebf5f55f7d43b9003093b86510add85872",
"size": "306... |
from pylons.util import _
from formencode import Schema, validators, ForEach, All
from ispmanccp.models.validators import *
__all__ = ['AccountUpdate', 'AccountDelete', 'AccountCreate']
try:
import DNS
dns_available = True
except ImportError:
dns_available = False
class AccountUpdate(Schema):
allow_... | {
"content_hash": "314127de326edde66f2d48dacf063838",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 92,
"avg_line_length": 42.10769230769231,
"alnum_prop": 0.6945560833028863,
"repo_name": "UfSoft/python-perl",
"id": "407ac48232cb38f613de1a6061d60dcbad837265",
"size": "35... |
import os.path
import logging
import json
import tempfile
import shutil
import time
from ceph_deploy import hosts
from ceph_deploy.cliutil import priority
from ceph_deploy.lib import remoto
import ceph_deploy.util.paths.mon
LOG = logging.getLogger(__name__)
def _keyring_equivalent(keyring_one, keyring_two):
"""... | {
"content_hash": "0228a26fc7df2814cada00e764558746",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 99,
"avg_line_length": 33.60820895522388,
"alnum_prop": 0.5620073276340624,
"repo_name": "SUSE/ceph-deploy",
"id": "656e89c614eab22c1a25bace02618a9502ee673e",
"size": "900... |
import argparse
import webdavtools
parser = argparse.ArgumentParser(description='WebDav upload processing.')
# List of files (required)
parser.add_argument( 'files',
metavar='File',
type=str,
nargs='+',
help='Multiple f... | {
"content_hash": "3c3f65f3635d02e71254b5d6118c084c",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 92,
"avg_line_length": 35.431372549019606,
"alnum_prop": 0.5683453237410072,
"repo_name": "thorbenegberts/webdav-tools",
"id": "9b7ee8a43d5540f9748c8f6591e39e20a22ed663",
"... |
import glanceclient.exc as glance_exceptions
from keystoneclient import exceptions as keystone_exceptions
from novaclient import exceptions as nova_exceptions
from quantumclient.common import exceptions as quantum_exceptions
from swiftclient import client as swift_exceptions
from cinderclient import exceptions as cinde... | {
"content_hash": "43508c6504c95ee3be7284ef814f663a",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 76,
"avg_line_length": 34.490566037735846,
"alnum_prop": 0.7603938730853391,
"repo_name": "99cloud/keystone_register",
"id": "9f58692033738ff266a9b25ef9e8001216729409",
"si... |
import json
import logging
import urlparse
from google.appengine.api import search
try:
from config import secret_token
except ImportError:
secret_token = ''
INDEX = search.Index(name="nuts")
NO_RESPONSE_SENT = object()
def send_json(start_response, status, headers, data):
res = ''
if data is not... | {
"content_hash": "b5c37a8b87e811b630715066ee3a0c88",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 106,
"avg_line_length": 26.07017543859649,
"alnum_prop": 0.5708838043965904,
"repo_name": "AlekSi/search.gonuts.io",
"id": "649d047154cb2d93357ba739f273a95a3e491bcb",
"siz... |
from django.shortcuts import get_object_or_404
from django.views.generic import list_detail
from libros.bookreader.models import Collection
def browse(request, **kwargs):
kwargs.setdefault('template_object_name','collection')
kwargs.setdefault('queryset', Collection.objects.all())
return list_detail.obj... | {
"content_hash": "793071f64f2d425b86bcedc089843d8b",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 75,
"avg_line_length": 36.31818181818182,
"alnum_prop": 0.7296620775969962,
"repo_name": "Early-Modern-OCR/Cobre",
"id": "52c708209287870cdd2b7eff8f82d2c4e88df735",
"size":... |
from sense_hat import SenseHat
from time import sleep
sense = SenseHat()
sense.clear()
| {
"content_hash": "e1c5ecdcf4762e3b56edd9d49b543e1b",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 30,
"avg_line_length": 14.833333333333334,
"alnum_prop": 0.7640449438202247,
"repo_name": "claremacrae/raspi_code",
"id": "9d3bcd8349d101063fcccb536acc5ae66f8d92ba",
"size":... |
from django.conf.urls import include, url
from viewflow.flow.viewset import FlowViewSet
from . import flows, views
urlpatterns = [
url(
r'^(?P<process_pk>\d+)/(?P<task_pk>\d+)/next/$',
views.NextTaskRedirectView.as_view(),
name='next_task'
),
url(
r'^',
include(Flo... | {
"content_hash": "34c998e0c9cce6ed657c9ac0db778a9e",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 56,
"avg_line_length": 21.58823529411765,
"alnum_prop": 0.5994550408719346,
"repo_name": "Candihub/pixel",
"id": "aa1a07292fd4f8f8579befa8b08bbc9d3c9fbcaf",
"size": "367",
... |
import os
import platform
import subprocess
import sys
folder = {
"install": "consumer",
"config": "consumer",
"get": "consumer",
"info": "consumer",
"search": "consumer",
"new": "creator",
"create": "creator",
"upload": "creator",
"export": "creator",
"export-pkg": "creator",
... | {
"content_hash": "f618f9f7c0fee273302b13495d393ef7",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 99,
"avg_line_length": 26.395522388059703,
"alnum_prop": 0.5620582414475545,
"repo_name": "conan-io/docs",
"id": "4cf63c196319f76019bf36fb01ab21126f570e07",
"size": "3537"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.