text stringlengths 4 1.02M | meta dict |
|---|---|
from django.db import models
import hashlib, datetime
class Zip(models.Model):
filename = models.CharField(max_length=20, primary_key=True)
password = models.CharField(max_length=40)
date_created = models.DateTimeField(auto_now_add=True)
def encrypt(self, text):
h = hashlib.sha1()
h.u... | {
"content_hash": "9062a45a481b42ed94a8a480f9328e25",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 64,
"avg_line_length": 30.285714285714285,
"alnum_prop": 0.6650943396226415,
"repo_name": "ojarva/file-sharing",
"id": "99927bf53e54a51f51e6681da1e738e142d6b7ae",
"size": "... |
"""Python net specification.
This module provides a way to write nets directly in Python, using a natural,
functional style. See examples/pycaffe/caffenet.py for an example.
Currently this works as a thin wrapper around the Python protobuf interface,
with layers and parameters automatically generated for the "layers"... | {
"content_hash": "5ed88980ecedb1b3ef22a880460c2adb",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 88,
"avg_line_length": 35.98695652173913,
"alnum_prop": 0.6254681647940075,
"repo_name": "jimmy-ren/RPN2T",
"id": "20918f9b6bcc556cdc88bc5c8974783b9332af99",
"size": "8277... |
"""
Reverse a singly linked list.
"""
__author__ = 'Daniel'
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def reverseList(self, head):
"""
:type head: ListNode
:rtype: ListNode
"""
if not head:
return ... | {
"content_hash": "fae20fc502bc760ec3323c88f8bb2592",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 51,
"avg_line_length": 18.806451612903224,
"alnum_prop": 0.5042881646655232,
"repo_name": "ee08b397/LeetCode-4",
"id": "6a7f77744260330dd2ea3c845d1d11c56ecb956d",
"size": "... |
"""Techniques for determining the saliency of input features."""
import logging
from typing import List, Optional, Tuple, Union
from ai_weather_climate.interpretability import utils
import numpy as np
import tensorflow as tf
def get_gradients_against_prediction(
input_img: Union[tf.Tensor, np.ndarray],
mode... | {
"content_hash": "db3146b5e74a291ef2d13c4a260ef5c1",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 111,
"avg_line_length": 37.43271767810026,
"alnum_prop": 0.670261507013463,
"repo_name": "google/ai-weather-climate",
"id": "4bbeb365adcc3eb671a71a7d7c03d747f24aaa3e",
"si... |
__author__ = "Nils Tobias Schmidt"
__email__ = "schmidt89 at informatik.uni-marburg.de"
from datetime import timedelta
import sys
from time import sleep
from time import time
from androlyze import Constants
from androlyze.util import Util
from androlyze.util.StopThread import StopThread
from Queue import Empty
clas... | {
"content_hash": "bf917b48a969caa7d52bf9b6883c44be",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 110,
"avg_line_length": 32.205479452054796,
"alnum_prop": 0.584857507443641,
"repo_name": "nachtmaar/androlyze",
"id": "80445f8d28ee7afa837161ea1351c47a8683670d",
"size": "... |
from __future__ import unicode_literals
from ytDownloader import ytDownloader
from threading import Thread
import gc
from concurrent.futures import ThreadPoolExecutor
gc.set_debug(gc.DEBUG_UNCOLLECTABLE)
def callback(d):
print 'CALLBACK: video finished', d['filename']
test = ['https://www.youtube.com/watch?v=... | {
"content_hash": "a5d67492889985a243bbe8840ee0aa89",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 70,
"avg_line_length": 20.147058823529413,
"alnum_prop": 0.743065693430657,
"repo_name": "lodemo/CATANA",
"id": "77f64934faca0da3b72031f13aaedb4caa364cf9",
"size": "710",
... |
"""
BLEU scoring of generated translations against reference translations.
"""
import argparse
import os
import sys
from fairseq import bleu
from fairseq.data import dictionary
def get_parser():
parser = argparse.ArgumentParser(description='Command-line script for BLEU scoring.')
# fmt: off
parser.add_a... | {
"content_hash": "7c3089b1b7a8ddc77437785465be5688",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 96,
"avg_line_length": 34.433734939759034,
"alnum_prop": 0.5608817354793562,
"repo_name": "hfp/libxsmm",
"id": "f7c3dc42b98f1039dd4062fcfda2a42ddfe762c4",
"size": "3058",
... |
import sys
import imp
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
import testValue
from popbill import ClosedownService, PopbillException
closedownService = ClosedownService(testValue.LinkID, testValue.SecretKey)
closedownService.IsTest = testValue.IsTest
closedownService... | {
"content_hash": "544fea77c89fa616778d5478786ffa53",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 74,
"avg_line_length": 26.975609756097562,
"alnum_prop": 0.6971066907775768,
"repo_name": "linkhub-sdk/popbill.closedown.example.py",
"id": "096a7b0faa1f49738a85b205bd07b5373... |
from rosbridge_library.internal.cbor_conversion import extract_cbor_values
from rosbridge_library.internal.message_conversion import (
extract_values as extract_json_values,
)
try:
from cbor import dumps as encode_cbor
except ImportError:
from rosbridge_library.util.cbor import dumps as encode_cbor
class... | {
"content_hash": "71169c8aad996743da5529d4eeb1636b",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 74,
"avg_line_length": 29.680851063829788,
"alnum_prop": 0.6408602150537634,
"repo_name": "RobotWebTools/rosbridge_suite",
"id": "c9d7dbc5db0ddabaf143f77262b8900047224cf5",
... |
"""Find and register unittests.
See https://docs.python.org/3/library/unittest.html#load-tests-protocol
for details or
https://github.com/python/cpython/blob/main/Lib/unittest/test/__main__.py
for sample implementation.
"""
import os
def load_tests(loader, standard_tests, unused_pattern):
"""Our tests end in `_te... | {
"content_hash": "8c49c67a5facf104e37c1f812b0985d4",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 76,
"avg_line_length": 32.35294117647059,
"alnum_prop": 0.7381818181818182,
"repo_name": "google-research/language",
"id": "3d2e70cf135c2f79058d8bf10ca487e7ab3abd5c",
"size... |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | {
"content_hash": "ca7e2d5236cbeca48c6669ef937af6af",
"timestamp": "",
"source": "github",
"line_count": 529,
"max_line_length": 247,
"avg_line_length": 40.965973534971646,
"alnum_prop": 0.6079091873932906,
"repo_name": "xuegang/gpdb",
"id": "6a4ba9335eaa98f2874b8aeaf4b15fec40c39b37",
"size": "21671... |
from django.core.cache import cache
from django.db.models.signals import post_delete, post_save
import functools
import hashlib
WEEK = 7 * 24 * 60 * 60 # 1 week
def cache_me(key=None, ikey=None, signals=(), models=(), timeout=WEEK):
def hashme(k):
if isinstance(k, unicode):
k = k.encode('utf-8'... | {
"content_hash": "8baca7f317cb85fa8fd938d06df52a3a",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 94,
"avg_line_length": 32.691428571428574,
"alnum_prop": 0.583114840062926,
"repo_name": "matrixise/microblog",
"id": "0074ec75e6b9dc5d25eb210e29f9ea24c69018c7",
"size": "... |
import sys
import numpy as np
try:
import wx
from wx import glcanvas
except ImportError:
raise ImportError, "Required dependency wx.glcanvas not present"
try:
from OpenGL.GL import *
except ImportError:
raise ImportError, "Required dependency OpenGL not present"
class GLFrame(wx.Frame):
... | {
"content_hash": "aa705ed35b758f50c2f15af04ace15aa",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 83,
"avg_line_length": 26.34285714285714,
"alnum_prop": 0.6005965292841648,
"repo_name": "fboers/jumegX",
"id": "080a6573a12eefefd5d33ccfae7d2c8b432cd747",
"size": "3688",... |
from distutils.core import setup
setup(name='physcon',
version='0.1',
description='Physical constants and units',
author='Kim G L Pedersen',
author_email='georglind@gmail.com',
py_modules=['physcon'],
url = 'http://github.com/georglind/physcon'
)
| {
"content_hash": "c3a88a09a6a85f186a3b661f410f6ce2",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 49,
"avg_line_length": 28.9,
"alnum_prop": 0.6366782006920415,
"repo_name": "georglind/physcon",
"id": "582372e1d7fa441bdfc81b8a96c5f894cec80c43",
"size": "312",
"binary"... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from message_coding.apps.project import models
class ProjectForm(forms.ModelForm):
"""
Form for creating new projects.
"""
class Meta:
model = models.Project
# Choose which fields to show on the form
... | {
"content_hash": "025b0ba9cdb72ca65a67d22cb0b0cb18",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 97,
"avg_line_length": 25.16,
"alnum_prop": 0.6025437201907791,
"repo_name": "michaelbrooks/uw-message-coding",
"id": "c30a0bd3a8dc7a24d33da06afa538584933afc3e",
"size": "6... |
from nose.tools import *
from exercises import ex13
def test_max_in_list():
'''
Confirm we are finding the largest number
'''
test_max_in_list = ex13.max_in_list([1, 2, 3, 4, 2, 6, 2])
assert_equal(test_max_in_list, 6)
| {
"content_hash": "922ad7296e7724d8c9f5d821a43b0175",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 62,
"avg_line_length": 22,
"alnum_prop": 0.6239669421487604,
"repo_name": "gravyboat/python-exercises",
"id": "14cdc39fabf7404442db9748cb5c228de4c0cd78",
"size": "242",
"... |
from django.contrib import admin
from reversion.admin import VersionAdmin
from test_app.models import TestModel, TestModelRelated
class TestModelAdmin(VersionAdmin):
filter_horizontal = ("related",)
admin.site.register(TestModel, TestModelAdmin)
admin.site.register(TestModelRelated, admin.ModelAdmin)
| {
"content_hash": "0010be1d5a879e99e86ccef7ca14a70c",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 55,
"avg_line_length": 22.357142857142858,
"alnum_prop": 0.8115015974440895,
"repo_name": "etianen/django-reversion",
"id": "c6641231097165bb8e5b1b6db3b2520ec262320b",
"siz... |
from ophyd.controls import EpicsSignal
# Helper function for generating Epics PVs
def getEpicsPV(basename, suffix):
rv = ''.join([basename, suffix])
return rv
# Helper function for generating Epics Signals
def getEpicsSignal(basename, suffix, name = None, rw = False):
pvname = getEpicsPV(basename, suffix)... | {
"content_hash": "78d82e0f8c84d7a3b530ed10cb99d3e5",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 62,
"avg_line_length": 32.166666666666664,
"alnum_prop": 0.7202072538860104,
"repo_name": "NSLS-II-XPD/ipython_ophyd",
"id": "22e39be165ee5d2b72f0d21cdd4508f3d1d99109",
"si... |
from collections import namedtuple
from aiosocks.connector import ProxyConnector, ProxyClientRequest, Socks4Auth, Socks5Auth
from aiohttp import ClientSession, ClientError, BasicAuth
from .common import *
import logging
HTTPResponse = namedtuple('HTTPResponse',
['version', 'status', 'reason',... | {
"content_hash": "3be274fc5412530cae6c009fbfcacc58",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 116,
"avg_line_length": 34.86725663716814,
"alnum_prop": 0.6007614213197969,
"repo_name": "dahakawang/feedme",
"id": "de8b2a098ef81d35454a481e6b9547b0a85e14f2",
"size": "3... |
import argparse
import os, audioop, numpy, glob, scipy, subprocess, wave, cPickle, threading, shutil, ntpath
import matplotlib.pyplot as plt
import audioFeatureExtraction as aF
import audioTrainTest as aT
import audioSegmentation as aS
import audioVisualization as aV
import audioBasicIO
import utilities as uT
import ... | {
"content_hash": "b10534c7e35f14aaa07bd37abf295fb7",
"timestamp": "",
"source": "github",
"line_count": 432,
"max_line_length": 181,
"avg_line_length": 53.523148148148145,
"alnum_prop": 0.7237695701063922,
"repo_name": "bossjones/pyAudioAnalysis",
"id": "ddbe0486b0de6bbfa10cded2bc7fc6acb3484e07",
"... |
from collections import defaultdict
from oslo_log import log as logging
import proboscis.asserts as asserts
from proboscis.dependencies import SkipTest
from trove.common import utils
from trove.tests.config import CONFIG
LOG = logging.getLogger(__name__)
MESSAGE_QUEUE = defaultdict(list)
def create_usage_verifier(... | {
"content_hash": "f7fb28ba56370d8cd0356d0bc13dc9b0",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 78,
"avg_line_length": 33.95652173913044,
"alnum_prop": 0.6205719163465643,
"repo_name": "zhangg/trove",
"id": "ae13ad831c7245d33c5dfe060f2ce9aa0d48c4bd",
"size": "2980",
... |
import sys, os, string, subprocess
#aliasing the filenames using the labels
def run_command(command):
print "Running command: " + command
err_capture_file = open("my.stderr", 'w') # writing stderr to a file
cmd_run = subprocess.Popen(args=command, shell=True, stderr=err_capture_file, stdout=sys.stdo... | {
"content_hash": "5a91db3c381c6a2f94800a62a5ebc46d",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 178,
"avg_line_length": 30.789473684210527,
"alnum_prop": 0.6521367521367522,
"repo_name": "ssn1306/trinityrnaseq",
"id": "33df3876b7fb347fea155a3018da0b5b26eb6621",
"size"... |
"""An IPv4/IPv6 manipulation library in Python.
This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and prefixes.
"""
__version__ = '1.0.2'
import struct
from json import loads
from secure.gae import gaeinit
gaeinit()
from google.appengine.api import urlfetch
class PublicIP:
def __init__(s... | {
"content_hash": "8c577563f7acbcfcee2f708c2a80bc4a",
"timestamp": "",
"source": "github",
"line_count": 1346,
"max_line_length": 79,
"avg_line_length": 30.436849925705793,
"alnum_prop": 0.5462800234329233,
"repo_name": "bretlowery/snakr",
"id": "0c695e11c47c17e1ab7511a34dbd2aaabc730d2e",
"size": "4... |
"""CLI command definitions."""
import os
import sys
import click
from moduleultra import *
from gimme_input import *
from yaml import dump as ydump
from .daemon import daemon
version = {}
version_path = os.path.join(os.path.dirname(__file__), '../version.py')
with open(version_path) as version_file:
exec(versio... | {
"content_hash": "47592757c228649d89911dd9250c3785",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 93,
"avg_line_length": 32.53448275862069,
"alnum_prop": 0.6157922628510863,
"repo_name": "MetaSUB/ModuleUltra",
"id": "09b43021feafc48ef17c6021d5698dfe01c113ea",
"size": "... |
"""
WSGI config for truffe2 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": "9250af4629fa04c29e652dfb431c0ef9",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 79,
"avg_line_length": 41.74285714285714,
"alnum_prop": 0.7926078028747433,
"repo_name": "ArcaniteSolutions/truffe2",
"id": "fc7ffca491eb3bdb6adf3ae7afa54024fe09c46e",
"siz... |
from __future__ import unicode_literals
import awx.main.fields
from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
from django.utils.timezone import now
import jsonfield.fields
import taggit.managers
def create_system_job_templates(apps, schema_editor):
''... | {
"content_hash": "642416686c93a1415ea22f4734d7cd60",
"timestamp": "",
"source": "github",
"line_count": 736,
"max_line_length": 487,
"avg_line_length": 50.48641304347826,
"alnum_prop": 0.588406265138059,
"repo_name": "GoogleCloudPlatform/sap-deployment-automation",
"id": "89fce679eae41c6f3cb4bf6b9b95... |
import json
from .api_test_base import ApiTestBase
class TestAPIBNFCodeViews(ApiTestBase):
api_prefix = "/api/1.0"
def assertNotJson(self, content):
try:
json.loads(content)
raise AssertionError("Expected %s... to be non-JSON" % content[:10])
except ValueError:
... | {
"content_hash": "c734c62abbcb1850079045f1c1f3998a",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 88,
"avg_line_length": 45.3125,
"alnum_prop": 0.6391724137931034,
"repo_name": "annapowellsmith/openpresc",
"id": "6f735ce802b171883e0fc2135dc8edf571aa78a1",
"size": "7250... |
'''
pi@raspberrypi ~ $ echo $LANG
zh_TW.UTF-8
https://github.com/ashtons/picam
url http://host:port/s/foo_webapp.html
'''
import settings
import picam
import logging,threading
import datetime,time
import Image
import httplib, urllib
import collections,array
import tornado.httpserver
import tornado.websocket
import to... | {
"content_hash": "06ff7d7bcfa7dfefbb4c946d8baa5cf0",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 78,
"avg_line_length": 28.0188679245283,
"alnum_prop": 0.6338945005611673,
"repo_name": "y12studio/pi",
"id": "e54fe3a32c8d84eac2a00bc7bef26fb6f68f49d8",
"size": "4476",
... |
"""
Tensorflow vs. e.g. oracle, train or no, that kind of stuff
May want to refactor name
"""
from experiment_construction.learner_construction.dummy_learner import DummyLearner
from experiment_construction.learner_construction.tensorflow_learner import TensorflowModel
from experiment_construction.learner_construction... | {
"content_hash": "5e3f299334ef7f9d6f1887286f986e40",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 163,
"avg_line_length": 50.020833333333336,
"alnum_prop": 0.7396917950853811,
"repo_name": "MichSchli/QuestionAnsweringGCN",
"id": "cb126091a36ed1835a79bc76d47387d9320fc84f",... |
"""Unit tests for model_activation.py."""
import unittest
import numpy
from gewittergefahr.deep_learning import model_activation
# The following constants are used to test get_hilo_activation_examples.
STORM_ACTIVATIONS = numpy.array([
3.0, -0.2, 0.6, -2.3, 4.3, -0.2, -1.3, -2.1, 0.0, 0.3, 1.1, -1.2, 2.5, -1.2,
... | {
"content_hash": "c3da697b2674d700b2f102931014de9d",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 80,
"avg_line_length": 38.75555555555555,
"alnum_prop": 0.6338876146788991,
"repo_name": "thunderhoser/GewitterGefahr",
"id": "8cb3d7c66c599008b56e66ca35e8f7af978b984c",
"... |
import os
import io
import sys
import time
import platform
from contextlib import contextmanager
"""This is (mostly) a standalone module used to write logging
information about Meson runs. Some output goes to screen,
some to logging dir and some goes to both."""
def _windows_ansi():
from ctypes import windll, byr... | {
"content_hash": "1061add939f7f4323393b7f5be4b0250",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 90,
"avg_line_length": 28.636363636363637,
"alnum_prop": 0.6171802054154996,
"repo_name": "jeandet/meson",
"id": "b8d3cccfb8b9b3eda2a7dfabb018eaef138e1cec",
"size": "5948"... |
"""Parses the command line, discovers the appropriate benchmarks, and runs them.
Handles benchmark configuration, but all the logic for
actually running the benchmark is in Benchmark and PageRunner."""
import argparse
import json
import logging
import os
import sys
from telemetry import benchmark
from telemetry.core... | {
"content_hash": "4d8b034cd13f2358b478fd99e034f1c3",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 80,
"avg_line_length": 35.437209302325584,
"alnum_prop": 0.674891718073238,
"repo_name": "sahiljain/catapult",
"id": "ae5020e0c1d5cff41da60439afa4d75342349c8d",
"size": "1... |
from __future__ import absolute_import
import numpy
from six.moves import range
def snap_to_cube(q_start, q_stop, chunk_depth=16, q_index=1):
"""
For any q in {x, y, z, t}
Takes in a q-range and returns a 1D bound that starts at a cube
boundary and ends at another cube boundary and includes the volume... | {
"content_hash": "c6899c71a8171e0092c1a145b20c0ad3",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 79,
"avg_line_length": 34.207207207207205,
"alnum_prop": 0.5609691861996313,
"repo_name": "neurodata/ndio",
"id": "292735f5c9d0bd057a4ba456e37ef2e76c329c2e",
"size": "3797... |
from __future__ import print_function
import os, sys, re
def getTerminalSize():
"""
returns (lines:int, cols:int)
"""
import os, struct
def ioctl_GWINSZ(fd):
import fcntl, termios
return struct.unpack("hh", fcntl.ioctl(fd, termios.TIOCGWINSZ, "1234"))
# try stdin, stdout, stderr
if (not sys.s... | {
"content_hash": "d6d7aa72b657c48b1c06fea2092492a6",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 77,
"avg_line_length": 20.58823529411765,
"alnum_prop": 0.6,
"repo_name": "rtmclay/Themis",
"id": "28ee37b85d8667d3ce9c8b14ba10c01dff5f69bf",
"size": "1089",
"binary": fa... |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
FLAHOO_FLICKR_API_KEY = "Insert your Flickr API key here"
FLAHOO_TOTAL_TAGS = 3
MANAGERS = ADMINS
DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = '' ... | {
"content_hash": "95e5940c53655c129e1aa0c1e5254cc7",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 101,
"avg_line_length": 35.24390243902439,
"alnum_prop": 0.7093425605536332,
"repo_name": "remiprev/flahoo",
"id": "de018caae6254daaafd455a0a003bf55c860f140",
"size": "2929... |
from qingcloud.cli.misc.utils import explode_array
from qingcloud.cli.iaas_client.actions.base import BaseAction
class AssociateAlarmPolicyAction(BaseAction):
action = 'AssociateAlarmPolicy'
command = 'associate-alarm-policy'
usage = '%(prog)s [-a <alarm_policy>...] [options] [-f <conf_file>]'
@clas... | {
"content_hash": "68b436c40f85a63a229c5b763cb46cf0",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 168,
"avg_line_length": 38.69767441860465,
"alnum_prop": 0.5895432692307693,
"repo_name": "yunify/qingcloud-cli",
"id": "1683893c8f0257ee3a44faba8d1880abad385a24",
"size": ... |
def create_with_snapshotted_data_disk(
project_id: str, zone: str, instance_name: str, snapshot_link: str
):
"""
Create a new VM instance with Debian 10 operating system and data disk created from snapshot.
Args:
project_id: project ID or project number of the Cloud project you want to use.
... | {
"content_hash": "0f05c9b3f6922f4967bc08ea1ac69775",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 97,
"avg_line_length": 41.25925925925926,
"alnum_prop": 0.6660682226211849,
"repo_name": "googleapis/python-compute",
"id": "ea87201e5f1729a412c86b19cdf6e194e80acdfe",
"siz... |
import logging
from random import choice
import fbvoting.apis.fb as fbapi
from fbvoting.db.users import users_with_missing_votes
import fbvoting.db.notifications as db
logger = logging.getLogger(__name__)
def send_notifications():
logger.info("Notifications about missing votes: querying db...")
notification... | {
"content_hash": "21bb6277296c09c6a2a14e4894a230c0",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 125,
"avg_line_length": 43.18421052631579,
"alnum_prop": 0.6386349786715417,
"repo_name": "corradomonti/fbvoting",
"id": "d2c580d5bb2b00dd5fe21c5b3e16a38d2c231cd5",
"size":... |
import mock
from chroma_core.models import Volume, VolumeNode, ManagedHost, LNetConfiguration
from chroma_core.models import NetworkInterface, Nid, ServerProfile
from chroma_core.models import NTPConfiguration
from chroma_core.models import CorosyncConfiguration
from chroma_core.models import PacemakerConfiguration
fr... | {
"content_hash": "c752ab8c0db5bc1203a1e84ac1b981a4",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 118,
"avg_line_length": 33.8041237113402,
"alnum_prop": 0.6289519162346244,
"repo_name": "intel-hpdd/intel-manager-for-lustre",
"id": "fa28a03ff86e97719240764e09403fb0eecba8... |
"""
sentry.utils.json
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from django.core.serializers.json import DjangoJSONEncoder
from django.utils import simplejson
import datetime
import uuid
class BetterJSONEncoder(DjangoJS... | {
"content_hash": "8bf1738f3d6a896264d4b9b58a332ced",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 70,
"avg_line_length": 25.11111111111111,
"alnum_prop": 0.6769911504424779,
"repo_name": "Kronuz/django-sentry",
"id": "fa17433802d77edc450a3ca8d0985ea90e068765",
"size": "... |
"""Test the abandontransaction RPC.
The abandontransaction RPC marks a transaction and all its in-wallet
descendants as abandoned which allows their inputs to be respent. It can be
used to replace "stuck" or evicted transactions. It only works on transactions
which are not included in a block and are not currently... | {
"content_hash": "4f10ede83eb7952681af8c0935804d90",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 138,
"avg_line_length": 48.7196261682243,
"alnum_prop": 0.6556685210051794,
"repo_name": "mm-s/bitcoin",
"id": "27d9d8da8899e49524ebe4f51c0f07b6c95297bb",
"size": "10640",... |
from itertools import takewhile
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
readme = str.join('', takewhile(lambda l: not l.startswith('Installation'), f.readlines()[15:]))
setup(
name = 'overloading',
version = '0.5.0',
description =... | {
"content_hash": "d556b48fef20910955264caac89d53b1",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 100,
"avg_line_length": 33.46875,
"alnum_prop": 0.6143790849673203,
"repo_name": "bintoro/overloading.py",
"id": "bca344f3f50ecb6283474713eadee8c5ff33f7b1",
"size": "1071",... |
from .screens import Screens
class Abilities():
def __init__(self):
return
def update(self, screenType, screen):
pass
| {
"content_hash": "37f737a89261c701ae682b3575e2deaf",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 41,
"avg_line_length": 16.11111111111111,
"alnum_prop": 0.6068965517241379,
"repo_name": "nkhoit/dcss.py",
"id": "df76837c488ef7d94dc16865cb19c7e79a913dc3",
"size": "145",
... |
"""LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
import cStringIO as StringIO
import struct
import kinect_joint_t
class kinect_bodyframe_update_t(object):
__slots__ = ["bodyjoints"]
SpineBase = 0
SpineMid = 1
Neck = 2
Head = 3
ShoulderLeft = 4
... | {
"content_hash": "40fcac4dad7671abac09b797dd6a83fe",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 128,
"avg_line_length": 31.04597701149425,
"alnum_prop": 0.6360607182524991,
"repo_name": "GearsAD/semisorted_arnerve",
"id": "347cab8d4612c336c4f3d81b3cee17599c9c7cd6",
"s... |
import inspect
import os
from trove_guestagent.openstack.common import importutils
from trove_guestagent.openstack.common import loopingcall
from trove_guestagent.openstack.common.rpc import service as rpc_service
from trove_guestagent.common import cfg
CONF = cfg.CONF
class RpcService(rpc_service.Service):
de... | {
"content_hash": "0aff864403e5d6e53f741c669b9c03ab",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 79,
"avg_line_length": 39.46666666666667,
"alnum_prop": 0.6494932432432432,
"repo_name": "denismakogon/trove-guestagent",
"id": "d22a92a595fa0712f869ac1f042659fd9b4f0ff5",
... |
from django.contrib import admin
from storyboard.stories.models import Comment
from storyboard.stories.models import Story
from storyboard.stories.models import StoryTag
from storyboard.stories.models import Task
admin.site.register(Story)
admin.site.register(Task)
admin.site.register(Comment)
admin.site.register(Sto... | {
"content_hash": "d1afc4eff7f4d0b5a2450568a214fab3",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 46,
"avg_line_length": 29.727272727272727,
"alnum_prop": 0.8440366972477065,
"repo_name": "Konovalov-Nik/storyboard",
"id": "d1686dcb67dde7ac5fd95d3755827fa2eaff18ff",
"siz... |
from collections import namedtuple
import re
import requests
from requests_ntlm import HttpNtlmAuth
from bs4 import BeautifulSoup
BASE_URL = 'https://uniflow.calvin.edu/'
CLIENT_PATH = 'pwclient/'
RQM_PATH = 'pwrqm/'
AUTH_PATH = 'getuserid.asp'
PRINT_BUDGET_PATH = 'dispBudget.asp'
PRINT_QUEUE_PATH = 'dispObjects.asp'
... | {
"content_hash": "61400f066a2b1af21e51c9981d8fba9c",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 92,
"avg_line_length": 36.83157894736842,
"alnum_prop": 0.5923120891683338,
"repo_name": "beni55/calvinwebprint",
"id": "582cfc9eec450ca4da04968905f5db82c2744192",
"size":... |
import logging
import time
import traceback
from datetime import datetime, timedelta
import requests
import simplejson as json
from django.conf import settings
from django.core.management.base import BaseCommand
from redis import ConnectionPool, StrictRedis
from sutrofm.redis_models import Party, Message
redis_conne... | {
"content_hash": "c8b22f784d646cb7316e934ef2d6c6ab",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 108,
"avg_line_length": 32.15094339622642,
"alnum_prop": 0.6948356807511737,
"repo_name": "superemily/sutrofm",
"id": "eb7eb557f35eede79bdb999d44fc00f0dbe79624",
"size": "... |
import sys
import antlr3
from TLexer import TLexer
from TParser import TParser
cStream = antlr3.FileStream(sys.argv[1])
lexer = TLexer(cStream)
tStream = antlr3.TokenRewriteStream(lexer)
parser = TParser(tStream)
parser.program()
print tStream
| {
"content_hash": "0ab23e28fb3fb7b590f62d3369af9d8c",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 42,
"avg_line_length": 22.272727272727273,
"alnum_prop": 0.8040816326530612,
"repo_name": "Sable/mclab-core",
"id": "66424d4c02d77d575f8225bc4db2dbbbdb417465",
"size": "245... |
list_of_values= [ace,two,three,four,five,six,seven,eight,nine,ten,jack,queen,king]
list_of_suites=["hearts","spades","diamonds","clubs"]
k=len(list_of_values)
s=len(list_of_suites)
list_of_cards = []
for p in list_of_suites:
for q in list_of_values:
cardd=(q, " of ", p)
list_of_cards.extend(cardd)
... | {
"content_hash": "a351493b272e3eabe0e978f4001d9eb5",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 82,
"avg_line_length": 30.181818181818183,
"alnum_prop": 0.6355421686746988,
"repo_name": "jeremiahmarks/dangerzone",
"id": "0092f988145f9b0b2376747a374b80854d1d32b7",
"siz... |
"""Concrete-table (table-per-class) inheritance example."""
from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import ForeignKey
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import or_
from sqlalchemy import String
from sqlalchemy.ext.declarative import ... | {
"content_hash": "c470666bc1b155d7f8960aaed02d2c63",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 76,
"avg_line_length": 26.07017543859649,
"alnum_prop": 0.6211305518169583,
"repo_name": "j5int/sqlalchemy",
"id": "4eb89984a0b6336d3c654cc7c165e71752566a67",
"size": "445... |
"""Keras convolution layers and image transformation layers.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.keras.python.keras import activations
from tensorflow.contrib.keras.python.keras import backend as K
from tensorflow.con... | {
"content_hash": "34cc941f26e7b7b80f73cbba685136f6",
"timestamp": "",
"source": "github",
"line_count": 1696,
"max_line_length": 104,
"avg_line_length": 44.26650943396226,
"alnum_prop": 0.6327055250679312,
"repo_name": "manazhao/tf_recsys",
"id": "b5e44c89c0892f28bc6ff90a29383361966fac1d",
"size": ... |
import testtools
from my_dev.tests import utils
from my_dev import users
from my_dev import ssh
class TestBase(testtools.TestCase):
def setUp(self):
super(TestBase, self).setUp()
self.user = users.Users()
def create_user(self, username=None, password=None, email=None):
username = use... | {
"content_hash": "80fb20818997ce7d7887473d4650c200",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 75,
"avg_line_length": 39.4,
"alnum_prop": 0.6355329949238578,
"repo_name": "esikachev/my-dev-client",
"id": "4d6b5b04664e8161c9a18372222900337b60163b",
"size": "985",
"b... |
"""Config controller. Other modules should `from yuno.core.config import config`
to get the settings as a global object. At some point early on, something
somewhere (normally yuno.py) needs to `load_default()` or `load_json()` to
load whatever settings it wants.
"""
import json
from yuno.core.errors import *
from yun... | {
"content_hash": "d952b8ccdad439605633236f6a4e1380",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 80,
"avg_line_length": 27.145454545454545,
"alnum_prop": 0.6999330207635633,
"repo_name": "bulatb/yuno",
"id": "79759bcd18723d79f772a4426695e2cd1ae86e17",
"size": "1493",
... |
from django.conf.urls.defaults import *
urlpatterns = patterns('aquaticore.databases.views',
(r'^$', 'index'),
(r'^(?P<database_id>\d+)/$', 'detail'),
)
| {
"content_hash": "299dc843af81fcc2dbeb4bacfdbf2121",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 52,
"avg_line_length": 32,
"alnum_prop": 0.5208333333333334,
"repo_name": "rockerBOO/aquaticore",
"id": "a038a3d6842001d07eaa62d96d8c358bcb2d3ecc",
"size": "192",
"binary"... |
import pydev_log
import traceback
import pydevd_resolver
from pydevd_constants import * #@UnusedWildImport
from types import * #@UnusedWildImport
try:
from urllib import quote
except:
from urllib.parse import quote #@UnresolvedImport
try:
from xml.sax.saxutils import escape
def makeValidXmlValue(s):
... | {
"content_hash": "a908dc567e10f969c607d5c1f6587492",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 120,
"avg_line_length": 30.08133971291866,
"alnum_prop": 0.5582948942261811,
"repo_name": "IllusionRom-deprecated/android_platform_tools_idea",
"id": "73258e6fcc655cc20b08ec... |
from helpers.plotter import Plotter
from helpers.metric import Calculator
import matplotlib.pyplot as plt
############## ALL GRU PLOTS ############################
result_file_1 = 'result/simple/gru/no_attention.csv'
result_file_2 = 'result/bidirectional/gru/no_attention.csv'
result_file_3 = 'result/stacked_simple/gru... | {
"content_hash": "aa646cd37b5580927c7a269bbfea576c",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 87,
"avg_line_length": 29.881967213114756,
"alnum_prop": 0.7454465657230634,
"repo_name": "harpribot/deep-summarization",
"id": "80a3e6ecf18950961d535d2aa49b10fc8338fbad",
... |
import numpy as np
from itertools import combinations
from functools import partial
from sklearn.utils import column_or_1d, check_consistent_length, check_array
from sklearn.preprocessing import label_binarize
from sklearn.metrics import auc, roc_curve
from sklearn.utils.multiclass import type_of_target
def _encod... | {
"content_hash": "3f9b9bf7b676665c4bfbb8db45981a31",
"timestamp": "",
"source": "github",
"line_count": 576,
"max_line_length": 85,
"avg_line_length": 42.473958333333336,
"alnum_prop": 0.600531371346822,
"repo_name": "michalkurka/h2o-3",
"id": "41e120d6221a92ee051ee250be6a10a78d1e275c",
"size": "24... |
def get_condition(args):
return COND_MAP[args[0]](*args[1:])
class ValueCondition:
__slots__ = ["property", "min", "max"]
def __init__(self, prop, _min, _max):
self.property = prop
if type(_min) == str:
_min = float(_min)
if type(_max) == str:
_max = float(_max)
self.min = _min
self.max = _max
... | {
"content_hash": "35f642774be964dbaece543c00e5f71c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 60,
"avg_line_length": 18.75,
"alnum_prop": 0.5977777777777777,
"repo_name": "Moguri/ullur",
"id": "dae24efdee633a373612ed39b3ab5986ad4b0e7d",
"size": "1063",
"binary": f... |
"""Pivotal tracker issue management."""
from twisted.internet import defer
from twisted.python import log
import treq
import json
class PivotalTrackerIssues(object):
"""Pivotal tracker issues management."""
def __init__(self, options):
"""Set up API basics."""
self._options = options
... | {
"content_hash": "26eac98560d3a8710809f1510e2f28a1",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 72,
"avg_line_length": 34.94444444444444,
"alnum_prop": 0.5858505564387917,
"repo_name": "dpnova/devdaemon",
"id": "864de316e7813400bf0486f70d31c96829c8a614",
"size": "2516... |
import random
from datetime import datetime, timedelta
import pytest
import pytz
import maya
from maya.compat import cmp
Los_Angeles = pytz.timezone("America/Los_Angeles")
New_York = pytz.timezone("America/New_York")
Melbourne = pytz.timezone("Australia/Melbourne")
def test_interval_requires_2_of_start_end_duratio... | {
"content_hash": "248eec3218e55776e83e6715ce06bf61",
"timestamp": "",
"source": "github",
"line_count": 561,
"max_line_length": 87,
"avg_line_length": 33.627450980392155,
"alnum_prop": 0.6173866949377154,
"repo_name": "kennethreitz/maya",
"id": "acc02a17160a8fa61a467b30885f636975f98c95",
"size": "1... |
"""
Controller class for the viewer
"""
import logging
from pylons import config
from pylons.controllers.util import abort, redirect
from turbulenz_local.controllers import BaseController
from turbulenz_local.models.gamelist import get_game_by_slug
LOG = logging.getLogger(__name__)
class ViewerController(BaseContro... | {
"content_hash": "838e0abca51a5ba57674c925be84fbb9",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 106,
"avg_line_length": 32.87096774193548,
"alnum_prop": 0.6310107948969578,
"repo_name": "turbulenz/turbulenz_local",
"id": "7ea2c6f10bdaf33e402bb55da234f538d712f5d9",
"si... |
"""
Triggers define what causes a Jenkins job to start building.
**Component**: triggers
:Macro: trigger
:Entry Point: jenkins_jobs.triggers
Example::
job:
name: test_job
triggers:
- timed: '@daily'
"""
import six
import xml.etree.ElementTree as XML
import jenkins_jobs.modules.base
from jenkin... | {
"content_hash": "70a21ac1fa7edc8fa81079a092bf5563",
"timestamp": "",
"source": "github",
"line_count": 1220,
"max_line_length": 104,
"avg_line_length": 44.5516393442623,
"alnum_prop": 0.5989733777344397,
"repo_name": "sebbrandt87/jenkins-job-builder",
"id": "06d6d23eaec6d07c10d82d58cf3ada4c35ddd18c"... |
'''
synbiochem (c) University of Manchester 2015
synbiochem is licensed under the MIT License.
To view a copy of this license, visit <http://opensource.org/licenses/MIT/>.
@author: neilswainston
'''
import gzip
import os
import tempfile
import zipfile
import requests
def get_file(source_url, target_filename):
... | {
"content_hash": "2172a33be4123a92457938192b12ab34",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 76,
"avg_line_length": 27.435294117647057,
"alnum_prop": 0.6355060034305318,
"repo_name": "synbiochem/synbiochem-py",
"id": "5d6daf02f5bc0970ba5dac79120be55a365cd7b7",
"siz... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.ads.googleads.v11.resources",
marshal="google.ads.googleads.v11",
manifest={"KeywordPlanAdGroup",},
)
class KeywordPlanAdGroup(proto.Message):
r"""A Keyword Planner ad group.
Max number of keyword plan ad groups per plan: ... | {
"content_hash": "ea4464763dbb4818afc305ae1ba9e444",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 79,
"avg_line_length": 35.283018867924525,
"alnum_prop": 0.6219251336898396,
"repo_name": "googleads/google-ads-python",
"id": "8b1caea05431d4d0452dc1804f1d7797c28841f4",
"... |
import os
import rollbar
import rollbar.contrib.flask
import structlog
from flask import got_request_exception
import heroku_bouncer
from dynoup import app
from scaler.utils import oauth_callback
import scaler.admin # noqa
logger = structlog.get_logger()
app.wsgi_app = heroku_bouncer.bouncer(app.wsgi_app, scop... | {
"content_hash": "2213990ffb2500e29f311b046de8be7f",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 96,
"avg_line_length": 26.622222222222224,
"alnum_prop": 0.7111853088480802,
"repo_name": "sibson/dynoup",
"id": "8286afbea00eabe698c0057796b4368bbb6b2162",
"size": "1198",... |
from __future__ import unicode_literals
# generic imports
import json
import jsonschema
import logging
# django imports
from django.conf import settings
from django.db import models
# import xml2kvp
from core.xml2kvp import XML2kvp
# Get an instance of a LOGGER
LOGGER = logging.getLogger(__name__)
# Set logging le... | {
"content_hash": "f1fde1c8c7472cb605d6efe287dcc30e",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 71,
"avg_line_length": 25.506849315068493,
"alnum_prop": 0.6396348012889366,
"repo_name": "WSULib/combine",
"id": "5127daf792f2e5695aee02561411058bfd4e645b",
"size": "1886"... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/wearables/vest/shared_vest_hutt_gang_s02.iff"
result.attribute_template_id = 11
result.stfName("wearables_name","vest_hutt_gang_s02")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return r... | {
"content_hash": "45ab6bd049b940f3f751b2f135a6da47",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 81,
"avg_line_length": 25,
"alnum_prop": 0.7046153846153846,
"repo_name": "anhstudios/swganh",
"id": "ab38da341804ff1d7037ecb6aacd763f8e875f23",
"size": "470",
"binary": ... |
import unittest
import os
import torch
from dotenv import load_dotenv
import nlpaug.augmenter.sentence as nas
class TestContextualWordEmbsAug(unittest.TestCase):
@classmethod
def setUpClass(cls):
env_config_path = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', '..', '..', ... | {
"content_hash": "accff7c499e0246b271642c3a1f78496",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 152,
"avg_line_length": 38.65384615384615,
"alnum_prop": 0.6159203980099502,
"repo_name": "makcedward/nlpaug",
"id": "4a79646cff5d83c096ea2465baaa3395a1e11303",
"size": "4... |
from django.conf.urls import include, url
from django.contrib import admin
from books_recsys_app.api import UsersList
import books_recsys_app.views
import rest_framework_swagger
'''
#working on django 1.7
urlpatterns = patterns('',
url(r'^docs/', include('rest_framework_swagger.urls')),
url(r'^$', 'books_recsys... | {
"content_hash": "7415bc69a218877826bee96187ef5e7a",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 82,
"avg_line_length": 46.67857142857143,
"alnum_prop": 0.6732976281560826,
"repo_name": "xianjunzhengbackup/code",
"id": "21598ae105fc1234ab0105829755754804f1a4c2",
"size"... |
import logging
from connections.shift_reg_buffered import ShiftRegBuffered
from connections.shift_reg_gpio import ShiftRegGPIO
def get_connection_by_config(config) -> object:
connection = None
if config["con_type"] == "shiftreg":
connection = \
ShiftRegBuffered(
ShiftRegG... | {
"content_hash": "d0be8fdc9c12e205b9689115891c1008",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 65,
"avg_line_length": 25.61111111111111,
"alnum_prop": 0.6529284164859002,
"repo_name": "s-kostyuk/smart_home_project",
"id": "8046faa09f0642cd292d8e21e9b1452ac5db7e15",
"... |
import paho.mqtt.publish as publish
publish.single("sensor", 'read_presence', hostname="172.20.10.7")
| {
"content_hash": "9ac88a2264f012dadc32c7151eb0721d",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 65,
"avg_line_length": 51,
"alnum_prop": 0.7549019607843137,
"repo_name": "ragulbalaji/Spaces",
"id": "58e27c475cb7e52f72de90f33b72da14345e1379",
"size": "141",
"binary": ... |
"""empty message
Revision ID: 489cf746b500
Revises: None
Create Date: 2015-11-20 17:18:29.015000
"""
# revision identifiers, used by Alembic.
revision = '489cf746b500'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | {
"content_hash": "d19785ccfdfa1d66dc98b6d8e970bdcc",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 70,
"avg_line_length": 28.555555555555557,
"alnum_prop": 0.6673151750972762,
"repo_name": "TwilioDevEd/account-verification-flask",
"id": "fac891fe0a1512e87d9a464ba8c7dcb0da5... |
import sys, os, io
if sys.version_info < (2, 7):
raise ImportError("bounter requires python >= 2.7")
# TODO add ez_setup?
from setuptools import setup, find_packages, Extension
def read(fname):
name = os.path.join(os.path.dirname(__file__), fname)
if not os.path.isfile(name):
return ''
with ... | {
"content_hash": "57a3a505448fc253fa2cb39cbd03f0ec",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 118,
"avg_line_length": 34.48275862068966,
"alnum_prop": 0.646,
"repo_name": "RaRe-Technologies/bounter",
"id": "2dbd7e87a39da52e829d40354880b512638bf1d6",
"size": "2238",
... |
from __future__ import unicode_literals
from django.contrib import admin
from reversion.admin import VersionAdmin
from stagecraft.apps.datasets.models.data_group import DataGroup
from stagecraft.apps.datasets.models.data_set import DataSet
class DataSetInline(admin.StackedInline):
model = DataSet
fields = (... | {
"content_hash": "41e9ea17241af4894567cb7b6d1c4acb",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 64,
"avg_line_length": 23.857142857142858,
"alnum_prop": 0.7095808383233533,
"repo_name": "alphagov/stagecraft",
"id": "3518c57567b3bae590d96ad450bb0332f896fb5e",
"size": "... |
import logging
from django.http import HttpResponse
from twilio.twiml.messaging_response import MessagingResponse
from apostello.reply import InboundSms
from apostello.twilio import twilio_view
from site_config.models import SiteConfiguration
logger = logging.getLogger("apostello")
@twilio_view
def sms(request):
... | {
"content_hash": "c1a421067664f5d22cf72020111ab45c",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 63,
"avg_line_length": 27.741935483870968,
"alnum_prop": 0.7290697674418605,
"repo_name": "monty5811/apostello",
"id": "57813bc5fdeab67cff99c09ef965b40139d28378",
"size": "... |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
def variable_summaries(var):
with tf.name_scope('summaries'):
mean = tf.reduce_mean(var)
tf.summary.scalar('mean', mean)
with tf.name_scope('stddev'):
stddev = tf... | {
"content_hash": "e51a832b4c43a634aac081039a31e051",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 120,
"avg_line_length": 33.635714285714286,
"alnum_prop": 0.6956891059672967,
"repo_name": "nmallinar/gans",
"id": "d3335c430c8ec2542553d7d084082bccf40f8505",
"size": "470... |
"""A clone of the Music Player Daemon (MPD) that plays music from a
Beets library. Attempts to implement a compatible protocol to allow
use of the wide range of MPD clients.
"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
import re
from string import Te... | {
"content_hash": "b9cd0d361bd3bf33c7b21d00c1c4e91a",
"timestamp": "",
"source": "github",
"line_count": 1179,
"max_line_length": 78,
"avg_line_length": 33.64461407972858,
"alnum_prop": 0.5589532861068395,
"repo_name": "ttsda/beets",
"id": "b998f5047c5fef434f9d2c308d9557b56e024571",
"size": "40314",... |
"""
Copyright (c) 2017, Arm Limited and affiliates.
SPDX-License-Identifier: Apache-2.0
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 requir... | {
"content_hash": "d7ec8d710e888f54c2f7b352948f7b3c",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 121,
"avg_line_length": 42.06060606060606,
"alnum_prop": 0.47586455331412103,
"repo_name": "c1728p9/mbed-os",
"id": "575b00c545aed5275238b6142a663a24c419dd40",
"size": "277... |
from kivy.app import App
from kivy.clock import Clock
from kivy.properties import (StringProperty)
from kivy.uix.widget import Widget
from random import randint
import kivent_cython # import needed for kv to work!
class DebugPanel(Widget):
"""docstring for DebugPanel"""
fps = StringProperty(None)
def __i... | {
"content_hash": "e198069e7ee2b40636c073df950545bd",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 78,
"avg_line_length": 28.506493506493506,
"alnum_prop": 0.5699316628701595,
"repo_name": "nightmarebadger/kivy-trying-out",
"id": "cdc920de351bcd72fad2d6ce0ee0b95219728aa0",... |
"""
Multiprocess logging management module.
"""
import sys
import logging
from queue import Empty
from atexit import register
from functools import wraps
from collections import namedtuple
from logging.handlers import QueueHandler
from multiprocessing import Queue, Process
from colorlog import ColoredFormatter
from s... | {
"content_hash": "7913dededbf564c11da536e9c7c79ea8",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 79,
"avg_line_length": 28.06201550387597,
"alnum_prop": 0.594475138121547,
"repo_name": "kuralabs/flowbber",
"id": "2d83b3e4ad594f2b9a7d873b9a9fe83b8fd91ba8",
"size": "785... |
BOT_NAME = 'bigghosthead'
SPIDER_MODULES = ['bigghosthead.spiders']
NEWSPIDER_MODULE = 'bigghosthead.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'bigghosthead (+http://www.yourdomain.com)'
# Obey robots.txt rules
ROBOTSTXT_OBEY = True
# Configure maximum ... | {
"content_hash": "c153d09daba1f9e896047820a98f2585",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 752,
"avg_line_length": 41.970873786407765,
"alnum_prop": 0.7904233171408744,
"repo_name": "baijiege9/BigGhostHead",
"id": "6e55b9f92b91e593d1fb2e8836be06db3525e638",
"siz... |
"""Read JSON taken from the stack analysis DB and re-creates pom.xml from the data."""
import sys
import json
def print_header():
"""Print the header for the pom.xml manifest file."""
print("""
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.redhat.bayessian.test</groupId>
<artifactId>test-ap... | {
"content_hash": "d887259b87951b17c3b5bff93122a5ca",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 86,
"avg_line_length": 26.09259259259259,
"alnum_prop": 0.6543647977288858,
"repo_name": "tisnik/fabric8-analytics-common",
"id": "c8fff46f69f4e6577e5de18fa955b37632b74e53",
... |
from .layer import Layer
from ..activation import Activation
import numpy as np
class RelativeInput(object):
def __init__(self, output_size, s=1.0):
self.output_size = output_size
# Relative variable
self.x = np.random.uniform(-s, s, output_size)
self.q = np.random.uniform(-s, s,... | {
"content_hash": "153f4beaa268b4810716c43fc6857242",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 81,
"avg_line_length": 28.59016393442623,
"alnum_prop": 0.5825688073394495,
"repo_name": "awlange/brainsparks",
"id": "3996999578c2d87452a3211581a691b28fdde491",
"size": "1... |
"""
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | {
"content_hash": "da1718f275753b09dfb90d950d2c88a6",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 83,
"avg_line_length": 40.34615384615385,
"alnum_prop": 0.6892278360343184,
"repo_name": "TheWardoctor/Wardoctors-repo",
"id": "f69f191509338709ed99fe44ac922675ec3d0eed",
"... |
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import rdflib
from rdflib.namespace import RDF, FOAF, RDFS, OWL, DC, DCTERMS, SKOS
from rdflib import URIRef, Literal, Namespace, XSD
import json
from mu.lib_unicode import UnicodeReader, UnicodeWriter
from mu.lib_dbpedia import DbpediaApi
import mu.mutil
from li... | {
"content_hash": "226957dfec6ff9c39f50ddfa6c02efe1",
"timestamp": "",
"source": "github",
"line_count": 831,
"max_line_length": 183,
"avg_line_length": 39.63297232250301,
"alnum_prop": 0.510308182784272,
"repo_name": "mr-justin/open-conference-data",
"id": "2c84effc4f129a231372ec51c44b92826911041f",
... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0003_auto_20160627_1833'),
]
operations = [
migrations.AddField(
model_name='status_jiraissue',
name='jira_issue_text... | {
"content_hash": "1720c9451c5f83c7acbd144e29c61a8d",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 49,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.5974358974358974,
"repo_name": "sunnytambi/QuickScrum",
"id": "f0f5fad904f79e53a5df88e7a1690e4b17a74fdd",
"size":... |
"""Handles all requests relating to instances (guest vms)."""
import datetime
import eventlet
import re
import time
from nova import db
from nova import exception
from nova import flags
from nova import log as logging
from nova import network
from nova import quota
from nova import rpc
from nova import utils
from nov... | {
"content_hash": "3adf13d39a59e1ffb4a33fa1c0dbc182",
"timestamp": "",
"source": "github",
"line_count": 767,
"max_line_length": 79,
"avg_line_length": 42.238591916558015,
"alnum_prop": 0.5639719727135228,
"repo_name": "superstack/nova",
"id": "a12b7dee5fa875d4f0e710c285286ffbc19d1fe2",
"size": "331... |
import logging
from django.contrib.gis.db import models
from census_places.enums import STATES
logger = logging.getLogger('census_places.models')
class PlaceBoundary(models.Model):
geo_id = models.CharField(
primary_key=True,
max_length=60
)
state = models.CharField(
ma... | {
"content_hash": "f4fa83e4cc39b006cabed7bbd16f0f28",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 95,
"avg_line_length": 27.835365853658537,
"alnum_prop": 0.5235487404162102,
"repo_name": "coddingtonbear/django-census-places",
"id": "a82cde3e51d85340712fda9b23e554505087b... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name = 'PttWebCrawler',
packages = ['PttWebCrawler'],
version = '1.4',
description = 'ptt web crawler',
author = '',
author_email = '',
url = 'https://github.com/jwlin/ptt-web-crawler',
... | {
"content_hash": "eff253f8183420a6ca55336ebe035a26",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 57,
"avg_line_length": 21.741935483870968,
"alnum_prop": 0.5459940652818991,
"repo_name": "jikotw74/StockBin",
"id": "e18d641767c3ec98aa3a25ec15c7b5e5c5712c89",
"size": "67... |
import math
from ummalqura_arrray import UmalqurraArray
'''
This class is responsoble to convert from Hijri to Gregorian or from Gregorian to Hijri
The algrothem was converted from java script to python by Khalid Al-hussayen in 1436-3-14 2015-1-5
The orjinal source developed by Suhail Alkowaileet the source url https:... | {
"content_hash": "bf210861915845f518c8ac149b0ae57a",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 143,
"avg_line_length": 39.71621621621622,
"alnum_prop": 0.5695814903028241,
"repo_name": "mpercich/Calendarize",
"id": "796d52d482201dc03caa30f99f5ad1738d315e0e",
"size": ... |
import os
import sys
sys.path.insert(0, "tests")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
if __name__ == "__main__":
from django.core.management import execute_from_command_line
args = sys.argv
args.insert(1, "test")
args.insert(2, "filemanager")
execute_from_command_line(args)
| {
"content_hash": "cd50b705e80508b07874a4003b32d020",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 64,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.684375,
"repo_name": "IMGIITRoorkee/django-filemanager",
"id": "7e016b4bc7922685394611f2a0465c76581c6e94",
"size"... |
import logging
import random # TODO: replace with safe random.
import pendulum
from synth.common.ordinal import as_ordinal
from synth.common.conftime import get_interval
from synth.devices.device import Device
from synth.devices.blb_helpers.solar_math import sun_bright
logger = logging.getLogger(__name__)
class Bl... | {
"content_hash": "189c725b3d36b0168b3c61080f332c85",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 117,
"avg_line_length": 44.90196078431372,
"alnum_prop": 0.614410480349345,
"repo_name": "DevicePilot/synth",
"id": "a1097b4a160f562b84147814aa4b199524a82759",
"size": "45... |
import _plotly_utils.basevalidators
class TicksuffixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="ticksuffix", parent_name="funnel.marker.colorbar", **kwargs
):
super(TicksuffixValidator, self).__init__(
plotly_name=plotly_name,
... | {
"content_hash": "ad644217b951896caf84c40ac8706a20",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 86,
"avg_line_length": 34.642857142857146,
"alnum_prop": 0.6103092783505155,
"repo_name": "plotly/python-api",
"id": "bc1859cdc6fd7420eea5f994c9757ff99f552a4b",
"size": "48... |
from Code.DataStructures.PrimeCurves import P192, P384
from Code.PerformanceComparison.joint_mul import JointMultiplicationScalarPerformanceTest
joint_mul_affine_192_33 = JointMultiplicationScalarPerformanceTest(1000, P192, [2**5, 2**32], 3, 3)
joint_mul_affine_192Big_33 = JointMultiplicationScalarPerformanceTest(1000... | {
"content_hash": "01bd238752f0218558b4e8856de19582",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 118,
"avg_line_length": 57.16494845360825,
"alnum_prop": 0.7655545536519387,
"repo_name": "dev-alberto/Bachelor2017",
"id": "c0cd8c64e2d9134e887ea9bb86244d54929a0b81",
"siz... |
"""
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": "5b8108018fed12dbfcda410379ae0733",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 249,
"avg_line_length": 42,
"alnum_prop": 0.6943722943722944,
"repo_name": "arenadata/ambari",
"id": "b4afb66388f7f7637906616aa267109ea79fad5b",
"size": "2332",
"binary":... |
import abc
from loggers import Actions
class BaseLogger(object):
"""
An abstract logger class. Contains the skeleton code and abstract methods to implement a full logger.
Inherit from this class to create a different logger.
"""
def __init__(self, output_controller, search_context):
self._o... | {
"content_hash": "ce7ea90e99b122a1928cfcda2dc6dbfd",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 136,
"avg_line_length": 35.68032786885246,
"alnum_prop": 0.6283023202389157,
"repo_name": "leifos/simiir",
"id": "ef2ef87d0b868af7756d3051688a7eeb59973355",
"size": "4353"... |
from oslo.config import cfg
from dnrm.openstack.common import context as req_context
from dnrm.openstack.common.gettextutils import _ # noqa
from dnrm.openstack.common import log as logging
from dnrm.openstack.common import rpc
LOG = logging.getLogger(__name__)
notification_topic_opt = cfg.ListOpt(
'notificatio... | {
"content_hash": "6b6bc98a0363e2d3392e7fc6411bf733",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 72,
"avg_line_length": 34.096774193548384,
"alnum_prop": 0.6594134342478714,
"repo_name": "Brocade-OpenSource/OpenStack-DNRM",
"id": "494c799472b6affed7ce6545e3f826b5ebfe9574... |
import sqlite3
import Course
import Student
class SQLWrapper:
def __init__(self):
'''Initialize SQLWrapper.'''
# Create a database file
self.con = sqlite3.connect('timetable.db')
# Connect to the database (locally)
self.cursor = self.con.cursor()
def createStudentsTable... | {
"content_hash": "b9796e1f96a18221b2d4588a9cd826f2",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 148,
"avg_line_length": 32.30061349693251,
"alnum_prop": 0.576068376068376,
"repo_name": "S-Kantor/Time-table-creator",
"id": "bbafa31bd51ecfafac9051e0230f9015b0f17d74",
"... |
import pytest
pytest.register_assert_rewrite("webargs.testing")
| {
"content_hash": "4ce23df2bd5ec36aa5e498590560dd64",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 49,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.8153846153846154,
"repo_name": "sloria/webargs",
"id": "ad2e3ad0758b96b25bd669d36e9eeb2f333fee03",
"size": "65",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.