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
4d30756e722cafa40fa449e48c967eeebc58500a
Add a manage.py command to import realm filters
vabs22/zulip,calvinleenyc/zulip,sup95/zulip,deer-hope/zulip,kokoar/zulip,ryanbackman/zulip,ahmadassaf/zulip,akuseru/zulip,shaunstanislaus/zulip,Gabriel0402/zulip,souravbadami/zulip,JanzTam/zulip,ufosky-server/zulip,noroot/zulip,amallia/zulip,vikas-parashar/zulip,kaiyuanheshang/zulip,synicalsyntax/zulip,ashwinirudrappa/...
zerver/management/commands/import_realm_filters.py
zerver/management/commands/import_realm_filters.py
from __future__ import absolute_import from django.core.management.base import BaseCommand from zerver.models import RealmFilter, get_realm import logging class Command(BaseCommand): help = """Imports realm filters to database""" def handle(self, *args, **options): realm_filters = { "zu...
apache-2.0
Python
c7fa4500b22104b34b50bbcacc3b64923d6da294
Add a parser for plain text
bjoernricks/trex,bjoernricks/trex
trex/parsers.py
trex/parsers.py
# -*- coding: utf-8 -*- # # (c) 2014 Bjoern Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'trex' for details. # from io import TextIOWrapper from rest_framework.parsers import BaseParser class PlainTextParser(BaseParser): media_type = "text/plain" def parse(self, stream, media_...
mit
Python
72d7e2a37bec5f7ae904ed2119dd8c30c22801fb
Add clinvar bot users
usajusaj/gennotes,usajusaj/gennotes,PersonalGenomesOrg/gennotes,PersonalGenomesOrg/gennotes,PersonalGenomesOrg/gennotes,usajusaj/gennotes
gennotes_server/migrations/0002_add_clinvar_bot_users.py
gennotes_server/migrations/0002_add_clinvar_bot_users.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.db import migrations def add_clinvar_bot_users(apps, schema_editor): usernames = ['clinvar-variant-importer', 'clinvar-data-importer'] for username in usernames: get_user_model()...
mit
Python
d56515878d4a1d4d56a10426fe5d6c45de97a671
Create servos.py
somchaisomph/RPI.GPIO.TH
gadgets/motors/servos.py
gadgets/motors/servos.py
from gadgets.th_gpio import TH_GPIO import time class Servo5V(): def __init__(self,pin_number=12,freq=100): self.pin_number = pin_number self.freq = freq self.pwm = TH_GPIO().pwm_create(self.pin_number,freq=self.freq) self.width = float(1000/self.freq) def set_freq(self,freq): self.freq = freq self.p...
mit
Python
0a074f3af770f049cf6f112bdc7fa5ae35c4a6dc
Create Run.py
SkinnyRat/Benchmark-MNIST
ImageNet/Run.py
ImageNet/Run.py
# From https://groups.google.com/a/tensorflow.org/forum/#!topic/discuss/4xjc7tSrb18 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os, math, time import cv2, csv import numpy as np import tensorflow as tf import CIFAR10 from datetime import da...
apache-2.0
Python
4fb80eede37a2af23c165cb0997989c039f8166e
Add utterance extraction script
MontrealCorpusTools/SPADE,MontrealCorpusTools/SPADE
utterances.py
utterances.py
####################################### ## SPADE utterance extraction script ## ####################################### ## Processes and extracts start-times and end-times for all speaker utterances. ## Used for extracting data collected as part of the SPeech Across Dialects of English ## (SPADE) project. ## Input: #...
mit
Python
b453943f86f97e38e52af3a1b048ee93b0177df8
add a test to make sure we don't have any more missing migrations
django-pci/django-axes,jazzband/django-axes
axes/tests/test_models.py
axes/tests/test_models.py
from django.test import TestCase class MigrationsCheck(TestCase): def setUp(self): from django.utils import translation self.saved_locale = translation.get_language() translation.deactivate_all() def tearDown(self): if self.saved_locale is not None: from django.uti...
mit
Python
1e7aee8c5597a7ccd9f2bc8f4e05e3ae489c3bfd
Add bot.py to run as an actual bot, via pywikibot
dissemin/oabot,dissemin/oabot,dissemin/oabot,CristianCantoro/oabot,CristianCantoro/oabot
src/bot.py
src/bot.py
from app import * from time import sleep import pywikibot def run_bot(template_param, access_token=None, site=None, max_edits=100000): cached_pages = list_cache_contents('bot_cache/') edits_made = 0 for page_name in cached_pages: print(page_name) cache_fname = 'bot_cache/'+to_cache_name(pag...
mit
Python
eb517e5b323ea183571b9d4967f46821729dd3e7
add part 6
f0lie/basic_python_workshop
part_6.py
part_6.py
# Let's try to draw a point moving on a line # To make things simple, we are going back to 1D pos = 1 velo = 1 # Since there are multiple positions at a time, we can represent as a list line_1 = [' ', ' ', ' '] line_2 = 3*[' '] # Note how they are equal statements print(line_1, line_2) # If we wanted to print the l...
mit
Python
98a6fd1b1d095d6babc55c5d415c2450743fdba6
Add antibody audits
ENCODE-DCC/encoded,ENCODE-DCC/encoded,ENCODE-DCC/snovault,ENCODE-DCC/encoded,ENCODE-DCC/encoded,T2DREAM/t2dream-portal,T2DREAM/t2dream-portal,ENCODE-DCC/snovault,T2DREAM/t2dream-portal,ENCODE-DCC/snovault,ENCODE-DCC/snovault,ENCODE-DCC/snovault,T2DREAM/t2dream-portal
src/encoded/audit/antibody_lot.py
src/encoded/audit/antibody_lot.py
from snovault import ( AuditFailure, audit_checker, ) from .conditions import rfa @audit_checker('antibody_lot', frame=['characterizations'], condition=rfa('ENCODE3', 'modERN')) def audit_antibody_missing_characterizations(value, system): ''' Check to see what characterizations are lack...
mit
Python
e8560c42e3ae73f1753073b8ad6aef7d564e6d65
Implement basic active monitoring algorithm
kaushikSarma/VM-Load-balancing,kaushikSarma/VM-Load-balancing,kaushikSarma/VM-Load-balancing,kaushikSarma/VM-Load-balancing
Host/original.py
Host/original.py
import sys from functools import reduce tempVmId = -1 def enhancedActiveVMLoadBalancer(vmStateList, currentAllocationCounts): ''' vmStateList: Dict<vmId, vmState> currentAllocationCounts: Dict<vmId, currentActiveAllocationCount> ''' global tempVmId vmId = -1 tot...
mit
Python
0a5e419dd91317d3a9d755cc5e8ee32c3a68d4af
Fix dates in show pending notifications
andrei-karalionak/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,vladan-m/ggrc-core,kr41/ggrc-core,hyperNURb/ggrc-core,hasanalom/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,uskudnik/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,uskudnik/ggrc-core,jmakov/ggrc-core,hasanalom/ggrc-core,jmakov/gg...
src/ggrc/notification/__init__.py
src/ggrc/notification/__init__.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: mouli@meics.org # Maintained By: miha@reciprocitylabs.com from collections import defaultdict from freezegun import freeze_time from datetime impo...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: mouli@meics.org # Maintained By: miha@reciprocitylabs.com from collections import defaultdict from freezegun import freeze_time from datetime impo...
apache-2.0
Python
b7e09bb39aa6161215799960bd5fda33a882e40f
fix docstring
yepengxj/theano_exercises,DeercoderResearch/theano_exercises,mathrho/theano_exercises,hamukazu/theano_exercises,xinmei9322/theano_exercises,OlafLee/theano_exercises,voidException/theano_exercises,yt752/theano_exercises,MarvinBertin/theano_exercises,goodfeli/theano_exercises,IQ17/theano_exercises,juampatronics/theano_ex...
01_basics/03_advanced_expressions/01_basic_indexing_soln.py
01_basics/03_advanced_expressions/01_basic_indexing_soln.py
# Fill in the TODOs in this exercise, then run the script to see if your # solution works. import numpy as np import theano.tensor as T def increment_odd(x): """ x: a Theano vector Returns: y: a Theano vector equal to x, but with all odd-numbered elements incremented by 1. """ raise NotImp...
bsd-3-clause
Python
787b46749a26f8078c1ac4e914aea7fbd0ced8c6
Add test for checking if privatecode in journey's is unique per day
bliksemlabs/bliksemintegration,bliksemlabs/bliksemintegration
bin/test.py
bin/test.py
import helper import logging import psycopg2 from settings.const import database_connect conn = psycopg2.connect(database_connect) cur = conn.cursor() cur.execute(""" SELECT j.id,jp.operator_id,j.operator_id FROM (select journeypatternref,count(distinct pointorder) as points from pointinjourneypattern group by journey...
bsd-2-clause
Python
3693b1aea769af1e0fbe31007a00f3e33bcec622
Add function to solve two pair sum
ueg1990/aids
aids/sorting_and_searching/pair_sum.py
aids/sorting_and_searching/pair_sum.py
''' Given an integer array, output all pairs that sum up to a specific value k ''' from binary_search import binary_search_iterative def pair_sum_sorting(arr, k): ''' Using sorting - O(n logn) ''' number_of_items = len(arr) if number_of_items < 2: return arr.sort() for index, item in enumerate(arr): ind...
mit
Python
72cfd9b52e860aaaca05e7ef7941d0b4e17ad95f
Add vocab_word.py
acsalu/streethunt-matcher,hsiaoching/streethunt-matcher
vocab_word.py
vocab_word.py
import cv2 import numpy as np from os import listdir from os.path import isfile, join from numpy import * from scipy.cluster.vq import kmeans,vq def buildVocabulary(path,k,grid_m,grid_n): files = [ f for f in listdir(path) if isfile(join(path,f)) ] dict_vocab = array([]) for i in range(0,grid_m): ...
mit
Python
9a67d63650b751c7b876f248bb3d82e619b37725
Add new script to create a list of words from frequencies
lucach/spellcorrect,lucach/spellcorrect,lucach/spellcorrect,lucach/spellcorrect
frequenciesToWords.py
frequenciesToWords.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Spell corrector - http://www.chiodini.org/ # Copyright © 2015 Luca Chiodini <luca@chiodini.org> # # This program 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 Fou...
agpl-3.0
Python
875fd0f57b1cbead04bd60b7d8c19cd1f106595a
add example python server
appunite/discovery-ios,appunite/discovery-ios
Server/server.py
Server/server.py
#!/usr/bin/env python import tornado.ioloop import tornado.web import tornado.websocket from tornado.options import define, options, parse_command_line import os import json import uuid define("port", default=8888, help="run on the given port", type=int) clients = set() metadatas = dict() class DiscoveryCl...
mit
Python
4535d6c41e17031b943e7016fc7de6f76b890f17
Put the test into the correct directory.
zepheira/amara,zepheira/amara,zepheira/amara,zepheira/amara,zepheira/amara,zepheira/amara
test/lib/test_inputsource.py
test/lib/test_inputsource.py
######################################################################## # test/xslt/test_inputsource.py import os from amara.lib import inputsource, iri, treecompare module_dir = os.path.dirname(os.path.abspath(__file__)) rlimit_nofile = 300 try: import resource except ImportError: pass else: rlimit_nof...
apache-2.0
Python
5bbb2a994397374356964b1db4c23b6b8ff5c848
Add the 'version' variable.
jeremiedecock/tictactoe-py,jdhp-sap/data-pipeline-standalone-scripts,jdhp-sap/sap-cta-data-pipeline,jeremiedecock/tictactoe-py,jdhp-sap/sap-cta-data-pipeline,jeremiedecock/pyai,jeremiedecock/podcast-manager,jeremiedecock/pyai,jeremiedecock/podcast-manager,jdhp-sap/data-pipeline-standalone-scripts
TODO/__init__.py
TODO/__init__.py
# The MIT License # # Copyright (c) 2016 Jeremie 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 without limitation the rights # ...
mit
Python
fcd96cb766f3211a185a3aadbd7c8dde795134ca
Add ILCommand class
ShivamSarodia/ShivyC,ShivamSarodia/ShivyC,ShivamSarodia/ShivyC
il_commands.py
il_commands.py
"""Classes representing IL commands, including procedures to generate asm code from a given IL command. """ import spots class ILCommand: """Base interface for all IL commands""" def __init__(self): raise NotImplementedError def input_values(self): """Return set of values read by this co...
mit
Python
f51bccaebdf0992a708ac96d329b3218df23c3d0
Create welcome.py
SiarheiGribov/pyBot,SiarheiGribov/pyBot
welcome.py
welcome.py
# coding=utf-8 import sys reload(sys) sys.setdefaultencoding('utf8') sys.path.append('pyBot/ext_libs') import re import ast import json import time import login import datetime import requests from urllib2 import urlopen from random import randrange from sseclient import SSEClient as EventSource minutes = 33 signUrl ...
mit
Python
732898dc4858ae5cfc7eac3e470069ac702f6c12
Add a command for deactivating a generation
Sinar/mapit,chris48s/mapit,New-Bamboo/mapit,Sinar/mapit,opencorato/mapit,chris48s/mapit,chris48s/mapit,Code4SA/mapit,opencorato/mapit,opencorato/mapit,Code4SA/mapit,Code4SA/mapit,New-Bamboo/mapit
mapit/management/commands/mapit_generation_deactivate.py
mapit/management/commands/mapit_generation_deactivate.py
# This script deactivates a particular generation from optparse import make_option from django.core.management.base import BaseCommand from mapit.models import Generation class Command(BaseCommand): help = 'Deactivate a generation' args = '<GENERATION-ID>' option_list = BaseCommand.option_list + ( ...
agpl-3.0
Python
ffdf48c758877dd869f4fb4ce598635ff6545d5d
add script for just building the *.zip
opendns/dynamicipupdate,opendns/dynamicipupdate,opendns/dynamicipupdate,opendns/dynamicipupdate,opendns/dynamicipupdate
mac/scripts/build-temp.py
mac/scripts/build-temp.py
#!/usr/bin/env python import sys import os import os.path import re import time import subprocess import stat import shutil """ Release build script designed to automate as much of the proces as possible and minimize errors. Pushing an update to mac client is involved. Files that must be changed: * Info.plist * co...
bsd-3-clause
Python
f04d683d44507a53be39a2db54d545d2f2a1361b
Add example settings module
AustralianAntarcticDataCentre/save_emails_to_files,AustralianAntarcticDataCentre/save_emails_to_files
settings_example.py
settings_example.py
import os import re from imap import EmailCheckError, EmailServer from postgresql import DatabaseServer CSV_FOLDER = os.getcwd() # Restrict emails by sender. EMAIL_FROM = 'sender@example.com' # Restrict emails by subject. EMAIL_SUBJECT_RE = re.compile(''.join([ r'(?P<year>\d{4})', r'(?P<month>\d{2})', r'(?P<day...
mit
Python
29c20a662f347e720c5228f0853eaa6ac0164379
Create ScreenSocket.py
flyinactor91/EV3-Remote,flyinactor91/EV3-Remote
ScreenSocket.py
ScreenSocket.py
#!/usr/bin/env python ##--Zachary Trette ##-- accepts commands for screen responses ##-- EV3- Remote - https://github.com/flyinactor91/EV3-Remote ## 2013-12-1 from socket import * import sys, os import pygame from pygame.locals import * def setup(): pygame.init() w = 640 h = 480 size=(w,h) scree...
mit
Python
d79ed2b4aa8315579688f4c6e9bfc8980e9717e3
Create chghost.py
merc-devel/merc
merc/features/ircv32/chghost.py
merc/features/ircv32/chghost.py
from merc import capability from merc import feature from merc import message class ChgHostFeature(feature.Feature): NAME = __name__ install = ChgHostFeature.install @ChgHostFeature.register_user_capability class ChgHostCapability(capability.Capability): NAME = "chghost" class _ChgHost(message.Command): d...
mit
Python
f11f5cf946c61f45d5059ecdd828018cf0bb7a55
Add pygments based lexical output processing
remibergsma/cloudstack-cloudmonkey,apache/cloudstack-cloudmonkey,remibergsma/cloudstack-cloudmonkey,apache/cloudstack-cloudmonkey,Interoute/cloudmonkey-interoute,Interoute/cloudmonkey-interoute
cloudmonkey/lexer.py
cloudmonkey/lexer.py
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
apache-2.0
Python
e5055344001b8fa313ff7bcde3284d90bb6c2d62
add preprocess program
JamisHoo/Distributed-Image-Search-Engine,JamisHoo/Distributed-Image-Search-Engine,JamisHoo/Distributed-Image-Search-Engine,JamisHoo/Distributed-Image-Search-Engine
compress.py
compress.py
#!/usr/bin/env python3 ############################################################################### # Copyright (c) 2015 Jamis Hoo # Distributed under the MIT license # (See accompanying file LICENSE or copy at http://opensource.org/licenses/MIT) # # Project: # Filename: compress.py # Version: 1.0 ...
mit
Python
d4a7cdd400fe29458cc584455c7b082efed99e2b
Add files via upload
bengjerstad/multiuselogserver,bengjerstad/multiuselogserver,bengjerstad/multiuselogserver
timedscripts/rollupwinlog.py
timedscripts/rollupwinlog.py
import requests import json import pandas as pd import sqlite3 from datetime import date from datetime import datetime from dateutil import parser import time SERVER = '10.24.25.130:8000' conn = sqlite3.connect('usersrollup.db') c = conn.cursor() def makedb(): c.execute('''Create Table users (username ...
mit
Python
98fbfe6e65c4cb32ea0f4f6ce6cba77f7fadcb7b
Add test for vendor object creation
teamtaverna/core
app/api/tests/test_vendor_api.py
app/api/tests/test_vendor_api.py
from django.test import Client, TestCase from .utils import obtain_api_key, create_admin_account class VendorApiTest(TestCase): """Test for Vendor API.""" def setUp(self): self.client = Client() self.endpoint = '/api' self.admin_test_credentials = ('admin', 'admin@taverna.com', 'qwer...
mit
Python
2cd2d7a20f2d19221b40aac9bfa1303dbfd97459
create metashare.wsgi
MiltosD/CEF-ELRC,MiltosD/CEFELRC,MiltosD/CEFELRC,MiltosD/CEF-ELRC,MiltosD/CEF-ELRC,MiltosD/CEFELRC,MiltosD/CEFELRC,MiltosD/CEF-ELRC,MiltosD/CEF-ELRC,MiltosD/CEF-ELRC,MiltosD/CEFELRC,MiltosD/CEFELRC,MiltosD/CEFELRC,MiltosD/CEF-ELRC
metashare/apache/metashare.wsgi
metashare/apache/metashare.wsgi
import os import sys path = '/var/www/CEF-ELRC' if path not in sys.path: sys.path.insert(0, path) sys.path.insert(0, '{0}/metashare'.format(path)) sys.path.append('{0}/lib/python2.7/site-packages'.format(path)) os.environ['DJANGO_SETTINGS_MODULE'] = 'metashare.settings' import django.core.handlers.wsgi application =...
bsd-3-clause
Python
123959bc3594299c2f1d4c54b11a996e92147347
Add missing migration
mfcovington/django-system-maintenance,mfcovington/django-system-maintenance,mfcovington/django-system-maintenance
system_maintenance/migrations/0002_auto_20181214_2122.py
system_maintenance/migrations/0002_auto_20181214_2122.py
# Generated by Django 2.1.4 on 2018-12-14 21:22 from django.db import migrations import markupfield_helpers.helpers class Migration(migrations.Migration): dependencies = [ ('system_maintenance', '0001_initial'), ] operations = [ migrations.AlterField( model_name='documentati...
bsd-3-clause
Python
71b97c202373ee127d57bcdb53ef3f6f4e8d7d57
Revert "Revert "Added a wrapper script for buildOnServer that merges certain files""
AndroidX/androidx,androidx/androidx,androidx/androidx,AndroidX/androidx,androidx/androidx,androidx/androidx,androidx/androidx,AndroidX/androidx,androidx/androidx,AndroidX/androidx,AndroidX/androidx,androidx/androidx,AndroidX/androidx,AndroidX/androidx,androidx/androidx,androidx/androidx,AndroidX/androidx,AndroidX/andro...
busytown/doAllTheBuild.py
busytown/doAllTheBuild.py
#!/usr/bin/python import os,sys,json # SAMPLE USE CASE: python doAllTheBuild.py --no-daemon -PuseMaxDepVersions # # Runs both gradle builds, then merges the output that needs merging # Arguments to this script are passed to both gradle builds without modification # Exceptions to this policy: # if DIST_DIR=path/to/di...
apache-2.0
Python
7c33e8c7a386e911d835f81e637515d40dfc4e62
Add a Laplace equation solving benchmark (from Numpy)
numba/numba-benchmark
benchmarks/bench_laplace.py
benchmarks/bench_laplace.py
""" Benchmark Laplace equation solving. From the Numpy benchmark suite, original code at https://github.com/yarikoptic/numpy-vbench/commit/a192bfd43043d413cc5d27526a9b28ad343b2499 """ import numpy as np from numba import jit dx = 0.1 dy = 0.1 dx2 = (dx * dx) dy2 = (dy * dy) @jit(nopython=True) def laplace(N, Nite...
bsd-2-clause
Python
8956ee3bd89b12da20ebb1946d41c4133467ae79
Add py-pure-eval (#19180)
iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/py-pure-eval/package.py
var/spack/repos/builtin/packages/py-pure-eval/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 PyPureEval(PythonPackage): """This is a Python package that lets you safely evaluate certa...
lgpl-2.1
Python
6d1eda812d57c6c251fb037b005103172de886af
Update __init__.py
geekroot/erpnext,njmube/erpnext,gsnbng/erpnext,geekroot/erpnext,indictranstech/erpnext,indictranstech/erpnext,geekroot/erpnext,gsnbng/erpnext,indictranstech/erpnext,geekroot/erpnext,njmube/erpnext,njmube/erpnext,gsnbng/erpnext,Aptitudetech/ERPNext,indictranstech/erpnext,gsnbng/erpnext,njmube/erpnext
erpnext/__init__.py
erpnext/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import frappe __version__ = '7.0.63' def get_default_company(user=None): '''Get default company for user''' from frappe.defaults import get_user_default_as_list if not user: user = frappe.session.user companies = get_user_default_as_list(user, 'c...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import frappe __version__ = '7.1.0-beta' def get_default_company(user=None): '''Get default company for user''' from frappe.defaults import get_user_default_as_list if not user: user = frappe.session.user companies = get_user_default_as_list(user...
agpl-3.0
Python
f0bd64992b05b0e7edd4b1ac6e99e1cd9db213d6
Create search.py
bm993a/ptwitch
search.py
search.py
apache-2.0
Python
c74a9943bbd9e7908ba884e0fea5b3390e8d668e
add migration
parksandwildlife/wastd,parksandwildlife/wastd,parksandwildlife/wastd,parksandwildlife/wastd
wastd/observations/migrations/0004_auto_20160905_1943.py
wastd/observations/migrations/0004_auto_20160905_1943.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.9 on 2016-09-05 11:43 from __future__ import unicode_literals from django.db import migrations, models import wastd.observations.models class Migration(migrations.Migration): dependencies = [ ('observations', '0003_auto_20160902_1206'), ] operat...
mit
Python
9115628cf10e194f1975e01142d8ae08ab5c4b06
Add test for pandas dataframe loading
fangohr/oommf-python,ryanpepper/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python,ryanpepper/oommf-python
joommf/test_odtreader.py
joommf/test_odtreader.py
def test_odtreader_dynamics_example(): from joommf.sim import Sim from joommf.mesh import Mesh from joommf.energies.exchange import Exchange from joommf.energies.demag import Demag from joommf.energies.zeeman import FixedZeeman from joommf.drivers import evolver # Mesh specification. lx ...
bsd-2-clause
Python
64d8f45e1868fd73415e8f1fe6acc21868d45fa7
Add rfreceiver mode selector
EndPointCorp/appctl,EndPointCorp/appctl
catkin/src/appctl/scripts/rfreceiver_mode_select.py
catkin/src/appctl/scripts/rfreceiver_mode_select.py
#!/usr/bin/env python """ This node listens for keyfob button presses and changes the mode accordingly. """ import rospy from appctl.msg import Mode from std_msgs.msg import Byte class ButtonHandler: def __init__(self, modes, mode_pub): self.modes = modes self.mode_pub = mode_pub def handle...
apache-2.0
Python
9e58f5507ba0a128c696bdec218d244df27feb87
add list_graspability script
pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc
jsk_arc2017_common/scripts/list_graspability.py
jsk_arc2017_common/scripts/list_graspability.py
#!/usr/bin/env python import jsk_arc2017_common graspability = jsk_arc2017_common.get_object_graspability() for obj_id, obj in enumerate(graspability): print('{:02}: {}'.format(obj_id+1, obj)) for style in graspability[obj]: print(' {}: {}'.format(style, graspability[obj][style]))
bsd-3-clause
Python
bdc04453938366e28ff91b6e16c536eca84d8bef
add summary generator
Mozilla-TWQA/Hasal_analysis,Mozilla-TWQA/Hasal_analysis
summary.py
summary.py
#!/usr/bin/env python import os import json import argparse from argparse import ArgumentDefaultsHelpFormatter from time import gmtime, strftime, mktime import datetime class DatetimeConverter(object): TIME_STR_FORMAT = '%Y-%m-%dT%H:%M:%S' @staticmethod def get_UTC(): return gmtime() @stat...
mpl-2.0
Python
d75c519eb4c3b276f04ba58277d03801c8568ff0
Create 4.py
utsavnarayan/projecteuler
solutions/4.py
solutions/4.py
# A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. # Find the largest palindrome made from the product of two 3-digit numbers. def main(): max =0 for i in range(999,900,-1): for j in range(999,900,-1): prod...
mit
Python
21ddecb7804501476d35290b0b0cb2b7311728ab
add hello world tornado
guillaumevincent/tornado-zeromq
server.py
server.py
import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def data_received(self, chunk): pass def get(self): self.write("Hello, world") def make_app(): return tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": ap...
mit
Python
19cfaf8534626e5c6b5193da40a17cc092b24758
Use tuple instead of a list for DEFAULT_VIEWPORT_VIRTUAL_TAGS
Spirotot/taskwiki,phha/taskwiki
taskwiki/constants.py
taskwiki/constants.py
DEFAULT_VIEWPORT_VIRTUAL_TAGS = ("-DELETED", "-PARENT") DEFAULT_SORT_ORDER = "due+,pri-,project+"
DEFAULT_VIEWPORT_VIRTUAL_TAGS = ["-DELETED", "-PARENT"] DEFAULT_SORT_ORDER = "due+,pri-,project+"
mit
Python
d93dada0fe434cd736d11b9cfb1635146130f24a
Add 031
alexprengere/euler
031/main.py
031/main.py
# Integers avoid having to rely on decimal.Decimal # to handle rounding errors COINS = 1, 2, 5, 10, 20, 50, 100, 200 TARGET = 200 visited = set() solutions = [] stack = [(0, (0,) * len(COINS))] while stack: total, state = stack.pop() for cn, coin in enumerate(COINS): new_total = total + coin ...
apache-2.0
Python
eaace54d5e7d8d2ebad42cf31cf071a9cf9d3e50
test case for creating a new story
mohrm/umklapp_site,mohrm/umklapp_site,mohrm/umklapp_site
umklapp/test.py
umklapp/test.py
from django.test import TestCase from django.test.utils import override_settings from umklapp.models import * class UmklappTestCase(TestCase): def addUsers(self): self.users = [] for i in range(0,7): u = User.objects.create_user( "user%d" % i, "test@exam...
mit
Python
d20e468a32d1f476196525848688ae64845c4dce
Add Python solution
baudm/sg-ski
sg-ski.py
sg-ski.py
#!/usr/bin/env python import sys def parse_map_file(path): map_grid = [] with open(path, 'r') as f: width, height = map(int, f.readline().split()) for line in f: row = map(int, line.split()) map_grid.append(row) assert height == len(map_grid) assert width == len...
mit
Python
78e0135169d2c53b0b99c7811109eb1da040f14d
add bin2h.py
littlekernel/lk,littlekernel/lk,travisg/lk,skabet/lk,sndnvaps/lk,minglun-tsai/lk,srodrig1/lk,sndnvaps/lk,srodrig1/lk,sndnvaps/lk,sndnvaps/lk,nvll/lk,hollanderic/lkstuff,minglun-tsai/lk,travisg/lk,skabet/lk,sndnvaps/lk,ErikCorryGoogle/lk,nvll/lk,hollanderic/lkstuff,nvll/lk,nvll/lk,skabet/lk,srodrig1/lk,hollanderic/lkstu...
tools/bin2h.py
tools/bin2h.py
#!/usr/bin/env python # vim: set expandtab ts=4 sw=4 tw=100: import sys from optparse import OptionParser parser = OptionParser() parser.add_option("-b", "--before", dest="before", action="append", help="text to put before, may be specified more than once") parser.add_option("-a", "--after", dest="a...
mit
Python
d68cfae0cac869d6676643e33479383bc11b086a
Add najeto.py script.
kmzbrnoI/hJOPserver
utils/najeto.py
utils/najeto.py
""" Calculate elapsed distance based on hJOP HV csv output. """ import sys import csv class HV: def __init__(self, addr: int, name: str, owner: str) -> None: self.address: int = addr self.name: str = name self.owner: str = owner self.start_forward: float = 0 self.start_bac...
apache-2.0
Python
cf8a0105e0c4fc6af04ede6c7ae4fe4f4dac048e
add migrations
masschallenge/django-accelerator,masschallenge/django-accelerator
accelerator/migrations/0103_update_startupupdate_model.py
accelerator/migrations/0103_update_startupupdate_model.py
# Generated by Django 2.2.28 on 2022-05-09 11:20 from django.db import ( migrations, models, ) class Migration(migrations.Migration): dependencies = [ ('accelerator', '0102_update_program_model'), ] operations = [ migrations.AddField( model_name='startupupdate', ...
mit
Python
7014c5affa780044fd46911287d883024bae3fae
Create ipy_custom_hbox.py
satishgoda/learningqt,satishgoda/learningqt
basics/layout/ipy_custom_hbox.py
basics/layout/ipy_custom_hbox.py
from PySide import QtCore from PySide import QtGui class MyHBoxLayout(QtGui.QHBoxLayout): def __init__(self, *args, **kwargs): super(MyHBoxLayout, self).__init__(*args, **kwargs) @property def margins(self): return self.contentsMargins() @margins.setter def margins(self, ...
mit
Python
17067d5d25c5ce755ba86505ffcf1dd6fd572deb
Initialize version.py
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
version.py
version.py
"""python-tutorials version.""" __version__ = '1.0.1'
mit
Python
bc518732086795c699290d49f30ad5d449b79f9e
add template for settings.py
cgutierr3z/proyecto-eees,cgutierr3z/proyecto-eees,cgutierr3z/proyecto-eees
proyecto_eees/settings-template.py
proyecto_eees/settings-template.py
""" Django settings for proyecto_eees project. Generated by 'django-admin startproject' using Django 1.11.5. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ imp...
mit
Python
c95ef4dc0771098e3589721851865f012b652136
add requirements unit test
wwitzel3/awx,snahelou/awx,wwitzel3/awx,wwitzel3/awx,wwitzel3/awx,snahelou/awx,snahelou/awx,snahelou/awx
awx/main/tests/unit/test_python_requirements.py
awx/main/tests/unit/test_python_requirements.py
from pip.operations import freeze from django.conf import settings def test_req(): def check_is_in(src, dests): if src not in dests: src2 = [src[0].replace('_', '-'), src[1]] if src2 not in dests: print("%s not in" % src2) return False el...
apache-2.0
Python
5f47cf46c82d9a48a9efe5ad11c6c3a55896da12
Implement abstract class for csc and csr matrix
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
cupy/sparse/compressed.py
cupy/sparse/compressed.py
from cupy import cusparse from cupy.sparse import base from cupy.sparse import data as sparse_data class _compressed_sparse_matrix(sparse_data._data_matrix): def __init__(self, arg1, shape=None, dtype=None, copy=False): if isinstance(arg1, tuple) and len(arg1) == 3: data, indices, indptr = ar...
mit
Python
e99af02407edf1424733350a359264c2202b27c3
Add unit test for appending with write_raster_netcdf.
landlab/landlab,cmshobe/landlab,cmshobe/landlab,landlab/landlab,amandersillinois/landlab,landlab/landlab,cmshobe/landlab,amandersillinois/landlab
landlab/io/netcdf/tests/test_write_raster_netcdf.py
landlab/io/netcdf/tests/test_write_raster_netcdf.py
import numpy as np import pytest from numpy.testing import assert_array_equal from landlab import RasterModelGrid from landlab.io.netcdf import WITH_NETCDF4, NotRasterGridError, write_raster_netcdf def test_append_with_time(tmpdir): field = RasterModelGrid(4, 3) field.add_field("node", "topographic__elevatio...
mit
Python
36333c275f4d3a66c8f14383c3ada5a42a197bea
Add module for displaying RAM usage
tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status
bumblebee/modules/memory.py
bumblebee/modules/memory.py
import bumblebee.module import psutil def fmt(num, suffix='B'): for unit in [ "", "Ki", "Mi", "Gi" ]: if num < 1024.0: return "{:.2f}{}{}".format(num, unit, suffix) num /= 1024.0 return "{:05.2f%}{}{}".format(num, "Gi", suffix) class Module(bumblebee.module.Module): def __init_...
mit
Python
06b536cdfd684d12ce64670bde50fdcbf7a71bd2
Add a workspace_binary rule to run a binary from the workspace root
ixdy/kubernetes-repo-infra,kubernetes/repo-infra,kubernetes/repo-infra,ixdy/kubernetes-repo-infra,kubernetes/repo-infra,ixdy/kubernetes-repo-infra
defs/run_in_workspace.bzl
defs/run_in_workspace.bzl
# Copyright 2018 The Kubernetes Authors. # # 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 ...
apache-2.0
Python
eda3e6c005c1115a039f394d6f00baabebd39fee
Add command for full daily build process
california-civic-data-coalition/django-calaccess-downloads-website,california-civic-data-coalition/django-calaccess-downloads-website,california-civic-data-coalition/django-calaccess-downloads-website
calaccess_website/management/commands/updatebuildpublish.py
calaccess_website/management/commands/updatebuildpublish.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Update to the latest available CAL-ACCESS snapshot and publish the files to the website. """ import logging from django.core.management import call_command from calaccess_raw.management.commands.updatecalaccessrawdata import Command as updatecommand logger = logging.get...
mit
Python
056966052d0c23395a205511dce2e9577f376539
Add Sequence
toslunar/chainerrl,toslunar/chainerrl
chainerrl/links/sequence.py
chainerrl/links/sequence.py
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import super from future import standard_library standard_library.install_aliases() import inspect import chainer from chainerrl.recurrent import Recurrent...
mit
Python
b8acaf64187f5626ef6755ef00d2b2a1471d4914
Add closure type inference test
pombredanne/numba,pombredanne/numba,cpcloud/numba,seibert/numba,numba/numba,gmarkall/numba,gmarkall/numba,numba/numba,jriehl/numba,stefanseefeld/numba,sklam/numba,GaZ3ll3/numba,stefanseefeld/numba,gmarkall/numba,sklam/numba,stuartarchibald/numba,gdementen/numba,ssarangi/numba,GaZ3ll3/numba,GaZ3ll3/numba,sklam/numba,sto...
numba/tests/closures/test_closure_type_inference.py
numba/tests/closures/test_closure_type_inference.py
import numpy as np from numba import * from numba.tests.test_support import * @autojit def test_cellvar_promotion(a): """ >>> inner = test_cellvar_promotion(10) 200.0 >>> inner.__name__ 'inner' >>> inner() 1000.0 """ b = int(a) * 2 @jit(void()) def inner(): print a...
bsd-2-clause
Python
79e3931d1a89fc1423e098b108a78302349c3f04
Add a test scenario for establish of vpn connection
openstack/ec2-api,hayderimran7/ec2-api,stackforge/ec2-api,openstack/ec2-api,stackforge/ec2-api,hayderimran7/ec2-api
ec2api/tests/functional/scenario/test_vpn_routing.py
ec2api/tests/functional/scenario/test_vpn_routing.py
# Copyright 2014 OpenStack Foundation # 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 requ...
apache-2.0
Python
3a04bff5a7940463d6429918215429700befb507
add valid-number
ibigbug/leetcode
valid-number.py
valid-number.py
# Link: https://oj.leetcode.com/problems/valid-number/ class Solution: """ Notes please see https://blog.xiaoba.me/2014/11/10/leetcode-valid-number.html """ # @param s, a string # @return a boolean def isNumber(self, s): stateTable = [ [ 1, 1, 1, 3, 3, 7, 7, 7,-1], ...
mit
Python
dec6ea168c68e267f15b74407f8745d242629d30
Create tokens.py
supthunder/premeStock
tokens.py
tokens.py
C_KEY = "" C_SECRET = "" A_TOKEN = "" A_TOKEN_SECRET = ""
mit
Python
d56c3528ad8058231910fd3d06895f39174eeb6c
Prepare v2.16.2.dev
Flexget/Flexget,Flexget/Flexget,tobinjt/Flexget,crawln45/Flexget,malkavi/Flexget,crawln45/Flexget,ianstalk/Flexget,Danfocus/Flexget,tobinjt/Flexget,tobinjt/Flexget,Danfocus/Flexget,malkavi/Flexget,crawln45/Flexget,Danfocus/Flexget,Flexget/Flexget,malkavi/Flexget,JorisDeRieck/Flexget,malkavi/Flexget,gazpachoking/Flexget...
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
502beb022bb7d4e70f44e40411a1af2f7f08c14e
add test version
zhzhussupovkz/cex-io-api-python
CexioAPI.py
CexioAPI.py
# # CexioAPI class # # @author zhzhussupovkz@gmail.com # # The MIT License (MIT) # # Copyright (c) 2013 Zhussupov Zhassulan zhzhussupovkz@gmail.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...
mit
Python
a475d50d2b7b9febe5fb01bb185b63cbbe25f4d1
add migration to remove fields
hoover/search,hoover/search,hoover/search
hoover/search/migrations/0006_auto_20200303_1309.py
hoover/search/migrations/0006_auto_20200303_1309.py
# Generated by Django 2.2.7 on 2020-03-03 13:09 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('search', '0005_rename_user_hypens_to_dots'), ] operations = [ migrations.RemoveField( model_name='collection', name='loader'...
mit
Python
32108ccab67a76a05150e8cfb5bbdf2ff3477346
Create minesweeper.py
MrMansley/Minesweeper
game/minesweeper.py
game/minesweeper.py
from tkinter import * root = Tk() root.resizable(0, 0) root.title("Minesweeper") frame = Frame(root) Grid.rowconfigure(root, 0, weight=1) Grid.columnconfigure(root, 0, weight=1) frame.grid(row=0, column=0) class Tiles: def __init__(self, frame, size): self.size = size self.frame = frame self.tiles[] for x ...
mit
Python
a75e87fd3b4fc3f370554227cefc4687593621ca
fix merge fup
fvbock/gDBPool
gdbpool/psyco_ge.py
gdbpool/psyco_ge.py
"""A wait callback to allow psycopg2 cooperation with gevent. Use `make_psycopg_green()` to enable gevent support in Psycopg. """ # Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com> # and licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining a copy # ...
mit
Python
5f503f0b9ab51ca2b1985fe88d5e84ff63b7d745
Add sample playlists for testing features.
wuvt/wuvt-site,wuvt/wuvt-site,wuvt/wuvt-site,wuvt/wuvt-site
addplaylists.py
addplaylists.py
#!/usr/bin/env python2 from datetime import datetime from datetime import timedelta import random from wuvt.trackman.lib import perdelta from wuvt import db from wuvt.trackman.models import DJSet, DJ today = datetime.now() print("adding dj") dj = DJ(u"Johnny 5", u"John") db.session.add(dj) db.session.commit() print("...
agpl-3.0
Python
1905395783d5a0f5997e6e620ba09d41398840e0
add test_vincia.py
deepjets/deepjets,deepjets/deepjets,deepjets/deepjets
test_vincia.py
test_vincia.py
from deepjets.generate import generate_events for event in generate_events('w_vincia.config', 1, vincia=True): pass
bsd-3-clause
Python
4fab31eef9ad80230b36039b66c70d94456e5f9b
Add missing tests file from previous commit.
GrAndSE/lighty
tests/monad.py
tests/monad.py
'''Test case for monads and monoidic functions ''' import unittest from lighty import monads class MonadTestCase(unittest.TestCase): '''Test case for partial template execution ''' def testNumberComparision(self): monad = monads.ValueMonad(10) assert monad == 10, 'Number __eq__ error: %s...
bsd-3-clause
Python
62207985d301dc9a47b0334f02a3f0c942e19d22
Add packetStreamerClient example
alsmadi/CSCI-6617,similecat/floodlightsec,UdS-TelecommunicationsLab/floodlight,deepurple/floodlight,chinmaymhatre91/floodlight,rizard/geni-cinema,geddings/floodlight,alexreimers/floodlight,wallnerryan/FL_HAND,xph906/SDN,aprakash6/floodlight_video_cacher,onebsv1/floodlightworkbench,gfsantanna/firewall_SDN,duanjp8617/flo...
example/packetStreamerClientExample.py
example/packetStreamerClientExample.py
#!/usr/bin/python import urllib2 import json import re import sys from optparse import OptionParser sys.path.append('~/floodlight/target/gen-py') sys.path.append('~/floodlight/thrift/lib/py') from packetstreamer import PacketStreamer from packetstreamer.ttypes import * from thrift import Thrift from thrift.transpo...
apache-2.0
Python
50141a66831d080ecc0791f94d1bd3bfec0aeb65
Add migration for #465
Minkov/site,Minkov/site,Phoenix1369/site,DMOJ/site,Minkov/site,Minkov/site,DMOJ/site,DMOJ/site,monouno/site,DMOJ/site,Phoenix1369/site,Phoenix1369/site,monouno/site,monouno/site,monouno/site,Phoenix1369/site,monouno/site
judge/migrations/0046_blogpost_authors.py
judge/migrations/0046_blogpost_authors.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2016-09-08 16:54 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('judge', '0045_organization_access_code'), ] operations = [ migrations.AddFie...
agpl-3.0
Python
364f8fedb492c1eedd317729b05d3bd37c0ea4ad
add andromercury tool
biddyweb/androguard,danielmohr/androguard,jxzhxch/androguard,natatapron/androguard,Ramble01/androguard,joeyt83/androguard,jxzhxch/androguard,liuyiVector/androguard,blokweb/androguard,bvanapriya/androguard,Iftekhar-ifti/androguard,pombreda/androguard,ohio813/androguard,IOsipov/androguard,woogi/androguard,natatapron/andr...
andromercury.py
andromercury.py
#!/usr/bin/env python # This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Androguard is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation,...
apache-2.0
Python
e5931a5837b1574681757e2c6fc7260122b48746
Add minify util
stefanogualdi/grails-ckeditor,stefanogualdi/grails-ckeditor,julyantonicheva/grails-ckeditor,julyantonicheva/grails-ckeditor,stefanogualdi/grails-ckeditor,stefanogualdi/grails-ckeditor,stefanogualdi/grails-ckeditor,julyantonicheva/grails-ckeditor,julyantonicheva/grails-ckeditor
web-app/js/ofm/scripts/utils/minify.py
web-app/js/ofm/scripts/utils/minify.py
#!/usr/bin/python2.6 # Minify Filemanager javascript files # Usage : $ python ./utils/minify.py class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' def disable(self): self.HEADER = '' self.OKBL...
apache-2.0
Python
348ffbf16fcb67768d72bd18167e6c70c99a27a1
Add Homodyne node
nckz/bart,nckz/bart,nckz/bart,nckz/bart,nckz/bart
gpi/Homodyne_GPI.py
gpi/Homodyne_GPI.py
# Author: Ashley Anderson III <aganders3@gmail.com> # Date: 2015-10-10 21:13 # Copyright (c) 2015 Dignity Health from __future__ import absolute_import, division, print_function, unicode_literals import os # gpi, future import gpi from bart.gpi.borg import IFilePath, OFilePath, Command # bart import bart base_path ...
bsd-3-clause
Python
1a7fa8080d19909ccf8e8e89aa19c92c1413f1c1
Add script to submite jobs again
lnls-fac/job_manager
apps/pyjob_submite_jobs_again.py
apps/pyjob_submite_jobs_again.py
#!/usr/bin/env python3 import os import sys import subprocess right_inputs = False if len(sys.argv) > 2 : tp = sys.argv[1] rms = [int(x) for x in sys.argv[2:]] if tp in ['ma', 'ex', 'xy']: right_inputs = True curdir = os.getcwd() if right_inputs: if curdir.endswith('trackcpp'): flatfile = 'fl...
mit
Python
1bf7439c67e2206acb0c6d285014261eeb18097f
Add coverage as single execution
mi-schi/php-code-checker
coverage.py
coverage.py
from app import initialization from app.configuration import add from app.check import * initialization.run() add('phpunit-coverage', 'true') phpunit.execute()
mit
Python
67f5e4a4ec4606d00fb94139b9c39c7abe0be33b
Add browse queue statistics sample
fbraem/mqweb,fbraem/mqweb,fbraem/mqweb
samples/python/queue_statistics.py
samples/python/queue_statistics.py
''' This sample will read all queue statistic messages from SYSTEM.ADMIN.STATISTICS.QUEUE. MQWeb runs on localhost and is listening on port 8081. ''' import json import httplib import socket import argparse parser = argparse.ArgumentParser( description='MQWeb - Python sample - Browse statistic messages from SYSTEM...
mit
Python
884ae74bb75e5a0c60da74791a2e6fad9e4b83e5
Add py solution for 436. Find Right Interval
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
py/find-right-interval.py
py/find-right-interval.py
from operator import itemgetter # Definition for an interval. # class Interval(object): # def __init__(self, s=0, e=0): # self.start = s # self.end = e class Solution(object): def findRightInterval(self, intervals): """ :type intervals: List[Interval] :rtype: List[int] ...
apache-2.0
Python
07f8fd56ab366a2d1365278c3310ade4b1d30c57
Add functional test for version negotiation
openstack/heat,noironetworks/heat,noironetworks/heat,openstack/heat
heat_integrationtests/functional/test_versionnegotiation.py
heat_integrationtests/functional/test_versionnegotiation.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
4b8f7a4c97668b4dbd8634d6b01e30b71737c3bd
fix send_HTML_email to work when no email_from argument is supplied
dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq
dimagi/utils/django/email.py
dimagi/utils/django/email.py
from django.conf import settings from django.core.mail import get_connection from django.core.mail.message import EmailMultiAlternatives NO_HTML_EMAIL_MESSAGE = """ Your email client is trying to display the plaintext version of an email that is only supported in HTML. Please set your email client to display this mess...
from django.conf import settings from django.core.mail import get_connection from django.core.mail.message import EmailMultiAlternatives NO_HTML_EMAIL_MESSAGE = """ Your email client is trying to display the plaintext version of an email that is only supported in HTML. Please set your email client to display this mess...
bsd-3-clause
Python
f7c4f8d43b30dfee36d4ff46e9133194a15b3e81
Add tests for __unicode__ functions in model. (#1026)
taranjeet/EvalAI,taranjeet/EvalAI,taranjeet/EvalAI,taranjeet/EvalAI
tests/unit/accounts/test_models.py
tests/unit/accounts/test_models.py
from django.contrib.auth.models import User from django.test import TestCase from accounts.models import Profile, UserStatus class BaseTestCase(TestCase): def setUp(self): self.user = User.objects.create( username='user', email='user@test.com', password='password') ...
bsd-3-clause
Python
3e5b98c1a79f625fbf9f54af782e459de7fa5b1f
update migration with new filename and parent migration name
masschallenge/django-accelerator,masschallenge/django-accelerator
accelerator/migrations/0052_cleanup_twitter_urls.py
accelerator/migrations/0052_cleanup_twitter_urls.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from accelerator.twitter_handle_cleanup import ( clean_entrepreneur_profile_twitter_handles, clean_expert_profile_twitter_handles, clean_organization_twitter_handles ) def clean_up_twitter_handles(apps, sche...
mit
Python
c97f648a012c38802d9637d4c573a4ca9c8e1633
Create encoder.py
sajithshetty/SLAE32,sajithshetty/SLAE32
additional/customencoder/encoder.py
additional/customencoder/encoder.py
#!/usr/bin/python #below is the shellcode for /bin/sh using execve sys call shellcode = ("\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80") t=[] w=[] z=[] ror = lambda val, r_bits, max_bits: \ ((val & (2**max_bits-1)) >> r_bits%max_bits) | \ (val << (max_b...
cc0-1.0
Python
30bb33609d9e22b6999d086196ed622a456d7dc2
Create incomplete_minimal_logger.py
AdityaSoni19031997/Machine-Learning,AdityaSoni19031997/Machine-Learning
lld_practice/incomplete_minimal_logger.py
lld_practice/incomplete_minimal_logger.py
# just trying to minimize what all it offers # reference python standard logging module snippets CRITICAL = 50 FATAL = CRITICAL ERROR = 40 WARNING = 30 WARN = WARNING INFO = 20 DEBUG = 10 NOTSET = 0 _levelToName = { CRITICAL: 'CRITICAL', ERROR: 'ERROR', WARNING: 'WARNING', INFO: 'INFO', DEBUG: 'DE...
mit
Python
fb004f72c27b49ba9661e6a83b8f49be39757d22
add changemath shell
lichunown/jekyllblog,lichunown/jekyllblog,lichunown/jekyllblog
math_change.py
math_change.py
import sys filename = './Deterministic Policy Gradient Algorithms笔记.md' outname = '' def change(filename, outname): f = open(filename, encoding='utf8') data = f.readlines() f.close() out = '' doublenum = 0 for line in data: if line=='$$\n': doublenum += 1 i...
apache-2.0
Python
79ea8a3a9ac43ba5ab9789e4962b4fb0814dccc0
clean up localsettings example
SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,SEL-Columbia/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qe...
localsettings.example.py
localsettings.example.py
import os import sys ####### Database config. This assumes Postgres ####### DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'commcarehq', 'USER': 'postgres', 'PASSWORD': '******' } } ####### Couch Config ###### COUCH_SERVER_ROOT = '127.0...
import os # Postgres config DATABASE_ENGINE = 'postgresql_psycopg2' DATABASE_NAME = 'commcarehq' DATABASE_USER = 'postgres' DATABASE_PASSWORD = '*****' DATABASE_HOST = '' DATABASE_PORT = '5432' DJANGO_LOG_FILE = "/var/log/datahq/datahq.django.log" LOG_SIZE = 1000000 LOG_LEVEL = "DEBUG" LOG_FILE = "/var/log/datah...
bsd-3-clause
Python
cc6f30cb1c91b321db6bf77496c8b6fe7c56aabb
Add log parser
qinglan233/vass,qinglan233/vass,qinglan233/vass,qinglan233/vass
log_parser/parse_logs.py
log_parser/parse_logs.py
#!/usr/bin/env python ###################################################### # -*- coding: utf-8 -*- # File Name: parse_logs.py # Author: James Hong & Qian Li # Created Date: 2017-10-28 # Description: Parse CloudWatch logs ###################################################### import argparse import json im...
apache-2.0
Python
f380db268eecec80a5ab12fcc553c0278452b18a
add file ProbModelXML.py along with an example of student model
anaviltripathi/pgmpy,ankurankan/pgmpy,palashahuja/pgmpy,pratyakshs/pgmpy,jhonatanoliveira/pgmpy,abinashpanda/pgmpy,sandeepkrjha/pgmpy,khalibartan/pgmpy,yashu-seth/pgmpy,ankurankan/pgmpy,liquidmetal/pgmpy,liquidmetal/pgmpy,pratyakshs/pgmpy,jhonatanoliveira/pgmpy,sandeepkrjha/pgmpy,pgmpy/pgmpy,abinashpanda/pgmpy,vivek425...
pgmpy/readwrite/ProbModelXML.py
pgmpy/readwrite/ProbModelXML.py
""" ProbModelXML: http://leo.ugr.es/pgm2012/submissions/pgm2012_submission_43.pdf For the student example the ProbModelXML file should be: <?xml version=“1.0” encoding=“UTF-8”?> <ProbModelXML formatVersion=“1.0”> <ProbNet type=BayesianNetwork > <AdditionalConstraints /> <Comment> Stude...
mit
Python
209314b65ee960d73ee81baad6b9ced4102d6c0b
Introduce GenericSparseDB() class
wojtekwalczak/FB_datalab
lib/generic_sparse_db.py
lib/generic_sparse_db.py
#!/usr/bin/env python # -*- encoding: utf-8 import gzip import scipy.io as sio from utils.utils import Utils class GenericSparseDB(Utils): def init(self): self.data = sio.mmread(gzip.open(self._matrix_fn)).tolil() self.factors = self._load_pickle(self._factors_fn) self.fac_len = len(self.factor...
mit
Python
47dff2561be481ff067c22ed98d9ea6a9cf8ae10
Add test to execute notebooks
adicu/AccessibleML,alanhdu/AccessibleML
test/test_notebook.py
test/test_notebook.py
import os import glob import contextlib import subprocess import pytest notebooks = list(glob.glob("*.ipynb", recursive=True)) @contextlib.contextmanager def cleanup(notebook): name, __ = os.path.splitext(notebook) yield fname = name + ".html" if os.path.isfile(fname): os.remove(fname) @py...
mit
Python
ec033203d8e82258347eb4f6a6a83ef67bc9171c
Add expr tests
schae234/Camoco,schae234/Camoco
tests/test_Expr.py
tests/test_Expr.py
#!/usr/bin/python3 import pytest import numpy as np def test_nans_in_same_place(testCOB): norm_expr = testCOB.expr(raw=False) raw_expr = testCOB.expr(raw=True).ix[norm_expr.index,norm_expr.columns] assert all(np.isnan(norm_expr) == np.isnan(raw_expr)) def test_inplace_nansort(testCOB): x = np.random....
mit
Python
f3c4b7513c49189750ea15b36e561a4e5ed56214
add linear classification back
RoboJackets/robocup-software,RoboJackets/robocup-software,RoboJackets/robocup-software,RoboJackets/robocup-software
soccer/gameplay/evaluation/linear_classification.py
soccer/gameplay/evaluation/linear_classification.py
# Classifies a feature into any number of classes # Linear classfication defined is # y = f(x, w, b) where... # x is a vector of input features of an object # w is a vector of weights to apply to the features # b is the bias of the feature-weight system # f() is x dot w + b # y is the final output score #...
apache-2.0
Python
14c20e35bcfc55cc3c12d94596079fc27a907f94
Add unit tests
brentmitchell25/deoxys,brentmitchell25/deoxys
tests/test_unit.py
tests/test_unit.py
import unittest from test_utilities import mapTestJsonFiles, mapJsonToYml, testYaml, getImmediateSubdirectories, unidiff_output class TestUnit(unittest.TestCase): def test_input(self): testDirectories = getImmediateSubdirectories('test_input') for directory in testDirectories: json = ma...
mit
Python
c2b082ebe95acc24f86fde9cd6875d7de3a9ca40
Set up test_user file
ucfopen/canvasapi,ucfopen/canvasapi,ucfopen/canvasapi
tests/test_user.py
tests/test_user.py
import unittest import settings import requests_mock from util import register_uris from pycanvas.user import User from pycanvas.exceptions import ResourceDoesNotExist from pycanvas import Canvas class TestUser(unittest.TestCase): """ Tests core Account functionality """ @classmethod def setUpCla...
mit
Python
39589065b158061c280f68fa730f72bf595428be
Add Stata package (#10189)
LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/stata/package.py
var/spack/repos/builtin/packages/stata/package.py
# Copyright 2018 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 * import os from datetime import datetime class Stata(Package): """STATA is a general-purpose statistic...
lgpl-2.1
Python