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
0ffa7edc5743b456c904ebfdbd48b3a3b874adf6
Add polyline codec tests
mapbox/mapbox-sdk-py,perrygeo/mapbox-sdk-py
tests/test_polyline_codec.py
tests/test_polyline_codec.py
import unittest from mapbox.polyline.codec import PolylineCodec class PolylineCodecTestCase(unittest.TestCase): def setUp(self): self.codec = PolylineCodec() def test_decode_multiple_points(self): d = self.codec.decode('gu`wFnfys@???nKgE??gE?????oK????fE??fE') self.assertEqual(d, [ ...
mit
Python
b04b6e14490e4bdb61457741d52bded336751618
Add ShengBTE (#16154)
iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/shengbte/package.py
var/spack/repos/builtin/packages/shengbte/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Shengbte(MakefilePackage): """ShengBTE is a software package for solving the Boltzmann Tran...
lgpl-2.1
Python
d6020572b9882a26939c71cb5d6ea795f0ef2d44
Add basic tests for spans
alisaifee/sifr,alisaifee/sifr
tests/test_spans.py
tests/test_spans.py
import unittest import datetime import hiro from sifr.span import Minute, Year, Month, Day, Hour class SpanTests(unittest.TestCase): def test_minute(self): with hiro.Timeline().freeze(datetime.datetime(2012, 12, 12)): now = datetime.datetime.now() span = Minute(now, ["single"]) ...
mit
Python
c7621caf782e44c76d2477813726ea35de00d49c
Add unit tests for the store class
tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status
tests/test_store.py
tests/test_store.py
# pylint: disable=C0103,C0111,W0703 import unittest from bumblebee.store import Store class TestStore(unittest.TestCase): def setUp(self): self.store = Store() self.anyKey = "some-key" self.anyValue = "some-value" self.unsetKey = "invalid-key" def test_set_value(self): ...
mit
Python
6f98d51375fa70e540f2d48a9242cf39ab482b2e
Test directory creation
goerz/clusterjob,goerz/clusterjob
tests/test_utils.py
tests/test_utils.py
import os from clusterjob.utils import run_cmd, _wrap_run_cmd def test_mkdir(tmpdir): """Test that 'mkdir -p folder' actually creates folder""" folder = str(tmpdir.join('folder')) assert not os.path.isdir(folder) run_cmd(['mkdir', '-p', folder], remote=None, ignore_exit_code=False) assert os.path.i...
mit
Python
a2b9d401f5a7966dc7268dbda805b0def50dd3a8
add udp.py
tjctw/PythonNote,tjctw/PythonNote,tjctw/PythonNote,tjctw/PythonNote
Foundations.of.Python.Network.Programming.369p/udp.py
Foundations.of.Python.Network.Programming.369p/udp.py
import argparse, socket from datetime import datetime MAX_BYTES = 65535 def server(port): sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(('127.0.0.1', port)) print('Listening at {}'.format(sock.getsockname())) while True: data, address = sock.recvfrom(MAX_BYTES) text =...
cc0-1.0
Python
cd2e527f86427257de0686269e6b3a9d74314249
Add Utility Method For Retrieving Error Vertices
StartTheShift/thunderdome-logging,StartTheShift/thunderdome-logging
thunderdome_logging/utils.py
thunderdome_logging/utils.py
# Copyright (c) 2012-2013 SHIFT.com # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, modify, merge, publish, dist...
mit
Python
ad2a074fdc2fc2fc4cb32437e55509269e50adb7
add mystem tag generator initial support (#529)
meg0man/languagetool,languagetool-org/languagetool,janissl/languagetool,languagetool-org/languagetool,jimregan/languagetool,janissl/languagetool,lopescan/languagetool,languagetool-org/languagetool,meg0man/languagetool,janissl/languagetool,jimregan/languagetool,lopescan/languagetool,janissl/languagetool,meg0man/language...
languagetool-language-modules/ru/src/main/resources/org/languagetool/resource/ru/generate-mystem-tags.py
languagetool-language-modules/ru/src/main/resources/org/languagetool/resource/ru/generate-mystem-tags.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import os from subprocess import call import re import enchant d = enchant.Dict("ru_RU") words = set() i=0 with open('need-tag.txt', 'r') as data_file: for data_line in data_file: # i += 1 # if i > 100: break if ' ' in data_line: if ...
lgpl-2.1
Python
10bee723e759c5fe62f1965f39ed385cb6f7c30e
Add desktop parser unittests
stoq/kiwi
tests/test_desktopparser.py
tests/test_desktopparser.py
# encoding: utf-8 import StringIO import unittest from kiwi.desktopparser import DesktopParser desktop_data = """ [Desktop Entry] Name=Totem Movie Player Name[pt]=Reprodutor de Filmes Totem Name[sv]=Filmspelaren Totem Categories=GNOME;Application;AudioVideo """ class TestTotem(unittest.TestCase): def setUp(self)...
lgpl-2.1
Python
a58ad5b272ccb68b3e0ffed374cb40551ee62fde
allow larger tags
pirate/bookmark-archiver,pirate/bookmark-archiver,pirate/bookmark-archiver
archivebox/core/migrations/0018_auto_20210327_0952.py
archivebox/core/migrations/0018_auto_20210327_0952.py
# Generated by Django 3.1.3 on 2021-03-27 09:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0017_auto_20210219_0211'), ] operations = [ migrations.AlterField( model_name='tag', name='name', ...
mit
Python
f315eb0c8d85263e2002ecce9e7deca26da01f23
Create a velocity profile node to execute geometric shapes for sensor characterization
buckbaskin/drive_stack,buckbaskin/drive_stack,buckbaskin/drive_stack
scripts/vel_profile_execution.py
scripts/vel_profile_execution.py
#!/usr/bin/env python """ Drive the robot in one of 3 geometric shapes (line, point, circle) Do so with smooth ramping (accel method) and then constant velocity, then smooth ramping down (accel again). It's probably advised to only run one of the main_ methods at the bottom. """ import rospy import math import rospy...
mit
Python
c983d42540be7ec6b900de3be9cd7e9d735da06f
Add migration
keithhackbarth/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server
clowder_server/migrations/0005_auto_20170503_0031.py
clowder_server/migrations/0005_auto_20170503_0031.py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-03 00:31 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('clowder_account', '0005_company_name'), ('clowder_server', '0004_ping_public'), ] ope...
agpl-3.0
Python
b3e30e1a8be6a399ec406d7cdc7797b0759c2d6f
Create re_read.py
ZhangDubhe/GISdev
ex-3/re_read.py
ex-3/re_read.py
#wirtten by python 2.7 import re print "2017 - 4 - 7 Homework 3: RE" print "By Dubhe" file = open("decisionTree.dot", 'rb') for each in file: x = re.search("X", each) if(x): print "begin node" name = re.search("^\d+", each) label = re.search("X\[(\d+)\] <= \d+\.\d+", each) print ...
mit
Python
0de42519cf227d2ad2a2ad2594d86d6e9171abf0
Add py-cachetools package (#12252)
iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack
var/spack/repos/tutorial/packages/py-cachetools/package.py
var/spack/repos/tutorial/packages/py-cachetools/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyCachetools(PythonPackage): """This module provides various memoizing collections and dec...
lgpl-2.1
Python
8f72e083e436198adcf113cb0abaa8af96f8caf1
Add unit tests for ts_specification
team-vigir/vigir_behavior_synthesis,team-vigir/vigir_behavior_synthesis
vigir_ltl_specification/test/unit/ts_specification_test.py
vigir_ltl_specification/test/unit/ts_specification_test.py
#!/usr/bin/env python import unittest from vigir_ltl_specification.ts_specification import * class SpecificationConstructionTests(unittest.TestCase): """Test the generation of Activation-Outcomes formulas""" def setUp(self): """Gets called before every test case.""" self.spec_name = 'test' ...
bsd-3-clause
Python
1692f2a41c34164682a08120ae55a3f6313f5ee9
test messages
SUNET/eduid-webapp,SUNET/eduid-webapp,SUNET/eduid-webapp
src/eduid_webapp/signup/tests/test_msgs.py
src/eduid_webapp/signup/tests/test_msgs.py
# -*- coding: utf-8 -*- import unittest from eduid_webapp.signup.helpers import SignupMsg class MessagesTests(unittest.TestCase): def test_messages(self): """""" self.assertEqual(str(SignupMsg.out_of_sync.value), 'user-out-of-sync') self.assertEqual(str(SignupMsg.temp_problem.value), 'T...
bsd-3-clause
Python
6fbe77764cf4ce03a57d474753cc37d221db401a
Add setup.py.
BBN-Q/libaps2,BBN-Q/libaps2,BBN-Q/libaps2,BBN-Q/libaps2,BBN-Q/libaps2
src/python/setup.py
src/python/setup.py
from setuptools import setup, find_packages setup( name='libaps2', version="1.2", url='https://github.com/BBN-Q/libaps2', py_modules=["aps2"] )
apache-2.0
Python
ce4e2cc646469099a614f689d0b17a0140a49ae9
Add solutions for "Shortest Word" kata - https://www.codewars.com/kata/57cebe1dc6fdc20c57000ac9
davidlukac/codekata-python
codewars/shortest_word.py
codewars/shortest_word.py
# Shortest word # https://www.codewars.com/kata/57cebe1dc6fdc20c57000ac9 import unittest def find_short(s: str) -> int: return next(iter(sorted(list(map(lambda word: len(word), s.split()))))) def find_short_2(s: str) -> int: return min(len(w) for w in s.split()) if __name__ == '__main__': unittest.ma...
mit
Python
934011a4995d4bfea7a721b31b8789ed310f53ad
Create __init__.py
numenta/nupic.research,subutai/nupic.research,numenta/nupic.research,subutai/nupic.research
src/nupic/research/frameworks/htm/__init__.py
src/nupic/research/frameworks/htm/__init__.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2022, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
Python
3515afa1aea2035fba7cf4e334d0ad7a5746e18f
Fix a pants test that was broken at least on osx.
cevaris/commons,VaybhavSharma/commons,atollena/commons,nkhuyu/commons,VaybhavSharma/commons,cevaris/commons,atollena/commons,nkhuyu/commons,jsirois/commons,atollena/commons,Yasumoto/commons,Yasumoto/commons,abel-von/commons,VaybhavSharma/commons,WCCCEDU/twitter-commons,brutkin/commons,Yasumoto/commons,WCCCEDU/twitter-c...
tests/python/twitter/pants/base/test_build_root.py
tests/python/twitter/pants/base/test_build_root.py
# ================================================================================================== # Copyright 2013 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
# ================================================================================================== # Copyright 2013 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
apache-2.0
Python
51831c62ba5a44fcabb9387956b0199da9f6f658
Implement IRCv3 extended-join
Heufneutje/txircd,DesertBus/txircd,ElementalAlchemist/txircd
txircd/modules/ircv3_extended-join.py
txircd/modules/ircv3_extended-join.py
from txircd.modbase import Module class ExtendedJoin(Module): def capRequest(self, user, capability): return True def capAcknowledge(self, user, capability): return False def capRequestRemove(self, user, capability): return True def capAcknowledgeRemove(self, user, capability): return False def ca...
bsd-3-clause
Python
e96add0f64f6486a41955cb53f514d87d927ffa3
Add utils.py with function to render video in notebook
JVillella/ml-playground
gan-gaussian-dist/utils.py
gan-gaussian-dist/utils.py
import numpy as np import matplotlib.pyplot as plt from matplotlib import animation from IPython.display import HTML from tempfile import NamedTemporaryFile import base64 def run_animation(anim_frames): VIDEO_TAG = """ <video controls> <source type="video/mp4"src="data:video/mp4;base64,{0}"> </vide...
mit
Python
4601de20b49245f088bdab69d5e7d429841cf345
Add forgotten migration for relation related_name change
Sinar/popit_ng,Sinar/popit_ng
popit/migrations/0058_auto_20170418_0745.py
popit/migrations/0058_auto_20170418_0745.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2017-04-18 07:45 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('popit', '0057_auto_20170315_0222'), ] operations = ...
agpl-3.0
Python
afab6608563cfd1c81a4013e367755c69a367ac8
update map extraction algorithm
DTU-ELMA/European_Dataset,DTU-ELMA/European_Dataset
Scripts/Make_Load_Maps/extract_excel_files.py
Scripts/Make_Load_Maps/extract_excel_files.py
import numpy as np import xlrd import os import pandas as pd indir = '../../Data/ENTSOE-load/excel_files/' outdir = '../../Data/ENTSOE-load/extracted_load/' # Kosovo and Albania are not listed. 2012 consumption from indexmundi.com c_kosovo = 5.67 c_serbia = 35.5 c_albania = 6.59 filestoload = [f for f in os.listdir(...
apache-2.0
Python
7ca142a17565c39196d026cc5d7f32d5ddf70b32
Add rohrpost's message helpers
axsemantics/rohrpost,axsemantics/rohrpost
rohrpost/message.py
rohrpost/message.py
import json def _send_message(message, content: dict, close: bool): message.reply_channel.send({ 'text': json.dumps(content), 'close': close, }) def send_message(message, message_id, handler, close=False, **additional_data): content = dict() if message_id: content['id'] = mes...
mit
Python
906c985de3b0156ac50a1bd10d0c803f3439cf4e
Create dinic.py (#1396)
TheAlgorithms/Python
graphs/dinic.py
graphs/dinic.py
INF = float("inf") class Dinic: def __init__(self, n): self.lvl = [0] * n self.ptr = [0] * n self.q = [0] * n self.adj = [[] for _ in range(n)] ''' Here we will add our edges containing with the following parameters: vertex closest to source, vertex closest to sink and ...
mit
Python
1c3158b65b0e44457610fbce1c465e7251c365d2
Create __init__.py
imzers/gsutil-with-php,imzers/gsutil-with-php
gslib/addlhelp/__init__.py
gslib/addlhelp/__init__.py
apache-2.0
Python
e0d71d17ef62bb4e515462c2a53a5dd7172cd15d
Add script to run a series of experiments
NLeSC/cptm,NLeSC/cptm
DilipadTopicModelling/experiment_number_of_topics.py
DilipadTopicModelling/experiment_number_of_topics.py
import logging import glob from multiprocessing import Process from CPTCorpus import CPTCorpus from CPT_Gibbs import GibbsSampler def run_sampler(corpus, nTopics, nIter, beta, out_dir): sampler = GibbsSampler(corpus, nTopics=nTopics, nIter=nIter, alpha=(50.0/n), beta=beta, beta_o=beta,...
apache-2.0
Python
127fdeee3c5fbc14c5a61274467436db5bd753a8
Add OpenSpaces screen
akshayaurora/PyDelhiMobile,pydelhi/pydelhi_mobile,samukasmk/pythonbrasil_mobile,shivan1b/pydelhi_mobile
pydelhiconf/uix/screens/screenopenspaces.py
pydelhiconf/uix/screens/screenopenspaces.py
from kivy.uix.screenmanager import Screen from kivy.lang import Builder class ScreenOpenSpaces(Screen): Builder.load_string(''' <BackLabel@Background+Label> valign: 'middle' size_hint_y: None height: (self.texture_size[1] + dp(9)) if self.text else 0 backcolor: (226/255.,168/255.,180/255., 0.5) t...
agpl-3.0
Python
fe0ceda543982923c48694f6e3e6d9fef6c16de7
add script for computing a rainbow table of repo hashes
fireeye/flare-wmi,fireeye/flare-wmi,fireeye/flare-wmi
python-cim/samples/compute_rainbow_table.py
python-cim/samples/compute_rainbow_table.py
#!/usr/bin/env python2 """ search for bytes in a WMI repository. author: Willi Ballenthin email: william.ballenthin@fireeye.com """ import sys import logging import binascii import argparse import cim logger = logging.getLogger(__name__) def build_rainbow_table(repo): """ build a mapping from WMI reposit...
apache-2.0
Python
fafb2c00597a99947f3e7a344e97551a390bda08
Create a searchable index on the request text field.
CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords
alembic/versions/5563ca9e7626_create_request_searc.py
alembic/versions/5563ca9e7626_create_request_searc.py
"""Create request search column and trigger. Revision ID: 5563ca9e7626 Revises: 30d3af507801 Create Date: 2014-03-06 13:13:52.831868 """ # revision identifiers, used by Alembic. revision = '5563ca9e7626' down_revision = '30d3af507801' from alembic import op import sqlalchemy as sa def upgrade(): # TODO(cj@post...
apache-2.0
Python
e77bbe570e6abdc5fc5eacc8444c4b615ab9938f
Create __init__.py
josedolz/LiviaNET
src/LiviaNet/Modules/__init__.py
src/LiviaNet/Modules/__init__.py
mit
Python
3f15b53bc475785eff419bbdb143ede422150c83
add dynamically populated engine module
simphony/simphony-common
simphony/engine/__init__.py
simphony/engine/__init__.py
""" Simphony engine module This module is dynamicaly populated at import with the registered plugins modules. Plugins modules need to be registered at the 'simphony.engine' entry point. """ def load_engine_extentions(): """ Discover and load engine extension modules. """ from stevedore import extensio...
bsd-2-clause
Python
31e1b8e06ad9545b2168afd25a6b336bc4c93d3f
add ATCG count from mpileup file
zym1905/bioinformatics,zym1905/bioinformatics
src/main/python/countBAMregion.py
src/main/python/countBAMregion.py
import sys import re BaseIndex = {'A': 0, 'T': 1, 'C': 2, 'G': 3} def main(pileupfile): if len(sys.argv) != 2: print("please input the mpipeup file from samtools") sys.exit(1) pipupfile = open(pileupfile, 'r') lines = pipupfile.readlines() for i in range(0, len(lines)): line ...
apache-2.0
Python
c204f3484bc5ff72e52323d2f154d3f944b41f2f
write tests for Emcee.open_game()
IanDCarroll/xox
tests/test_emcee_podium.py
tests/test_emcee_podium.py
import unittest from source.emcee_podium import * from source.announcer_chair import * class MuteAnnouncer(Announcer): def show(self, what_is_said): return what_is_said class Dummy(Emcee): announcer = MuteAnnouncer() class Mc_Human(Dummy): def ask_human(self): return '1' class Mc_Compute...
mit
Python
67153408c30726728a1bf9ec9e03ff869b306174
Add automated tests for proposal_speaker_manage.
pydata/conf_site,pydata/conf_site,pydata/conf_site
conf_site/proposals/tests/test_proposal_management.py
conf_site/proposals/tests/test_proposal_management.py
from django.contrib.auth import get_user_model from django.urls import reverse from django.utils.crypto import get_random_string from symposion.speakers.models import Speaker from conf_site.proposals.tests import ProposalTestCase class ProposalSpeakerManageViewTestCase(ProposalTestCase): """Automated test cases...
mit
Python
5e3d637d10aa6053c1a0f40af3758ab41369543d
Add validators.UniqueTogetherValidator
BryanAke/django-rest-framework-mongoengine,9nix00/django-rest-framework-mongoengine-hack,9nix00/django-rest-framework-mongoengine,optik/django-rest-framework-mongoengine,umutbozkurt/django-rest-framework-mongoengine,j1z0/django-rest-framework-mongoengine,nicolascine/django-rest-framework-mongoengine,arpitgoyalhtmedia/d...
rest_framework_mongoengine/validators.py
rest_framework_mongoengine/validators.py
from rest_framework import validators from rest_framework.exceptions import ValidationError class UniqueTogetherValidator(validators.UniqueTogetherValidator): def __call__(self, attrs): self.enforce_required_fields(attrs) queryset = self.queryset queryset = self.filter_queryset(attrs, quer...
mit
Python
3b979828666d867027132ea1c8312f3cdd293574
Create outline of setup file for pygments_k3.
DaMSL/K3,yliu120/K3,DaMSL/K3
tools/pygments_k3/setup.py
tools/pygments_k3/setup.py
from setuptools import setup setup( name="Pygments-K3", author="P.C. Shyamshankar", version="0.1", description="Pygments support for the K3 Programming Language.", packages=["pygments_k3"], install_requires=["pygments"], entry_points={ 'pygments.lexers': [ 'K3Lexer = ...
apache-2.0
Python
e62b72a6fd02520bea892e6c34022cb59c9cc517
Add simple script to evaluate the given network
BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH
Utils/py/cnn-segmentation-classification/evaluate.py
Utils/py/cnn-segmentation-classification/evaluate.py
#!/usr/bin/env python3 import argparse import pickle import keras import numpy as np import sys parser = argparse.ArgumentParser(description='Train the network given ') parser.add_argument('-b', '--database-path', dest='imgdb_path', help='Path to the image database containing test data.' ...
apache-2.0
Python
f0efcda9d9dfc5376be8b37a1e61c6a72c2722f3
Add LoggerAction
alvarogzp/telegram-bot,alvarogzp/telegram-bot
bot/action/standard/logger.py
bot/action/standard/logger.py
from bot.action.core.action import IntermediateAction from bot.logger.logger import LoggerFactory from bot.logger.message_sender.factory import MessageSenderFactory class LoggerAction(IntermediateAction): def __init__(self, logger_type: str = "formatted", reuse_max_length: int = 4000, reuse_max_time: int = 60): ...
agpl-3.0
Python
4e096c82d41ae507a01eed53fa939cf5eb23e14d
convert 'title' to 'varchar'
pkimber/old_cms
cms/migrations/0002_auto__chg_field_simple_title.py
cms/migrations/0002_auto__chg_field_simple_title.py
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Simple.title' db.alter_column(u'cms_simple', 'title', self.gf('django.db.models.fields.Te...
apache-2.0
Python
8cc137185440239eb527c520c1b1526565bc5ec1
Add rabbitmq check
simplegeo/metartg,simplegeo/metartg
metartg/checks/rabbitmq.py
metartg/checks/rabbitmq.py
#!/usr/bin/env python from time import time def rabbitmq_metrics(): p = subprocess.Popen(['/usr/sbin/rabbitmqctl', '-q', 'list_queues', '-p', 'simplegeo'], stdout=subprocess.PIPE) stdout, stderr = p.communicate() now = int(time()) metrics = {} for line in stdout.strip().split('\n'): queue,...
bsd-3-clause
Python
1fa31c04dbd323af36a5b0cb606aa49e0b1c0359
Debug script to modify jbrowse track config manually.
churchlab/millstone,woodymit/millstone_accidental_source,churchlab/millstone,woodymit/millstone,woodymit/millstone,woodymit/millstone_accidental_source,woodymit/millstone_accidental_source,woodymit/millstone_accidental_source,woodymit/millstone,churchlab/millstone,churchlab/millstone,woodymit/millstone
genome_designer/debug/modify_jbrowse_track_config.py
genome_designer/debug/modify_jbrowse_track_config.py
"""Functions for manipulating JBrowse configs. NOTE: User responsible for managing backups / not breaking anything. """ import json TRACK_LIST_CONFIG = '/dep_data/temp_data/projects/3bc32fc9/ref_genomes/01166f51/jbrowse/trackList.json' def main(): with open(TRACK_LIST_CONFIG) as fh: config_json = json.loads(f...
mit
Python
f454a9aac28ba1e693d557fbf7701ee71ba75199
Test procedure added.
HPCGISLab/pcml,HPCGISLab/pcml
test-scripts/bed-and-breakfast-procedure.py
test-scripts/bed-and-breakfast-procedure.py
#!/usr/bin/python """ Copyright (c) 2014 High-Performance Computing and GIS (HPCGIS) Laboratory. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Authors and contributors: Eric Shook (eshook@kent.edu) """ from pcml import * import os.path as path im...
bsd-3-clause
Python
b9eaea741910b3858098c1ae18c383b80cc1f6a1
Add migration
stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten
features/groups/migrations/0015_auto_20171117_1723.py
features/groups/migrations/0015_auto_20171117_1723.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-11-17 16:23 from __future__ import unicode_literals import datetime from django.db import migrations, models import features.groups.models class Migration(migrations.Migration): dependencies = [ ('groups', '0014_auto_20170704_1729'), ] ...
agpl-3.0
Python
cc89a8f32b3a4edd7f02b8f83fd32ad72d555215
Add baron.py to begin work on the tiered salt master framework
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/baron.py
salt/baron.py
''' The baron is a minion of a higher master, the baron only allows the publisher to have access to the master's local api and facilitates a remote api via another master server ''' import salt.minion
apache-2.0
Python
90194ebd870fe758cfc60077418ffcd08a75ee08
Test coinbase category in wallet rpcs
Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc
test/functional/wallet_coinbase_category.py
test/functional/wallet_coinbase_category.py
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test coinbase transactions return the correct categories. Tests listtransactions, listsinceblock, and ...
mit
Python
a6f871162410b3a0b2fa8c5672cf94285e6aca96
add first config page
spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal,spyder-ide/spyder-terminal
spyder_terminal/confpage.py
spyder_terminal/confpage.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """Spyder terminal configuration page.""" # Third party imports from qtpy.QtWidgets import QTabWidget, QVBoxLayout, QWidget, QComboBox # Local imports from spyder.ap...
mit
Python
cdd11a37512decd63c9d0b2e96c7f85e0d0c914b
Add migration file
teamtaverna/core
app/timetables/migrations/0013_auto_20161007_1610.py
app/timetables/migrations/0013_auto_20161007_1610.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-10-07 16:10 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('timetables', '0012_vendor'), ] operations = [ ...
mit
Python
d0435bdd72576b84b1add45e6871c2647706b728
Add script to scrape top 10k players
Cyanogenoid/osu-modspecific-rank
scrape-10k.py
scrape-10k.py
import csv import time import requests import lxml.html top10k = {} for page_index in range(1, 201): print('Requesting page {}'.format(page_index)) url = 'https://osu.ppy.sh/p/pp/' payload = { 'm': 0, # osu! standard gamemode 'o': 1, # descending order 'page': page_index, } ...
mit
Python
2bda9d0e746d4abe64f0a21803fbc07e244bc96b
Add a migration for model meta options that should have been added earlier
AparatTechnologies/django-connectwise,KerkhoffTechnologies/django-connectwise,KerkhoffTechnologies/django-connectwise
djconnectwise/migrations/0008_auto_20170215_1430.py
djconnectwise/migrations/0008_auto_20170215_1430.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('djconnectwise', '0007_auto_20170215_1918'), ] operations = [ migrations.AlterModelOptions( name='company', ...
mit
Python
505671b698490918fe0ea6c6dfdab8c0b25339be
Add test for containment of a subclass of a native type.
MrSurly/micropython,dmazzella/micropython,infinnovation/micropython,bvernoux/micropython,selste/micropython,pfalcon/micropython,bvernoux/micropython,pozetroninc/micropython,kerneltask/micropython,torwag/micropython,infinnovation/micropython,ryannathans/micropython,pfalcon/micropython,swegener/micropython,dmazzella/micr...
tests/basics/subclass_native_containment.py
tests/basics/subclass_native_containment.py
# test containment operator on subclass of a native type class mylist(list): pass class mydict(dict): pass class mybytes(bytes): pass l = mylist([1, 2, 3]) print(0 in l) print(1 in l) d = mydict({1:1, 2:2}) print(0 in l) print(1 in l) b = mybytes(b'1234') print(0 in b) print(b'1' in b)
mit
Python
8f30d6b1fb1aaa5f063d73d85a94dd09dcdc2ca5
Add LogTestCase.test_log_user_anonymous_request
wking/bes
test/test_django.py
test/test_django.py
import re as _re import unittest as _unittest try: import unittest.mock as _mock except ImportError: import mock as _mock try: from django.conf import settings as _settings except ImportError as e: _settings_error = e _settings = None else: if not _settings.configured: _settings.configu...
bsd-2-clause
Python
069b5179a630ad863d0792142564e7f60ce2e4e5
Add complete plugin
thomasleese/smartbot-old,tomleese/smartbot,Muzer/smartbot,Cyanogenoid/smartbot
plugins/complete.py
plugins/complete.py
import requests import lxml.etree import urllib.parse class Plugin: def on_command(self, bot, stdin, stdout, args): query = " ".join(args) if not query: query = stdin.read().strip() if not query: print(self.on_help(bot), file=stdout) return url...
mit
Python
bf4fe3578e74b32e60973d1879ec0308f3fddcb3
add delete proposal action
ecreall/nova-ideo,ecreall/nova-ideo,ecreall/nova-ideo,ecreall/nova-ideo,ecreall/nova-ideo
novaideo/views/proposal_management/delete_proposal.py
novaideo/views/proposal_management/delete_proposal.py
# Copyright (c) 2014 by Ecreall under licence AGPL terms # avalaible on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi import colander from pyramid.view import view_config from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS from pontus.default_behavior import Cancel fro...
agpl-3.0
Python
2a2f410db724326add3fa5b4e0ef44be6f554e67
Fix invalid cmp behavior for status checks (#3903)
fotinakis/sentry,mvaled/sentry,ifduyue/sentry,JackDanger/sentry,mvaled/sentry,gencer/sentry,BuildingLink/sentry,JamesMura/sentry,BuildingLink/sentry,fotinakis/sentry,jean/sentry,fotinakis/sentry,zenefits/sentry,fotinakis/sentry,JamesMura/sentry,jean/sentry,looker/sentry,looker/sentry,gencer/sentry,ifduyue/sentry,Buildi...
src/sentry/status_checks/base.py
src/sentry/status_checks/base.py
from __future__ import absolute_import import six from functools import total_ordering from sentry.utils.compat import implements_to_string @implements_to_string @total_ordering class Problem(object): # Used for issues that may render the system inoperable or have effects on # data integrity (e.g. issues ...
from __future__ import absolute_import import six from sentry.utils.compat import implements_to_string @implements_to_string class Problem(object): # Used for issues that may render the system inoperable or have effects on # data integrity (e.g. issues in the processing pipeline.) SEVERITY_CRITICAL = '...
bsd-3-clause
Python
02f48e3125a6640456840d7c01769b69697c7af1
add validator
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
corehq/apps/app_manager/app_translations/validator.py
corehq/apps/app_manager/app_translations/validator.py
from __future__ import absolute_import from memoized import memoized from corehq.apps.app_manager.app_translations import ( expected_bulk_app_sheet_headers, expected_bulk_app_sheet_rows, get_unicode_dicts) from corehq.apps.app_manager.app_translations.const import MODULES_AND_FORMS_SHEET_NAME class Uploa...
bsd-3-clause
Python
9cfa4c90c98cd4f0db14b5c2a761a41c12cd513d
add example script to plot mission trajectory in Monterey Bay
bluesquall/okeanidanalysis
examples/maps/mission-trajectory-in-monterey-bay.py
examples/maps/mission-trajectory-in-monterey-bay.py
#!/usr/bin/env python """ `mission-trajectory-in-monterey-bay.py` ======================================= An example script to generate a map of a vehicle trajectory in the area around Monterey Bay. """ import numpy as np import matplotlib.pyplot as plt import oceanidanalysis as oa bmres = ['l','i','h','f'] def ma...
mit
Python
14ad1f86d3f5517ac992ed46c41f3476a8d19d0b
Add migration for PRT
SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci
metaci/plan/migrations/0026_planrepositorytrigger.py
metaci/plan/migrations/0026_planrepositorytrigger.py
# Generated by Django 2.1.5 on 2019-01-30 22:43 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('repository', '0006_remove_repository_public'), ('plan', '0025_auto_20181207_2010'), ] operations = [ ...
bsd-3-clause
Python
e48742c4b7019c4871978226adc7069001bfdced
add an urls.py file for the idp application
incuna/authentic,BryceLohr/authentic,incuna/authentic,adieu/authentic2,pu239ppy/authentic2,pu239ppy/authentic2,adieu/authentic2,pu239ppy/authentic2,BryceLohr/authentic,adieu/authentic2,BryceLohr/authentic,incuna/authentic,incuna/authentic,BryceLohr/authentic,incuna/authentic,adieu/authentic2,pu239ppy/authentic2
idp/urls.py
idp/urls.py
from django.conf.urls.defaults import * from django.views.generic.simple import direct_to_template import liberty.saml2_endpoints urlpatterns = patterns('', (r'^saml/', include(liberty.saml2_endpoints)), )
agpl-3.0
Python
7f49b7e5bc697089d0286548a6826a9167ab5703
simplify pyWWA support libs, remove pyIEM requirement
akrherz/pyWWA,akrherz/pyWWA
support/ldmbridge.py
support/ldmbridge.py
# Python imports import sys, re from twisted.internet import stdio, error from twisted.protocols import basic from twisted.internet import reactor class LDMProductReceiver(basic.LineReceiver): delimiter = '\n' productDelimiter = '\003' def __init__(self): self.productBuffer = "" self.set...
mit
Python
ffd7715b9e1eadd26618593e40b4b88dcf1a0ab6
add generate events
lstorchi/pca_fit,lstorchi/pca_fit,lstorchi/pca_fit,lstorchi/pca_fit,lstorchi/pca_fit
generateevents/RandomHits_HBout.py
generateevents/RandomHits_HBout.py
#!/usr/bin/python import sys, string, os, time, re import random def main(): print "Generating random hits for gf test" if len(sys.argv)<5: print "usage: RandomHits.py numEvts numRoads numHitsPerLayer outFile" return -1 #the following two numbers are fixed NSVXhits = 5 NSVThits = 6 Ntest ...
apache-2.0
Python
53e5d5b909f5e83610dcf40307751a199659fce2
print delimited bioconductor and recipe names
ostrokach/bioconda-recipes,dkoppstein/recipes,zachcp/bioconda-recipes,jasper1918/bioconda-recipes,JenCabral/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,phac-nml/bioconda-recipes,rob-p/bioconda-recipes,guowei-he/bioconda-recipes,dmaticzka/bioconda-recipes,saketkc/bioconda-recipes,yesimon/bioconda-re...
scripts/update-bioconductor-packages.py
scripts/update-bioconductor-packages.py
""" New version of bioconductor? This script goes through each current Bioconductor recipe, finds the corresponding dependencies that are also in this repo, and reports the [reverse toplogically sorted] set of Bioconductor packages should be updated using bioconductor-scraper.py. In other words, the first items in the...
""" New version of bioconductor? This script goes through each current Bioconductor recipe, finds the corresponding dependencies that are also in this repo, and reports the [reverse toplogically sorted] set of Bioconductor packages should be updated using bioconductor-scraper.py. In other words, the first items in the...
mit
Python
7d998deb5cfc5dafe24f0ba21e120020ba695447
Add functions for generating missing data in worst case scenario absence of previous data
googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks
project/scripts/data_generator.py
project/scripts/data_generator.py
# Copyright 2021 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
Python
68ce37f9636593483c71a2fb0444a9ffb8580b12
add new test script
peshay/btcde
tests/test_btcde.py
tests/test_btcde.py
from unittest.mock import patch from unittest import TestCase import btcde class TestBtcdeApi(TestCase): """Test Api Functions.""" def setUp(self): pass def tearDown(self): pass patch('btcde.APIConnect') def test_showOrderbook_buy(self, mock_APIConnect): resul...
mit
Python
26d5b3964bbe2a42702dd90cb9274287b402d944
Add first skeleton of selenium-based test
gateway4labs/labmanager,go-lab/labmanager,morelab/labmanager,morelab/labmanager,labsland/labmanager,gateway4labs/labmanager,morelab/labmanager,labsland/labmanager,labsland/labmanager,labsland/labmanager,go-lab/labmanager,porduna/labmanager,morelab/labmanager,go-lab/labmanager,go-lab/labmanager,porduna/labmanager,pordun...
labmanager/tests/integration/util.py
labmanager/tests/integration/util.py
import unittest import time import re from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException class IntegrationTestCase(unittest.TestCase): """ This class wraps Selenium. So the se...
bsd-2-clause
Python
9934a8dffb9eec3e9b920a3b9d49eb8ec80a7719
store the state information even if the action fails
HelioGuilherme66/RIDE,fingeronthebutton/RIDE,caio2k/RIDE,HelioGuilherme66/RIDE,caio2k/RIDE,fingeronthebutton/RIDE,fingeronthebutton/RIDE,robotframework/RIDE,HelioGuilherme66/RIDE,robotframework/RIDE,robotframework/RIDE,HelioGuilherme66/RIDE,robotframework/RIDE,caio2k/RIDE
src/robotide/plugins/connector.py
src/robotide/plugins/connector.py
# Copyright 2008-2009 Nokia Siemens Networks Oyj # # 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 applicab...
# Copyright 2008-2009 Nokia Siemens Networks Oyj # # 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 applicab...
apache-2.0
Python
9b63684a004a83bc342b096d19a47c14f83b8813
Add utility tests
blindstore/blindstore-old-scarab
tests/test_utils.py
tests/test_utils.py
import numpy as np import scarab from nose.tools import * from common.utils import * def test_binary(): a = binary(1, size=5) assert_true(np.all(a == [0, 0, 0, 0, 1])) a = binary(2, size=3) assert_true(np.all(a == [0, 1, 0])) def test_encrypt_index(): pk, sk = scarab.generate_pair() c = encr...
mit
Python
8b0a63fab4221cebd927b4022f4daae1a1f46b70
Set version number to 0.10.
jaddison/django-assets,Eksmo/django-assets,logston/django-assets,mcfletch/django-assets,ridfrustum/django-assets,adamchainz/django-assets,logston/django-assets
django_assets/__init__.py
django_assets/__init__.py
# Make a couple frequently used things available right here. from webassets.bundle import Bundle from django_assets.env import register __all__ = ('Bundle', 'register') __version__ = (0, 10) __webassets_version__ = ('0.10',) from django_assets import filter
# Make a couple frequently used things available right here. from webassets.bundle import Bundle from django_assets.env import register __all__ = ('Bundle', 'register') __version__ = (0, 9) __webassets_version__ = ('0.10',) from django_assets import filter
bsd-2-clause
Python
da68bdcc01390f78f3338ccb2c93c6a18abeb9d1
Fix PYTHON_VERSION detection, as sometimes sys.version_info is a tuple, not a NamedTuple
selfcommit/simian,googlearchive/simian,alexandregz/simian,selfcommit/simian,sillywilly42/simian,sillywilly42/simian,alexandregz/simian,frlen/simian,googlearchive/simian,selfcommit/simian,sillywilly42/simian,alexandregz/simian,frlen/simian,frlen/simian,googlearchive/simian,googlearchive/simian,frlen/simian,alexandregz/s...
src/simian/munki/simian_client.py
src/simian/munki/simian_client.py
#!/usr/bin/env python # # Copyright 2015 Google Inc. 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 require...
#!/usr/bin/env python # # Copyright 2015 Google Inc. 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 require...
apache-2.0
Python
bd73d5f2a011b8b47dd3967ea733a6e5325938c2
set an new Manager user, nuking all the others
MCLConsortium/mcl-site,MCLConsortium/mcl-site
support/admin.py
support/admin.py
#!/usr/bin/env python # encoding: utf-8 # Copyright 2016 California Institute of Technology. ALL RIGHTS # RESERVED. U.S. Government Sponsorship acknowledged. from AccessControl.SecurityManagement import newSecurityManager, noSecurityManager from AccessControl.SecurityManager import setSecurityPolicy from Products.CMFC...
apache-2.0
Python
0257dcd72d4463ad4d12b19d48b5462defa86bd9
add examples of data tricks
FilipDominec/plotcommander
todo_data_tricks.py
todo_data_tricks.py
def nGaN(energies): ## returns index of refraction in GaN according to [Tisch et al., JAP 89 (2001)] eV = [1.503, 1.655, 1.918, 2.300, 2.668, 2.757, 2.872, 3.006, 3.136, 3.229, 3.315, 3.395, 3.422] n = [2.359, 2.366, 2.383, 2.419, 2.470, 2.486, 2.511, 2.549, 2.596, 2.643, 2.711, 2.818, 2.893] return np....
mit
Python
93ae7006120754f7bb2ff35f718756a09265702a
add test cases for Data Export tool
frappe/frappe,yashodhank/frappe,yashodhank/frappe,frappe/frappe,almeidapaulopt/frappe,mhbu50/frappe,frappe/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,yashodhank/frappe,mhbu50/frappe,StrellaGroup/frappe,mhbu50/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,mhbu50/frappe,yashodhank/frappe,almeidapaulopt/frappe
frappe/core/doctype/data_export/test_data_exporter.py
frappe/core/doctype/data_export/test_data_exporter.py
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies and Contributors # License: MIT. See LICENSE import unittest import frappe from frappe.core.doctype.data_export.exporter import DataExporter class TestDataExporter(unittest.TestCase): def setUp(self): self.doctype_name = 'Test DocType for Export Tool...
mit
Python
773003b45d472807b17b41db3a96ea1795571ddf
Add example for outwardly-propagating cylindrical flame
speth/ember,speth/ember,speth/ember
python/ember/examples/example_cylindrical_outward.py
python/ember/examples/example_cylindrical_outward.py
#!/usr/bin/env python """ Outwardly-propagating cylindrical geometry for a strained lean methane flame. The converged axial velocity profile is plotted. The stagnation point is located at r=0. """ from ember import * import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt output = 'run/ex_cylindrical_...
mit
Python
e2d320d103e19fe2a1fa973652fec72d35e3f883
Increase test coverage
ArchiFleKs/magnum,openstack/magnum,ArchiFleKs/magnum,openstack/magnum
magnum/tests/unit/api/test_expose.py
magnum/tests/unit/api/test_expose.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
Python
9774c146ccc7f0953f9db2e2eedc4c4c151a3cbd
add test for connecting with different SSL/TLS versions
scylladb/scylla,scylladb/scylla,scylladb/scylla,scylladb/scylla
test/cql-pytest/test_ssl.py
test/cql-pytest/test_ssl.py
# -*- coding: utf-8 -*- # Copyright 2021-present ScyllaDB # # This file is part of Scylla. # # Scylla is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your optio...
agpl-3.0
Python
4b5650b57c28e33003795075c439632f4b2dd1e8
Add tests for VerifyUserAdmin fieldsets
incuna/django-user-management,incuna/django-user-management
user_management/models/tests/test_admin.py
user_management/models/tests/test_admin.py
from django.contrib.admin.sites import AdminSite from django.test import TestCase from ..admin import VerifyUserAdmin from .factories import UserFactory from .models import User class VerifyUserAdminTest(TestCase): def setUp(self): self.site = AdminSite() def test_create_fieldsets(self): exp...
bsd-2-clause
Python
0f8036e5ac326faa0d8e7ecc079b2a8a5a081764
Create bisect.py
py-in-the-sky/challenges,py-in-the-sky/challenges,py-in-the-sky/challenges
utilities/bisect.py
utilities/bisect.py
def bisect_left(A, x): "Return leftmost index where you could insort x into A." lo, hi = 0, len(A) while lo < hi: # Loop invariant: lo <= the leftmost index where you could insort x # Loop invariant: hi >= the leftmost index where you could insort x mid = (hi + lo) // 2 if ...
mit
Python
77e22d7f5b085adb0dbd05b1e84a08ca9efa53cb
add one more python script remove-wm.py
tcler/argparse-getopt-examples,tcler/argparse-getopt-examples,tcler/argparse-getopt-examples,tcler/argparse-getopt-examples,tcler/argparse-getopt-examples
python/remove-wm.py
python/remove-wm.py
#!/usr/bin/env python3 #ref: https://github.com/pymupdf/PyMuPDF-Utilities/blob/master/image-replacement/remover.py import fitz #python3 pymupdf module import io,os,sys from PIL import Image path = sys.argv[1] pdfname = path.split(".")[0] pdf = fitz.open(path) for page_index in range(len(pdf)): #print(f"page-{pa...
mit
Python
488b2cc7d99b23d530c0cb8e9878d72804012dfe
Add command to load dataset release
MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets
datasets/management/commands/load_dataset_release.py
datasets/management/commands/load_dataset_release.py
import sys import json from django.core.management.base import BaseCommand from datasets.models import * from collections import defaultdict class Command(BaseCommand): help = 'Create release for FSD. Use it as python manage.py load_dataset_release <release_tag> <annotation file>' def add_arguments(self, par...
agpl-3.0
Python
e99ea87797b99ed57f18e45d06d4fb40309ea8e3
Create 0001.py
Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2,Show-Me-the-Code/python,Show-Me-the-Code/python,Show-Me-the-Code/python,Yrthgze/prueba-sourcetree2
Liez-python-code/0001/0001.py
Liez-python-code/0001/0001.py
# coding = utf-8 __author__= 'liez' import random def make_number(num, length): str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' a = [] i = 0 while i < num: numstr = '' for j in range(length): numstr += random.choice(str) if numstr not in a: #...
mit
Python
5d394aa1f2df7a36a90b3dee2436ae3b5742d60e
Add tests for authentication helpers.
harrissoerja/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,harrissoerja/vumi,vishwaprakashmishra/xmatrix,vishwaprakashmishra/xmatrix,TouK/vumi,TouK/vumi,TouK/vumi
vumi/transports/httprpc/tests/test_auth.py
vumi/transports/httprpc/tests/test_auth.py
# -*- coding: utf-8 -*- """Tests for vumi.transports.httprpc.auth.""" from twisted.web.resource import IResource from twisted.cred.credentials import UsernamePassword from twisted.cred.error import UnauthorizedLogin from vumi.tests.helpers import VumiTestCase from vumi.transports.httprpc.auth import HttpRpcRealm, St...
bsd-3-clause
Python
f1fe9b6a0e93766b5bc2d8fa53b89eefd64faefe
Test various capabilitie sets that should give a media capable client
jku/telepathy-gabble,Ziemin/telepathy-gabble,jku/telepathy-gabble,Ziemin/telepathy-gabble,mlundblad/telepathy-gabble,mlundblad/telepathy-gabble,Ziemin/telepathy-gabble,Ziemin/telepathy-gabble,mlundblad/telepathy-gabble,jku/telepathy-gabble
tests/twisted/caps/jingle-caps.py
tests/twisted/caps/jingle-caps.py
""" Test several different permutations of features that should a client audio and/or video capable """ from gabbletest import exec_test, make_presence, sync_stream from servicetest import assertContains import constants as cs import ns from caps_helper import presence_and_disco, compute_caps_hash client = 'http://te...
lgpl-2.1
Python
92bbe67fe2e5528e8d87c3f9897b8791f022f6a5
Test FileParser returns correct object type
m42e/tvnamer,dbr/tvnamer,lahwaacz/tvnamer
tests/test_fileparse_api.py
tests/test_fileparse_api.py
#!/usr/bin/env python #encoding:utf-8 #author:dbr/Ben #project:tvnamer #repository:http://github.com/dbr/tvnamer #license:Creative Commons GNU GPL v2 # http://creativecommons.org/licenses/GPL/2.0/ """Tests the FileParser API """ from tvnamer.utils import FileParser, EpisodeInfo, DatedEpisodeInfo, NoSeasonEpisodeInfo ...
unlicense
Python
ab88061c78cd17913faf6249f4d70a48779b4e56
Test to ensure equations with line breaks are parsed correctly
JamesPHoughton/pysd
tests/unit_test_xmile2py.py
tests/unit_test_xmile2py.py
import os import unittest import tempfile from io import StringIO from pysd.py_backend.xmile.xmile2py import translate_xmile class TestEquationStringParsing(unittest.TestCase): def test_multiline_equation(): with open('tests/test-models/tests/game/test_game.stmx', 'r') as stmx: contents = s...
mit
Python
13155ce67b3d0893af02a348c70ab08ecee8e875
Update LINUX.py
mjdietzx/Espruino,tve/Espruino,vshymanskyy/Espruino,luetgendorf/Espruino,lancernet/Espruino,luetgendorf/Espruino,nkolban/Espruino,wilberforce/Espruino,AlexanderBrevig/Espruino,redbear/Espruino,mjdietzx/Espruino,nkolban/Espruino,vshymanskyy/Espruino,lancernet/Espruino,wilberforce/Espruino,mjdietzx/Espruino,AlexanderBrev...
boards/LINUX.py
boards/LINUX.py
#!/bin/false # This file is part of Espruino, a JavaScript interpreter for Microcontrollers # # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at h...
#!/bin/false # This file is part of Espruino, a JavaScript interpreter for Microcontrollers # # Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at h...
mpl-2.0
Python
adbfbc94b11b5a6f6a38821d5ea60f971e66d73c
Structure change
valbub/python-radix
tests/Testing.py
tests/Testing.py
__author__ = 'Valeria' import unittest from radix import * from timeit import timeit class TestRadixPerformance(unittest.TestCase): def test_perf(self): def testtime(): for i in range(1000): cast(i, 16, 32) timeit(testtime, number=1000) class TestRadixMethods(unittest.T...
mit
Python
56dda3cd40f3b650a9eb4757250cdd1461151da4
Fix launching
fabianofranz/docker-registry,dhiltgen/docker-registry,pombredanne/docker-registry,dhiltgen/docker-registry,ken-saka/docker-registry,depay/docker-registry,kireal/docker-registry,ken-saka/docker-registry,deis/docker-registry,stormltf/docker-registry,viljaste/docker-registry-1,atyenoria/docker-registry,nunogt/docker-regis...
docker_registry/wsgi.py
docker_registry/wsgi.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os from .run import app if __name__ == '__main__': # Bind to PORT if defined, otherwise default to 5000. port = int(os.environ.get('PORT_WWW', 5000)) app.debug = True app.run(host='0.0.0.0', port=port) # Or you can run: # gu...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os from .app import app if __name__ == '__main__': # Bind to PORT if defined, otherwise default to 5000. port = int(os.environ.get('PORT_WWW', 5000)) app.debug = True app.run(host='0.0.0.0', port=port) # Or you can run: # gu...
apache-2.0
Python
5b213fea20352151aba4fcaa312a0cfab7d90390
Add initial implementation
jhedev/mockutils
mockutils/fs.py
mockutils/fs.py
import os class VirtualFile(object): def __init__(self, name, content=None): self.name = name self.content = content def __str__(self): return self.name class VirtualDir(object): def __init__(self, name, content={}): self.name = name self.content = content de...
mit
Python
b1ce7fefe95d93547db205948cad01a327baae0b
add test for parse function
Falinor/seo-cartographer
tests/test_parser.py
tests/test_parser.py
import cartodup.parser as parser def test_parse(): for page in parser.parse('resources/pages.txt'): assert page is not None
mit
Python
6d12095b31448474b47ea79a9be521bc40c67150
Add test for polycs
Effective-Quadratures/Effective-Quadratures,psesh/Effective-Quadratures
tests/test_polycs.py
tests/test_polycs.py
from unittest import TestCase import unittest from equadratures import * import numpy as np class TestPolyreg(TestCase): def test_simple2D(self): d = 5 param = Parameter(distribution='Uniform', lower=-1, upper=1., order=1) myParameters = [param for _ in range(d)] def f(x): ...
lgpl-2.1
Python
438ae025e67beca5df012e0e7b086e9d315cfcf7
Add rb/jira review tool
parthchandra/drill,StevenMPhillips/drill,homosepian/drill,mapr/incubator-drill,nagix/drill,jdownton/drill,puneetjaiswal/drill,ppadma/drill,yufeldman/incubator-drill,Agirish/drill,squidsolutions/drill,Ben-Zvi/drill,adityakishore/drill,tshiran/drill,KulykRoman/drill,adityakishore/drill,cwestin/incubator-drill,kingmesal/d...
tools/drill-patch-review.py
tools/drill-patch-review.py
#!/usr/bin/env python # Modified based on Kafka's patch review tool import argparse import sys import os import time import datetime import tempfile from jira.client import JIRA def get_jira(): options = { 'server': 'https://issues.apache.org/jira' } # read the config file home=jira_home=os.getenv('HOME...
apache-2.0
Python
2e332350449b639e91e1cc97d0f9363ddfbc30f0
Add the monitor example.
nylas/nylas-python
examples/monitor.py
examples/monitor.py
#!/usr/bin/env python import sys import click import json from time import time, sleep from inbox import APIClient from inbox.client.util import generate_id TIMEOUT = 120 class TimeoutError(Exception): pass def self_send(client, email): draft = client.drafts.create(to=[{'name': 'Inbox SelfSend', ...
mit
Python
88ede9eae1b07c8082455d726ded821fc0fbd706
Create buscabinaria.py
juancanuto/estrutura-de-dados
buscabinaria.py
buscabinaria.py
import unittest def busca_binaria(seq, procurado): seq.sort() inicio=0 fim=len(seq)-1 while inicio<=fim: meio = (inicio + fim)//2 if procurado<seq[meio]: fim = meio - 1 elif procurado > seq[meio]: inicio = meio + 1 else: while meio >...
mit
Python
c812bf3ee0f0f21b6ef6b93e42399d3cad87102b
Add test script
nemunaire/eyespot
eyespot/__main__.py
eyespot/__main__.py
import sys from eyespot import certs from eyespot import ciphers from eyespot import protocols host = ('free.fr', 443) for protocol in protocols.get(): if protocols.test(host, protocol): print(protocol) for cipher in ciphers.get(): if ciphers.test(host, cipher): print(cipher) print(certs.ge...
agpl-3.0
Python
0fab5650a2c61d306cad9777781fb2507ad70b01
Prepare v1.2.316.dev
xfouloux/Flexget,ibrahimkarahan/Flexget,qvazzler/Flexget,jawilson/Flexget,malkavi/Flexget,qvazzler/Flexget,OmgOhnoes/Flexget,tobinjt/Flexget,tarzasai/Flexget,ibrahimkarahan/Flexget,Pretagonist/Flexget,JorisDeRieck/Flexget,cvium/Flexget,tsnoam/Flexget,tsnoam/Flexget,drwyrm/Flexget,dsemi/Flexget,ZefQ/Flexget,drwyrm/Flexg...
flexget/_version.py
flexget/_version.py
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
""" Current FlexGet version. This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by release scripts in continuous integration. Should (almost) never be set manually. The version should always be set to the <next release version>.dev The jenkins release job wi...
mit
Python
ecf82959a6cc76dc6c44f043479cf86365537b57
Create cf_ip_update.py
GaryBrittain/CloudFlare_Dynamic_IP
cf_ip_update.py
cf_ip_update.py
mit
Python
108107b36c4cc5f9f828c6511a062cd5ea64c7d5
Add Support for CSF (#33117)
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/modules/csf.py
salt/modules/csf.py
# -*- coding: utf-8 -*- ''' Support for Config Server Firewall (CSF) ======================================== :maintainer: Mostafa Hussein <mostafa.hussein91@gmail.com> :maturity: new :platform: Linux ''' # Import Python Libs from __future__ import absolute_import # Import Salt Libs from salt.exceptions import Comman...
apache-2.0
Python
0716e0bdda9159511444ff627b16b339080b1578
add pkg runner, list available pkg upgrades and group by packages
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/runners/pkg.py
salt/runners/pkg.py
# -*- coding: utf-8 -*- ''' Package helper functions which provide other formatted output of salt.modules.pkg ''' # Import python libs import os # Import salt libs import salt.output import salt.minion def _get_returner(returner_types): ''' Helper to iterate over retuerner_types and pick the first one '...
apache-2.0
Python
debcc4d639945e676fb4579f71bfa711e29e343f
Add framework for wordcloud visualisation
PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project
src/project/word_cloud.py
src/project/word_cloud.py
import sys from os.path import isdir, isfile from corpus import Corpus from lda_corpus import LDACorpus class WordCloud(object): def __init__(self, lda_corpus): self.corpus = lda_corpus def draw_topics(self): print self.corpus topics = self.corpus.print_topics() print topics...
mit
Python