text
stringlengths
0
1.05M
meta
dict
# Airplay Mode for PiRadio # Limited functionality for now. # When enabled, the mode starts the Shairport Sync service to make the device # visible to Apple devices. # # No metadata is available at the moment. This may change in future releases. from subprocess import call from resources.basemode import RadioBaseMode...
{ "repo_name": "elParaguayo/PiRadio", "path": "modes/airplay.py", "copies": "1", "size": "1239", "license": "mit", "hash": -2144685760708891100, "line_mean": 24.8125, "line_max": 77, "alpha_frac": 0.6359967716, "autogenerated": false, "ratio": 3.920886075949367, "config_test": false, "has_no_k...
"""airports.py provides an example Steno3D project of airports""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np from .base import BaseExample, exampleproperty from ..point import Mesh0D, Point fr...
{ "repo_name": "3ptscience/steno3dpy", "path": "steno3d/examples/airports.py", "copies": "1", "size": "3650", "license": "mit", "hash": 5240546841310380000, "line_mean": 31.3008849558, "line_max": 76, "alpha_frac": 0.5364383562, "autogenerated": false, "ratio": 4.329774614472123, "config_test": ...
""" Airship automated installation script usage: python2.7 <(curl -fsSL raw.github.com/mgax/airship/master/install_airship.py) /var/local/my_awesome_app """ import os import sys import subprocess import urllib import json AIRSHIP_PACKAGE = 'https://github.com/mgax/airship/tarball/master' AIRSHIP_GIT = 'git+https://g...
{ "repo_name": "mgax/airship", "path": "install_airship.py", "copies": "1", "size": "4017", "license": "bsd-2-clause", "hash": -8046051157195396000, "line_mean": 32.475, "line_max": 110, "alpha_frac": 0.6114015434, "autogenerated": false, "ratio": 3.3475, "config_test": false, "has_no_keywords...
airStats = { 'hpPoints':80, 'epPoints':120, 'epRegenCount':5, 'epRegenChance':100, 'abilities':[ 'Category 1 wind -- Cost:15 EP - Damage:10 HP', 'Tornado -- Cost:30 EP - Damage:25 HP', 'Updraft -- Cost:10 EP - Damage:5 HP', 'Vortex Blast -- Cost:25 EP - Damage:0~20 EP - Gain:10~30 HP' ] } waterStats = { ...
{ "repo_name": "Thurii/legendary-telegram", "path": "element_game_stats.py", "copies": "1", "size": "3078", "license": "cc0-1.0", "hash": 2399175430104281600, "line_mean": 24.4462809917, "line_max": 89, "alpha_frac": 0.6309291748, "autogenerated": false, "ratio": 2.2017167381974247, "config_test...
# AI_sample_game.py written by Duncan Murray 26/4/2015 import os import planet import simulator import character import aikif.agents.agent as agt class ReallySimpleGameAI(): """ simple example of an AI which walks characters in a world """ def __init__(self): p = planet.Planet('Simple...
{ "repo_name": "acutesoftware/virtual-AI-simulator", "path": "vais/AI_sample_game.py", "copies": "1", "size": "1644", "license": "mit", "hash": -8670213196275809000, "line_mean": 31.9, "line_max": 88, "alpha_frac": 0.5535279805, "autogenerated": false, "ratio": 3.3896907216494845, "config_test":...
"""aiserverproj URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
{ "repo_name": "PayPal-Opportunity-Hack-Chennai-2015/AID-India", "path": "server/aiserverproj/aiserverproj/urls.py", "copies": "1", "size": "1436", "license": "apache-2.0", "hash": 1611113674148764000, "line_mean": 36.7894736842, "line_max": 83, "alpha_frac": 0.7395543175, "autogenerated": false, ...
# AISim1.py # Reversi (Othello) """ Reversi Simulation 1 - a computer vs. computer tile flipping game An example from Chapter 16 of 'Invent Your Own Games With Python' by Al Sweigart A.C. LoGreco """ import random import sys def drawBoard(board): """ This function prints out the board that it was passed. Re...
{ "repo_name": "aclogreco/InventGamesWP", "path": "ch16/AISim1.py", "copies": "1", "size": "9436", "license": "bsd-2-clause", "hash": -7855244984931019000, "line_mean": 25.2841225627, "line_max": 94, "alpha_frac": 0.5391055532, "autogenerated": false, "ratio": 3.654531371030209, "config_test": f...
# AISim2.py # Reversi (Othello) """ Reversi Simulation 1 - a computer vs. computer tile flipping game simulation An example from Chapter 16 of 'Invent Your Own Games With Python' by Al Sweigart A.C. LoGreco """ import random import sys def drawBoard(board): """ This function prints out the board that it was...
{ "repo_name": "aclogreco/InventGamesWP", "path": "ch16/AISim2.py", "copies": "1", "size": "9764", "license": "bsd-2-clause", "hash": 3369069184803645000, "line_mean": 25.460704607, "line_max": 101, "alpha_frac": 0.5405571487, "autogenerated": false, "ratio": 3.575247162211644, "config_test": fa...
# AISim#.py # Reversi (Othello) """ Reversi Simulation 1 - a computer vs. computer tile flipping game simulation This version includes multiple AI algorithms. An example from Chapter 16 of 'Invent Your Own Games With Python' by Al Sweigart A.C. LoGreco """ import random import sys def drawBoard(board): """ ...
{ "repo_name": "aclogreco/InventGamesWP", "path": "ch16/AISim3.py", "copies": "1", "size": "12600", "license": "bsd-2-clause", "hash": -5351669126102697000, "line_mean": 25.6949152542, "line_max": 101, "alpha_frac": 0.556984127, "autogenerated": false, "ratio": 3.5553047404063207, "config_test":...
"""A janky globstar implementation, not completely stupid but not really optimized. Homegrown because glob2 had no license at the time. It may be worth replacing in the future, but for now it's adequate. https://github.com/miracle2k/python-glob2/issues/2 """ import os from posixpath import join import re import sys ...
{ "repo_name": "bulatb/yuno", "path": "yuno/core/recursive_glob.py", "copies": "1", "size": "2264", "license": "mit", "hash": -7864864079607873000, "line_mean": 28.0256410256, "line_max": 80, "alpha_frac": 0.6347173145, "autogenerated": false, "ratio": 3.6457326892109503, "config_test": false, ...
# ajaxはPOST、それ以外はGET import os import sys import glob import json import DBreader as db import tweepy as tp import flask from functools import wraps import zipfile import urllib import datetime # TL回収用 import adminTL import gettweet os.chdir(os.path.dirname(os.path.abspath(__file__))) # 自身の名称を app という名前でインスタンス化する app...
{ "repo_name": "marron-akanishi/TPTS_web", "path": "app.py", "copies": "1", "size": "9601", "license": "mit", "hash": -726485549788426900, "line_mean": 33.8884615385, "line_max": 135, "alpha_frac": 0.6123911366, "autogenerated": false, "ratio": 3.107571085988352, "config_test": false, "has_no_...
"""Ajax views tests.""" from flask import url_for from wordbook.domain.repo.translation import Repo def test_add_translation(app, client): """Test of add_translation ajax view. Translation should be added to repository and returned in response. """ data = dict( word='sheep', ipa='szii...
{ "repo_name": "lizardschool/wordbook", "path": "tests/flaskapp/test_ajax_views.py", "copies": "1", "size": "1100", "license": "mit", "hash": -4551572702714964500, "line_mean": 32.3333333333, "line_max": 120, "alpha_frac": 0.6436363636, "autogenerated": false, "ratio": 3.832752613240418, "config...
ajax = widget_inputs["check1"] images = widget_inputs["check2"] add_divs_to_page = widget_inputs["check3"] web_worker = widget_inputs["check4"] comments = [] def commentizer(new): if new not in comments: comments.append(new) is_correct = False if not ajax: is_correct = is_correct and False commen...
{ "repo_name": "udacity/course-promises", "path": "quizzes/widget/1.6.async-scenarios.py", "copies": "1", "size": "1271", "license": "mit", "hash": 3065843803116942000, "line_mean": 30.0243902439, "line_max": 132, "alpha_frac": 0.7128245476, "autogenerated": false, "ratio": 3.453804347826087, "c...
# Ajayrama Kumaraswamy, 07 Oct 2014 # Usage: "python splitVCard.py contacts.vcf" where "contacts.vcf" contains multiple contacts. # A folder (in the case named contacts) will be created and the contacts will be stored inside the directory in files # named 1.vcf, 2.vcf.., one contact being stored per file. import os fr...
{ "repo_name": "dEvasEnApati/vcardSplitterCombiner", "path": "splitVCard.py", "copies": "2", "size": "1860", "license": "apache-2.0", "hash": 3114265900693593000, "line_mean": 20.8823529412, "line_max": 117, "alpha_frac": 0.5322580645, "autogenerated": false, "ratio": 3.522727272727273, "config_...
# A jiffy to try and identify the FreeR column in an MTZ file - will look for # FreeR_flag, then *free*, will check that the column type is 'I' and so # will be useful when an external reflection file is passed in for copying # of the FreeR column. from xia2.Wrappers.CCP4.Mtzdump import Mtzdump def FindFreeFlag(hkl...
{ "repo_name": "xia2/xia2", "path": "src/xia2/Modules/FindFreeFlag.py", "copies": "1", "size": "1302", "license": "bsd-3-clause", "hash": 1971868602642990600, "line_mean": 29.2790697674, "line_max": 77, "alpha_frac": 0.6397849462, "autogenerated": false, "ratio": 3.5867768595041323, "config_test...
a = ['jio a, +19','inc a','tpl a','inc a','tpl a','inc a','tpl a','tpl a','inc a','inc a','tpl a','tpl a','inc a','inc a','tpl a','inc a','inc a','tpl a','jmp +23','tpl a','tpl a','inc a','inc a','tpl a','inc a','inc a','tpl a','inc a','tpl a','inc a','tpl a','inc a','tpl a','inc a','inc a','tpl a','inc a','inc a','tpl...
{ "repo_name": "imylyanyk/AdventOfCode", "path": "day23.py", "copies": "1", "size": "1229", "license": "mit", "hash": 1370332523217162800, "line_mean": 27.5813953488, "line_max": 414, "alpha_frac": 0.3783563873, "autogenerated": false, "ratio": 2.8123569794050343, "config_test": false, "has_no...
# AJ Looney # 9/7/15 # Facial-Detection import cv2 from cascadeFile import CascadeFile class DetectFace: def __init__(self, vid, smile=False, eye=False): self.active = True self.smile = smile self.eye = eye self.vid = vid self.faceCascade = CascadeFile("haarcascade_frontal...
{ "repo_name": "Looney4444/Facial-Detection", "path": "src/DetectFace.py", "copies": "1", "size": "2229", "license": "apache-2.0", "hash": 1704010552028980500, "line_mean": 31.7794117647, "line_max": 96, "alpha_frac": 0.4782413638, "autogenerated": false, "ratio": 3.73993288590604, "config_test"...
# A job for creating and managing key generation from os import environ, remove, path import subprocess jenkins_scripts = environ.get("JENKINS_SCRIPTS") aws_access_key = environ.get("AWS_ACCESS_KEY") aws_secret_key = environ.get("AWS_SECRET_KEY") domain_name=environ.get('Domain_Name') state=environ.get('State') city...
{ "repo_name": "TopherGopher/aws-infra.jenkins-scripts", "path": "csr_generation_and_upload.py", "copies": "1", "size": "2602", "license": "mit", "hash": -6446074609047677000, "line_mean": 52.1224489796, "line_max": 257, "alpha_frac": 0.7401998463, "autogenerated": false, "ratio": 3.08293838862559...
# A 'job server' which actually runs the requests. At the moment this is # simply a proof of concept. It runs one job at a time and has no # provisions for supporting multiple job managers or multiple in flight jobs. # This job-server will try to run jobs which haven't been started before, but # will not retry jobs...
{ "repo_name": "preames/lc-service", "path": "job-server/main.py", "copies": "1", "size": "4521", "license": "bsd-3-clause", "hash": -3407603752033924000, "line_mean": 35.756097561, "line_max": 80, "alpha_frac": 0.6560495466, "autogenerated": false, "ratio": 3.9762532981530345, "config_test": fa...
"""A job to send a HTTP (GET or DELETE) periodically.""" import logging import requests from ndscheduler.corescheduler import job logger = logging.getLogger(__name__) class CurlJob(job.JobBase): TIMEOUT = 10 @classmethod def meta_info(cls): return { 'job_class_string': '%s.%s' % (c...
{ "repo_name": "Nextdoor/ndscheduler", "path": "simple_scheduler/jobs/curl_job.py", "copies": "1", "size": "1481", "license": "bsd-2-clause", "hash": -7748917719032585000, "line_mean": 31.9111111111, "line_max": 91, "alpha_frac": 0.490209318, "autogenerated": false, "ratio": 4.280346820809249, "...
"""A job to send a HTTP (GET or DELETE) periodically.""" import logging import requests from ndscheduler import job logger = logging.getLogger(__name__) class CurlJob(job.JobBase): TIMEOUT = 10 @classmethod def meta_info(cls): return { 'job_class_string': '%s.%s' % (cls.__module__,...
{ "repo_name": "DurgaChowdary/ndscheduler", "path": "simple_scheduler/jobs/curl_job.py", "copies": "1", "size": "1467", "license": "bsd-2-clause", "hash": 2979742059552332300, "line_mean": 31.6, "line_max": 91, "alpha_frac": 0.4853442399, "autogenerated": false, "ratio": 4.252173913043478, "conf...
"""A job to send slack message periodically.""" import logging import json import os import socket import requests from ndscheduler.corescheduler import job logger = logging.getLogger(__name__) class SlackJob(job.JobBase): MAX_RETRIES = 3 TIMEOUT = 10 @classmethod def meta_info(cls): ret...
{ "repo_name": "Nextdoor/ndscheduler", "path": "simple_scheduler/jobs/slack_job.py", "copies": "1", "size": "2950", "license": "bsd-2-clause", "hash": -4475711735287276500, "line_mean": 35.875, "line_max": 100, "alpha_frac": 0.54, "autogenerated": false, "ratio": 4.190340909090909, "config_test"...
"""A job to send slack message periodically.""" import logging import json import os import socket import requests from ndscheduler import job logger = logging.getLogger(__name__) class SlackJob(job.JobBase): MAX_RETRIES = 3 TIMEOUT = 10 @classmethod def meta_info(cls): return { ...
{ "repo_name": "DurgaChowdary/ndscheduler", "path": "simple_scheduler/jobs/slack_job.py", "copies": "1", "size": "2935", "license": "bsd-2-clause", "hash": 2169233528810239500, "line_mean": 36.1518987342, "line_max": 100, "alpha_frac": 0.538330494, "autogenerated": false, "ratio": 4.18687589158345...
import cgi import os import yaml import StringIO import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' if os.environ.get('APPENGINE_RUNTIME') == 'python27': # internal django version is fine with python27 from google.appengine._internal.django.utils.html import escape else: # with python2.5 we load...
{ "repo_name": "pmleveque/cross-site-navigation", "path": "cefbase.py", "copies": "1", "size": "2262", "license": "mit", "hash": -5584614913412147000, "line_mean": 34.9047619048, "line_max": 114, "alpha_frac": 0.7400530504, "autogenerated": false, "ratio": 3.5734597156398102, "config_test": fals...
# A JSON-based API(view) for your app. # Most rules would look like: # @jsonify.when("isinstance(obj, YourClass)") # def jsonify_yourclass(obj): # return [obj.val1, obj.val2] # @jsonify can convert your objects to following types: # lists, dicts, numbers and strings from turbojson.jsonify import jsonify from turb...
{ "repo_name": "LamCiuLoeng/bossini", "path": "ecrm/json.py", "copies": "1", "size": "1121", "license": "mit", "hash": -2813798006828335000, "line_mean": 32.9696969697, "line_max": 72, "alpha_frac": 0.7109723461, "autogenerated": false, "ratio": 3.407294832826748, "config_test": false, "has_no...
# A JSON-based API(view) for your app. # Most rules would look like: # @jsonify.when("isinstance(obj, YourClass)") # def jsonify_yourclass(obj): # return [obj.val1, obj.val2] # @jsonify can convert your objects to following types: # lists, dicts, numbers and strings from turbojson.jsonify import jsonify ...
{ "repo_name": "pbarton666/buzz_bot", "path": "bot_project/buzzbot/json.py", "copies": "1", "size": "1157", "license": "mit", "hash": 1442032543179757800, "line_mean": 33.0606060606, "line_max": 72, "alpha_frac": 0.6914433881, "autogenerated": false, "ratio": 3.402941176470588, "config_test": fa...
"""A JSON Encoder similar to TaggedJSONSerializer from Flask, that knows about Result Proxies and adds some convenience for other common types. This encoder is a good fit because it will traverse the data structure it encodes recursively, raising any SuspendTask/TaskError exceptions stored in task results. Any seriali...
{ "repo_name": "severb/flowy", "path": "flowy/serialization.py", "copies": "1", "size": "3659", "license": "mit", "hash": 1154026848799148300, "line_mean": 25.9044117647, "line_max": 112, "alpha_frac": 0.6078163433, "autogenerated": false, "ratio": 3.88016967126193, "config_test": false, "has_...
'''A JSON-RPC Server with a task queue for performing lengthy calculations''' import os import base import time from unuk.utils import get_logger, load_settings settings = load_settings('taskqueue.settings') from unuk.core.jsonrpc import JSONRPC, Proxy from unuk.contrib.tasks import Controller def callbac...
{ "repo_name": "pombredanne/unuk", "path": "examples/taskqueue/application.py", "copies": "1", "size": "1430", "license": "bsd-3-clause", "hash": 7949384851384214000, "line_mean": 28.4255319149, "line_max": 80, "alpha_frac": 0.6475524476, "autogenerated": false, "ratio": 4.097421203438396, "conf...
"""A JSON service for statvent. You can also run this module as a command and it will read the data from your stat pipes and serve it up as JSON via HTTP. It tries to gracefully handle dead pipes, and will unlink them if it finds any. """ import optparse import os import signal import time import traceback import url...
{ "repo_name": "dowski/statvent", "path": "statvent/web.py", "copies": "1", "size": "3869", "license": "bsd-2-clause", "hash": -4715942450179535000, "line_mean": 30.7131147541, "line_max": 80, "alpha_frac": 0.5479452055, "autogenerated": false, "ratio": 4.1781857451403885, "config_test": false, ...
"""A Jupyter Notebook interface to Klampt. Examples: Basic usage:: from klampt import * from klampt.vis.ipython import KlamptWidget from IPython.display import display world = WorldModel() ... #set up the world... kvis = KlamptWidget(world,width=800,height=640) ...
{ "repo_name": "krishauser/Klampt", "path": "Python/python2_version/klampt/vis/ipython/widgets.py", "copies": "1", "size": "42495", "license": "bsd-3-clause", "hash": 1126795481282057900, "line_mean": 41.495, "line_max": 239, "alpha_frac": 0.5657136134, "autogenerated": false, "ratio": 3.842919153...
# ajutils.py by ApolloJustice # for use with Python 3 # non PEP-8 compliant because honestly fuck that # probably not commented because too lazy __module_name__ = 'AJUtils' __module_version__ = '1.0' __module_description__ = 'General commands.' __author__ = 'ApolloJustice' zncPrefix = '*' import hexchat def nea(): ...
{ "repo_name": "ApolloJustice/HexChat-pyscripts", "path": "ajutils.py", "copies": "1", "size": "5182", "license": "mit", "hash": 9001510288552405000, "line_mean": 36.5579710145, "line_max": 166, "alpha_frac": 0.6889231957, "autogenerated": false, "ratio": 2.9227298364354204, "config_test": false...
# aka OVERKILL.PY # # Some fun utilities to serialize python data into compressed strings. # Need this because a) memcached has a 1MB datasize limit and b) memcached # requires plain, ASCII-only strings. try: from cPickle import dumps, loads except ImportError: from pickle import dumps, loads from hashlib impor...
{ "repo_name": "mtigas/radiowut", "path": "cacheutil.py", "copies": "1", "size": "2920", "license": "mit", "hash": -7133824887433191000, "line_mean": 26.2897196262, "line_max": 77, "alpha_frac": 0.6089041096, "autogenerated": false, "ratio": 3.700887198986058, "config_test": false, "has_no_key...
#akara.resource """ There is no superclass for an Akara resource. It's any object with an id data mamber self.policy - instance of L{akara.policy.manager} """ #__all__ = ['manager', 'standard_index'] CREATED = 'akara:created' UPDATED = 'akara:updated' CONTENT_LENGTH = 'akara:size' CONTENT_TYPE = 'akara:type' clas...
{ "repo_name": "uogbuji/akara", "path": "lib/resource/__init__.py", "copies": "1", "size": "2414", "license": "apache-2.0", "hash": -2144753600971282200, "line_mean": 24.1458333333, "line_max": 96, "alpha_frac": 0.5828500414, "autogenerated": false, "ratio": 4.1194539249146755, "config_test": fa...
"""akara.services - adapters to use Python functions as WSGI handlers This module is meant to be used by functions in an Akara extension module. """ import httplib import warnings import functools import cgi import inspect from cStringIO import StringIO from xml.sax.saxutils import escape as xml_escape from BaseHTT...
{ "repo_name": "uogbuji/akara", "path": "lib/services.py", "copies": "1", "size": "24661", "license": "apache-2.0", "hash": 361344488637400100, "line_mean": 37.7142857143, "line_max": 99, "alpha_frac": 0.6299420137, "autogenerated": false, "ratio": 4.141225860621327, "config_test": false, "has...
# akerl, 2013 # https://github.com/akerl/conflib '''conflib is designed to simply stacking of configurations useful when you have defaults & user input, or global and local settings ''' class Config(object): ''' *configs is a stack of dicts or other Config objects order flows from least to most 'powe...
{ "repo_name": "akerl/conflib", "path": "conflib/conflib.py", "copies": "1", "size": "3518", "license": "mit", "hash": 1047407001123281400, "line_mean": 37.2391304348, "line_max": 75, "alpha_frac": 0.5571347356, "autogenerated": false, "ratio": 5.196454948301329, "config_test": true, "has_no_k...
# akerl, 2013 # https://github.com/akerl/modlib '''modlib maintains a stack of dynamically-loaded module objects useful when you need to import dynamic modules with some degree of control ''' from os.path import isfile, expanduser from importlib import import_module class Modstack(object): '''formula is used by...
{ "repo_name": "akerl/modlib", "path": "modlib/modlib.py", "copies": "1", "size": "1429", "license": "mit", "hash": 9169512810954617000, "line_mean": 32.2325581395, "line_max": 74, "alpha_frac": 0.610916725, "autogenerated": false, "ratio": 4.2656716417910445, "config_test": false, "has_no_key...
"""A kernel client for in-process kernels.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from IPython.kernel.channelsabc import HBChannelABC from .socket import DummySocket #----------------------------------------------------------------------------- # Chan...
{ "repo_name": "wolfram74/numerical_methods_iserles_notes", "path": "venv/lib/python2.7/site-packages/IPython/kernel/inprocess/channels.py", "copies": "4", "size": "2629", "license": "mit", "hash": -2258868846302330400, "line_mean": 26.1030927835, "line_max": 81, "alpha_frac": 0.602890833, "autogene...
"""A kernel client for in-process kernels.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from IPython.kernel.channelsabc import ( ShellChannelABC, IOPubChannelABC, HBChannelABC, StdInChannelABC, ) from .socket import DummySocket #--------------------...
{ "repo_name": "mattvonrocketstein/smash", "path": "smashlib/ipy3x/kernel/inprocess/channels.py", "copies": "1", "size": "6705", "license": "mit", "hash": -6196055306194000000, "line_mean": 32.0295566502, "line_max": 80, "alpha_frac": 0.5422818792, "autogenerated": false, "ratio": 4.68553459119496...
""" A kernel client for in-process kernels. """ #----------------------------------------------------------------------------- # Copyright (C) 2012 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #---...
{ "repo_name": "noslenfa/tdjangorest", "path": "uw/lib/python2.7/site-packages/IPython/kernel/inprocess/channels.py", "copies": "2", "size": "6812", "license": "apache-2.0", "hash": 8097668796476168000, "line_mean": 34.1134020619, "line_max": 81, "alpha_frac": 0.5256899589, "autogenerated": false, ...
""" a kernel implementation of a (localised) seamless update from a coupling between two weighted ensembles (coarse and fine) to two coupled evenly weighted ensembles """ from __future__ import absolute_import from __future__ import division from firedrake import * from firedrake.mg.utils import get_level from fade ...
{ "repo_name": "alsgregory/FADE", "path": "fade/ml/coupling.py", "copies": "2", "size": "8073", "license": "mit", "hash": -9190670743584968000, "line_mean": 38.5735294118, "line_max": 100, "alpha_frac": 0.6065898675, "autogenerated": false, "ratio": 3.3651521467278034, "config_test": false, "h...
"""A kernel manager for in-process kernels.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from IPython.utils.traitlets import Instance, DottedObjectName from IPython.kernel.managerabc import KernelManagerABC from IPython.kernel.manager import KernelManager fro...
{ "repo_name": "wolfram74/numerical_methods_iserles_notes", "path": "venv/lib/python2.7/site-packages/IPython/kernel/inprocess/manager.py", "copies": "4", "size": "2469", "license": "mit", "hash": -7985418457950066000, "line_mean": 33.7746478873, "line_max": 93, "alpha_frac": 0.6265694613, "autogene...
"""A kernel manager for in-process kernels.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from traitlets import Instance, DottedObjectName, default from jupyter_client.managerabc import KernelManagerABC from jupyter_client.manager import KernelManager from jup...
{ "repo_name": "sserrot/champion_relationships", "path": "venv/Lib/site-packages/ipykernel/inprocess/manager.py", "copies": "9", "size": "2764", "license": "mit", "hash": 6489665061387190000, "line_mean": 33.1234567901, "line_max": 88, "alpha_frac": 0.6331403763, "autogenerated": false, "ratio": 4...
"""A kernel manager for in-process kernels.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from traitlets import Instance, DottedObjectName from jupyter_client.managerabc import KernelManagerABC from jupyter_client.manager import KernelManager from jupyter_clie...
{ "repo_name": "bdh1011/wau", "path": "venv/lib/python2.7/site-packages/ipykernel/inprocess/manager.py", "copies": "1", "size": "2467", "license": "mit", "hash": -5736140954056489000, "line_mean": 33.2638888889, "line_max": 88, "alpha_frac": 0.6214025132, "autogenerated": false, "ratio": 4.6990476...
"""A kernel manager for in-process kernels.""" #----------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #----...
{ "repo_name": "mattvonrocketstein/smash", "path": "smashlib/ipy3x/kernel/inprocess/manager.py", "copies": "1", "size": "2873", "license": "mit", "hash": -1987688352129125600, "line_mean": 34.9125, "line_max": 79, "alpha_frac": 0.5210581274, "autogenerated": false, "ratio": 5.5570599613152805, "...
"""A kernel manager for multiple kernels Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as par...
{ "repo_name": "marcoantoniooliveira/labweb", "path": "oscar/lib/python2.7/site-packages/IPython/kernel/multikernelmanager.py", "copies": "2", "size": "9118", "license": "bsd-3-clause", "hash": 6667340723475497000, "line_mean": 29.292358804, "line_max": 82, "alpha_frac": 0.5632814214, "autogenerated...
"""A kernel manager for multiple kernels""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import absolute_import import os import uuid import zmq from IPython.config.configurable import LoggingConfigurable from IPython.utils.importstring import...
{ "repo_name": "mattvonrocketstein/smash", "path": "smashlib/ipy3x/kernel/multikernelmanager.py", "copies": "1", "size": "9811", "license": "mit", "hash": -1142344876163740000, "line_mean": 29.1876923077, "line_max": 81, "alpha_frac": 0.5968810519, "autogenerated": false, "ratio": 4.32393124724548...
"""A kernel manager for multiple kernels""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import absolute_import import os import uuid import zmq from traitlets.config.configurable import LoggingConfigurable from ipython_genutils.importstring i...
{ "repo_name": "ArcherSys/ArcherSys", "path": "Lib/site-packages/jupyter_client/multikernelmanager.py", "copies": "6", "size": "9790", "license": "mit", "hash": 802074518801046400, "line_mean": 29.8832807571, "line_max": 82, "alpha_frac": 0.5994892748, "autogenerated": false, "ratio": 4.3032967032...
"""A kernel manager relating notebooks and kernels Authors: * Brian Granger """ #----------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distribu...
{ "repo_name": "noslenfa/tdjangorest", "path": "uw/lib/python2.7/site-packages/IPython/html/services/kernels/kernelmanager.py", "copies": "2", "size": "4209", "license": "apache-2.0", "hash": -2850908001190806000, "line_mean": 37.2636363636, "line_max": 80, "alpha_frac": 0.5433594678, "autogenerated...
"""A kernel manager with a tornado IOLoop""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from tornado import ioloop from zmq.eventloop.zmqstream import ZMQStream from traitlets import ( Instance, Type, ) from jupyter_client.manager import KernelManage...
{ "repo_name": "sserrot/champion_relationships", "path": "venv/Lib/site-packages/jupyter_client/ioloop/manager.py", "copies": "1", "size": "3398", "license": "mit", "hash": 2793422577878640000, "line_mean": 32.3137254902, "line_max": 94, "alpha_frac": 0.65891701, "autogenerated": false, "ratio": 3...
"""A kernel manager with a tornado IOLoop""" #----------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #------...
{ "repo_name": "wolfram74/numerical_methods_iserles_notes", "path": "venv/lib/python2.7/site-packages/IPython/kernel/ioloop/manager.py", "copies": "14", "size": "2141", "license": "mit", "hash": -3314566430515189000, "line_mean": 33.5322580645, "line_max": 78, "alpha_frac": 0.5296590378, "autogenera...
"""A kernel manager with a tornado IOLoop""" #----------------------------------------------------------------------------- # Copyright (c) The Jupyter Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #------------...
{ "repo_name": "ammarkhann/FinalSeniorCode", "path": "lib/python2.7/site-packages/jupyter_client/ioloop/manager.py", "copies": "12", "size": "2120", "license": "mit", "hash": -6897679466263419000, "line_mean": 33.1935483871, "line_max": 89, "alpha_frac": 0.5268867925, "autogenerated": false, "rati...
AKEY = 'a' BKEY = 'b' CKEY = 'c' DKEY = 'd' EKEY = 'e' FKEY = 'f' GKEY = 'g' HKEY = 'h' IKEY = 'i' JKEY = 'j' KKEY = 'k' LKEY = 'l' MKEY = 'm' NKEY = 'n' OKEY = 'o' PKEY = 'p' QKEY = 'q' RKEY = 'r' SKEY = 's' TKEY = 't' UKEY = 'u' VKEY = 'v' WKEY = 'w' XKEY = 'x' YKEY = 'y' ZKEY = 'z' ZEROKEY = '0' ONEKEY = '1' TWOKEY...
{ "repo_name": "Remwrath/bgui", "path": "bgui/key_defs.py", "copies": "9", "size": "1501", "license": "mit", "hash": 2494647455241124400, "line_mean": 11.6134453782, "line_max": 23, "alpha_frac": 0.6568954031, "autogenerated": false, "ratio": 2.1022408963585435, "config_test": false, "has_no_k...
"""A key-value[] store that implements reservoir sampling on the values.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import random import threading class Reservoir(object): """A map-to-arrays container, with deterministic Reser...
{ "repo_name": "kcartier/tensorflow-toe-in-the-water", "path": "tensorflow/python/summary/impl/reservoir.py", "copies": "1", "size": "7300", "license": "apache-2.0", "hash": 6131645538671578000, "line_mean": 33.5971563981, "line_max": 80, "alpha_frac": 0.6723287671, "autogenerated": false, "ratio"...
"""A key-value[] store that implements reservoir sampling on the values.""" import collections import random import threading class Reservoir(object): """A map-to-arrays container, with deterministic Reservoir Sampling. Items are added with an associated key. Items may be retrieved by key, and a list of keys ...
{ "repo_name": "brendandburns/tensorflow", "path": "tensorflow/python/summary/impl/reservoir.py", "copies": "5", "size": "5458", "license": "apache-2.0", "hash": 8486158812770790000, "line_mean": 32.2804878049, "line_max": 80, "alpha_frac": 0.6637962624, "autogenerated": false, "ratio": 3.79554937...
"""Akhet installation script. """ import os from setuptools import setup from setuptools import find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, "README.txt")).read() README = README.split("\n\n", 1)[0] + "\n" CHANGES = open(os.path.join(here, "CHANGES.txt")).read() re...
{ "repo_name": "koansys/akhet", "path": "setup.py", "copies": "1", "size": "1264", "license": "mit", "hash": -4693349044940925000, "line_mean": 26.4782608696, "line_max": 72, "alpha_frac": 0.6289556962, "autogenerated": false, "ratio": 3.482093663911846, "config_test": false, "has_no_keywords"...
#a kind of python meli api import json import logging import time import requests from requests_ssl_fix import SSLAdapter from requests.adapters import HTTPAdapter import ssl requests.packages.urllib3.disable_warnings() req_s = requests.Session() req_s.mount('https://', SSLAdapter(ssl.PROTOCOL_TLSv1)) #req_s = requ...
{ "repo_name": "mfalcon/meli-collection", "path": "meli_api.py", "copies": "1", "size": "4980", "license": "apache-2.0", "hash": 269278827794773220, "line_mean": 30.7197452229, "line_max": 140, "alpha_frac": 0.5335341365, "autogenerated": false, "ratio": 3.598265895953757, "config_test": false, ...
#a kind of python meli api import json import logging import time import requests BASE_URL = 'https://api.mercadolibre.com/' BASE_SITE_URL = BASE_URL + 'sites/' SLEEP_TIME = 0.05 #in seconds ERROR_SLEEP_TIME = 0.1 class MeliAPI(): def __init__(self, sid='MLA'): self.sid = sid logger = logging.g...
{ "repo_name": "mfalcon/melive", "path": "meli_api.py", "copies": "1", "size": "3507", "license": "mit", "hash": 6308156812912320000, "line_mean": 31.4722222222, "line_max": 140, "alpha_frac": 0.5625891075, "autogenerated": false, "ratio": 3.493027888446215, "config_test": false, "has_no_keywo...
"""Akismet spam checker backend for Zinnia""" from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.utils.encoding import smart_str from zinnia.settings import PROTOCOL from zinnia_akismet.api import APIKeyError from zinnia_ak...
{ "repo_name": "django-blog-zinnia/zinnia-spam-checker-akismet", "path": "zinnia_akismet/akismet.py", "copies": "1", "size": "1469", "license": "bsd-3-clause", "hash": 160395757767265180, "line_mean": 34.8292682927, "line_max": 73, "alpha_frac": 0.6739278421, "autogenerated": false, "ratio": 3.353...
"""Akismet spam checker backend for Zinnia""" from django.conf import settings from django.utils.encoding import smart_str from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from zinnia.settings import PROTOCOL try: from akismet import Akismet from akismet imp...
{ "repo_name": "westinedu/similarinterest", "path": "zinnia/spam_checker/backends/automattic.py", "copies": "3", "size": "1616", "license": "bsd-3-clause", "hash": -8902216685147546000, "line_mean": 37.4761904762, "line_max": 77, "alpha_frac": 0.6775990099, "autogenerated": false, "ratio": 3.43099...
# Akismet spam filtering: http://sciyoshi.com/blog/2009/jul/17/prevent-django-newcomments-spam-akismet-reloaded/ from django.contrib.comments.moderation import CommentModerator, moderator, AlreadyModerated from django.contrib.sites.models import Site from django.conf import settings class AkismetModerator(Comme...
{ "repo_name": "albatrossandco/brubeck_cms", "path": "brubeck/core/moderation.py", "copies": "1", "size": "1918", "license": "bsd-3-clause", "hash": -5090757203409511000, "line_mean": 36.36, "line_max": 112, "alpha_frac": 0.5849843587, "autogenerated": false, "ratio": 3.7315175097276265, "config...
# A.Klimentov Mar 3, 2014 # # DEFT tasks handling # # Mar 15, 2014. Add json # Mar 19, 2014. Add JEDI Client.py # Mar 20, 2014. Dataset tables synchronization # Ignore tasks and datasets with ID < 4 000 000 # Mar 24, 2014. Requests state update vs Task state # Mar 31, 2014. Add taskinfo into task partit...
{ "repo_name": "PanDAWMS/panda-bigmon-atlas", "path": "atlas/postproduction/deft/deft_handling.py", "copies": "1", "size": "46427", "license": "apache-2.0", "hash": -3693314298390160400, "line_mean": 37.9488255034, "line_max": 128, "alpha_frac": 0.5612466883, "autogenerated": false, "ratio": 3.286...
# A.Klimentov May 13, 2014 # # register productiuon containers and add datasets # # Last Edit : Jun 11, 2014 ak # import re import sys import os import getopt import commands import datetime import time import cx_Oracle import deft_conf import deft_pass import deft_user_list import DButils # from dq2.clientapi.DQ2 ...
{ "repo_name": "PanDAWMS/panda-bigmon-atlas", "path": "atlas/postproduction/deft/add_containter.py", "copies": "1", "size": "9730", "license": "apache-2.0", "hash": -7812118469978455000, "line_mean": 36.4230769231, "line_max": 214, "alpha_frac": 0.5568345324, "autogenerated": false, "ratio": 3.496...
a_l = [0, 1, 2] b_l = [10, 20, 30] a_t = (0, 1, 2) b_t = (10, 20, 30) a_s = 'abc' b_s = 'xyz' print(a_l + b_l) # [0, 1, 2, 10, 20, 30] print(a_t + b_t) # (0, 1, 2, 10, 20, 30) print(a_s + b_s) # abcxyz # print(a_l + 3) # TypeError: can only concatenate list (not "int") to list print(a_l + [3]) # [0, 1, 2, 3] # ...
{ "repo_name": "nkmk/python-snippets", "path": "notebook/arithmetic_operator_list_tuple_str.py", "copies": "1", "size": "1210", "license": "mit", "hash": -6346641609654221000, "line_mean": 13.4047619048, "line_max": 63, "alpha_frac": 0.494214876, "autogenerated": false, "ratio": 1.7872968980797637...
a = """L1, L5, R1, R3, L4, L5, R5, R1, L2, L2, L3, R4, L2, R3, R1, L2, R5, R3, L4, R4, L3, R3, R3, L2, R1, L3, R2, L1, R4, L2, R4, L4, R5, L3, R1, R1, L1, L3, L2, R1, R3, R2, L1, R4, L4, R2, L189, L4, R5, R3, L1, R47, R4, R1, R3, L3, L3, L2, R70, L1, R4, R185, R5, L4, L5, R4, L1, L4, R5, L3, R2, R3, L5, L3, R5, L1, R5,...
{ "repo_name": "tehasdf/AdventOfCode2016", "path": "p1.py", "copies": "1", "size": "1913", "license": "mit", "hash": -862583638469329700, "line_mean": 31.9827586207, "line_max": 670, "alpha_frac": 0.4605331939, "autogenerated": false, "ratio": 2.1446188340807173, "config_test": false, "has_no_...
"""A L1 loss on BatchNorm gamma that targets the number of activations.""" from __future__ import absolute_import from __future__ import division # [internal] enable type annotations from __future__ import print_function from typing import Optional from morph_net.framework import batch_norm_source_op_handler from mo...
{ "repo_name": "google-research/morph-net", "path": "morph_net/network_regularizers/activation_regularizer.py", "copies": "1", "size": "7520", "license": "apache-2.0", "hash": -6452031395115190000, "line_mean": 41.0111731844, "line_max": 80, "alpha_frac": 0.7090425532, "autogenerated": false, "rat...
# ALAINA KAFKES IMPLEMENTATION - alainakafkes ## Mergesort implementation in Python ## Runtime: O(n log(n)) ## Space: O(n) ## Advantages: guaranteed good complexity (no need to worry about choice of pivot as in quicksort) ## Disadvantages: more temporary data storage needed than quicksort #def mergesort(arr): # if...
{ "repo_name": "saru95/DSA", "path": "Python/mergesort.py", "copies": "1", "size": "1356", "license": "mit", "hash": 6069667117075721000, "line_mean": 20.1875, "line_max": 109, "alpha_frac": 0.6342182891, "autogenerated": false, "ratio": 2.3915343915343916, "config_test": false, "has_no_keywor...
AL = 'AL' NL = 'NL' MLB = 'MLB' LEAGUES = [AL, NL, MLB] def mlb_teams(year): """ For given year return teams active in the majors. Caveat, list is not complete; those included are only those with a current team still active. """ year = int(year) return sorted(al_teams(year) + nl_teams(y...
{ "repo_name": "barajasr/Baseball-Reference-Plotting", "path": "Teams.py", "copies": "1", "size": "5487", "license": "bsd-2-clause", "hash": -2996144160093778400, "line_mean": 24.8820754717, "line_max": 73, "alpha_frac": 0.5806451613, "autogenerated": false, "ratio": 3.515054452274183, "config_t...
# Alamo Alerts Module import shutil import requests import json import os import arrow import tweepy # define global vars (local time object) utcTime = arrow.utcnow() localTime = utcTime.to('US/Central') # define twitterbot with auth keys twitterAuth = tweepy.OAuthHandler("MzMGLR7WDxAVnFm1mfCwqqZ5c", "L7zzwuL7RWXL7F...
{ "repo_name": "altonchaney/alamoAlerts", "path": "backend/alamoAlerts.py", "copies": "1", "size": "11377", "license": "mit", "hash": 8658678046511747000, "line_mean": 60.5027027027, "line_max": 243, "alpha_frac": 0.4745539246, "autogenerated": false, "ratio": 4.95945945945946, "config_test": fa...
""" A lan connect class using udp """ __author__ = "Oliver Lindemann <oliver@expyriment.org>" __version__ = "0.5" import atexit import os import socket from multiprocessing import Process, Event, Queue import logging from .types import UDPData from .polling_time_profile import PollingTimeProfile from .process_priori...
{ "repo_name": "lindemann09/pyForceDAQ", "path": "forceDAQ/_lib/udp_connection.py", "copies": "1", "size": "9900", "license": "mit", "hash": 927618546579611000, "line_mean": 30.1320754717, "line_max": 89, "alpha_frac": 0.5522222222, "autogenerated": false, "ratio": 4.2002545608824775, "config_te...
"""A land-ocean setup from `bib.anderson2009spatially`.""" import numpy as np import dapper.mods as modelling from dapper.mods.Lorenz96.sakov2008 import X0, Dyn, LPs, Nx, Tplot from dapper.tools.localization import localization_setup, pairwise_distances from dapper.tools.viz import xtrema t = modelling.Chronology(0....
{ "repo_name": "nansencenter/DAPPER", "path": "dapper/mods/Lorenz96/anderson2009.py", "copies": "1", "size": "1831", "license": "mit", "hash": 1263194428738432500, "line_mean": 32.9074074074, "line_max": 88, "alpha_frac": 0.6340797378, "autogenerated": false, "ratio": 2.816923076923077, "config_...
# Alan Gustavo Valdez Cascajares A01336955 # Rafael Manriquez Valdez A01196010 import ply.yacc as yacc import sys sys.path.append("../../Lancer") # Clases definidas por nosotros from LancerLex import tokens from Directories.FunctionDirectory import FunctionDirectory from Directories.Stack import Stack from Semantic_...
{ "repo_name": "agvaldezc/Lancer", "path": "Parser_Lexer/LancerYaccV2.py", "copies": "1", "size": "30379", "license": "mit", "hash": 5080227925333343000, "line_mean": 26.4426377597, "line_max": 328, "alpha_frac": 0.6635833964, "autogenerated": false, "ratio": 3.671178247734139, "config_test": fa...
# Alan Richardson (Ausar Geophysical) # 2017/01/09 # Simple first attempt using Ridge regression to predict missing PE values, and SVC for the facies import numpy as np import pandas as pd from sklearn import preprocessing, cross_validation, grid_search, linear_model, svm, metrics # Load + preprocessing train_data =...
{ "repo_name": "seg/2016-ml-contest", "path": "ar4/ar4_submission001.py", "copies": "2", "size": "2318", "license": "apache-2.0", "hash": 3563587541606404600, "line_mean": 45.36, "line_max": 142, "alpha_frac": 0.7243313201, "autogenerated": false, "ratio": 2.7464454976303316, "config_test": true...
# Alan Richardson (Ausar Geophysical) # 2017/01/31 import numpy as np import scipy.signal import pandas as pd from sklearn import preprocessing, metrics from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor from sklearn.base import clone from matplotlib import pyplot as plt import scipy.optimize from...
{ "repo_name": "seg/2016-ml-contest", "path": "ar4/ar4_submission3.py", "copies": "1", "size": "27730", "license": "apache-2.0", "hash": -5907807276246357000, "line_mean": 43.2971246006, "line_max": 329, "alpha_frac": 0.6047601875, "autogenerated": false, "ratio": 3.136168287717711, "config_test...
""" A large portion of this sub-package is taken from Pyramid """ import inspect import logging import pkgutil from typing import Optional, Tuple from types import ModuleType import ramlfications as raml import venusian from pyrsistent import pmap, pvector from solo.server.app import App from solo.server.csrf import...
{ "repo_name": "avanov/solo", "path": "solo/configurator/__init__.py", "copies": "1", "size": "7360", "license": "mit", "hash": -7778135602919673000, "line_mean": 36.7435897436, "line_max": 128, "alpha_frac": 0.6213315217, "autogenerated": false, "ratio": 4.184195565662308, "config_test": true, ...
# a larger script for InMoov inMoov = Runtime.createAndStart("inMoov", "InMoov") # attach an arduino to InMoov # possible board types include uno atmega168 atmega328p atmega2560 atmega1280 atmega32u4 # the MRLComm.ino sketch must be loaded into the Arduino for MyRobotLab control ! # set COM number according to t...
{ "repo_name": "DarkRebel/myrobotlab", "path": "src/resource/Python/examples/InMoov.py", "copies": "2", "size": "9184", "license": "apache-2.0", "hash": 8766592775884759000, "line_mean": 29.675862069, "line_max": 257, "alpha_frac": 0.6344729965, "autogenerated": false, "ratio": 2.178884934756821, ...
# a larger script for InMoov inMoov = Runtime.createAndStart("inMoov", "InMoov") # attach an arduino to InMoov # possible board types include uno atmega168 atmega328p atmega2560 atmega1280 atmega32u4 # the MRLComm.ino sketch must be loaded into the Arduino for MyRobotLab control ! # set COM number accordin...
{ "repo_name": "mecax/pyrobotlab", "path": "toSort/InMoov.py", "copies": "1", "size": "9473", "license": "apache-2.0", "hash": -2442934497061536300, "line_mean": 14.8635578584, "line_max": 257, "alpha_frac": 0.6151166473, "autogenerated": false, "ratio": 2.1041759218125278, "config_test": false,...
"""A Lark Transformer for transforming a Lark parse tree into a Python dict""" import re import sys from typing import List, Dict, Any from lark import Transformer, Discard HEREDOC_PATTERN = re.compile(r'<<([a-zA-Z][a-zA-Z0-9._-]+)\n((.|\n)*?)\n\s*\1', re.S) HEREDOC_TRIM_PATTERN = re.compile(r'<<-([a-zA-Z][a-zA-Z0-9....
{ "repo_name": "amplify-education/python-hcl2", "path": "hcl2/transformer.py", "copies": "1", "size": "8543", "license": "mit", "hash": -3373394633407241000, "line_mean": 35.0464135021, "line_max": 102, "alpha_frac": 0.5644387218, "autogenerated": false, "ratio": 3.6384156729131174, "config_test...
# alarm_clock.py # Description: A simple Python program to make the computer act # like an alarm clock. Start it running from the command line # with a command line argument specifying the duration in minutes # after which to sound the alarm. It will sleep for that long, # and then beep a few times. Use a duration...
{ "repo_name": "ActiveState/code", "path": "recipes/Python/579117_Simple_commandline_alarm_clock/recipe-579117.py", "copies": "1", "size": "1496", "license": "mit", "hash": -486850354214936200, "line_mean": 25.7142857143, "line_max": 71, "alpha_frac": 0.6691176471, "autogenerated": false, "ratio":...
# Copyright Peter Hinch # V0.4 10th October 2016 Now uses machine.reset_cause() # Flashes leds at 30 second intervals courtesy of two concurrent timers # (each times out at one minute intervals). # Note that the Pyboard flashes the green LED briefly on waking from standby. import stm, pyb, upower, machine red, green,...
{ "repo_name": "peterhinch/micropython-micropower", "path": "alarm.py", "copies": "1", "size": "1171", "license": "mit", "hash": -5261503305971661000, "line_mean": 39.3793103448, "line_max": 103, "alpha_frac": 0.6643894108, "autogenerated": false, "ratio": 3.1061007957559683, "config_test": fals...
"""Alarm Script.""" import sys import time from . import config as cg from . import all_off, fade, lcd from .context import IO # FIXME: Re-implement as a thread with an interrupt Exception ########################### # Configuration: ########################### # Electronic Pin Numbering Globals: off_button = cg.g...
{ "repo_name": "KyleKing/PiAlarm", "path": ".archive-python/modules/alarm.py", "copies": "1", "size": "6336", "license": "mit", "hash": 722681017223502800, "line_mean": 28.4697674419, "line_max": 89, "alpha_frac": 0.5678661616, "autogenerated": false, "ratio": 3.1459781529294935, "config_test": ...
## Alarm Server ## Supporting Envisalink 2DS/3 ## ## This code is under the terms of the GPL v3 license. import ctypes c_uint16 = ctypes.c_uint16 class IconLED_Bitfield( ctypes.LittleEndianStructure ): _fields_ = [ ("alarm", c_uint16, 1 ), ("alarm_in_memory", c_uint16, 1 ), ...
{ "repo_name": "jnimmo/pyenvisalink", "path": "pyenvisalink/honeywell_envisalinkdefs.py", "copies": "1", "size": "15602", "license": "mit", "hash": -1215106233768105200, "line_mean": 26.1339130435, "line_max": 584, "alpha_frac": 0.4976926035, "autogenerated": false, "ratio": 3.0207163601161664, ...
## Alarm Server ## Supporting Envisalink 2DS/3 ## ## This code is under the terms of the GPL v3 license. evl_Commands = { 'KeepAlive' : '000', 'StatusReport' : '001', 'DumpZoneTimers' : '008', 'PartitionKeypress' : '071', 'Disarm' : '040', 'ArmStay' : '031', 'ArmAway' : '030', 'ArmMax' ...
{ "repo_name": "Cinntax/pyenvisalink", "path": "pyenvisalink/dsc_envisalinkdefs.py", "copies": "1", "size": "6748", "license": "mit", "hash": 3367477178545005000, "line_mean": 67.1616161616, "line_max": 250, "alpha_frac": 0.5997332543, "autogenerated": false, "ratio": 3.0192393736017897, "config...
a = [{"latitudes": ["29.77119", "29.77879", "29.78162", "29.78177", "29.77881"], "longitudes": ["-96.03579", "-96.0045", "-95.9906", "-95.98236", "-95.96749"], "latitudeOffsets": ["0.00400", "0.00400", "0.00400", "0.00400", "0.00400"], "longitudeOffsets": ["0.00100", "0.00100", "0.00100", "0.00100", "...
{ "repo_name": "anivk/riceai-traffic", "path": "speeds/segment_info.py", "copies": "1", "size": "316844", "license": "mit", "hash": 3280300544466884600, "line_mean": 90.4148874784, "line_max": 120, "alpha_frac": 0.5903599248, "autogenerated": false, "ratio": 2.719667642337834, "config_test": fal...
"""A layered graph, backed by redis. Licensed under the 3-clause BSD License: Copyright (c) 2013, Neeraj Kumar (neerajkumar.org) 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...
{ "repo_name": "neeraj-kumar/nkpylib", "path": "nkredisgraph.py", "copies": "1", "size": "40830", "license": "bsd-3-clause", "hash": 2145750332079443000, "line_mean": 42.8560687433, "line_max": 186, "alpha_frac": 0.5611070291, "autogenerated": false, "ratio": 3.8544321721891817, "config_test": f...
""" A layer on top of GitPython, handles pulling and scheduling. """ import os.path import platform import random import git from Anemone import app, schedule from Anemone.models import Job, Project from Anemone.abcfile import parse as abcparse from Anemone.buildslave import build def setup_schedule(): """ Setups...
{ "repo_name": "Winnak/Anemone", "path": "Anemone/githandling.py", "copies": "1", "size": "3147", "license": "mit", "hash": -1394937412854038800, "line_mean": 39.8701298701, "line_max": 100, "alpha_frac": 0.6313949793, "autogenerated": false, "ratio": 3.7508939213349226, "config_test": false, ...
"""A layout for a XLS report. Each sheet in a report contains a single layout. The layout describes how the different elements are organized and can contain child layouts inside. """ __author__ = 'jt@javiertordable.com' __copyright__ = "Copyright (C) 2014 Javier Tordable" from style import TableStyle MAX_EXCEL_CO...
{ "repo_name": "tordable/XlsxReports", "path": "layout.py", "copies": "1", "size": "8369", "license": "apache-2.0", "hash": -1394631079583768600, "line_mean": 33.4403292181, "line_max": 80, "alpha_frac": 0.6661488828, "autogenerated": false, "ratio": 3.7613483146067415, "config_test": false, "...
"""Album and Photo models.""" from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible from django.db import models from django.contrib.auth.models import User from taggit.managers import TaggableManager PUBLISHED_OPTIONS = ( ("private", "private"), ("shared", "shar...
{ "repo_name": "pasaunders/django-imager", "path": "imagersite/imager_images/models.py", "copies": "1", "size": "2304", "license": "mit", "hash": 9023013273337566000, "line_mean": 31.4507042254, "line_max": 92, "alpha_frac": 0.6692708333, "autogenerated": false, "ratio": 3.8336106489184694, "con...
"""Album views.""" from pyramid.httpexceptions import HTTPForbidden from pyramid.httpexceptions import HTTPNotFound from sqlalchemy.orm.exc import NoResultFound from lasco.auth import get_user_role from lasco.batch import Batch from lasco.models import Album from lasco.models import DBSession from lasco.models impor...
{ "repo_name": "dbaty/Lasco", "path": "lasco/views/album.py", "copies": "1", "size": "1772", "license": "bsd-3-clause", "hash": 5184988334340639000, "line_mean": 35.9166666667, "line_max": 75, "alpha_frac": 0.6371331828, "autogenerated": false, "ratio": 3.683991683991684, "config_test": false, ...
# Alden Golab # 7/27/2016 # This file is an encapsulation in Python for ebLink, which runs in R. # This program requires R to run. # ebLink is drawn from Steorts, et. al. 2015 can can be found here: # https://github.com/resteorts/ebLink ## NOTES ## # Current build only takes csvs. To add additional file types or c...
{ "repo_name": "aldengolab/graphical-record-linkage", "path": "python-encapsulation/eblink.py", "copies": "1", "size": "21295", "license": "cc0-1.0", "hash": 6204278033126673000, "line_mean": 37.4386281588, "line_max": 146, "alpha_frac": 0.5170697347, "autogenerated": false, "ratio": 4.36910135412...
"""A legacy test for a particular somewhat complicated mapping.""" from sqlalchemy import CHAR from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import String from sqlalchemy import testing from sqlalchemy import Text from sqlalchemy.orm import backref from sqlalchemy.orm import mapper f...
{ "repo_name": "monetate/sqlalchemy", "path": "test/orm/inheritance/test_magazine.py", "copies": "3", "size": "11321", "license": "mit", "hash": 8804364880007253000, "line_mean": 29.0291777188, "line_max": 79, "alpha_frac": 0.4673615405, "autogenerated": false, "ratio": 4.685844370860927, "confi...
"""Alembic migrations handler """ import os from sqlalchemy import MetaData from alembic.config import Config from alembic import command as alembic_cmd from lux.utils.context import app_attribute TEMPLATE_PATH = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'commands', 'template' ) def lux_templ...
{ "repo_name": "quantmind/lux", "path": "lux/ext/odm/migrations.py", "copies": "1", "size": "4156", "license": "bsd-3-clause", "hash": -8978608378144670000, "line_mean": 31.7244094488, "line_max": 77, "alpha_frac": 0.5635226179, "autogenerated": false, "ratio": 4.168505516549649, "config_test": ...
"""Alerter module""" import smtplib from email.mime.text import MIMEText import click from slacker import Slacker from config import CONFIG class SlackAlerter(object): """SlackAlerter class""" def __init__(self): token = CONFIG.get('slack', 'API_TOKEN') self.slack = Slacker(token) ...
{ "repo_name": "abulte/python-influxdb-alerts", "path": "alerters.py", "copies": "1", "size": "2324", "license": "mit", "hash": -8615540629591645000, "line_mean": 30.8356164384, "line_max": 108, "alpha_frac": 0.5404475043, "autogenerated": false, "ratio": 3.778861788617886, "config_test": true, ...
""" Alert Logic Event API """ # Author: Justin Ibarra (justin.s.ibarra@gmail.com) # License: MIT - A full copy of the license is provided with this source code from incidents import Incident, Event, threading from errors import IncidentNotRetrievedError, EventNotRetrievedError def get_event(event_id, customer_id, u...
{ "repo_name": "brokensound77/AlertLogic-event-api", "path": "alapi/alapi.py", "copies": "1", "size": "2795", "license": "mit", "hash": 7370795453971111000, "line_mean": 34.8333333333, "line_max": 115, "alpha_frac": 0.6350626118, "autogenerated": false, "ratio": 3.6583769633507854, "config_test"...
"""Alert on AWS Security Groups that allow ingress from anywhere.""" from rules.helpers.base import get_keys from streamalert.shared.rule import rule @rule( logs=['cloudwatch:events'], req_subkeys={ 'detail': ['eventName', 'requestParameters'] }) def cloudtrail_security_group_ingress_anywhere(rec)...
{ "repo_name": "airbnb/streamalert", "path": "rules/community/cloudwatch_events/cloudtrail_security_group_ingress_anywhere.py", "copies": "1", "size": "1034", "license": "apache-2.0", "hash": 6380590633888725000, "line_mean": 32.3548387097, "line_max": 82, "alpha_frac": 0.6470019342, "autogenerated"...
"""Alert on calls made without MFA that may be attempting to abuse a flawed enforcement policy""" from streamalert.shared.rule import rule _IAM_ACTIONS = { 'CreateUser', 'CreateAccessKey', 'DetachUserPolicy', 'DetachGroupPolicy', 'RemoveUserFromGroup', 'DeleteUserPolicy', 'PutGroupPolicy',...
{ "repo_name": "airbnb/streamalert", "path": "rules/community/cloudwatch_events/cloudtrail_mfa_policy_abuse_attempt.py", "copies": "1", "size": "3151", "license": "apache-2.0", "hash": -6808185094441624000, "line_mean": 42.7638888889, "line_max": 99, "alpha_frac": 0.6835925103, "autogenerated": fals...
"""Alert on dangerous S3 bucket ACLs.""" from streamalert.shared.rule import rule _DENIED_ACLS = { 'http://acs.amazonaws.com/groups/global/AuthenticatedUsers', 'http://acs.amazonaws.com/groups/global/AllUsers' } @rule( logs=['cloudwatch:events'], req_subkeys={ 'detail': ['requestParameters', ...
{ "repo_name": "airbnb/streamalert", "path": "rules/community/cloudwatch_events/cloudtrail_put_bucket_acl.py", "copies": "1", "size": "1761", "license": "apache-2.0", "hash": -4691504852176326000, "line_mean": 37.2826086957, "line_max": 97, "alpha_frac": 0.6553094832, "autogenerated": false, "rati...
"""Alert on insecure Amazon Machine Images (AMIs).""" from streamalert.shared.rule import rule @rule( logs=['cloudwatch:events'], req_subkeys={'detail': ['requestParameters', 'eventName']}) def unencrypted_ami_volume(rec): """ author: airbnb_csirt description: Identifies creation of an AMI ...
{ "repo_name": "airbnb/streamalert", "path": "rules/community/cloudwatch_events/cloudtrail_ec2_image_creation.py", "copies": "1", "size": "2216", "license": "apache-2.0", "hash": 6920055813780598000, "line_mean": 34.7419354839, "line_max": 93, "alpha_frac": 0.6407942238, "autogenerated": false, "r...
"""Alert on resources made public""" from streamalert.shared.rule import rule @rule(logs=['cloudtrail:events']) def cloudtrail_snapshot_or_ami_made_public(rec): """ author: spiper description: Alert on AWS API calls that make EBS snapshots, RDS snapshots, or AMIs pub...
{ "repo_name": "airbnb/streamalert", "path": "rules/community/cloudwatch_events/cloudtrail_snapshot_or_ami_made_public.py", "copies": "1", "size": "1859", "license": "apache-2.0", "hash": -4538519538758568400, "line_mean": 39.4130434783, "line_max": 83, "alpha_frac": 0.5664335664, "autogenerated": f...
"""AlertProfile class""" from .halo_endpoint import HaloEndpoint from .http_helper import HttpHelper from .utility import Utility as utility class AlertProfile(HaloEndpoint): """Initializing the AlertProfile class: Filtering options for :func:`AlertProfile.list_all()` can be passed in as keyword argument...
{ "repo_name": "cloudpassage/cloudpassage-halo-python-sdk", "path": "cloudpassage/alert_profile.py", "copies": "1", "size": "1603", "license": "bsd-3-clause", "hash": -416531011816418500, "line_mean": 32.3958333333, "line_max": 77, "alpha_frac": 0.6606363069, "autogenerated": false, "ratio": 4.415...
"""Alert related models.""" from django.db import models from django.utils import timezone from reversion import revisions as reversion from .. import constants class AlarmQuerySet(models.QuerySet): """Custom queryset for Alarm.""" def opened(self): """Return opened alarms.""" return self....
{ "repo_name": "modoboa/modoboa", "path": "modoboa/admin/models/alarm.py", "copies": "1", "size": "1465", "license": "isc", "hash": 4179619620076557000, "line_mean": 25.6363636364, "line_max": 73, "alpha_frac": 0.6511945392, "autogenerated": false, "ratio": 3.9594594594594597, "config_test": fal...