commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
cb1997cccff92a700a8886235619d8332c3f089d
Add test_message.py
famz/patchew,famz/patchew,patchew-project/patchew,patchew-project/patchew,patchew-project/patchew,famz/patchew,patchew-project/patchew,famz/patchew
tests/test_message.py
tests/test_message.py
#!/usr/bin/env python3 # # Copyright 2016 Red Hat, Inc. # # Authors: # Fam Zheng <famz@redhat.com> # # This work is licensed under the MIT License. Please see the LICENSE file or # http://opensource.org/licenses/MIT. import sys import os import time import datetime from patchewtest import PatchewTestCase, main c...
mit
Python
a26ed408704225009e6ba1c9d2373e6e39700dbc
Create netowrkCatom.py
hua372494277/protein-contact-maps
netowrkCatom.py
netowrkCatom.py
# calculate the clustering coefficient, characteristic path length, entropy, assortativity coefficient, Diameter # and Radius of the network based on the coordinate of C atoms import math import networkx as nx fromP = r'E:\NextIdea\pdbChain' fr = open(r'E:\NextIdea\Dataset\scopClassHelixSheetpercentageNew.csv') fw =...
bsd-3-clause
Python
03c4cd54b76413da3d803c14d6e459e36f7f5a84
Create Test.py
nightcustard/Robosap
Test.py
Test.py
# by Augustus Nightcustard # heavily based on # command codes from http://www.aibohack.com/robosap/ir_codes.htm import robo rs=robo.Robo(21) #create Robo object for GPIO 21 rs.send_code(0xB1) #Issue reset command raw_input('Enter') rs.send_code(0x81) #Right arm up rs.send_code(0x81) rs.send_code(0x82) #Right wrist o...
mit
Python
60b8c0bd0dc75c1c39de135f7684ec0cf7d2c3c4
Create Zona.py
mdmirabal/Parcial2-Prog3
Zona.py
Zona.py
#!/usr/bin/python # -*- coding: utf-8 -*- Zona = { "Zona_1":["La Boca","Calzada de Amador"], "Zona_2":["San Felipe","Chorrillo","Santa Ana","Ancón"], "Zona_3":["Calidonia","San Miguel","Albrook","Altos de Diablo"], "Zona_4":["Punta Paitilla","Bella Vista","Universidad"] , "Zona_5":["Punta Pacífica","El Dorado","La...
mit
Python
85b553724cb56821cf9cea80983c21c238f1469f
add tnetstring inspection tool
gzzhanghao/mitmproxy,jvillacorta/mitmproxy,dweinstein/mitmproxy,xaxa89/mitmproxy,gzzhanghao/mitmproxy,fimad/mitmproxy,tdickers/mitmproxy,Kriechi/mitmproxy,dweinstein/mitmproxy,fimad/mitmproxy,mhils/mitmproxy,mosajjal/mitmproxy,dweinstein/mitmproxy,Kriechi/mitmproxy,ikoz/mitmproxy,dwfreed/mitmproxy,Endika/mitmproxy,mhil...
test/tools/inspect_dumpfile.py
test/tools/inspect_dumpfile.py
from pprint import pprint import click from libmproxy import tnetstring def read_tnetstring(input): # tnetstring throw a ValueError on EOF, which is hard to catch # because they raise ValueErrors for a couple of other reasons. # Check for EOF to avoid this. if not input.read(1): return None ...
mit
Python
69d472c3a1a6dc60d852f136ec572ec56b71523d
Create tetris.py
swatisbhat/Tetris
tetris.py
tetris.py
import pygame,sys import random #constants cols=15 rows=30 cell=22 #define colours colors = [ (189, 183, 107 ), (255, 85, 85), (100, 200, 115), (120, 108, 245), (255, 140, 50 ), (50, 120, 52 ), (146, 202, 73 ), (150, 161, 218 ), (240, 230, 140 ) ] #define the tetromino shapes shapes=[ [ [1,1], ...
mit
Python
f1a83921f6528df6514d37cf1ccd2c8b35cf49e5
Solve Knowit2019/05
matslindh/codingchallenges,matslindh/codingchallenges
knowit2019/05.py
knowit2019/05.py
def unfscker(s): return unfscker_halfsies( unfscker_pairsies( unfscker_long_trios(s) ) ) def unfscker_halfsies(s): return s[len(s)//2:] + s[:len(s)//2] def unfscker_pairsies(s): r = '' for i in range(0, len(s), 2): r += s[i+1] r += s[i] return r ...
mit
Python
b94e0712de8442dcecea17aa9fb617c2ec34544d
Add package app models
opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind
src/packages/models.py
src/packages/models.py
from __future__ import unicode_literals from decimal import Decimal from django.core.validators import MinValueValidator from django.db import models from django.utils.encoding import python_2_unicode_compatible from nodeconductor.core import models as core_models @python_2_unicode_compatible class PackageTemplate...
mit
Python
8f82ec26e5c81ec22959d8b89912d0b16223018a
remove unused import
zaro0508/jenkinsapi,jduan/jenkinsapi,zaro0508/jenkinsapi,imsardine/jenkinsapi,mistermocha/jenkinsapi,JohnLZeller/jenkinsapi,jduan/jenkinsapi,mistermocha/jenkinsapi,JohnLZeller/jenkinsapi,salimfadhley/jenkinsapi,salimfadhley/jenkinsapi,mistermocha/jenkinsapi,zaro0508/jenkinsapi,imsardine/jenkinsapi,domenkozar/jenkinsapi...
jenkinsapi_tests/unittests/test_views.py
jenkinsapi_tests/unittests/test_views.py
import mock import unittest from jenkinsapi.view import View from jenkinsapi.jenkins import Jenkins from jenkinsapi.jenkinsbase import JenkinsBase from jenkinsapi.utils.requester import Requester class TestDataMissing(Exception): pass class TestViews(unittest.TestCase): @mock.patch.object(Jenkins, '_poll') @m...
mit
Python
eb764d1aa926c690aeb148e0840703777547d693
Create regsvr32.py
api0cradle/Empire,PowerShellEmpire/Empire,frohoff/Empire,drshellface/Empire,byt3bl33d3r/Empire,ThePirateWhoSmellsOfSunflowers/Empire,byt3bl33d3r/Empire,ThePirateWhoSmellsOfSunflowers/Empire,wisdark/Empire,byt3bl33d3r/Empire,EmpireProject/Empire,wisdark/Empire,PowerShellEmpire/Empire,drshellface/Empire,EmpireProject/Emp...
lib/stagers/regsvr32.py
lib/stagers/regsvr32.py
from lib.common import helpers class Stager: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'regsvr32', 'Author': ['@subTee', '@enigma0x3'], 'Description': ('Generates an sct file (COM Scriptlet) Host this anywhere'), 'Comments': [ ...
bsd-3-clause
Python
777360d1593f243a1d5fc07c8c0cf1fa8fa66ee5
Add default `exports` setting
vladan-m/ggrc-core,josthkko/ggrc-core,hasanalom/ggrc-core,hyperNURb/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,hyperNURb/ggrc-core,selahssea/ggrc-core,vladan-m/ggrc-core,hasanalom/ggrc-core,NejcZupec/ggrc-core,hasanalom/ggrc-core,uskudnik/ggrc-core,josthkko/ggrc-core,uskudnik/ggrc-core,NejcZupec/ggrc-core,andrei-karalio...
src/ggrc/settings/default.py
src/ggrc/settings/default.py
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: dan@reciprocitylabs.com DEBUG = False TESTING = False # Flask-SQLAlchemy fix to be less than `wait_time` ...
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: dan@reciprocitylabs.com DEBUG = False TESTING = False # Flask-SQLAlchemy fix to be less than `wait_time` ...
apache-2.0
Python
799675f18d2771053afb9ee444c05d981d701ca3
Add empty driver program
yesudeep/puppy,yesudeep/puppy,yesudeep/puppy
src/puppy.py
src/puppy.py
#!/usr/bin/env python # -*- coding: utf-8 -*-
mit
Python
4e700f073dd604fcb9519c58f4807ddd1f828623
Create utils
simonbreiter/universal-turing-machine,simonbreiter/universal-turing-machine
src/utils.py
src/utils.py
from config import Config def list_to_string(to_stringify): return str.join('', to_stringify) def insert_pipes_between_characters(string): return '|'.join(string[i:i + 1] for i in range(0, len(string))) def get_next_index(index, direction): return index + Config.tape_movement_for(direction) if directi...
mit
Python
cf7763bd5d1467bf71786961709437080190e40e
Create jira_add_label_tag.py (#683)
AstroTech/atlassian-python-api,AstroTech/atlassian-python-api,MattAgile/atlassian-python-api
examples/jira/jira_add_label_tag.py
examples/jira/jira_add_label_tag.py
# coding=utf-8 from atlassian import Jira # This example shoes how to add an additional value to the Labels field # without loosing the previously defined ones already defined issue_key = "TST-1" new_tag = "label_to_add_for_test" jira = Jira(url="http://localhost:8080", username="admin", password="admin") def jira_...
apache-2.0
Python
c51fab1397a716df57edd6ff7bfde2edd1ab1099
add python implementation for promote
sassoftware/mirrorball,sassoftware/mirrorball
scripts/promote.py
scripts/promote.py
#!/usr/bin/python # # Copyright (c) 2008 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.rp...
apache-2.0
Python
f42f1d133e64d95db1b92d07a3593b2dc41df1c4
Reconfigure mode: WIP
CanonicalLtd/subiquity,CanonicalLtd/subiquity
system_setup/ui/views/reconfigure.py
system_setup/ui/views/reconfigure.py
""" Integration Integration provides user with options to set up integration configurations. """ import re from urwid import ( connect_signal, ) from subiquitycore.ui.form import ( Form, BooleanField, simple_field, WantsToKnowFormField ) from subiquitycore.ui.interactive import StringEditor from...
agpl-3.0
Python
5c56f73e3390a276e8d7a331815a41e1a68a64a0
Implement the chghost extension
Heufneutje/txircd,ElementalAlchemist/txircd
txircd/modules/ircv3/chghost.py
txircd/modules/ircv3/chghost.py
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class ChangeHost(ModuleData): implements(IPlugin, IModuleData) name = "ChangeHost" def action(self): return [ ("changehost", 1, self.updateHosts), ("changeident", 1, ...
bsd-3-clause
Python
9309cb7f0f9df6e78dec020f61fe24f16b674551
Create a quick way to search a huge JSON tree
Rosuav/shed,Rosuav/shed,Rosuav/shed,Rosuav/shed,Rosuav/shed
jsonsearch.py
jsonsearch.py
# TODO: Parameterize. Pass a JSON file name, a JSON blob, or no argument to read stdin. import json import sys with open("eu4_parse.json") as f: data = json.load(f) def search(node, term, path): if isinstance(node, dict): items = node.items() elif isinstance(node, list): items = enumerate(node) elif term in str(no...
mit
Python
bf129309453d8bea494647c32b31a0a46e8520bb
Add lebonscrap.py
wbwlkr/lebonscrap
lebonscrap.py
lebonscrap.py
import scrapy import json from urllib.parse import urlencode import requests # To call the script : # scrapy runspider lebonscrap.py -o data.json class LeboncoinSpider(scrapy.Spider): name = "leboncoin" start_urls = [ 'http://www.leboncoin.fr/li?ca=16_s&c=10&f=p&mre=800&sqs=6&ros=3&ret=1&re...
mit
Python
6b25614cbdec4595cedd772ca5d405cfafec741d
Add file for ipython notebook snippets
jhamrick/python-snippets
ipynb.py
ipynb.py
"""ipynb.py -- helper functions for working with the IPython Notebook This software is licensed under the terms of the MIT License as follows: Copyright (c) 2013 Jessica B. Hamrick Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "S...
mit
Python
f26573de49373f20c6312f72f2e42478f207fd15
add simple "handles url" unit tests
spaam/svtplay-dl,qnorsten/svtplay-dl,OakNinja/svtplay-dl,leakim/svtplay-dl,dalgr/svtplay-dl,olof/svtplay-dl,iwconfig/svtplay-dl,leakim/svtplay-dl,olof/svtplay-dl,selepo/svtplay-dl,iwconfig/svtplay-dl,OakNinja/svtplay-dl,OakNinja/svtplay-dl,selepo/svtplay-dl,leakim/svtplay-dl,spaam/svtplay-dl,qnorsten/svtplay-dl,dalgr/s...
lib/svtplay_dl/service/tests/picsearch.py
lib/svtplay_dl/service/tests/picsearch.py
#!/usr/bin/python # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # The unittest framwork doesn't play nice with pylint: # pylint: disable-msg=C0103 from __future__ import absolute_import import unittest from svtplay_dl.service.tests import HandlesURLsTestMixin from svtplay_...
mit
Python
840093754532e08541a5d2057798989aee95c45e
add ex44
AisakaTiger/Learn-Python-The-Hard-Way,AisakaTiger/Learn-Python-The-Hard-Way
ex44.py
ex44.py
class Parent(object): def implicit(self): print "PARENT implicit()" def override(self): print "PARENT override()" def altered(self): print "PARENT altered()" class Other(object): def override(self): print "OTHER override()" def implicit(self): print "OTHER...
mit
Python
a80eafd675f45d633fe7f6fe05a5d1593ffeb9d6
Create disco.py
umbresp/dream-cogs
disco/disco.py
disco/disco.py
import discord import time from discord.ext import commands from random import choice, randint import cogs.utils import asyncio from cogs.utils import checks class disco: """Changes a role's color every x seconds. Must be 60 or superior.""" def __init__(self, bot): self.bot = bot @checks.ad...
mit
Python
dd9e80cb13d41a6faf0fb1340ea7edc949f0fab7
Add missing migration for Invitation.email
rapidpro/dash,peterayeni/dash,rapidpro/dash,caktus/dash,caktus/dash,peterayeni/dash
dash/orgs/migrations/0012_auto_20150715_1816.py
dash/orgs/migrations/0012_auto_20150715_1816.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('orgs', '0011_auto_20150710_1612'), ] operations = [ migrations.AlterField( model_name='invitation', ...
bsd-3-clause
Python
4a67508786b9c28e930a4d6ce49001f6bb9be39d
Add constraints for unique together for org and slug in org backend, migrations
rapidpro/dash,rapidpro/dash
dash/orgs/migrations/0025_auto_20180321_1520.py
dash/orgs/migrations/0025_auto_20180321_1520.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-03-21 15:20 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('orgs', '0024_populate_org_backend'), ] operations = [ migrations.AlterUniqueTogeth...
bsd-3-clause
Python
8f6378b30225a59dd4eaa9ebb4bc51f83305e978
add kattis/catcoat
mjenrungrot/competitive_programming,mjenrungrot/competitive_programming,mjenrungrot/algorithm,mjenrungrot/competitive_programming,mjenrungrot/competitive_programming
Kattis/catcoat.py
Kattis/catcoat.py
""" Problem: catcoat Link: https://open.kattis.com/problems/catcoat Source: Kattis / Spotify Challenge 2011 """ possibilities = { 'Black': ['B-D-oo', 'B-D-o'], 'Blue': ['B-ddoo', 'B-ddo'], 'Chocolate': ['bbD-oo', 'bbD-o'], 'Lilac': ['bbddoo', 'bbddo'], 'Red': ['--D-OO', '--D-O'], 'Cream': ['--d...
mit
Python
345bd41290c299a3d57fd1e897d521950773d006
Create FilterMAFfile.py
CuppenResearch/Genetics,jdeligt/Genetics,CuppenResearch/Genetics,jdeligt/Genetics,jdeligt/Genetics,CuppenResearch/Genetics
FilterMAFfile.py
FilterMAFfile.py
#!/opt/local/bin/python2.7 # GENERAL import os from itertools import dropwhile, islice from math import log # MAF handling from pysam import AlignmentFile, AlignedSegment from optparse import OptionParser # ------------------------------------------------------------------------------------------------------------...
mit
Python
09b06509a878c797a2b9c83702c05f07d42e7b75
Create test_switchdpidassignment.py
mininet/mininet,mininet/mininet,mininet/mininet
mininet/test/test_switchdpidassignment.py
mininet/test/test_switchdpidassignment.py
#!/usr/bin/env python """Package: mininet Regression tests for switch dpid assignment.""" import unittest import re from mininet.net import Mininet from mininet.node import Switch from mininet.topo import Topo from mininet.log import setLogLevel class testSwitchDpidAssignment ( unittest.TestCase ): """Verify...
bsd-3-clause
Python
0ac6f33c0b7990ede9cb57e766036db45b781dd4
Add `symoroutils/dyninit.py`
symoro/symoro,galou/symoro,galou/symoro,symoro/symoro,ELZo3/symoro,ELZo3/symoro
symoroutils/dyninit.py
symoroutils/dyninit.py
# -*- coding: utf-8 -*- """ This module contains the parameters used to initialise the dynamic model of a robot. """ class Init: @classmethod def init_Jplus(cls, robo): """Copies the inertia parameters. Used for composed link inertia computation Returns ======= Jplus...
mit
Python
38c2e77613024c23c239a215e9dea1bbedc4f29a
Add missing smugcli/version.py file.
graveljp/smugcli
smugcli/version.py
smugcli/version.py
__version__ = '1.0.4'
mit
Python
8a39563fd9f1dc2fecfc4967160efe674b0cbb99
Add testing settings.py
qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,SEL-Columbia/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,SEL-Colu...
settings.py
settings.py
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 SECRET_KEY = 'this is not a secret key' INSTALLED_APPS = ( 'casexml', 'couchdbkit.ext.django', 'couchforms', 'coverage', ) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'casexml', } } ####### Couch Con...
bsd-3-clause
Python
c645d92fe9206c2d9bb6b1bdf5e8cfa9243e254a
Add logging subpackage
abn/python-cafe
cafe/logging/__init__.py
cafe/logging/__init__.py
# noinspection PyProtectedMember from logging import getLogger, basicConfig, debug, exception, INFO, _levelNames, root from logging.config import dictConfig from os import getenv from os.path import isfile from yaml import safe_load as load LOGGING_LEVELS = _levelNames BASE_CONFIGURATION = { 'format': '[%(asctim...
apache-2.0
Python
5885ba0cb14d52268238789e72197ddd57f75ada
implement SNMP.get()
trehn/hnmp
hnmp.py
hnmp.py
from datetime import timedelta from pysnmp.entity.rfc3413.oneliner import cmdgen from pysnmp.proto.rfc1902 import ( Gauge32, Integer, IpAddress, OctetString, TimeTicks, ) def _convert_value_to_native(value): if isinstance(value, Gauge32): return int(value.prettyPrint()) if isinsta...
isc
Python
ab49edac8156398571e8d04eba3212480db8c7c3
Add __init__.py so root folder is a package
Rostlab/nalaf
nala/__init__.py
nala/__init__.py
apache-2.0
Python
344b2a7b1429e2330ac7dea1104be60305e240b7
add leetcode Single Number II
Fity/2code,Fity/2code,Fity/2code,Fity/2code,Fity/2code,Fity/2code
leetcode/SingleNumberII/solution.py
leetcode/SingleNumberII/solution.py
#!/usr/bin/env python # -*- coding:utf-8 -*- class Solution: # @param A, a list of integer # @return an integer def singleNumber(self, A): one = 0 amu = 0 for x in A: amu |= x & one one ^= x t = amu & one one &= ~t amu &= ...
mit
Python
d9c57eb29990f4d201ae35414cc67609829b72a5
Add a simple test script.
ifduyue/exception-notifier,fossilet/exception-notifier,ifduyue/exception-notifier,fossilet/exception-notifier
test/test.py
test/test.py
"""Test script. """ import os import sys import traceback import exception_notifier log_name = os.getlogin() def exc_handler(): typ, value, tb = sys.exc_info() print '-----' print 'type:', typ print 'value:', value print 'stack traces:', traceback.extract_tb(tb) print '-----' @exception_n...
mit
Python
7e05e46bb5dd86d33faf36f34216c02c1f946346
Add createsu.py file as a custom command to create super user admin if it does not exist
bysreg/m_play,bysreg/m_play,bysreg/m_play,bysreg/m_play
src/m_play/gnovel/management/commands/createsu.py
src/m_play/gnovel/management/commands/createsu.py
from django.core.management.base import BaseCommand from django.contrib.auth.models import User class Command(BaseCommand): def handle(self, *args, **options): if not User.objects.filter(username="admin").exists(): User.objects.create_superuser("admin", "moralityplaycmu@gmail.com", "morallarom"...
mit
Python
3441c78359e39b072334c8ac6af8cbce570da61d
Create login.py
diamontip/pract,diamontip/pract
login.py
login.py
import getpass username = raw_input("enter username:") password = getpass.getpass("enter password:") print username print password
mit
Python
f5c610c34f681cbba08070bd1ed7608ba7580f0c
Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/dc6e1a149d0e26a44796dd4a5bc71a3b97bed9c8.
tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,karllessard/tensorflow,yongtang/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflo...
third_party/tf_runtime/workspace.bzl
third_party/tf_runtime/workspace.bzl
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "dc6e1a149d0e26a44796dd4a5bc71a3b97bed9c8" TFRT_SHA256 = "36344ca5373ce87431828edadd37...
"""Provides the repository macro to import TFRT.""" load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls") def repo(): """Imports TFRT.""" # Attention: tools parse and update these lines. TFRT_COMMIT = "8060ca28434cf69aeb3ba238a7b6a776c8939497" TFRT_SHA256 = "dcc987c2d9a0d84333903fd25d9c...
apache-2.0
Python
60fc47c8c9bb20a75ba1a25c75f1f5e5479ed58c
Add ARNES wsgi settings
matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo,matijapretnar/projekt-tomo,ul-fmf/projekt-tomo,ul-fmf/projekt-tomo,matijapretnar/projekt-tomo
web/web/wsgi/arnes.py
web/web/wsgi/arnes.py
""" WSGI config for web project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings.arnes") from django.core.wsg...
agpl-3.0
Python
d78972ea0597a32cdcacf962dbdf52a338f7cf13
Create vnc.py
ThePirateWhoSmellsOfSunflowers/Empire,EmpireProject/Empire,cobbr/ObfuscatedEmpire,api0cradle/Empire,wisdark/Empire,api0cradle/Empire,cobbr/ObfuscatedEmpire,byt3bl33d3r/Empire,wisdark/Empire,byt3bl33d3r/Empire,byt3bl33d3r/Empire,drshellface/Empire,ThePirateWhoSmellsOfSunflowers/Empire,EmpireProject/Empire,wisdark/Empire...
lib/modules/powershell/management/vnc.py
lib/modules/powershell/management/vnc.py
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-Vnc', 'Author': ['@n00py'], 'Description': ('Invoke-Vnc executes a VNC agent in-memory and initiates a reverse connection, or binds to a specified port...
bsd-3-clause
Python
59463c624a0ca206bbbc269f9cc3a14d67910948
introduce utils
maxpumperla/hyperas,pkainz/hyperas
hyperas/utils.py
hyperas/utils.py
import ast from operator import attrgetter import re import warnings class ImportParser(ast.NodeVisitor): def __init__(self): self.lines = [] self.line_numbers = [] def visit_Import(self, node): line = 'import {}'.format(self._import_names(node.names)) self.line_numbers.appen...
mit
Python
7ae80689588145e508d6a95b2dc1ffcb03478139
Create pf.py
vanzhiganov/pf
pf.py
pf.py
import socket import sys import os import thread import time import commands def main(setup, error): # open file for error messages sys.stderr = file(error, 'a') # read settings for port forwarding for forwards in parse(setup): print forwards # todo: write pid - <port>.pid pid...
apache-2.0
Python
2df309e9f0bee04f29fa943836cf440522fc51ca
Create what_is_your_name.py
JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking,JsWatt/Free-Parking
hacker_rank/python/strings/what_is_your_name.py
hacker_rank/python/strings/what_is_your_name.py
def print_full_name(a, b): print("Hello " + str(a) + " " + str(b) +"! You just delved into python." )
mit
Python
f3db3dbbdf2d40f9f0095cf03f09b13668d40665
Create testsuite.py
robert-mcdermott/citest,robert-mcdermott/citest
testsuite.py
testsuite.py
#!/usr/bin/python import sys def test(target): if target == 'pass': for x in range(1,10): print("Test \'%s\': PASS" % x) sys.exit(0) if target == 'fail': for x in range(1,10): print("Test \'%s\': FAIL" % x) sys.exit(99) if __name__ == "__main__": ta...
mit
Python
28841d9a7077293b0befab23fb3d1183006edc89
Add wye-delta and delta-wye transformations
mph-/lcapy
lcapy/nettransform.py
lcapy/nettransform.py
"""This module performs network transformations. Copyright 2020 Michael Hayes, UCECE """ def Z_wye_to_delta(Z1, Z2, Z3): """Perform wye to delta transformation of three impedances. This is equivalent to a tee-pi transform or a star-mesh transform.""" N = Z1 * Z2 + Z1 * Z3 + Z2 * Z3 Za = N / Z...
lgpl-2.1
Python
7ccdb9ac1a4fa99f168d3996c8e980ab42265265
Create ControleMotorTracao.py
MateusJFabricio/ProjVeiculoMapeamentoAutomatico,MateusJFabricio/ProjVeiculoMapeamentoAutomatico
Navegacao/ControleMotorTracao.py
Navegacao/ControleMotorTracao.py
#L293D #Controle motor Dc utilizando CI L293D import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) DIR_A = 5 DIR_B = 6 VEL = 13 #Inicializa a porta de direção como Output GPIO.setup(DIR_A, GPIO.OUT) GPIO.output(DIR_A, 0) GPIO.setup(DIR_B, GPIO.OUT) GPIO.output(DIR_B, 0) #Inicializa a porta de controle de ve...
unlicense
Python
0ef0f3528dfd21ff608ea5e59980856e7f673817
Add a country field for available shipping countries
JamesRamm/longclaw,JamesRamm/longclaw,JamesRamm/longclaw,JamesRamm/longclaw
longclaw/longclawshipping/fields.py
longclaw/longclawshipping/fields.py
from longclaw.longclawsettings.models import LongclawSettings from longclaw.longclawshipping.models import ShippingRate from django_countries import countries, fields class CountryChoices(object): ''' Helper class which returns a list of available countries based on the selected shipping options. If d...
mit
Python
9705aefa87abdcdd3580850ddbe7d77474c57c3e
Add ostf handler tests
nebril/fuel-web,SmartInfrastructures/fuel-main-dev,huntxu/fuel-main,teselkin/fuel-main,huntxu/fuel-web,koder-ua/nailgun-fcert,stackforge/fuel-main,AnselZhangGit/fuel-main,ddepaoli3/fuel-main-dev,zhaochao/fuel-web,Fiware/ops.Fuel-main-dev,zhaochao/fuel-main,zhaochao/fuel-web,eayunstack/fuel-web,stackforge/fuel-main,zhao...
nailgun/nailgun/test/test_ostf_handler.py
nailgun/nailgun/test/test_ostf_handler.py
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, Inc. # # 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 requi...
apache-2.0
Python
54776414c94c53e9db1a3b26ff468fa8179b89e1
Add ExponentialBackoff helper
Hornwitser/YetiBridge
yetibridge/backoff.py
yetibridge/backoff.py
from time import monotonic from random import Random class ExponentialBackoff: """An implementation of the exponential backoff algorithm Provides a convenient interface to implement an exponential backoff for reconnecting or retrying transmissions in a distributed network. Once instantiated, the del...
mit
Python
5443e0fd371253f0d8dc5c9a2a1f5a6dc55d259f
print all the files and directories inside a given directory
thunderoy/dgplug_training
assignments/assign2.py
assignments/assign2.py
#!/usr/bin/env python3 import os a = os.listdir(input("enter any directory you want to see the content of: ")) for x in a: print(x) print()
mit
Python
e859df662ea7bd923eb041331c9776dcb86483b2
Add color support.
Jarn/jarn.viewdoc
jarn/viewdoc/colors.py
jarn/viewdoc/colors.py
import blessed term = blessed.Terminal() bold = term.bold blue = term.bold_blue green = term.bold_green red = term.bold_red
bsd-2-clause
Python
9a9460e155f98fb389d9dc2b39b6fa6c403b3879
Create w4.py
s40523133/2016fallcp_hw,s40523133/2016fallcp_hw,s40523133/2016fallcp_hw
w4.py
w4.py
print("s40523133")
agpl-3.0
Python
3c71ea117afc0751b2dc82b544b7fbfb9f6a70b8
add options.py file with first implementation
aurzenligl/prophy,cislaa/prophy,cislaa/prophy,aurzenligl/prophy,cislaa/prophy
jinja/options.py
jinja/options.py
from optparse import OptionParser parser = OptionParser() parser.add_option("-i", "--isar_path", help="path to isar dir", type="string", action="store", dest="isar_path") print parser.parse_args()
mit
Python
12e24b00456f0a0efc5f89100c39c03382041258
Add tests
guykisel/python-autocast-decorator
tests/autocast_test.py
tests/autocast_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from autocast import autocast @autocast def return_a_type(input): return type(input) def string_to_int_test(): assert return_a_type('5') == int ass...
mit
Python
02e907a97eb1cb79b5c427e6153caf8ca0009058
Add basic test for build
mwilliamson/whack
tests/builder_tests.py
tests/builder_tests.py
import contextlib import json import os from nose.tools import istest, assert_equal from whack.tempdir import create_temporary_dir from whack.files import sh_script_description, plain_file, read_file from whack.sources import PackageSource from whack.builder import build @istest def build_uses_params_as_environ...
bsd-2-clause
Python
4edcc59c3dc6f5c5121e0b453f39ab90ec5af3ca
Add damselfly package
krafczyk/spack,EmreAtes/spack,iulian787/spack,EmreAtes/spack,TheTimmy/spack,lgarren/spack,mfherbst/spack,LLNL/spack,iulian787/spack,LLNL/spack,krafczyk/spack,lgarren/spack,LLNL/spack,matthiasdiener/spack,mfherbst/spack,EmreAtes/spack,tmerrick1/spack,skosukhin/spack,skosukhin/spack,matthiasdiener/spack,LLNL/spack,krafcz...
var/spack/packages/damselfly/package.py
var/spack/packages/damselfly/package.py
from spack import * class Damselfly(Package): """Damselfly is a model-based parallel network simulator.""" homepage = "https://github.com/scalability-llnl/damselfly" url = "https://github.com/scalability-llnl/damselfly" version('1.0', '05cf7e2d8ece4408c0f2abb7ab63fd74c0d62895', git='https://githu...
lgpl-2.1
Python
548f5215adaa0e2329a4d2c4d9a2ae728d617a1a
Solve task #496
Zmiecer/leetcode,Zmiecer/leetcode
496.py
496.py
class Solution(object): def nextGreaterElement(self, findNums, nums): """ :type findNums: List[int] :type nums: List[int] :rtype: List[int] """ l = len(nums) ans = [] for f in findNums: found = False for i in range(nums.index(f)...
mit
Python
d0e8945a196612ec463b2feb34836f6971076546
add serializers for the content app models
ralphiee22/kolibri,66eli77/kolibri,whitzhu/kolibri,indirectlylit/kolibri,jayoshih/kolibri,rtibbles/kolibri,jamalex/kolibri,learningequality/kolibri,whitzhu/kolibri,aronasorman/kolibri,benjaoming/kolibri,MingDai/kolibri,mrpau/kolibri,MingDai/kolibri,DXCanas/kolibri,learningequality/kolibri,christianmemije/kolibri,66eli7...
kolibri/content/serializers.py
kolibri/content/serializers.py
from models import ContentMetadata, File, Format from rest_framework import serializers class ContentMetadataSerializer(serializers.ModelSerializer): class Meta: model = ContentMetadata fields = ('content_id', 'title', 'description', 'kind', 'slug', 'total_file_size', 'available', 'license', 'prer...
mit
Python
b6f2325c153b499c3b79fdb813d80e5423e4919d
Disable torcache for now. Randomize order torrent cache mirrors are added to urls list.
tobinjt/Flexget,tarzasai/Flexget,jacobmetrick/Flexget,offbyone/Flexget,Flexget/Flexget,tvcsantos/Flexget,qk4l/Flexget,jawilson/Flexget,sean797/Flexget,oxc/Flexget,oxc/Flexget,asm0dey/Flexget,Flexget/Flexget,thalamus/Flexget,Danfocus/Flexget,crawln45/Flexget,v17al/Flexget,JorisDeRieck/Flexget,dsemi/Flexget,vfrc2/Flexget...
flexget/plugins/services/torrent_cache.py
flexget/plugins/services/torrent_cache.py
import logging import re import random from flexget.plugin import register_plugin, priority log = logging.getLogger('torrent_cache') MIRRORS = ['http://torrage.com/torrent/', # Now using a landing page instead of going directly to the torrent # TODO: May be fixable by setting the referer ...
import logging import re from flexget.plugin import register_plugin, priority log = logging.getLogger('torrent_cache') MIRRORS = ['http://torrage.com/torrent/', 'http://torcache.net/torrent/', 'http://zoink.it/torrent/', 'http://torrage.ws/torrent/'] class TorrentCache(object): ...
mit
Python
6539acd170b5c41b949928cc50ad7787cf634f45
test added
ibinti/intellij-community,FHannes/intellij-community,apixandru/intellij-community,ThiagoGarciaAlves/intellij-community,xfournet/intellij-community,xfournet/intellij-community,vvv1559/intellij-community,mglukhikh/intellij-community,ThiagoGarciaAlves/intellij-community,suncycheng/intellij-community,vvv1559/intellij-commu...
python/testData/testRunner/env/testsInFolder/tests/test_spam.py
python/testData/testRunner/env/testsInFolder/tests/test_spam.py
from unittest import TestCase def test_funeggs(): pass class EggsTest(TestCase): def test_metheggs(self): pass
apache-2.0
Python
fed162eec62b13adff00949e76e171dee37f7f17
test 2 functions in graph_functions
berkeley-stat159/project-theta
code/utils/tests/test_graph_functions.py
code/utils/tests/test_graph_functions.py
""" Test graph_function module the following functions: loadtxt_dict loadnib_dict vol_mean Run with:: nosetests test_graph_functions.py """ # Loading modules. from __future__ import absolute_import, division, print_function import numpy as np import matplotlib.pyplot as plt import nibabel as nib impor...
bsd-3-clause
Python
28e51114d5bc7dfe65c04913d176da6443bbdf84
Add killpoint calculation
tchapley/ProgressBot
killpoints.py
killpoints.py
import datetime class KillPoints(object): chest_available = datetime.datetime(2016, 9, 21) breakpoints = [194, 578, 1225, 2181, 4800, 9600] def __init__(self, json): self.json = json def get_legendary_count(self, killpoints): for i in range(0, len(self.breakpoints)): if self.breakpoints[i] > k...
mit
Python
e75b93074af1af8d815dab352574d01a84c81ae9
add unit tests for lf_needed_fuel, lf_performance, sflf_needed_fuel
aandergr/kspalculator
unittests.py
unittests.py
#!/usr/bin/env python3 from unittest import TestCase, main import physics class TestPhysics(TestCase): def assertListAlmostEqual(self, first, second): if len(first) != len(second): raise self.failureException("List length mismatch") for i in range(len(first)): self.assertA...
mit
Python
4c9f84f6c6cc935216cf888f829cede4bd7e4dfc
call LP DAAC STAC API for UCFR, write png with thumbnails
dgketchum/MT_Rsense
utils/hls.py
utils/hls.py
import os import os import json from datetime import datetime import requests as r import numpy as np import pandas as pd import geopandas as gp from skimage import io import matplotlib.pyplot as plt from osgeo import gdal import rasterio as rio from rasterio.mask import mask from rasterio.enums import Resampling from ...
apache-2.0
Python
66fef56c0e960a03263ee87e44058e209aac13af
add converting module
jefftc/changlab,jefftc/changlab,jefftc/changlab,jefftc/changlab,jefftc/changlab,jefftc/changlab
Betsy/Betsy/modules/rnasequnprocessedsignalfile_to_unprocessedsignalfile.py
Betsy/Betsy/modules/rnasequnprocessedsignalfile_to_unprocessedsignalfile.py
from Module import AbstractModule class Module(AbstractModule): def __init__(self): AbstractModule.__init__(self) def run( self, network, in_data, out_attributes, user_options, num_cores, outfile): import shutil shutil.copyfile(in_data.identifier, outfile) def name...
mit
Python
8bdf671af72d36ccdc606132dd96be47d03cc369
Add BmiIlamb class
permamodel/bmi-ilamb
bmi_ilamb/bmi_ilamb.py
bmi_ilamb/bmi_ilamb.py
#! /usr/bin/env python import sys import subprocess class BmiIlamb(object): _command = 'ilamb2-run' _args = None _env = None def __init__(self): self._time = self.get_start_time() @property def args(self): return [self._command] + (self._args or []) def get_component_nam...
mit
Python
e598e86fd566d02096330e06557c8cc2568092aa
Add unit tests for NanEncoder.
rladeira/mltils
tests/mltils/test_nan_encoder.py
tests/mltils/test_nan_encoder.py
# pylint: disable=missing-docstring, invalid-name, import-error import numpy as np import pandas as pd from mltils.encoders import NanEncoder def test_nan_encoder_1(): nenc = NanEncoder() assert nenc is not None def test_nan_encoder_2(): df = pd.DataFrame({'A': [np.nan, 'a', 'b', 'c', np.nan]}) enc...
mit
Python
2a8f064733892b86c2041f3294d5efebd4b565d9
Allow channel ops to change the required level for specific permissions
Heufneutje/txircd,ElementalAlchemist/txircd
txircd/modules/extra/channelopaccess.py
txircd/modules/extra/channelopaccess.py
from twisted.plugin import IPlugin from txircd.module_interface import IMode, IModuleData, Mode, ModuleData from txircd.utils import ModeType from zope.interface import implements class ChannelOpAccess(ModuleData, Mode): implements(IPlugin, IModuleData, IMode) name = "ChannelOpAccess" affectedActions = { "check...
bsd-3-clause
Python
a1757c31700200e765a1b5ee43a12d91623c7148
Create preprocessing.py
nishankmahore/lda-api
preprocessing.py
preprocessing.py
# @example: python preprocessing.py test.raw test.corpus -psub import gensim import nltk.data from nltk.corpus import stopwords import argparse import os import re import logging import sys # configuration parser = argparse.ArgumentParser(description='Script for preprocessing public corpora') parser.add_argument('ra...
mit
Python
a00822aeb17eabde80adf16c30498472d5775159
Add tests for existing image
tpouyer/nova-lxd,Saviq/nova-compute-lxd,tpouyer/nova-lxd,Saviq/nova-compute-lxd
nclxd/tests/test_container_image.py
nclxd/tests/test_container_image.py
# Copyright 2015 Canonical Ltd # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
Python
8c01f0554093e142992e51549557211aef08e546
Create IC74152.py
rajathkumarmp/BinPy,BinPy/BinPy,yashu-seth/BinPy,yashu-seth/BinPy,rajathkumarmp/BinPy,daj0ker/BinPy,BinPy/BinPy,daj0ker/BinPy
BinPy/examples/ic/Series_7400/IC74152.py
BinPy/examples/ic/Series_7400/IC74152.py
from __future__ import print_function from BinPy import * print ('Usage of IC 74152:\n') ic = IC_74152() print ("""This is 14-pin 8:1 multiplexer with inverted input."""") print ('\nThe Pin configuration is:\n') p ={1:1 ,2:0 ,3:1 ,4:0 ,5:1 ,8:0 ,9:0 ,10:1 ,11:1 ,12:0 ,13:0 } print (p) print ('\nPin initialization -usi...
bsd-3-clause
Python
55a56c716d96ea8bf4b70a991554f57435909ec7
add eventlet tests
overcastcloud/aioeventlet
tests/test_eventlet.py
tests/test_eventlet.py
import eventlet import tests class EventletTests(tests.TestCase): def test_soon_spawn(self): result = [] def func1(): result.append("spawn") def func2(): result.append("spawn_after") self.loop.call_soon_threadsafe(self.loop.stop) def schedule_g...
apache-2.0
Python
cfd6881ad497a47948b4b432e1d9499534f83af7
Add teste for patterns
rougeth/bottery
tests/test_patterns.py
tests/test_patterns.py
from bottery.conf.patterns import Pattern def test_pattern_instance(): view = lambda: 'Hello world' pattern = Pattern('ping', view) assert pattern.pattern == 'ping' assert pattern.view == view def test_pattern_check_right_message(): ''' Check if Pattern class return the view when message che...
mit
Python
a2959a03b3da547d2a4399d7b902aa1d8f1fda60
edit test
pchmieli/h2o-3,pchmieli/h2o-3,junwucs/h2o-3,madmax983/h2o-3,tarasane/h2o-3,datachand/h2o-3,datachand/h2o-3,kyoren/https-github.com-h2oai-h2o-3,tarasane/h2o-3,datachand/h2o-3,michalkurka/h2o-3,madmax983/h2o-3,YzPaul3/h2o-3,michalkurka/h2o-3,mathemage/h2o-3,michalkurka/h2o-3,brightchen/h2o-3,h2oai/h2o-dev,jangorecki/h2o-...
h2o-py/tests/testdir_misc/pyunit_types.py
h2o-py/tests/testdir_misc/pyunit_types.py
import sys sys.path.insert(1, "../../") import h2o def pyunit_types(ip,port): pros = h2o.import_file(h2o.locate("smalldata/prostate/prostate.csv")) types = pros.types print types pros[1] = pros[1].asfactor() types2 = pros.types print types2 if __name__ == "__main__": h2o.run_test(sys.argv, pyunit_ty...
import sys sys.path.insert(1, "../../") import h2o def pyunit_types(ip,port): pros = h2o.import_file(h2o.locate("smalldata/prostate/prostate.csv")) types = pros.types print types pros[1] = pros[1].asfactor() types2 = pros.types assert types2["CAPSULE"] == "enum" if __name__ == "__main__": h2o.run_te...
apache-2.0
Python
e2c52c768420357b43394df622a32629155c927e
Add cli arguments parser tests
tesonet/pyhttp
tests/unit/test_cli.py
tests/unit/test_cli.py
from hamcrest import assert_that, is_ import pytest from pyhttp.cli import parse_args def describe_parse_args(): def it_returns_parsed_arguments(): args = parse_args(['-c', '100', 'http://example.com']) assert_that(args.concurrency, is_(100)) assert_that(args.url, is_('http://example.com...
mit
Python
0e01a4ead643352cb7be33505286dd6a1668f989
Split list tag.
visualspace/django-vspace-utils
vspace_utils/templatetags/split_list.py
vspace_utils/templatetags/split_list.py
""" Adapted from https://djangosnippets.org/snippets/889/ Usage: {% split_list list as new_list 2 %} """ from django.template import Library, Node, TemplateSyntaxError register = Library() class SplitListNode(Node): def __init__(self, list, cols, new_list): self.list, self.cols, self.new_list = list, c...
bsd-3-clause
Python
bcabafaddb49e92891546997cbef64d5d5d3c9c6
update emails
colllin/dsenyo-notify,saintsjd/dsenyo-notify
app.py
app.py
import os from flask import Flask, request import sendgrid app = Flask(__name__) SENDGRID_USERNAME = os.getenv('SENDGRID_USERNAME',False) SENDGRID_PASSWORD = os.getenv('SENDGRID_PASSWORD',False) @app.route('/') def hello(): return 'Notification app for Dsenyo.com' @app.route('/customer/new', methods=['GET','POST'...
import os from flask import Flask, request import sendgrid app = Flask(__name__) SENDGRID_USERNAME = os.getenv('SENDGRID_USERNAME',False) SENDGRID_PASSWORD = os.getenv('SENDGRID_PASSWORD',False) @app.route('/') def hello(): return 'Notification app for Dsenyo.com' @app.route('/customer/new', methods=['GET','POST'...
mit
Python
e7b2eacf9de4d95990c7f608a13bb0a246e381d0
convert mhd file to jpg and png
ALISCIFP/tensorflow-resnet-segmentation,ALISCIFP/tensorflow-resnet-segmentation
convert_mhd2jpg_png.py
convert_mhd2jpg_png.py
#!/usr/bin/env python # This script belongs to https://github.com/ import os,glob import argparse import numpy as np import SimpleITK as sitk from PIL import Image import cv2 DATA_DIRECTORY = '/home/zack/Data/ILDDataset/output/yes_lesions_no_rescale_merge_yes/' OUT_DIRECTORY = "/home/zack/Data/ILDDataset/output/ye...
mit
Python
58182671c3c32042cac6aa695b8197553252cbed
Add kinect version of robot
matthiasplappert/pibot
src/kinect_robot.py
src/kinect_robot.py
import argparse import logging import time import cv2 import numpy as np import Pyro4 import freenect # Attempt to load gopigo, which is not available everywhere gopigo_available = True try: import gopigo except ImportError: gopigo_available = False from util import pyro_event_loop, Action class Agent(obje...
mit
Python
c699a331ed8976069731f6bc7f61871123810865
Add migration for view_all_talks permission.
CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer,CarlFK/wafer,CarlFK/wafer,CTPUG/wafer
wafer/talks/migrations/0002_auto_20150813_2327.py
wafer/talks/migrations/0002_auto_20150813_2327.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('talks', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='talk', options={'permi...
isc
Python
e4bdca3556c0ac01b5c87dc273209dae7f8cf254
Add migration
CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer
wafer/talks/migrations/0008_auto_20160629_1404.py
wafer/talks/migrations/0008_auto_20160629_1404.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('talks', '0007_add_ordering_option'), ] operations = [ migrations.AlterField( model_name='talk', name...
isc
Python
6eca854c1e3364718c13da4251828d1f38612f9c
add urlhaus payloads in feeds (#283)
yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti,yeti-platform/yeti
plugins/feeds/public/urlhaus_payloads.py
plugins/feeds/public/urlhaus_payloads.py
import logging from datetime import timedelta from core import Feed from core.errors import ObservableValidationError from core.observables import Url, File, Hash class UrlHausPayloads(Feed): default_values = { "frequency": timedelta(hours=1), "name": "UrlHausPayloads", ...
apache-2.0
Python
4bb6f5015cdb2a4e2efcd5b4569e5274e44e7e5c
update task
raonyguimaraes/mendelmd,raonyguimaraes/mendelmd,raonyguimaraes/mendelmd,raonyguimaraes/mendelmd,raonyguimaraes/mendelmd,raonyguimaraes/mendelmd,raonyguimaraes/mendelmd,raonyguimaraes/mendelmd
workers/tasks.py
workers/tasks.py
# Create your tasks here from __future__ import absolute_import, unicode_literals from celery import Celery app = Celery('mendelmd') from tasks.models import Task from workers.models import Worker from django.db.models import Q from scripts.worker import IWorker from subprocess import run @app.task def launch_worke...
bsd-3-clause
Python
342ad2678750884116581cae9cc61c33dfc49df0
add git_ls_date
ton1517/git-ls-date
git_ls_date.py
git_ls_date.py
#!/usr/bin/env python from subprocess import Popen, PIPE import sys #======================================= # config #======================================= _name = 'git-ls-date' _version = '0.0.1' _license = 'MIT License' _description = '' _url = 'https://github.com/ton1517/git-ls-date' _author = 'ton1517' _autho...
mit
Python
dfcd8cbb386119d159492acd791ec92b5e4c334d
Initialize model selection testing
christopherjenness/ML-lib
tests/test_modelselection.py
tests/test_modelselection.py
import ML.modelselection as modelselection import ML.regression as regression import data import numpy as np def test_best_subset(): X, y = data.tall_matrix_data_2() error_measure = modelselection.Error.mse model = regression.LinearRegression subset = modelselection.best_subset(X, y, model, 2, error_m...
mit
Python
126007d25b4d33c528fa0646b4195901c798fa4d
Create __init__.py
carthagecollege/django-djforms,carthage-college/django-djforms,carthage-college/django-djforms,carthagecollege/django-djforms,carthage-college/django-djforms,carthagecollege/django-djforms,carthagecollege/django-djforms,carthage-college/django-djforms
djforms/communications/print/__init__.py
djforms/communications/print/__init__.py
unlicense
Python
dd69d5fe91fdcf1d0b44305ebce2bc798a0bd132
Create wordToSDR.py
ilblackdragon/nupic-hackathon-2014
wordToSDR.py
wordToSDR.py
import urllib2; import json; def createSDR(wordStr): ceptUrl = "http://api.cept.at/v1/term2bitmap"; appIdParam = "app_id=0201d171"; appKeyParam = "app_key=c15941581b95b92021d4ec61f00819c7"; wordParam = "term=" + wordStr; andChar = "&"; qstMark = "?"; queryUrl = ceptUrl + qstMark + word...
mit
Python
65bcc5369edb6601704e11d674e8b050721d5a64
write test on notifications
williamroot/opps,YACOWS/opps,opps/opps,opps/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,williamroot/opps,jeanmask/opps,opps/opps,jeanmask/opps,williamroot/opps,opps/opps,jeanmask/opps,YACOWS/opps
opps/contrib/notifications/tests.py
opps/contrib/notifications/tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.test import TestCase from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from opps.containers.models import Container from opps.channels.models import Channel from opps.db import Db from .models import Notification cla...
mit
Python
6168cfb4e94e6e03626e1853f25ca0814732ff68
complete 1 multiples of 3 and 5
dawran6/project-euler
1-multiples-of-3-and-5/solve.py
1-multiples-of-3-and-5/solve.py
def multiples_of_3_and_5(num=1000): for i in range(num): if i % 3 == 0 or i % 5 == 0: yield i if __name__ == '__main__': print(sum(multiples_of_3_and_5()))
mit
Python
4f4c57d7e27fd098d8bddc5d4a9b8c52f4f3e1e4
Test some views
stev-0/bustimes.org.uk,jclgoodwin/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,stev-0/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,jclgoodwin/bustimes.org.uk,stev-0/bustimes.org.uk
busstops/test_views.py
busstops/test_views.py
from django.test import TestCase from .models import Region, Operator, Service class ViewsTests(TestCase): @classmethod def setUpTestData(cls): cls.north = Region.objects.create(pk='N', name='North') cls.service = Service.objects.create( pk='ea_21-45-A-y08', line_name='...
mpl-2.0
Python
978fa7d63195eed230f16090fd3c821162a1f546
Add a snippet (Pillow).
jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets
python/pil/python3_pillow_fork/resize.py
python/pil/python3_pillow_fork/resize.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including witho...
mit
Python
4d5ed1b8dc52daaeecde09788765525b0d214d54
add conary proxy plugin
sassoftware/amiconfig,sassoftware/amiconfig
amiconfig/plugins/conaryproxy.py
amiconfig/plugins/conaryproxy.py
# # Copyright (c) 2007 rPath, Inc. # from amiconfig.errors import * from rpathplugin import rPathPlugin class AMIConfigPlugin(rPathPlugin): name = 'conaryproxy' def pluginMethod(self): if 'conaryproxy' not in self.rpathcfg: return proxy = self.rpathcfg['conaryproxy'] fh ...
apache-2.0
Python
d6c490d57b8696cc3775b15a29cd83f3bed7c5ea
Add indexing tests
J535D165/recordlinkage,J535D165/recordlinkage
tests/test_indexing.py
tests/test_indexing.py
import unittest import pandas.util.testing as pdt import recordlinkage import numpy as np import pandas as pd import os class TestIndexing(unittest.TestCase): def test_full_index_unique(self): df1 = pd.DataFrame({'name':['Bob', 'Anne', 'Micheal']}, index=['001', '002', '003']) df2 = pd.DataFrame...
bsd-3-clause
Python
9386120ee2d5e27374a53c10ca45bf7b6f0d2e6e
Add initial test for listener module
beezz/pg_bawler,beezz/pg_bawler
tests/test_listener.py
tests/test_listener.py
#!/usr/bin/env python import pytest import pg_bawler.core @pytest.mark.asyncio async def test_simple_listen(): class NotificationListener( pg_bawler.core.BawlerBase, pg_bawler.core.ListenerMixin ): pass class NotificationSender( pg_bawler.core.BawlerBase, pg_bawl...
bsd-3-clause
Python
185fc17fdd4de4756064df9b9f5ae471f9e4282c
test the dismissed support for memory file.
chfw/pyexcel-ods3,chfw/pyexcel-ods3
tests/test_stringio.py
tests/test_stringio.py
import os import pyexcel from pyexcel.ext import ods3 import sys if sys.version_info[0]< 2: from StringIO import StringIO else: from io import BytesIO as StringIO from base import create_sample_file1 class TestStringIO: def test_ods_stringio(self): odsfile = "cute.ods" create_sample_file1...
bsd-3-clause
Python
48e7ee8153efbef8f2831242fffb604d85d77dfc
Test tracking module. #4
numberoverzero/bloop,numberoverzero/bloop
tests/test_tracking.py
tests/test_tracking.py
import bloop.tracking import uuid def test_before_save(User, engine): ''' before saving, all non-key fields should be in the diff's SET ''' user = User(id=uuid.uuid4(), age=4) expected = {'SET': [(User.age, user.age)]} diff = bloop.tracking.diff_obj(user, engine) assert diff == expected def test...
mit
Python
be0fdf0cbcb89dd0e5f906504ecc25f2f3f702e6
add config for content machines
hmcmooc/muddx-platform,bigdatauniversity/edx-platform,zadgroup/edx-platform,TeachAtTUM/edx-platform,LearnEra/LearnEraPlaftform,teltek/edx-platform,mcgachey/edx-platform,pepeportela/edx-platform,DefyVentures/edx-platform,RPI-OPENEDX/edx-platform,jonathan-beard/edx-platform,DNFcode/edx-platform,vismartltd/edx-platform,ww...
envs/content.py
envs/content.py
""" These are debug machines used for content creators, so they're kind of a cross between dev machines and AWS machines. """ from aws import * DEBUG = True TEMPLATE_DEBUG = True EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
agpl-3.0
Python
85aa8aaeb278172a43639caed1a01b515432a6e2
add example
mamaddeveloper/telegrambot,mamaddeveloper/teleadmin,mamaddeveloper/telegrambot,mamaddeveloper/teleadmin
multi_thread_example.py
multi_thread_example.py
import datetime import json import logging import logging.config import os import queue import random import time import threading def main(): LOGGING_PATH = "logs/config.json" if os.path.exists(LOGGING_PATH): with open(LOGGING_PATH, 'rt') as f: config = json.load(f) logging.config...
mit
Python
ad1121b941a694b7cb6a65e7e6bf4839147f7551
Add script to test/verify alert configuration
aelialper/skyline,hcxiong/skyline,loggly/skyline,triplekill/skyline,PaytmLabs/skyline,100star/skyline,CDKGlobal/skyline,hcxiong/skyline,loggly/skyline,sdgdsffdsfff/skyline,klynch/skyline,aelialper/skyline,triplekill/skyline,100star/skyline,sdgdsffdsfff/skyline,hcxiong/skyline,loggly/skyline,sdgdsffdsfff/skyline,PaytmLa...
utils/verify_alerts.py
utils/verify_alerts.py
#!/usr/bin/env python import os import sys from os.path import dirname, join, realpath from optparse import OptionParser # Get the current working directory of this file. # http://stackoverflow.com/a/4060259/120999 __location__ = realpath(join(os.getcwd(), dirname(__file__))) # Add the shared settings file to namesp...
mit
Python